CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
23 
27 public:
28  enum { nLevel1Triggers = 128, nLevel1TestTriggers = 64, firstShortLSRun = 125574 };
29 
30  static const unsigned long long N_BX = 3564ULL;
31  static const unsigned long long N_BX_ACTIVE = 2808ULL;
32  static const unsigned long long N_ORBITS_LUMI_SECTION = 0x100000ULL;
33  static const unsigned long long N_BX_LUMI_SECTION = N_ORBITS_LUMI_SECTION * N_BX;
34 
36  Level1TriggerScalers(const unsigned char* rawData);
37  virtual ~Level1TriggerScalers();
38 
40  std::string name() const { return "Level1TriggerScalers"; }
41 
43  bool empty() const { return false; }
44 
45  // Data accessor methods
46  int version() const { return (version_); }
47 
48  unsigned int trigType() const { return (trigType_); }
49  unsigned int eventID() const { return (eventID_); }
50  unsigned int sourceID() const { return (sourceID_); }
51  unsigned int bunchNumber() const { return (bunchNumber_); }
52 
53  struct timespec collectionTime() const {
54  return (collectionTime_.get_timespec());
55  }
56 
57  unsigned int lumiSegmentNr() const { return (lumiSegmentNr_); }
58  unsigned int lumiSegmentOrbits() const { return (lumiSegmentOrbits_); }
59  unsigned int orbitNr() const { return (orbitNr_); }
60 
61  unsigned int gtResets() const { return (gtResets_); }
62  unsigned int bunchCrossingErrors() const { return (bunchCrossingErrors_); }
63  unsigned long long gtTriggers() const { return (gtTriggers_); }
64  unsigned long long gtEvents() const { return (gtEvents_); }
65  float gtTriggersRate() const { return (gtTriggersRate_); }
66  float gtEventsRate() const { return (gtEventsRate_); }
67  int prescaleIndexAlgo() const { return (prescaleIndexAlgo_); }
68  int prescaleIndexTech() const { return (prescaleIndexTech_); }
69 
70  struct timespec collectionTimeLumiSeg() const {
72  }
73 
74  unsigned int lumiSegmentNrLumiSeg() const { return (lumiSegmentNrLumiSeg_); }
75 
76  unsigned long long triggersPhysicsGeneratedFDL() const { return (triggersPhysicsGeneratedFDL_); }
77  unsigned long long triggersPhysicsLost() const { return (triggersPhysicsLost_); }
78  unsigned long long triggersPhysicsLostBeamActive() const { return (triggersPhysicsLostBeamActive_); }
79  unsigned long long triggersPhysicsLostBeamInactive() const { return (triggersPhysicsLostBeamInactive_); }
80  unsigned long long l1AsPhysics() const { return (l1AsPhysics_); }
81  unsigned long long l1AsRandom() const { return (l1AsRandom_); }
82  unsigned long long l1AsTest() const { return (l1AsTest_); }
83  unsigned long long l1AsCalibration() const { return (l1AsCalibration_); }
84  unsigned long long deadtime() const { return (deadtime_); }
85  unsigned long long deadtimeBeamActive() const { return (deadtimeBeamActive_); }
86  unsigned long long deadtimeBeamActiveTriggerRules() const { return (deadtimeBeamActiveTriggerRules_); }
87  unsigned long long deadtimeBeamActiveCalibration() const { return (deadtimeBeamActiveCalibration_); }
88  unsigned long long deadtimeBeamActivePrivateOrbit() const { return (deadtimeBeamActivePrivateOrbit_); }
90  unsigned long long deadtimeBeamActiveTimeSlot() const { return (deadtimeBeamActiveTimeSlot_); }
91 
92  unsigned int lastOrbitCounter0() const { return (lastOrbitCounter0_); }
93  unsigned int lastTestEnable() const { return (lastTestEnable_); }
94  unsigned int lastResync() const { return (lastResync_); }
95  unsigned int lastStart() const { return (lastStart_); }
96  unsigned int lastEventCounter0() const { return (lastEventCounter0_); }
97  unsigned int lastHardReset() const { return (lastHardReset_); }
98  unsigned long long spare0() const { return (spare0_); }
99  unsigned long long spare1() const { return (spare1_); }
100  unsigned long long spare2() const { return (spare2_); }
101 
102  static double rateLS(unsigned long long counts);
103  static double rateLS(unsigned int counts);
104  static double percentLS(unsigned long long counts);
105  static double percentLSActive(unsigned long long counts);
106 
107  static double rateLS(unsigned long long counts, int runNumber);
108  static double rateLS(unsigned int counts, int runNumber);
109  static double percentLS(unsigned long long counts, int runNumber);
110  static double percentLSActive(unsigned long long counts, int runNumber);
111 
112  std::vector<unsigned int> gtAlgoCounts() const { return (gtAlgoCounts_); }
113 
114  std::vector<unsigned int> gtTechCounts() const { return (gtTechCounts_); }
115 
117  int operator==(const Level1TriggerScalers& e) const { return false; }
118 
120  int operator!=(const Level1TriggerScalers& e) const { return false; }
121 
122 protected:
123  int version_;
124 
125  unsigned int trigType_;
126  unsigned int eventID_;
127  unsigned int sourceID_;
128  unsigned int bunchNumber_;
129 
131  unsigned int lumiSegmentNr_;
132  unsigned int lumiSegmentOrbits_;
133  unsigned int orbitNr_;
134  unsigned int gtResets_;
135  unsigned int bunchCrossingErrors_;
136  unsigned long long gtTriggers_;
137  unsigned long long gtEvents_;
142 
144  unsigned int lumiSegmentNrLumiSeg_;
145  unsigned long long triggersPhysicsGeneratedFDL_;
146  unsigned long long triggersPhysicsLost_;
147  unsigned long long triggersPhysicsLostBeamActive_;
149  unsigned long long l1AsPhysics_;
150  unsigned long long l1AsRandom_;
151  unsigned long long l1AsTest_;
152  unsigned long long l1AsCalibration_;
153  unsigned long long deadtime_;
154  unsigned long long deadtimeBeamActive_;
156  unsigned long long deadtimeBeamActiveCalibration_;
159  unsigned long long deadtimeBeamActiveTimeSlot_;
160 
161  std::vector<unsigned int> gtAlgoCounts_;
162  std::vector<unsigned int> gtTechCounts_;
163 
164  // Orbit counter markers indicating when the last BGO
165  // command of a particular type was received, relative
166  // to the last OrbitCounter0 (OC0), for this L1 accept
167  unsigned int lastOrbitCounter0_;
168  unsigned int lastTestEnable_;
169  unsigned int lastResync_;
170  unsigned int lastStart_;
171  unsigned int lastEventCounter0_;
172  unsigned int lastHardReset_;
173 
174  // For future use
175  unsigned long long spare0_;
176  unsigned long long spare1_;
177  unsigned long long spare2_;
178 };
179 
181 std::ostream& operator<<(std::ostream& s, const Level1TriggerScalers& c);
182 
183 typedef std::vector<Level1TriggerScalers> Level1TriggerScalersCollection;
184 
185 #endif
unsigned long long deadtimeBeamActivePartitionController_
unsigned long long spare1_
static double rateLS(unsigned long long counts)
const edm::EventSetup & c
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
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
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_
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_