Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:05

0001 #ifndef RAWECAL_ECALDCCHEADERBLOCK_H
0002 #define RAWECAL_ECALDCCHEADERBLOCK_H
0003 
0004 /** \class EcalDCCHeaderBlock
0005  *  Container for ECAL specific DCC Header information
0006  *
0007  *
0008  */
0009 
0010 #include <vector>
0011 
0012 #define MAX_TCC_SIZE 4
0013 #define MAX_TT_SIZE 70
0014 
0015 class EcalDCCHeaderBlock {
0016 public:
0017   typedef int key_type;  ///< For the sorted collection
0018 
0019   enum EcalDCCRuntype {
0020 
0021     // run types pre-global runs
0022     COSMIC = 0,
0023     BEAMH4 = 1,
0024     BEAMH2 = 2,
0025     MTCC = 3,
0026     LASER_STD = 4,
0027     LASER_POWER_SCAN = 5,
0028     LASER_DELAY_SCAN = 6,
0029     TESTPULSE_SCAN_MEM = 7,
0030     TESTPULSE_MGPA = 8,
0031     PEDESTAL_STD = 9,
0032     PEDESTAL_OFFSET_SCAN = 10,
0033     PEDESTAL_25NS_SCAN = 11,
0034     LED_STD = 12,
0035 
0036     // physics triggers in global runs
0037     PHYSICS_GLOBAL = 13,
0038     COSMICS_GLOBAL = 14,
0039     HALO_GLOBAL = 15,
0040 
0041     // gap events in global runs
0042     LASER_GAP = 16,
0043     TESTPULSE_GAP = 17,
0044     PEDESTAL_GAP = 18,
0045     LED_GAP = 19,
0046 
0047     // physics triggers in local runs
0048     PHYSICS_LOCAL = 20,
0049     COSMICS_LOCAL = 21,
0050     HALO_LOCAL = 22,
0051     CALIB_LOCAL = 23
0052 
0053   };
0054 
0055   enum EcalBasicTriggerType {
0056     PHYSICS_TRIGGER = 1,
0057     CALIBRATION_TRIGGER = 2,
0058     TEST_TRIGGER = 3,
0059     TECHNICAL_EXTERNAL_TRIGGER = 4
0060   };
0061 
0062   enum TTC_DTT_TYPE { TTC_LASER = 4, TTC_LED = 5, TTC_TESTPULSE = 6, TTC_PEDESTAL = 7 };
0063 
0064   struct EcalDCCEventSettings {
0065     short LaserPower;
0066     short LaserFilter;
0067     short wavelength;
0068     short delay;
0069     short MEMVinj;
0070     short mgpa_content;
0071     short ped_offset;
0072   };
0073 
0074   EcalDCCHeaderBlock();
0075   EcalDCCHeaderBlock(const int& dccId);
0076 
0077   // partitional and geometrical:
0078   // CMS: 1-9 EE-, 10-45 EB, 46-54 EE+
0079   // TB and COSM: 1  (10 in case of EcalRawToDigi)
0080   const int& id() const { return dccId_; }
0081 
0082   // as found in raw data, namely
0083   // CMS: 601-654         TB and COSM: 0-35
0084   const int fedId() const { return fedId_; }
0085 
0086   void setId(const int& dccId) { dccId_ = dccId; };
0087   void setFedId(const int& fedId) { fedId_ = fedId; };
0088 
0089   void setErrors(const int& dccErrors) { dccErrors_ = dccErrors; };
0090   void setDccInTTCCommand(const int& dccInTTCCommand) { dccInTTCCommand_ = dccInTTCCommand; };
0091   void setRunNumber(const int& run) { runNumber_ = run; }
0092   void setLV1(const int& LV1) { LV1event_ = LV1; }
0093   void setBX(const int& BX) { BX_ = BX; }
0094   void setOrbit(const int& orbit) { orbitNumber_ = orbit; }
0095   void setEventSettings(const EcalDCCEventSettings& EventSettings) { EventSettings_ = EventSettings; };
0096   void setRunType(const short& runType) { runType_ = runType; };
0097   void setZs(const short& zs) { zs_ = zs; };
0098   void setBasicTriggerType(const short& triggerType) { basic_trigger_type_ = triggerType; };
0099   //void setSequence(const short& sequence) { sequence_=sequence; } ;
0100   void setRtHalf(const short& rtHalf) { rtHalf_ = rtHalf; };
0101   void setMgpaGain(const short& mgpaGain) { mgpaGain_ = mgpaGain; };
0102   void setMemGain(const short& memGain) { memGain_ = memGain; };
0103   void setSelectiveReadout(const bool& selectiveReadout) { selectiveReadout_ = selectiveReadout; };
0104   void setZeroSuppression(const bool& zeroSuppression) { zeroSuppression_ = zeroSuppression; };
0105   void setTestZeroSuppression(const bool& testZeroSuppression) { testZeroSuppression_ = testZeroSuppression; };
0106   void setSrpStatus(const short& srpStatus) { srpStatus_ = srpStatus; };
0107   void setTccStatus(const std::vector<short>& tccStatus) { tccStatus_ = tccStatus; };
0108   void setTriggerTowerFlags(const std::vector<short>& triggerTowerFlag) { triggerTowerFlag_ = triggerTowerFlag; };
0109   void setFEStatus(const std::vector<short>& feStatus) { feStatus_ = feStatus; };
0110 
0111   void setFEBx(const std::vector<short>& feBx) { feBx_ = feBx; }
0112   void setTCCBx(const std::vector<short>& tccBx) { tccBx_ = tccBx; }
0113   void setSRPBx(const short& srpBx) { srpBx_ = srpBx; }
0114 
0115   void setFELv1(const std::vector<short>& feLv1) { feLv1_ = feLv1; }
0116   void setTCCLv1(const std::vector<short>& tccLv1) { tccLv1_ = tccLv1; }
0117   void setSRPLv1(const short& srpLv1) { srpLv1_ = srpLv1; }
0118 
0119   //TODO add all the get methods
0120 
0121   int getDCCErrors() const { return dccErrors_; }
0122   int getDccInTCCCommand() const { return dccInTTCCommand_; };
0123   int getRunNumber() const { return runNumber_; }
0124   int getLV1() const { return LV1event_; }
0125   int getBX() const { return BX_; }
0126   int getOrbit() const { return orbitNumber_; }
0127   EcalDCCEventSettings getEventSettings() const { return EventSettings_; }
0128   short getRunType() const { return runType_; }
0129   short getZs() const { return zs_; }
0130   short getBasicTriggerType() const { return basic_trigger_type_; }
0131 
0132   short getRtHalf() const { return rtHalf_; }
0133   short getMgpaGain() const { return mgpaGain_; }
0134   short getMemGain() const { return memGain_; }
0135   short getSelectiveReadout() const { return selectiveReadout_; }
0136   bool getZeroSuppression() const { return zeroSuppression_; }
0137   bool getTestZeroSuppression() const { return testZeroSuppression_; }
0138   short getSrpStatus() const { return srpStatus_; }
0139   const std::vector<short>& getTccStatus() const { return tccStatus_; }
0140   const std::vector<short>& getTriggerTowerFlag() const { return triggerTowerFlag_; }
0141   const std::vector<short>& getFEStatus() const { return feStatus_; }
0142 
0143   const std::vector<short>& getFEBxs() const { return feBx_; }
0144   const std::vector<short>& getTCCBx() const { return tccBx_; }
0145   short getSRPBx() const { return srpBx_; }
0146 
0147   const std::vector<short>& getFELv1() const { return feLv1_; }
0148   const std::vector<short>& getTCCLv1() const { return tccLv1_; }
0149   short getSRPLv1() const { return srpLv1_; }
0150 
0151 private:
0152   int dccId_;  //to be used as the Key
0153   int fedId_;
0154   int dccErrors_;
0155   int dccInTTCCommand_;
0156   int orbitNumber_;
0157   short runType_;
0158   short zs_;
0159 
0160   short basic_trigger_type_;
0161 
0162   int LV1event_;
0163   int runNumber_;
0164   int BX_;
0165   EcalDCCEventSettings EventSettings_;
0166 
0167   short rtHalf_;
0168   short mgpaGain_;
0169   short memGain_;
0170   bool selectiveReadout_;
0171   bool testZeroSuppression_;
0172   bool zeroSuppression_;
0173 
0174   short srpStatus_;
0175   std::vector<short> tccStatus_;
0176   std::vector<short> triggerTowerFlag_;
0177   std::vector<short> feStatus_;
0178 
0179   std::vector<short> feBx_;
0180   std::vector<short> tccBx_;
0181   short srpBx_;
0182 
0183   std::vector<short> feLv1_;
0184   std::vector<short> tccLv1_;
0185   short srpLv1_;
0186 };
0187 
0188 #endif