00001 #ifndef RAWECAL_ECALDCCHEADERBLOCK_H
00002 #define RAWECAL_ECALDCCHEADERBLOCK_H
00003
00004 #include <boost/cstdint.hpp>
00005
00013 #include <vector>
00014
00015 #define MAX_TCC_SIZE 4
00016 #define MAX_TT_SIZE 70
00017
00018
00019
00020 class EcalDCCHeaderBlock
00021 {
00022
00023 public:
00024
00025 typedef int key_type;
00026
00027 enum EcalDCCRuntype{
00028
00029
00030 COSMIC =0,
00031 BEAMH4 =1,
00032 BEAMH2 =2,
00033 MTCC =3,
00034 LASER_STD =4,
00035 LASER_POWER_SCAN =5,
00036 LASER_DELAY_SCAN =6,
00037 TESTPULSE_SCAN_MEM =7,
00038 TESTPULSE_MGPA =8,
00039 PEDESTAL_STD =9,
00040 PEDESTAL_OFFSET_SCAN =10,
00041 PEDESTAL_25NS_SCAN =11,
00042 LED_STD =12,
00043
00044
00045 PHYSICS_GLOBAL =13,
00046 COSMICS_GLOBAL =14,
00047 HALO_GLOBAL =15,
00048
00049
00050 LASER_GAP =16,
00051 TESTPULSE_GAP =17,
00052 PEDESTAL_GAP =18,
00053 LED_GAP =19,
00054
00055
00056 PHYSICS_LOCAL =20,
00057 COSMICS_LOCAL =21,
00058 HALO_LOCAL =22,
00059 CALIB_LOCAL =23
00060
00061 };
00062
00063 enum EcalBasicTriggerType{
00064 PHYSICS_TRIGGER =1,
00065 CALIBRATION_TRIGGER =2,
00066 TEST_TRIGGER =3,
00067 TECHNICAL_EXTERNAL_TRIGGER =4
00068 };
00069
00070 enum TTC_DTT_TYPE{
00071 TTC_LASER = 4,
00072 TTC_LED = 5,
00073 TTC_TESTPULSE = 6,
00074 TTC_PEDESTAL = 7
00075 };
00076
00077 struct EcalDCCEventSettings{
00078 short LaserPower;
00079 short LaserFilter;
00080 short wavelength;
00081 short delay;
00082 short MEMVinj;
00083 short mgpa_content;
00084 short ped_offset;
00085 };
00086
00087 EcalDCCHeaderBlock();
00088 EcalDCCHeaderBlock(const int& dccId);
00089
00090
00091
00092
00093 const int& id() const { return dccId_; }
00094
00095
00096
00097 const int fedId() const { return fedId_; }
00098
00099 void setId(const int& dccId) { dccId_=dccId; };
00100 void setFedId(const int& fedId) { fedId_=fedId; };
00101
00102 void setErrors(const int& dccErrors) { dccErrors_=dccErrors; };
00103 void setDccInTTCCommand(const int& dccInTTCCommand) { dccInTTCCommand_=dccInTTCCommand; };
00104 void setRunNumber(const int& run){runNumber_ = run;}
00105 void setLV1(const int& LV1){LV1event_ = LV1;}
00106 void setBX(const int& BX){BX_ = BX;}
00107 void setOrbit(const int& orbit){orbitNumber_ = orbit;}
00108 void setEventSettings(const EcalDCCEventSettings& EventSettings) { EventSettings_=EventSettings; };
00109 void setRunType(const short& runType) { runType_=runType; };
00110 void setBasicTriggerType(const short& triggerType) { basic_trigger_type_=triggerType; };
00111
00112 void setRtHalf(const short& rtHalf) { rtHalf_=rtHalf; } ;
00113 void setMgpaGain(const short& mgpaGain) { mgpaGain_=mgpaGain; };
00114 void setMemGain(const short& memGain) { memGain_=memGain; };
00115 void setSelectiveReadout(const bool& selectiveReadout) { selectiveReadout_=selectiveReadout; };
00116 void setZeroSuppression(const bool& zeroSuppression) { zeroSuppression_=zeroSuppression; };
00117 void setTestZeroSuppression(const bool& testZeroSuppression) { testZeroSuppression_ = testZeroSuppression; };
00118 void setSrpStatus(const short& srpStatus) { srpStatus_=srpStatus; };
00119 void setTccStatus(const std::vector<short>& tccStatus) { tccStatus_=tccStatus; };
00120 void setTriggerTowerFlags(const std::vector<short>& triggerTowerFlag) { triggerTowerFlag_ = triggerTowerFlag; };
00121 void setFEStatus(const std::vector<short>& feStatus) { feStatus_ = feStatus; };
00122
00123
00124
00125 int getDCCErrors() const{ return dccErrors_;}
00126 int getDccInTCCCommand() const{ return dccInTTCCommand_; };
00127 int getRunNumber() const {return runNumber_ ;}
00128 int getLV1() const {return LV1event_ ;}
00129 int getBX() const {return BX_ ;}
00130 int getOrbit() const {return orbitNumber_;}
00131 EcalDCCEventSettings getEventSettings() const { return EventSettings_;}
00132 short getRunType() const {return runType_ ;}
00133 short getBasicTriggerType() const {return basic_trigger_type_ ;}
00134
00135 short getRtHalf() const { return rtHalf_; }
00136 short getMgpaGain() const { return mgpaGain_;}
00137 short getMemGain() const { return memGain_;}
00138 short getSelectiveReadout() const { return selectiveReadout_;}
00139 bool getZeroSuppression() const { return zeroSuppression_;}
00140 bool getTestZeroSuppression() const {return testZeroSuppression_ ;}
00141 short getSrpStatus() const { return srpStatus_;}
00142 std::vector<short> getTccStatus() const { return tccStatus_ ;}
00143 std::vector<short> getTriggerTowerFlag() const { return triggerTowerFlag_ ;}
00144 std::vector<short> getFEStatus() const { return feStatus_ ;}
00145 private:
00146
00147 int dccId_;
00148 int fedId_;
00149 int dccErrors_;
00150 int dccInTTCCommand_;
00151 int orbitNumber_;
00152 short runType_;
00153
00154 short basic_trigger_type_;
00155
00156 int LV1event_;
00157 int runNumber_;
00158 int BX_;
00159 EcalDCCEventSettings EventSettings_;
00160
00161 short rtHalf_;
00162 short mgpaGain_;
00163 short memGain_;
00164 bool selectiveReadout_;
00165 bool testZeroSuppression_;
00166 bool zeroSuppression_;
00167
00168 short srpStatus_;
00169 std::vector<short> tccStatus_;
00170 std::vector<short> triggerTowerFlag_;
00171 std::vector<short> feStatus_;
00172
00173 };
00174
00175 #endif