File indexing completed on 2024-04-06 12:31:12
0001 #ifndef HCALTBTRIGGERDATA_H
0002 #define HCALTBTRIGGERDATA_H 1
0003
0004 #include <string>
0005 #include <iostream>
0006 #include <cstdint>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 class HcalTBTriggerData {
0018 public:
0019 HcalTBTriggerData();
0020
0021
0022
0023 const std::string& runNumberSequenceId() const { return runNumberSequenceId_; }
0024
0025
0026 uint32_t runNumber() const { return runNumber_; }
0027
0028 uint32_t triggerWord() const { return triggerWord_; }
0029
0030 uint32_t triggerTimeUsec() const { return triggerTimeUsec_; }
0031
0032 uint32_t triggerTimeBase() const { return triggerTimeBase_; }
0033
0034 uint32_t spillNumber() const { return spillNumber_; }
0035
0036 uint32_t orbitNumber() const { return orbitNumber_; }
0037
0038 uint16_t bunchNumber() const { return bunchNumber_; }
0039
0040 uint16_t eventNumber() const { return eventNumber_; }
0041 uint32_t flagsDaqTtype() const { return flagsDaqTtype_; }
0042 uint32_t algoBits3() const { return algoBits3_; }
0043 uint32_t algoBits2() const { return algoBits2_; }
0044 uint32_t algoBits1() const { return algoBits1_; }
0045 uint32_t algoBits0() const { return algoBits0_; }
0046 uint32_t techBits() const { return techBits_; }
0047 uint32_t gps1234() const { return gps1234_; }
0048 uint32_t gps5678() const { return gps5678_; }
0049
0050
0051 void setStandardData(uint32_t orbitNumber,
0052 uint32_t eventNumber,
0053 uint16_t bunchNumber,
0054 uint32_t flags_daq_ttype,
0055 uint32_t algo_bits_3,
0056 uint32_t algo_bits_2,
0057 uint32_t algo_bits_1,
0058 uint32_t algo_bits_0,
0059 uint32_t tech_bits,
0060 uint32_t gps_1234,
0061 uint32_t gps_5678);
0062
0063 void setExtendedData(uint32_t triggerWord,
0064 uint32_t triggerTime_usec,
0065 uint32_t triggerTime_base,
0066 uint32_t spillNumber,
0067 uint32_t runNumber,
0068 const char* runNumberSequenceId);
0069
0070
0071
0072
0073 inline bool wasBeamTrigger() const { return (triggerWord() & 0x0F) == bit_BeamTrigger; }
0074
0075
0076 inline bool wasFakeTrigger() const { return (triggerWord() & 0x0F) == bit_FakeTrigger; }
0077
0078
0079 inline bool wasSpillIgnorantPedestalTrigger() const {
0080 return (triggerWord() & 0x0F) == bit_spillIgnorantPedestalTrigger;
0081 }
0082
0083
0084 inline bool wasOutSpillPedestalTrigger() const { return (triggerWord() & 0x0F) == bit_OutSpillPedestalTrigger; }
0085
0086
0087 inline bool wasInSpillPedestalTrigger() const { return (triggerWord() & 0x0F) == bit_InSpillPedestalTrigger; }
0088
0089
0090 inline bool wasLaserTrigger() const { return (triggerWord() & 0x0F) == bit_LaserTrigger; }
0091
0092
0093 inline bool wasLEDTrigger() const { return (triggerWord() & 0x0F) == bit_LEDTrigger; }
0094
0095
0096 inline bool wasInSpill() const { return (triggerWord() & bit_InSpill); }
0097
0098 static const uint32_t bit_BeamTrigger;
0099 static const uint32_t bit_InSpillPedestalTrigger;
0100 static const uint32_t bit_OutSpillPedestalTrigger;
0101 static const uint32_t bit_LaserTrigger;
0102 static const uint32_t bit_spillIgnorantPedestalTrigger;
0103 static const uint32_t bit_LEDTrigger;
0104
0105 static const uint32_t bit_FakeTrigger;
0106
0107 static const uint32_t bit_InSpill;
0108
0109 private:
0110 std::string runNumberSequenceId_;
0111 uint32_t runNumber_;
0112 uint32_t triggerWord_;
0113 uint32_t triggerTimeUsec_;
0114 uint32_t triggerTimeBase_;
0115 uint32_t spillNumber_;
0116 uint32_t orbitNumber_;
0117 uint16_t bunchNumber_;
0118 uint32_t eventNumber_;
0119 uint32_t flagsDaqTtype_;
0120 uint32_t algoBits3_;
0121 uint32_t algoBits2_;
0122 uint32_t algoBits1_;
0123 uint32_t algoBits0_;
0124 uint32_t techBits_;
0125 uint32_t gps1234_;
0126 uint32_t gps5678_;
0127 };
0128
0129 std::ostream& operator<<(std::ostream& s, const HcalTBTriggerData& htbtd);
0130
0131 #endif