00001 /* @version $Revision: 1850 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-08-22 09:59:31 +0200 (Wed, 22 Aug 2012) $ */ 00002 00003 #ifndef RUN_HH 00004 #define RUN_HH 00005 00006 #include "mTypes.h" 00007 #include <fstream> 00008 00009 00010 00011 ////////////////////////////////////////////////////////////////////////// 00012 // // 00013 // Run for MICROMEGAS READOUT // 00014 // // 00015 ////////////////////////////////////////////////////////////////////////// 00016 00017 ////////////////////////////////////////////////////////////////////////// 00018 /// CLASS RUN // 00019 ////////////////////////////////////////////////////////////////////////// 00020 class Detector; 00021 00022 class Run { 00023 friend std::ostream& operator <<(std::ostream& out, const Run& x); 00024 00025 public: 00026 Run(Detector &aDetector); 00027 ~Run(); 00028 00029 private: 00030 Detector& detector; 00031 00032 ui32 id; 00033 00034 std::string name; // <- XML 00035 std::string date; // <- XML 00036 00037 time_t reconstructionDate; // <- Set by constructor 00038 std::string svnrev ; // svn version 00039 std::string rawDataFilename; // <- XML 00040 bool calibrationRun; // <- XML // true -> calibration. false -> production 00041 bool difSynchro; // set true for dif_synchro acquisition 00042 00043 00044 00045 ui16 delayTrigger; 00046 // Following data member are only available in calibration mode 00047 float injectedCharge; 00048 00049 // DIRAC CALIBRATION ONLY 00050 ui16 widthCtest; // 10 bit store in 16 bits 00051 ui16 periodCtest; // 10 bit store in 16 bits 00052 ui16 delayCtest; // 10 bit store in 16 bits 00053 00054 ui16 dataFormat; // current data format in the first hexadecimal character of the file 00055 ui16 daqSoftware; // DAQ software version 8 bits 00056 ui16 cccFirmware; // CCC firmware version 8 bits 00057 ui16 sdCCFirmware; // SDCC firmware version 16 bits 00058 ui16 difFirmware; // DIF firmware version 16 bits 00059 public: 00060 00061 std::ostream& operator <<(std::ostream &out) const; 00062 00063 Detector& getDetector(void) const { return detector; } 00064 std::string getSvnrev()const ; 00065 00066 inline const time_t getReconstructionDate(void) const { return reconstructionDate; } 00067 void setReconstructionDate(time_t _aDate) { reconstructionDate = _aDate;}; 00068 00069 inline ui32 getId(void) const { return id; } 00070 inline void setId(const ui32 aId){ id = aId; } 00071 00072 inline std::string getName(void) const { return name; } 00073 inline void setName(const std::string aName){ name = aName; } 00074 00075 inline std::string getDate(void) const { return date; } 00076 inline void setDate(const std::string aDate){ date = aDate; } 00077 00078 inline ui16 getDataFormat() const { return dataFormat ; } ; 00079 void setDataFormat(ui16 value) { dataFormat = value; }; 00080 00081 inline ui16 getDaqSoftware() const { return daqSoftware ; } ; 00082 void setDaqSoftware(ui16 value) { daqSoftware = value; }; 00083 00084 inline ui16 getDifFirmware() const { return difFirmware ; } ; 00085 void setDifFirmware(ui16 value) { difFirmware = value; }; 00086 00087 inline ui16 getCccFirmware() const { return cccFirmware ; } ; 00088 void setCccFirmware(ui16 value) { cccFirmware = value; }; 00089 00090 inline ui16 getSDccFirmware() const { return sdCCFirmware ; } ; 00091 void setSDccFirmware(ui16 value) { sdCCFirmware = value; }; 00092 00093 void setRawDataFilename(std::string value) { rawDataFilename = value;}; 00094 std::string getRawDataFilename(void) const { return rawDataFilename; }; 00095 00096 bool isCalibrationRun(void) const { return calibrationRun; }; 00097 void setCalibrationRun(bool aValue) { calibrationRun = aValue; } 00098 00099 bool isDifSynchro(void) const { return difSynchro; }; 00100 void setDifSynchro(bool aValue) { difSynchro = aValue; } 00101 00102 // calibration only // Infos from calibration raw data file 00103 //ui32 getSendedCharge(void) const { return injectedCharge; } ; 00104 float getSendedCharge(void) const { return injectedCharge; } ; 00105 ui16 getWidthCtest(void) const { return widthCtest; } ; 00106 ui16 getPeriodCtest(void) const { return periodCtest; } ; 00107 ui16 getDelayCtest(void) const { return delayCtest; } ; 00108 ui16 getDelayTrigger(void) const { return delayTrigger; } ; 00109 00110 //void setInjectedCharge(ui32 aValue) { injectedCharge = aValue; } ; 00111 void setInjectedCharge(float aValue) { injectedCharge = aValue; } ; 00112 void setWidthCtest(ui16 aValue) { widthCtest = aValue; } ; 00113 void setPeriodCtest(ui16 aValue) { periodCtest = aValue; } ; 00114 void setDelayCtest(ui16 aValue) { delayCtest = aValue; } 00115 void setDelayTrigger(ui16 aValue) { delayTrigger = aValue; } 00116 }; 00117 00118 #endif