CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DataFormats/EcalRawData/interface/EcalDCCHeaderBlock.h

Go to the documentation of this file.
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     // run types pre-global runs
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     // physics triggers in global runs
00045     PHYSICS_GLOBAL           =13,
00046     COSMICS_GLOBAL           =14,
00047     HALO_GLOBAL              =15,
00048 
00049     // gap events in global runs
00050     LASER_GAP                =16,
00051     TESTPULSE_GAP            =17,
00052     PEDESTAL_GAP             =18,
00053     LED_GAP                  =19,
00054 
00055     // physics triggers in local runs
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   // partitional and geometrical:
00091   // CMS: 1-9 EE-, 10-45 EB, 46-54 EE+
00092   // TB and COSM: 1  (10 in case of EcalRawToDigi)
00093   const int& id() const { return dccId_; }
00094 
00095   // as found in raw data, namely
00096   // CMS: 601-654         TB and COSM: 0-35
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 setZs(const short& zs) { zs_=zs;};
00111   void setBasicTriggerType(const short& triggerType) { basic_trigger_type_=triggerType; };
00112   //void setSequence(const short& sequence) { sequence_=sequence; } ;
00113   void setRtHalf(const short& rtHalf) { rtHalf_=rtHalf; } ;
00114   void setMgpaGain(const short& mgpaGain) { mgpaGain_=mgpaGain; };
00115   void setMemGain(const short& memGain) { memGain_=memGain; };
00116   void setSelectiveReadout(const bool& selectiveReadout) { selectiveReadout_=selectiveReadout; };
00117   void setZeroSuppression(const bool& zeroSuppression) { zeroSuppression_=zeroSuppression; };
00118   void setTestZeroSuppression(const bool& testZeroSuppression) { testZeroSuppression_ = testZeroSuppression; };
00119   void setSrpStatus(const short& srpStatus) { srpStatus_=srpStatus; };
00120   void setTccStatus(const std::vector<short>& tccStatus) { tccStatus_=tccStatus; };
00121   void setTriggerTowerFlags(const std::vector<short>& triggerTowerFlag) { triggerTowerFlag_ = triggerTowerFlag; };
00122   void setFEStatus(const std::vector<short>& feStatus) { feStatus_ = feStatus; };
00123 
00124   void setFEBx(const std::vector<short>& feBx)  { feBx_  = feBx;  }
00125   void setTCCBx(const std::vector<short>& tccBx){ tccBx_ = tccBx; }
00126   void setSRPBx(const short & srpBx)            { srpBx_ = srpBx; }
00127   
00128   void setFELv1(const std::vector<short>& feLv1)  { feLv1_ = feLv1;   }
00129   void setTCCLv1(const std::vector<short>& tccLv1){ tccLv1_ = tccLv1; }
00130   void setSRPLv1(const short & srpLv1)            { srpLv1_ = srpLv1; }
00131 
00132 
00133 
00134 
00135 
00136   //TODO add all the get methods
00137   
00138   int getDCCErrors() const{ return dccErrors_;}
00139   int getDccInTCCCommand() const{ return dccInTTCCommand_; };
00140   int getRunNumber() const {return runNumber_ ;}
00141   int getLV1() const {return LV1event_ ;}
00142   int getBX() const {return BX_ ;}
00143   int getOrbit() const {return orbitNumber_;}
00144   EcalDCCEventSettings getEventSettings() const { return EventSettings_;}
00145   short getRunType() const {return runType_ ;}
00146   short getZs() const {return zs_ ;}
00147   short getBasicTriggerType() const {return basic_trigger_type_ ;}
00148 
00149   short getRtHalf() const { return rtHalf_; } 
00150   short getMgpaGain() const { return mgpaGain_;}
00151   short getMemGain() const  { return memGain_;}
00152   short getSelectiveReadout() const { return selectiveReadout_;}
00153   bool getZeroSuppression() const { return zeroSuppression_;}
00154   bool getTestZeroSuppression() const {return testZeroSuppression_ ;}
00155   short getSrpStatus() const  { return srpStatus_;}
00156   const std::vector<short>& getTccStatus() const { return tccStatus_ ;}
00157   const std::vector<short>& getTriggerTowerFlag() const { return triggerTowerFlag_ ;}
00158   const std::vector<short>& getFEStatus() const { return feStatus_ ;}
00159 
00160   const std::vector<short>& getFEBxs() const { return feBx_;}
00161   const std::vector<short>& getTCCBx() const { return tccBx_;}
00162   short              getSRPBx() const { return srpBx_; }
00163   
00164   const std::vector<short>& getFELv1() const { return feLv1_;}
00165   const std::vector<short>& getTCCLv1()const { return tccLv1_;}
00166   short              getSRPLv1() const { return srpLv1_; }
00167   
00168   
00169  private:
00170 
00171   int dccId_;  //to be used as the Key
00172   int fedId_;
00173   int dccErrors_;
00174   int dccInTTCCommand_;
00175   int orbitNumber_;
00176   short runType_;
00177   short zs_;
00178 
00179   short basic_trigger_type_;
00180 
00181   int LV1event_;
00182   int runNumber_;
00183   int BX_;
00184   EcalDCCEventSettings  EventSettings_;
00185   
00186   short rtHalf_;
00187   short mgpaGain_;
00188   short memGain_;
00189   bool selectiveReadout_;
00190   bool testZeroSuppression_;
00191   bool zeroSuppression_;
00192   
00193   short srpStatus_;
00194   std::vector<short> tccStatus_;
00195   std::vector<short> triggerTowerFlag_;
00196   std::vector<short> feStatus_;
00197   
00198   std::vector<short> feBx_;  
00199   std::vector<short> tccBx_; 
00200   short              srpBx_; 
00201   
00202   std::vector<short> feLv1_;  
00203   std::vector<short> tccLv1_; 
00204   short              srpLv1_; 
00205  
00206 };
00207 
00208 #endif