CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalTBTriggerData.h
Go to the documentation of this file.
1 #ifndef HCALTBTRIGGERDATA_H
2 #define HCALTBTRIGGERDATA_H 1
3 
4 #include <string>
5 #include <iostream>
6 #include <cstdint>
7 
18 public:
20 
21  // Getter methods
22 
24 
26  uint32_t runNumber() const { return runNumber_; }
28  uint32_t triggerWord() const { return triggerWord_; }
30  uint32_t triggerTimeUsec() const { return triggerTimeUsec_; }
32  uint32_t triggerTimeBase() const { return triggerTimeBase_; }
34  uint32_t spillNumber() const { return spillNumber_; }
36  uint32_t orbitNumber() const { return orbitNumber_; }
38  uint16_t bunchNumber() const { return bunchNumber_; }
40  uint16_t eventNumber() const { return eventNumber_; }
41  uint32_t flagsDaqTtype() const { return flagsDaqTtype_; }
42  uint32_t algoBits3() const { return algoBits3_; }
43  uint32_t algoBits2() const { return algoBits2_; }
44  uint32_t algoBits1() const { return algoBits1_; }
45  uint32_t algoBits0() const { return algoBits0_; }
46  uint32_t techBits() const { return techBits_; }
47  uint32_t gps1234() const { return gps1234_; }
48  uint32_t gps5678() const { return gps5678_; }
49 
50  // Setter methods
51  void setStandardData(uint32_t orbitNumber,
52  uint32_t eventNumber,
53  uint16_t bunchNumber,
54  uint32_t flags_daq_ttype,
55  uint32_t algo_bits_3,
56  uint32_t algo_bits_2,
57  uint32_t algo_bits_1,
58  uint32_t algo_bits_0,
59  uint32_t tech_bits,
60  uint32_t gps_1234,
61  uint32_t gps_5678);
62 
63  void setExtendedData(uint32_t triggerWord,
64  uint32_t triggerTime_usec,
65  uint32_t triggerTime_base,
66  uint32_t spillNumber,
67  uint32_t runNumber,
68  const char* runNumberSequenceId);
69 
70  // Parse trigger word routines
71 
73  inline bool wasBeamTrigger() const { return (triggerWord() & 0x0F) == bit_BeamTrigger; }
74 
76  inline bool wasFakeTrigger() const { return (triggerWord() & 0x0F) == bit_FakeTrigger; }
77 
79  inline bool wasSpillIgnorantPedestalTrigger() const {
80  return (triggerWord() & 0x0F) == bit_spillIgnorantPedestalTrigger;
81  }
82 
84  inline bool wasOutSpillPedestalTrigger() const { return (triggerWord() & 0x0F) == bit_OutSpillPedestalTrigger; }
85 
87  inline bool wasInSpillPedestalTrigger() const { return (triggerWord() & 0x0F) == bit_InSpillPedestalTrigger; }
88 
90  inline bool wasLaserTrigger() const { return (triggerWord() & 0x0F) == bit_LaserTrigger; }
91 
93  inline bool wasLEDTrigger() const { return (triggerWord() & 0x0F) == bit_LEDTrigger; }
94 
96  inline bool wasInSpill() const { return (triggerWord() & bit_InSpill); }
97 
98  static const uint32_t bit_BeamTrigger; // = 1;
99  static const uint32_t bit_InSpillPedestalTrigger; // = 2;
100  static const uint32_t bit_OutSpillPedestalTrigger; // = 3;
101  static const uint32_t bit_LaserTrigger; // = 4
102  static const uint32_t bit_spillIgnorantPedestalTrigger; // = 5;
103  static const uint32_t bit_LEDTrigger; // = 6
104 
105  static const uint32_t bit_FakeTrigger; // = 15
106 
107  static const uint32_t bit_InSpill; // = 0x10;
108 
109 private:
111  uint32_t runNumber_;
112  uint32_t triggerWord_;
115  uint32_t spillNumber_;
116  uint32_t orbitNumber_;
117  uint16_t bunchNumber_;
118  uint32_t eventNumber_;
119  uint32_t flagsDaqTtype_;
120  uint32_t algoBits3_;
121  uint32_t algoBits2_;
122  uint32_t algoBits1_;
123  uint32_t algoBits0_;
124  uint32_t techBits_;
125  uint32_t gps1234_;
126  uint32_t gps5678_;
127 };
128 
129 std::ostream& operator<<(std::ostream& s, const HcalTBTriggerData& htbtd);
130 
131 #endif
static const uint32_t bit_LaserTrigger
uint32_t triggerWord() const
Returns the entire packed trigger word.
bool wasLEDTrigger() const
returns true if this was a LED trigger
std::string runNumberSequenceId_
void setExtendedData(uint32_t triggerWord, uint32_t triggerTime_usec, uint32_t triggerTime_base, uint32_t spillNumber, uint32_t runNumber, const char *runNumberSequenceId)
uint32_t algoBits1() const
uint32_t techBits() const
bool wasFakeTrigger() const
returns true if this trigger was fake (from a non-H2 manager)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
const std::string & runNumberSequenceId() const
static const uint32_t bit_LEDTrigger
void setStandardData(uint32_t orbitNumber, uint32_t eventNumber, uint16_t bunchNumber, uint32_t flags_daq_ttype, uint32_t algo_bits_3, uint32_t algo_bits_2, uint32_t algo_bits_1, uint32_t algo_bits_0, uint32_t tech_bits, uint32_t gps_1234, uint32_t gps_5678)
uint32_t algoBits3() const
uint32_t algoBits0() const
static const uint32_t bit_InSpill
bool wasOutSpillPedestalTrigger() const
returns true if this was an out-of-spill pedestal trigger
static const uint32_t bit_InSpillPedestalTrigger
bool wasInSpill() const
returns true if the &quot;spill&quot; bit was set
uint32_t spillNumber() const
Returns the spill number of this trigger.
uint32_t algoBits3_
&lt;extended type=&quot;31:28,extended&quot; size=&quot;27:24,zeros=23:7,daq#=6:4,type=3:0&quot;&gt;
uint32_t gps1234() const
uint32_t orbitNumber() const
Returns the orbit number of this trigger.
uint32_t gps5678() const
uint32_t triggerTimeUsec() const
Returns the relative time of this trigger in microseconds.
uint16_t eventNumber() const
Returns the event number of this trigger.
static const uint32_t bit_FakeTrigger
uint16_t bunchNumber() const
Returns the bunch number of this trigger.
uint32_t triggerTimeBase() const
Returns the base time of the run (in seconds, from a time() call)
static const uint32_t bit_spillIgnorantPedestalTrigger
bool wasSpillIgnorantPedestalTrigger() const
returns true if this trigger was a calibration trigger
uint32_t algoBits2() const
static const uint32_t bit_BeamTrigger
bool wasInSpillPedestalTrigger() const
returns true if this was an in-spill pedestal trigger
bool wasBeamTrigger() const
returns true if this trigger came from beam data
static const uint32_t bit_OutSpillPedestalTrigger
bool wasLaserTrigger() const
returns true if this was a laser trigger
uint32_t flagsDaqTtype() const
uint32_t runNumber() const
Returns the current run number.