CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Typedefs | Functions
L1TriggerScalers.h File Reference
#include "DataFormats/Scalers/interface/TimeSpec.h"
#include <ctime>
#include <iosfwd>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  L1TriggerScalers
 

Typedefs

typedef std::vector
< L1TriggerScalers
L1TriggerScalersCollection
 

Functions

std::ostream & operator<< (std::ostream &s, const L1TriggerScalers &c)
 Pretty-print operator for L1TriggerScalers. More...
 

Detailed Description

file for Level 1 Global Trigger Scalers

Author
: William Badgett

Definition in file L1TriggerScalers.h.

Typedef Documentation

Definition at line 132 of file L1TriggerScalers.h.

Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const L1TriggerScalers c 
)

Pretty-print operator for L1TriggerScalers.

Definition at line 99 of file L1TriggerScalers.cc.

References L1TriggerScalers::bunchCrossingErrors(), L1TriggerScalers::bunchNumber(), L1TriggerScalers::calibrationTriggers(), L1TriggerScalers::collectionTimeDetails(), L1TriggerScalers::collectionTimeSpecial(), L1TriggerScalers::collectionTimeSummary(), L1TriggerScalers::deadTime(), L1TriggerScalers::deadTimeActive(), L1TriggerScalers::deadTimeActiveCalibration(), L1TriggerScalers::deadTimeActivePartition(), L1TriggerScalers::deadTimeActivePrivate(), L1TriggerScalers::deadTimeActiveThrottle(), L1TriggerScalers::eventID(), L1TriggerScalers::eventNumber(), L1TriggerScalers::finalTriggersDistributed(), L1TriggerScalers::finalTriggersGenerated(), L1TriggerScalers::finalTriggersInvalidBC(), mps_fire::i, geometryCSVtoXML::line, L1TriggerScalers::lostFinalTriggers(), L1TriggerScalers::lostFinalTriggersActive(), L1TriggerScalers::luminositySection(), L1TriggerScalers::numberResets(), L1TriggerScalers::randomTriggers(), alignCSCRings::s, L1TriggerScalers::sourceID(), L1TriggerScalers::testTriggers(), L1TriggerScalers::totalTestTriggers(), L1TriggerScalers::triggerNumber(), L1TriggerScalers::triggers(), L1TriggerScalers::trigType(), and L1TriggerScalers::version().

99  {
100  s << "L1TriggerScalers Version:" << c.version() << " SourceID: " << c.sourceID() << std::endl;
101  constexpr size_t kLineBufferSize = 164;
102  char line[kLineBufferSize];
103  char zeitHeaven[128];
104  char zeitHell[128];
105  char zeitLimbo[128];
106  struct tm* horaHeaven;
107  struct tm* horaHell;
108  struct tm* horaLimbo;
109 
110  sprintf(line, " TrigType: %d EventID: %d BunchNumber: %d", c.trigType(), c.eventID(), c.bunchNumber());
111  s << line << std::endl;
112 
113  timespec secondsToHeaven = c.collectionTimeSummary();
114  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
115  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
116  snprintf(line, kLineBufferSize, " CollectionTimeSummary: %s.%9.9d", zeitHeaven, (int)secondsToHeaven.tv_nsec);
117  s << line << std::endl;
118 
119  timespec secondsToHell = c.collectionTimeSpecial();
120  horaHell = gmtime(&secondsToHell.tv_sec);
121  strftime(zeitHell, sizeof(zeitHell), "%Y.%m.%d %H:%M:%S", horaHell);
122  snprintf(line, kLineBufferSize, " CollectionTimeSpecial: %s.%9.9d", zeitHell, (int)secondsToHell.tv_nsec);
123  s << line << std::endl;
124 
125  timespec secondsToLimbo = c.collectionTimeDetails();
126  horaLimbo = gmtime(&secondsToLimbo.tv_sec);
127  strftime(zeitLimbo, sizeof(zeitLimbo), "%Y.%m.%d %H:%M:%S", horaLimbo);
128  snprintf(line, kLineBufferSize, " CollectionTimeDetails: %s.%9.9d", zeitLimbo, (int)secondsToLimbo.tv_nsec);
129  s << line << std::endl;
130 
131  snprintf(line,
132  kLineBufferSize,
133  " LuminositySection: %15d BunchCrossingErrors: %15d",
134  c.luminositySection(),
135  c.bunchCrossingErrors());
136  s << line << std::endl;
137 
138  snprintf(line,
139  kLineBufferSize,
140  " TriggerNumber: %15d EventNumber: %15d",
141  c.triggerNumber(),
142  c.eventNumber());
143  s << line << std::endl;
144 
145  snprintf(line,
146  kLineBufferSize,
147  " TriggersDistributed: %10d TriggersGenerated: %15d",
150  s << line << std::endl;
151 
152  snprintf(line,
153  kLineBufferSize,
154  " TriggersInvalidBC: %15d CalibrationTriggers: %15d",
156  c.calibrationTriggers());
157  s << line << std::endl;
158 
159  snprintf(line,
160  kLineBufferSize,
161  " TestTriggers: %15d RandomTriggers: %15d",
162  c.totalTestTriggers(),
163  c.randomTriggers());
164  s << line << std::endl;
165 
166  snprintf(line,
167  kLineBufferSize,
168  " DeadTime: %15d DeadTimeActiveTimeSlot: %15ld",
169  c.numberResets(),
170  (long int)c.deadTime());
171  s << line << std::endl;
172 
173  snprintf(line,
174  kLineBufferSize,
175  " DeadTimeActive: %15ld DeadTimeActiveCalibration:%15ld",
176  (long int)c.deadTimeActive(),
177  (long int)c.deadTimeActiveCalibration());
178  s << line << std::endl;
179 
180  snprintf(line,
181  kLineBufferSize,
182  " LostTriggers: %15ld DeadTimeActivePartition: %15ld",
183  (long int)c.lostFinalTriggers(),
184  (long int)c.deadTimeActivePartition());
185  s << line << std::endl;
186 
187  snprintf(line,
188  kLineBufferSize,
189  " LostTriggersActive:%15ld DeadTimeActiveThrottle: %15ld",
190  (long int)c.lostFinalTriggersActive(),
191  (long int)c.deadTimeActiveThrottle());
192  s << line << std::endl;
193 
194  snprintf(line,
195  kLineBufferSize,
196  " NumberResets: %15d DeadTimeActivePrivate: %15ld",
197  c.numberResets(),
198  (long int)c.deadTimeActivePrivate());
199  s << line << std::endl;
200 
201  s << "Physics Triggers" << std::endl;
202  std::vector<unsigned int> triggers = c.triggers();
203  int length = triggers.size() / 4;
204  for (int i = 0; i < length; i++) {
205  snprintf(line,
206  kLineBufferSize,
207  " %3.3d: %10d %3.3d: %10d %3.3d: %10d %3.3d: %10d",
208  i,
209  triggers[i],
210  (i + length),
211  triggers[i + length],
212  (i + (length * 2)),
213  triggers[i + (length * 2)],
214  (i + (length * 3)),
215  triggers[i + (length * 3)]);
216  s << line << std::endl;
217  }
218 
219  s << "Test Triggers" << std::endl;
220  std::vector<unsigned int> testTriggers = c.testTriggers();
221  length = testTriggers.size() / 4;
222  for (int i = 0; i < length; i++) {
223  snprintf(line,
224  kLineBufferSize,
225  " %3.3d: %10d %3.3d: %10d %3.3d: %10d %3.3d: %10d",
226  i,
227  testTriggers[i],
228  (i + length),
229  testTriggers[i + length],
230  (i + (length * 2)),
231  testTriggers[i + (length * 2)],
232  (i + (length * 3)),
233  testTriggers[i + (length * 3)]);
234  s << line << std::endl;
235  }
236  return s;
237 }
unsigned long long deadTimeActivePartition() const
unsigned long long lostFinalTriggers() const
unsigned int eventNumber() const
timespec collectionTimeSpecial() const
timespec collectionTimeSummary() const
unsigned int numberResets() const
unsigned int eventID() const
unsigned int totalTestTriggers() const
unsigned int triggerNumber() const
unsigned long long deadTimeActiveThrottle() const
unsigned int randomTriggers() const
unsigned long long deadTimeActive() const
unsigned long long lostFinalTriggersActive() const
std::vector< unsigned int > testTriggers() const
unsigned long long deadTimeActiveCalibration() const
timespec collectionTimeDetails() const
unsigned long long deadTime() const
unsigned int sourceID() const
unsigned int finalTriggersDistributed() const
unsigned int finalTriggersGenerated() const
unsigned int bunchNumber() const
unsigned int luminositySection() const
unsigned int trigType() const
unsigned int bunchCrossingErrors() const
std::vector< unsigned int > triggers() const
unsigned int calibrationTriggers() const
int version() const
unsigned int finalTriggersInvalidBC() const
unsigned long long deadTimeActivePrivate() const