test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 "boost/cstdint.hpp"
7 
8 
19  public:
21 
22  // Getter methods
23 
25 
27  uint32_t runNumber() const { return runNumber_; }
29  uint32_t triggerWord() const { return triggerWord_; }
31  uint32_t triggerTimeUsec() const { return triggerTimeUsec_; }
33  uint32_t triggerTimeBase() const { return triggerTimeBase_; }
35  uint32_t spillNumber() const { return spillNumber_; }
37  uint32_t orbitNumber() const { return orbitNumber_; }
39  uint16_t bunchNumber() const { return bunchNumber_; }
41  uint16_t eventNumber() const { return eventNumber_; }
42  uint32_t flagsDaqTtype() const { return flagsDaqTtype_; }
43  uint32_t algoBits3() const { return algoBits3_; }
44  uint32_t algoBits2() const { return algoBits2_; }
45  uint32_t algoBits1() const { return algoBits1_; }
46  uint32_t algoBits0() const { return algoBits0_; }
47  uint32_t techBits() const { return techBits_; }
48  uint32_t gps1234() const { return gps1234_; }
49  uint32_t gps5678() const { return gps5678_; }
50 
51  // Setter methods
52  void setStandardData( uint32_t orbitNumber,
53  uint32_t eventNumber,
54  uint16_t bunchNumber,
55  uint32_t flags_daq_ttype,
56  uint32_t algo_bits_3,
57  uint32_t algo_bits_2,
58  uint32_t algo_bits_1,
59  uint32_t algo_bits_0,
60  uint32_t tech_bits,
61  uint32_t gps_1234,
62  uint32_t gps_5678 );
63 
64  void setExtendedData( uint32_t triggerWord,
65  uint32_t triggerTime_usec,
66  uint32_t triggerTime_base,
67  uint32_t spillNumber,
68  uint32_t runNumber,
69  const char *runNumberSequenceId );
70 
71  // Parse trigger word routines
72 
74  inline bool wasBeamTrigger() const {
75  return (triggerWord()&0x0F)==bit_BeamTrigger;
76  }
77 
79  inline bool wasFakeTrigger() const {
80  return (triggerWord()&0x0F)==bit_FakeTrigger;
81  }
82 
84  inline bool wasSpillIgnorantPedestalTrigger() const {
86  }
87 
89  inline bool wasOutSpillPedestalTrigger() const {
91  }
92 
94  inline bool wasInSpillPedestalTrigger() const {
95  return (triggerWord()&0x0F)==bit_InSpillPedestalTrigger;
96  }
97 
99  inline bool wasLaserTrigger() const {
100  return (triggerWord()&0x0F)==bit_LaserTrigger;
101  }
102 
104  inline bool wasLEDTrigger() const {
105  return (triggerWord()&0x0F)==bit_LEDTrigger;
106  }
107 
109  inline bool wasInSpill() const {
110  return (triggerWord()&bit_InSpill);
111  }
112 
113  static const uint32_t bit_BeamTrigger; // = 1;
114  static const uint32_t bit_InSpillPedestalTrigger; // = 2;
115  static const uint32_t bit_OutSpillPedestalTrigger; // = 3;
116  static const uint32_t bit_LaserTrigger; // = 4
117  static const uint32_t bit_spillIgnorantPedestalTrigger; // = 5;
118  static const uint32_t bit_LEDTrigger; // = 6
119 
120  static const uint32_t bit_FakeTrigger; // = 15
121 
122  static const uint32_t bit_InSpill; // = 0x10;
123 
124  private:
126  uint32_t runNumber_;
127  uint32_t triggerWord_;
130  uint32_t spillNumber_;
131  uint32_t orbitNumber_;
132  uint16_t bunchNumber_;
133  uint32_t eventNumber_;
134  uint32_t flagsDaqTtype_;
135  uint32_t algoBits3_;
136  uint32_t algoBits2_;
137  uint32_t algoBits1_;
138  uint32_t algoBits0_;
139  uint32_t techBits_;
140  uint32_t gps1234_;
141  uint32_t gps5678_;
142  };
143 
144  std::ostream& operator<<(std::ostream& s, const HcalTBTriggerData& htbtd);
145 
146 #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:188
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.