/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DetailsFromRecordSvc.h
Go to the documentation of this file.
00001 #ifndef DAQDETAILSSVC_DETAILSFROMRECORDSVC_H
00002 #define DAQDETAILSSVC_DETAILSFROMRECORDSVC_H
00003 
00004 /*
00005  *  DetailsFromRecordSvc.h
00006  *  DaqDetails
00007  *
00008  *  Created by Simon Patton on 6/9/11.
00009  *  Copyright 2011 DayaBay Collaboration. All rights reserved.
00010  *
00011  */
00012 #include <vector>
00013 
00014 #include "DataSvc/IDaqDetailsSvc.h"
00015 
00016 namespace DybDaq {
00017   class CalibrationParametersRecord;
00018   class FileNameStrings;
00019   class FileStartRecord;
00020   class RunParametersRecord;
00021 }
00022 
00023 class RunDetailsFromRecord :
00024   public DaqRunDetails {
00025 
00026   public:
00027 
00031     RunDetailsFromRecord(const DybDaq::RunParametersRecord& record);
00032 
00036     virtual ~RunDetailsFromRecord();
00037 
00041     const DybDaq::RunParametersRecord& record() const;
00042 
00046     virtual unsigned int runNumber() const;
00047 
00051     virtual const DetectorList& detectors() const;
00052 
00053   private:
00054 
00058     RunDetailsFromRecord();
00059 
00063     RunDetailsFromRecord(const RunDetailsFromRecord& rhs);
00064 
00068     RunDetailsFromRecord& operator=(const RunDetailsFromRecord& rhs);
00069 
00073     const DybDaq::RunParametersRecord& m_record;
00074 };
00075 
00076 class FileDetailsFromRecord :
00077   public DaqFileDetails {
00078 
00079   public:
00080 
00084     FileDetailsFromRecord(const DybDaq::FileStartRecord& record,
00085                           const DybDaq::FileNameStrings& names);
00086 
00090     virtual ~FileDetailsFromRecord();
00091 
00095     virtual unsigned int fileNumber() const;
00096 
00100     virtual std::string fileName() const;
00101 
00105     virtual TimeStamp& whenStarted() const;
00106 
00107 private:
00108 
00112     FileDetailsFromRecord();
00113 
00117     FileDetailsFromRecord(const FileDetailsFromRecord& rhs);
00118 
00122     FileDetailsFromRecord& operator=(const DaqFileDetails& rhs);
00123 
00127     const DybDaq::FileStartRecord& m_record;
00128 
00132     const DybDaq::FileNameStrings& m_names;
00133 };
00134 
00135 class CalibDetailsFromRecord :
00136   public DaqCalibDetails {
00137 
00138   public:
00139 
00143     CalibDetailsFromRecord(const DybDaq::CalibrationParametersRecord& record);
00144 
00148     virtual ~CalibDetailsFromRecord();
00149 
00153     virtual DetectorId::DetectorId_t detectorId() const;
00154 
00158     virtual DayaBay::Detector adNumber() const;
00159 
00163     virtual DayaBay::Calibration::SourceType::SourceType_t sourceIdA() const;
00164 
00168     virtual int zPositionA() const;
00169 
00173     virtual DayaBay::Calibration::SourceType::SourceType_t sourceIdB() const;
00174 
00178     virtual int zPositionB() const;
00179 
00183     virtual DayaBay::Calibration::SourceType::SourceType_t sourceIdC() const;
00184 
00188     virtual int zPositionC() const;
00189 
00193     virtual int duration() const;
00194 
00198     virtual int led1() const;
00199 
00203     virtual int led2() const;
00204 
00208     virtual int led1Voltage() const;
00209 
00213     virtual int led2Voltage() const;
00214 
00218     virtual int ledFrequency() const;
00219 
00223     virtual int ledPulseSeparation() const;
00224 
00228     virtual int ltbMode() const;
00229 
00233     virtual int motorPower() const;
00234 
00238     virtual int cameraPower() const;
00239 
00243     virtual bool ledFlashing() const;
00244 
00248     virtual bool homeA() const;
00249 
00253     virtual bool homeB() const;
00254 
00258     virtual bool homeC() const;
00259 
00260 private:
00261 
00265     CalibDetailsFromRecord();
00266 
00270     CalibDetailsFromRecord(const CalibDetailsFromRecord& rhs);
00271 
00275     CalibDetailsFromRecord& operator=(const CalibDetailsFromRecord& rhs);
00276 
00280     Site::Site_t convertSite(unsigned int site) const;
00281 
00285     DetectorId::DetectorId_t convertDetectorId(unsigned int detector) const;
00286 
00290     DayaBay::Calibration::SourceType::SourceType_t convertSource(unsigned int source) const;
00291 
00295     const DybDaq::CalibrationParametersRecord& m_record;
00296 };
00297 
00298 #include "GaudiKernel/Service.h"
00299 
00300 class IDaqReadoutSvc;
00301 
00305 class DetailsFromRecordSvc :
00306   public Service,
00307   virtual public IDaqDetailsSvc {
00308 
00309  public:
00310 
00314     DetailsFromRecordSvc(const std::string& name,
00315                         ISvcLocator* svc);
00316 
00320     virtual ~DetailsFromRecordSvc();
00321 
00325     virtual StatusCode initialize();
00326 
00330     virtual StatusCode finalize();
00331 
00335     virtual StatusCode queryInterface(const InterfaceID& id, 
00336                                       void** interface);
00337 
00341     virtual bool hasRunDetails(const ServiceMode& svcMode) const;
00342 
00346     virtual const DaqRunDetails& runDetails(const ServiceMode& svcMode) const;
00347 
00351     virtual bool hasFileDetails(const ServiceMode& svcMode) const;
00352 
00356     virtual const DaqFileDetails& fileDetails(const ServiceMode& svcMode) const;
00357 
00361     virtual int calibDetailsCount(const ServiceMode& svcMode) const;
00362 
00366     virtual const DaqCalibDetails& calibDetails(const int index,
00367                                                 const ServiceMode& svcMode) const;
00368 
00369 private:
00370 
00374     DetailsFromRecordSvc(const DetailsFromRecordSvc& rhs);
00375 
00379     DetailsFromRecordSvc& operator=(const DetailsFromRecordSvc& rhs);
00380 
00384     IDaqReadoutSvc* m_daqReadoutSvc;
00385 
00386     void flushExpiredDetails() const;
00387 
00391     mutable unsigned int m_lastTime;
00392 
00396     mutable unsigned int m_lastDate;
00397 
00401     mutable unsigned int m_lastFile;
00402 
00406     mutable const RunDetailsFromRecord* m_runDetails;
00407 
00411     mutable const FileDetailsFromRecord* m_fileDetails;
00412 
00416     mutable std::vector<CalibDetailsFromRecord*>* m_calibDetails;
00417 
00418 };
00419 
00420 #endif // DAQDETAILSSVC_DETAILSFROMRECORDSVC_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:15:31 for DaqFormatModules by doxygen 1.7.4