CMS 3D CMS Logo

Level1TriggerScalers.h
Go to the documentation of this file.
1 /*
2  * File: DataFormats/Scalers/interface/Level1TriggerScalers.h (W.Badgett)
3  *
4  * Various Level 1 Trigger Scalers from the GT/TS
5  *
6  */
7 
8 #ifndef DATAFORMATS_SCALERS_LEVEL1TRIGGERSCALERS_H
9 #define DATAFORMATS_SCALERS_LEVEL1TRIGGERSCALERS_H
10 
11 #include <ostream>
12 #include <vector>
13 
15 
24 
28 {
29  public:
30 
31  enum
32  {
35  firstShortLSRun = 125574
36  };
37 
38  static const unsigned long long N_BX = 3564ULL;
39  static const unsigned long long N_BX_ACTIVE = 2808ULL;
40  static const unsigned long long N_ORBITS_LUMI_SECTION = 0x100000ULL;
41  static const unsigned long long N_BX_LUMI_SECTION = N_ORBITS_LUMI_SECTION * N_BX;
42 
44  Level1TriggerScalers(const unsigned char * rawData);
45  virtual ~Level1TriggerScalers();
46 
48  std::string name() const { return "Level1TriggerScalers"; }
49 
51  bool empty() const { return false; }
52 
53  // Data accessor methods
54  int version() const { return(version_);}
55 
56  unsigned int trigType() const { return(trigType_);}
57  unsigned int eventID() const { return(eventID_);}
58  unsigned int sourceID() const { return(sourceID_);}
59  unsigned int bunchNumber() const { return(bunchNumber_);}
60 
61  struct timespec collectionTime() const
62  { return(collectionTime_.get_timespec());}
63 
64  unsigned int lumiSegmentNr() const { return(lumiSegmentNr_);}
65  unsigned int lumiSegmentOrbits() const { return(lumiSegmentOrbits_);}
66  unsigned int orbitNr() const { return(orbitNr_);}
67 
68  unsigned int gtResets() const { return(gtResets_);}
69  unsigned int bunchCrossingErrors() const { return(bunchCrossingErrors_);}
70  unsigned long long gtTriggers() const { return(gtTriggers_);}
71  unsigned long long gtEvents() const { return(gtEvents_);}
72  float gtTriggersRate() const { return(gtTriggersRate_);}
73  float gtEventsRate() const { return(gtEventsRate_);}
74  int prescaleIndexAlgo() const { return(prescaleIndexAlgo_);}
75  int prescaleIndexTech() const { return(prescaleIndexTech_);}
76 
77  struct timespec collectionTimeLumiSeg() const
79 
80  unsigned int lumiSegmentNrLumiSeg() const
81  { return(lumiSegmentNrLumiSeg_);}
82 
83  unsigned long long triggersPhysicsGeneratedFDL() const
85  unsigned long long triggersPhysicsLost() const
86  { return(triggersPhysicsLost_);}
87  unsigned long long triggersPhysicsLostBeamActive() const
89  unsigned long long triggersPhysicsLostBeamInactive() const
91  unsigned long long l1AsPhysics() const
92  { return(l1AsPhysics_);}
93  unsigned long long l1AsRandom() const
94  { return(l1AsRandom_);}
95  unsigned long long l1AsTest() const
96  { return(l1AsTest_);}
97  unsigned long long l1AsCalibration() const
98  { return(l1AsCalibration_);}
99  unsigned long long deadtime() const
100  { return(deadtime_);}
101  unsigned long long deadtimeBeamActive() const
102  { return(deadtimeBeamActive_);}
103  unsigned long long deadtimeBeamActiveTriggerRules() const
105  unsigned long long deadtimeBeamActiveCalibration() const
107  unsigned long long deadtimeBeamActivePrivateOrbit() const
109  unsigned long long deadtimeBeamActivePartitionController() const
111  unsigned long long deadtimeBeamActiveTimeSlot() const
112  { return(deadtimeBeamActiveTimeSlot_);}
113 
114  unsigned int lastOrbitCounter0() const { return(lastOrbitCounter0_);}
115  unsigned int lastTestEnable() const { return(lastTestEnable_);}
116  unsigned int lastResync() const { return(lastResync_);}
117  unsigned int lastStart() const { return(lastStart_);}
118  unsigned int lastEventCounter0() const { return(lastEventCounter0_);}
119  unsigned int lastHardReset() const { return(lastHardReset_);}
120  unsigned long long spare0() const { return(spare0_);}
121  unsigned long long spare1() const { return(spare1_);}
122  unsigned long long spare2() const { return(spare2_);}
123 
124  static double rateLS(unsigned long long counts);
125  static double rateLS(unsigned int counts);
126  static double percentLS(unsigned long long counts);
127  static double percentLSActive(unsigned long long counts);
128 
129  static double rateLS(unsigned long long counts, int runNumber);
130  static double rateLS(unsigned int counts, int runNumber);
131  static double percentLS(unsigned long long counts, int runNumber);
132  static double percentLSActive(unsigned long long counts, int runNumber);
133 
134  std::vector<unsigned int> gtAlgoCounts() const
135  { return(gtAlgoCounts_);}
136 
137  std::vector<unsigned int> gtTechCounts() const
138  { return(gtTechCounts_);}
139 
141  int operator==(const Level1TriggerScalers& e) const { return false; }
142 
144  int operator!=(const Level1TriggerScalers& e) const { return false; }
145 
146 protected:
147  int version_;
148 
149  unsigned int trigType_;
150  unsigned int eventID_;
151  unsigned int sourceID_;
152  unsigned int bunchNumber_;
153 
155  unsigned int lumiSegmentNr_;
156  unsigned int lumiSegmentOrbits_;
157  unsigned int orbitNr_;
158  unsigned int gtResets_;
159  unsigned int bunchCrossingErrors_;
160  unsigned long long gtTriggers_;
161  unsigned long long gtEvents_;
166 
168  unsigned int lumiSegmentNrLumiSeg_;
169  unsigned long long triggersPhysicsGeneratedFDL_;
170  unsigned long long triggersPhysicsLost_;
171  unsigned long long triggersPhysicsLostBeamActive_;
173  unsigned long long l1AsPhysics_;
174  unsigned long long l1AsRandom_;
175  unsigned long long l1AsTest_;
176  unsigned long long l1AsCalibration_;
177  unsigned long long deadtime_;
178  unsigned long long deadtimeBeamActive_;
180  unsigned long long deadtimeBeamActiveCalibration_;
183  unsigned long long deadtimeBeamActiveTimeSlot_;
184 
185  std::vector<unsigned int> gtAlgoCounts_;
186  std::vector<unsigned int> gtTechCounts_;
187 
188  // Orbit counter markers indicating when the last BGO
189  // command of a particular type was received, relative
190  // to the last OrbitCounter0 (OC0), for this L1 accept
191  unsigned int lastOrbitCounter0_;
192  unsigned int lastTestEnable_;
193  unsigned int lastResync_;
194  unsigned int lastStart_;
195  unsigned int lastEventCounter0_;
196  unsigned int lastHardReset_;
197 
198  // For future use
199  unsigned long long spare0_;
200  unsigned long long spare1_;
201  unsigned long long spare2_;
202 };
203 
204 
206 std::ostream& operator<<(std::ostream& s, const Level1TriggerScalers& c);
207 
208 typedef std::vector<Level1TriggerScalers> Level1TriggerScalersCollection;
209 
210 #endif
unsigned long long deadtimeBeamActivePartitionController_
unsigned long long spare1_
static double rateLS(unsigned long long counts)
unsigned long long deadtimeBeamActiveTriggerRules_
unsigned long long gtEvents() const
unsigned long long deadtimeBeamActive() const
unsigned long long deadtimeBeamActivePrivateOrbit() const
unsigned long long triggersPhysicsGeneratedFDL() const
unsigned int bunchNumber() const
unsigned int lastTestEnable() const
unsigned long long spare1() const
static const unsigned long long N_BX
unsigned long long l1AsRandom() const
unsigned long long triggersPhysicsLostBeamInactive_
unsigned long long deadtimeBeamActiveTimeSlot_
unsigned int lastResync() const
std::vector< unsigned int > gtTechCounts() const
int operator==(const Level1TriggerScalers &e) const
equality operator
unsigned int trigType() const
unsigned long long triggersPhysicsLost() const
unsigned long long triggersPhysicsLostBeamActive() const
unsigned int lastStart() const
unsigned long long gtTriggers_
unsigned int gtResets() const
static const unsigned long long N_BX_ACTIVE
timespec get_timespec() const
Definition: TimeSpec.cc:4
unsigned long long l1AsCalibration() const
std::vector< unsigned int > gtTechCounts_
std::vector< unsigned int > gtAlgoCounts_
unsigned long long spare0() const
unsigned long long deadtime_
int operator!=(const Level1TriggerScalers &e) const
inequality operator
bool empty() const
empty method (= false)
std::string name() const
name method
unsigned long long l1AsTest_
unsigned int bunchCrossingErrors() const
unsigned int orbitNr() const
unsigned int lastEventCounter0() const
std::vector< unsigned int > gtAlgoCounts() const
unsigned long long triggersPhysicsLost_
unsigned long long l1AsPhysics() const
unsigned long long spare2() const
unsigned int lumiSegmentOrbits() const
static double percentLSActive(unsigned long long counts)
unsigned long long l1AsCalibration_
static const unsigned long long N_ORBITS_LUMI_SECTION
unsigned long long deadtimeBeamActiveTriggerRules() const
unsigned long long deadtimeBeamActivePrivateOrbit_
unsigned int lastHardReset() const
unsigned int lumiSegmentNrLumiSeg_
unsigned long long l1AsTest() const
unsigned int lastOrbitCounter0() const
static const unsigned long long N_BX_LUMI_SECTION
unsigned int lumiSegmentNr() const
unsigned long long deadtimeBeamActive_
unsigned long long deadtime() const
unsigned long long gtTriggers() const
static double percentLS(unsigned long long counts)
unsigned int eventID() const
float gtTriggersRate() const
unsigned int sourceID() const
struct timespec collectionTimeLumiSeg() const
unsigned long long deadtimeBeamActiveTimeSlot() const
unsigned long long l1AsPhysics_
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
unsigned long long deadtimeBeamActiveCalibration() const
unsigned long long triggersPhysicsLostBeamActive_
unsigned long long triggersPhysicsLostBeamInactive() const
unsigned long long spare2_
std::ostream & operator<<(std::ostream &s, const Level1TriggerScalers &c)
Pretty-print operator for Level1TriggerScalers.
unsigned long long spare0_
unsigned long long deadtimeBeamActiveCalibration_
unsigned long long deadtimeBeamActivePartitionController() const
unsigned int lumiSegmentNrLumiSeg() const
unsigned long long triggersPhysicsGeneratedFDL_
struct timespec collectionTime() const
unsigned long long gtEvents_
unsigned long long l1AsRandom_