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 
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
Level1TriggerScalers::deadtime
unsigned long long deadtime() const
Definition: Level1TriggerScalers.h:84
Level1TriggerScalers::l1AsRandom_
unsigned long long l1AsRandom_
Definition: Level1TriggerScalers.h:150
Level1TriggerScalers::lastOrbitCounter0_
unsigned int lastOrbitCounter0_
Definition: Level1TriggerScalers.h:167
Level1TriggerScalers::prescaleIndexAlgo
int prescaleIndexAlgo() const
Definition: Level1TriggerScalers.h:67
Level1TriggerScalers::firstShortLSRun
Definition: Level1TriggerScalers.h:28
Level1TriggerScalers::deadtimeBeamActivePartitionController_
unsigned long long deadtimeBeamActivePartitionController_
Definition: Level1TriggerScalers.h:158
Level1TriggerScalers::bunchCrossingErrors
unsigned int bunchCrossingErrors() const
Definition: Level1TriggerScalers.h:62
Level1TriggerScalers::lastHardReset
unsigned int lastHardReset() const
Definition: Level1TriggerScalers.h:97
Level1TriggerScalers::rateLS
static double rateLS(unsigned long long counts)
Definition: Level1TriggerScalers.cc:143
Level1TriggerScalers::gtEvents
unsigned long long gtEvents() const
Definition: Level1TriggerScalers.h:64
Level1TriggerScalers::triggersPhysicsLostBeamActive_
unsigned long long triggersPhysicsLostBeamActive_
Definition: Level1TriggerScalers.h:147
Level1TriggerScalers::N_BX_ACTIVE
static const unsigned long long N_BX_ACTIVE
Definition: Level1TriggerScalers.h:31
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:162
Level1TriggerScalers::nLevel1Triggers
Definition: Level1TriggerScalers.h:28
Level1TriggerScalers::lumiSegmentOrbits_
unsigned int lumiSegmentOrbits_
Definition: Level1TriggerScalers.h:132
Level1TriggerScalers::triggersPhysicsGeneratedFDL
unsigned long long triggersPhysicsGeneratedFDL() const
Definition: Level1TriggerScalers.h:76
Level1TriggerScalers::bunchCrossingErrors_
unsigned int bunchCrossingErrors_
Definition: Level1TriggerScalers.h:135
Level1TriggerScalers::gtAlgoCounts
std::vector< unsigned int > gtAlgoCounts() const
Definition: Level1TriggerScalers.h:112
TimeSpec::get_timespec
timespec get_timespec() const
Definition: TimeSpec.cc:4
Level1TriggerScalers::lastResync_
unsigned int lastResync_
Definition: Level1TriggerScalers.h:169
watchdog.const
const
Definition: watchdog.py:83
Level1TriggerScalers::lastResync
unsigned int lastResync() const
Definition: Level1TriggerScalers.h:94
Level1TriggerScalers::lumiSegmentNr_
unsigned int lumiSegmentNr_
Definition: Level1TriggerScalers.h:131
Level1TriggerScalers::collectionTime_
TimeSpec collectionTime_
Definition: Level1TriggerScalers.h:130
Level1TriggerScalers::l1AsCalibration
unsigned long long l1AsCalibration() const
Definition: Level1TriggerScalers.h:83
Level1TriggerScalers::gtResets
unsigned int gtResets() const
Definition: Level1TriggerScalers.h:61
Level1TriggerScalers::triggersPhysicsLost
unsigned long long triggersPhysicsLost() const
Definition: Level1TriggerScalers.h:77
Level1TriggerScalers::version_
int version_
Definition: Level1TriggerScalers.h:123
Level1TriggerScalers::Level1TriggerScalers
Level1TriggerScalers()
Definition: Level1TriggerScalers.cc:12
convertSQLiteXML.runNumber
runNumber
Definition: convertSQLiteXML.py:91
Level1TriggerScalers::lumiSegmentNrLumiSeg_
unsigned int lumiSegmentNrLumiSeg_
Definition: Level1TriggerScalers.h:144
Level1TriggerScalers::~Level1TriggerScalers
virtual ~Level1TriggerScalers()
Definition: Level1TriggerScalers.cc:139
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Level1TriggerScalers::gtTriggers_
unsigned long long gtTriggers_
Definition: Level1TriggerScalers.h:136
Level1TriggerScalers::lastEventCounter0_
unsigned int lastEventCounter0_
Definition: Level1TriggerScalers.h:171
Level1TriggerScalers::gtTechCounts_
std::vector< unsigned int > gtTechCounts_
Definition: Level1TriggerScalers.h:162
Level1TriggerScalers::eventID_
unsigned int eventID_
Definition: Level1TriggerScalers.h:126
Level1TriggerScalers::sourceID
unsigned int sourceID() const
Definition: Level1TriggerScalers.h:50
Level1TriggerScalers::collectionTimeLumiSeg
struct timespec collectionTimeLumiSeg() const
Definition: Level1TriggerScalers.h:70
Level1TriggerScalers::trigType_
unsigned int trigType_
Definition: Level1TriggerScalers.h:125
Level1TriggerScalers::orbitNr
unsigned int orbitNr() const
Definition: Level1TriggerScalers.h:59
Level1TriggerScalers::lastOrbitCounter0
unsigned int lastOrbitCounter0() const
Definition: Level1TriggerScalers.h:92
Level1TriggerScalers::gtEvents_
unsigned long long gtEvents_
Definition: Level1TriggerScalers.h:137
Level1TriggerScalers::deadtimeBeamActiveTriggerRules_
unsigned long long deadtimeBeamActiveTriggerRules_
Definition: Level1TriggerScalers.h:155
Level1TriggerScalers::lastTestEnable
unsigned int lastTestEnable() const
Definition: Level1TriggerScalers.h:93
Level1TriggerScalers::deadtimeBeamActiveTimeSlot
unsigned long long deadtimeBeamActiveTimeSlot() const
Definition: Level1TriggerScalers.h:90
Level1TriggerScalers::operator==
int operator==(const Level1TriggerScalers &e) const
equality operator
Definition: Level1TriggerScalers.h:117
Level1TriggerScalers::bunchNumber
unsigned int bunchNumber() const
Definition: Level1TriggerScalers.h:51
Level1TriggerScalers::nLevel1TestTriggers
Definition: Level1TriggerScalers.h:28
Level1TriggerScalers::collectionTimeLumiSeg_
TimeSpec collectionTimeLumiSeg_
Definition: Level1TriggerScalers.h:143
Level1TriggerScalers::gtTriggersRate
float gtTriggersRate() const
Definition: Level1TriggerScalers.h:65
Level1TriggerScalers::spare1_
unsigned long long spare1_
Definition: Level1TriggerScalers.h:176
Level1TriggerScalers::gtResets_
unsigned int gtResets_
Definition: Level1TriggerScalers.h:134
Level1TriggerScalers::deadtimeBeamActiveTriggerRules
unsigned long long deadtimeBeamActiveTriggerRules() const
Definition: Level1TriggerScalers.h:86
Level1TriggerScalers::deadtime_
unsigned long long deadtime_
Definition: Level1TriggerScalers.h:153
Level1TriggerScalers::triggersPhysicsLostBeamActive
unsigned long long triggersPhysicsLostBeamActive() const
Definition: Level1TriggerScalers.h:78
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Level1TriggerScalers::sourceID_
unsigned int sourceID_
Definition: Level1TriggerScalers.h:127
Level1TriggerScalers::gtAlgoCounts_
std::vector< unsigned int > gtAlgoCounts_
Definition: Level1TriggerScalers.h:161
Level1TriggerScalers::l1AsTest
unsigned long long l1AsTest() const
Definition: Level1TriggerScalers.h:82
Level1TriggerScalers::triggersPhysicsLostBeamInactive_
unsigned long long triggersPhysicsLostBeamInactive_
Definition: Level1TriggerScalers.h:148
Level1TriggerScalers::collectionTime
struct timespec collectionTime() const
Definition: Level1TriggerScalers.h:53
Level1TriggerScalers::operator!=
int operator!=(const Level1TriggerScalers &e) const
inequality operator
Definition: Level1TriggerScalers.h:120
Level1TriggerScalers::deadtimeBeamActive
unsigned long long deadtimeBeamActive() const
Definition: Level1TriggerScalers.h:85
Level1TriggerScalers::gtTriggers
unsigned long long gtTriggers() const
Definition: Level1TriggerScalers.h:63
Level1TriggerScalers::deadtimeBeamActive_
unsigned long long deadtimeBeamActive_
Definition: Level1TriggerScalers.h:154
Level1TriggerScalers::lumiSegmentNrLumiSeg
unsigned int lumiSegmentNrLumiSeg() const
Definition: Level1TriggerScalers.h:74
Level1TriggerScalers::deadtimeBeamActivePartitionController
unsigned long long deadtimeBeamActivePartitionController() const
Definition: Level1TriggerScalers.h:89
Level1TriggerScalers::lastHardReset_
unsigned int lastHardReset_
Definition: Level1TriggerScalers.h:172
Level1TriggerScalers::N_BX
static const unsigned long long N_BX
Definition: Level1TriggerScalers.h:30
Level1TriggerScalers::percentLSActive
static double percentLSActive(unsigned long long counts)
Definition: Level1TriggerScalers.cc:175
Level1TriggerScalers::spare1
unsigned long long spare1() const
Definition: Level1TriggerScalers.h:99
Level1TriggerScalers::l1AsTest_
unsigned long long l1AsTest_
Definition: Level1TriggerScalers.h:151
Level1TriggerScalers::prescaleIndexTech
int prescaleIndexTech() const
Definition: Level1TriggerScalers.h:68
Level1TriggerScalers::lastStart
unsigned int lastStart() const
Definition: Level1TriggerScalers.h:95
Level1TriggerScalers::deadtimeBeamActivePrivateOrbit_
unsigned long long deadtimeBeamActivePrivateOrbit_
Definition: Level1TriggerScalers.h:157
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
Level1TriggerScalers::version
int version() const
Definition: Level1TriggerScalers.h:46
Level1TriggerScalers::l1AsCalibration_
unsigned long long l1AsCalibration_
Definition: Level1TriggerScalers.h:152
Level1TriggerScalers::gtEventsRate
float gtEventsRate() const
Definition: Level1TriggerScalers.h:66
Level1TriggerScalers::bunchNumber_
unsigned int bunchNumber_
Definition: Level1TriggerScalers.h:128
Level1TriggerScalers::N_BX_LUMI_SECTION
static const unsigned long long N_BX_LUMI_SECTION
Definition: Level1TriggerScalers.h:33
Level1TriggerScalers::l1AsPhysics
unsigned long long l1AsPhysics() const
Definition: Level1TriggerScalers.h:80
Level1TriggerScalers::triggersPhysicsLostBeamInactive
unsigned long long triggersPhysicsLostBeamInactive() const
Definition: Level1TriggerScalers.h:79
Level1TriggerScalers::percentLS
static double percentLS(unsigned long long counts)
Definition: Level1TriggerScalers.cc:160
Level1TriggerScalers::lastStart_
unsigned int lastStart_
Definition: Level1TriggerScalers.h:170
TimeSpec.h
Level1TriggerScalers::triggersPhysicsLost_
unsigned long long triggersPhysicsLost_
Definition: Level1TriggerScalers.h:146
Level1TriggerScalers::prescaleIndexTech_
int prescaleIndexTech_
Definition: Level1TriggerScalers.h:141
Level1TriggerScalers::trigType
unsigned int trigType() const
Definition: Level1TriggerScalers.h:48
Level1TriggerScalers
Definition: Level1TriggerScalers.h:26
operator<<
std::ostream & operator<<(std::ostream &s, const Level1TriggerScalers &c)
Pretty-print operator for Level1TriggerScalers.
Definition: Level1TriggerScalers.cc:193
Level1TriggerScalers::N_ORBITS_LUMI_SECTION
static const unsigned long long N_ORBITS_LUMI_SECTION
Definition: Level1TriggerScalers.h:32
Level1TriggerScalers::l1AsPhysics_
unsigned long long l1AsPhysics_
Definition: Level1TriggerScalers.h:149
Level1TriggerScalers::spare2_
unsigned long long spare2_
Definition: Level1TriggerScalers.h:177
Level1TriggerScalers::lastEventCounter0
unsigned int lastEventCounter0() const
Definition: Level1TriggerScalers.h:96
dqmiodumpmetadata.counts
counts
Definition: dqmiodumpmetadata.py:25
Level1TriggerScalers::spare0
unsigned long long spare0() const
Definition: Level1TriggerScalers.h:98
Level1TriggerScalers::l1AsRandom
unsigned long long l1AsRandom() const
Definition: Level1TriggerScalers.h:81
Level1TriggerScalers::orbitNr_
unsigned int orbitNr_
Definition: Level1TriggerScalers.h:133
TimeSpec
Definition: TimeSpec.h:7
Level1TriggerScalers::triggersPhysicsGeneratedFDL_
unsigned long long triggersPhysicsGeneratedFDL_
Definition: Level1TriggerScalers.h:145
Level1TriggerScalers::lumiSegmentOrbits
unsigned int lumiSegmentOrbits() const
Definition: Level1TriggerScalers.h:58
Level1TriggerScalers::name
std::string name() const
name method
Definition: Level1TriggerScalers.h:40
Level1TriggerScalers::gtEventsRate_
float gtEventsRate_
Definition: Level1TriggerScalers.h:139
Level1TriggerScalers::prescaleIndexAlgo_
int prescaleIndexAlgo_
Definition: Level1TriggerScalers.h:140
Level1TriggerScalersCollection
std::vector< Level1TriggerScalers > Level1TriggerScalersCollection
Definition: Level1TriggerScalers.h:183
Level1TriggerScalers::gtTriggersRate_
float gtTriggersRate_
Definition: Level1TriggerScalers.h:138
Level1TriggerScalers::deadtimeBeamActiveCalibration
unsigned long long deadtimeBeamActiveCalibration() const
Definition: Level1TriggerScalers.h:87
Level1TriggerScalers::deadtimeBeamActivePrivateOrbit
unsigned long long deadtimeBeamActivePrivateOrbit() const
Definition: Level1TriggerScalers.h:88
Level1TriggerScalers::lastTestEnable_
unsigned int lastTestEnable_
Definition: Level1TriggerScalers.h:168
Level1TriggerScalers::gtTechCounts
std::vector< unsigned int > gtTechCounts() const
Definition: Level1TriggerScalers.h:114
Level1TriggerScalers::deadtimeBeamActiveCalibration_
unsigned long long deadtimeBeamActiveCalibration_
Definition: Level1TriggerScalers.h:156
Level1TriggerScalers::empty
bool empty() const
empty method (= false)
Definition: Level1TriggerScalers.h:43
Level1TriggerScalers::lumiSegmentNr
unsigned int lumiSegmentNr() const
Definition: Level1TriggerScalers.h:57
Level1TriggerScalers::eventID
unsigned int eventID() const
Definition: Level1TriggerScalers.h:49
Level1TriggerScalers::spare0_
unsigned long long spare0_
Definition: Level1TriggerScalers.h:175
Level1TriggerScalers::deadtimeBeamActiveTimeSlot_
unsigned long long deadtimeBeamActiveTimeSlot_
Definition: Level1TriggerScalers.h:159
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
Level1TriggerScalers::spare2
unsigned long long spare2() const
Definition: Level1TriggerScalers.h:100