CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
Level1TriggerScalers.cc File Reference
#include "DataFormats/Scalers/interface/Level1TriggerScalers.h"
#include "DataFormats/Scalers/interface/ScalersRaw.h"
#include <iostream>
#include <time.h>
#include <cstdio>

Go to the source code of this file.

Functions

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

Function Documentation

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

Pretty-print operator for Level1TriggerScalers.

Definition at line 220 of file Level1TriggerScalers.cc.

References Level1TriggerScalers::bunchCrossingErrors(), Level1TriggerScalers::bunchNumber(), Level1TriggerScalers::collectionTime(), Level1TriggerScalers::collectionTimeLumiSeg(), Level1TriggerScalers::deadtime(), Level1TriggerScalers::deadtimeBeamActive(), Level1TriggerScalers::deadtimeBeamActiveCalibration(), Level1TriggerScalers::deadtimeBeamActivePartitionController(), Level1TriggerScalers::deadtimeBeamActivePrivateOrbit(), Level1TriggerScalers::deadtimeBeamActiveTimeSlot(), Level1TriggerScalers::deadtimeBeamActiveTriggerRules(), Level1TriggerScalers::eventID(), Level1TriggerScalers::gtAlgoCounts(), Level1TriggerScalers::gtEvents(), Level1TriggerScalers::gtEventsRate(), Level1TriggerScalers::gtResets(), Level1TriggerScalers::gtTechCounts(), Level1TriggerScalers::gtTriggers(), Level1TriggerScalers::gtTriggersRate(), i, Level1TriggerScalers::l1AsCalibration(), Level1TriggerScalers::l1AsPhysics(), Level1TriggerScalers::l1AsRandom(), Level1TriggerScalers::l1AsTest(), Level1TriggerScalers::lastEventCounter0(), Level1TriggerScalers::lastHardReset(), Level1TriggerScalers::lastOrbitCounter0(), Level1TriggerScalers::lastResync(), Level1TriggerScalers::lastStart(), Level1TriggerScalers::lastTestEnable(), geometryCSVtoXML::line, Level1TriggerScalers::lumiSegmentNr(), Level1TriggerScalers::lumiSegmentNrLumiSeg(), Level1TriggerScalers::lumiSegmentOrbits(), Level1TriggerScalers::orbitNr(), Level1TriggerScalers::percentLS(), Level1TriggerScalers::percentLSActive(), Level1TriggerScalers::prescaleIndexAlgo(), Level1TriggerScalers::prescaleIndexTech(), Level1TriggerScalers::rateLS(), alignCSCRings::s, Level1TriggerScalers::sourceID(), Level1TriggerScalers::triggersPhysicsGeneratedFDL(), Level1TriggerScalers::triggersPhysicsLost(), Level1TriggerScalers::triggersPhysicsLostBeamActive(), Level1TriggerScalers::triggersPhysicsLostBeamInactive(), Level1TriggerScalers::trigType(), and Level1TriggerScalers::version().

221 {
222  s << "Level1TriggerScalers Version:" << c.version() <<
223  " SourceID: " << c.sourceID() << std::endl;
224  char line[128];
225  char zeitHeaven[128];
226  struct tm * horaHeaven;
227 
228  sprintf(line, " TrigType: %d EventID: %d BunchNumber: %d",
229  c.trigType(), c.eventID(), c.bunchNumber());
230  s << line << std::endl;
231 
232  struct timespec secondsToHeaven = c.collectionTime();
233  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
234  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
235  sprintf(line, " CollectionTime: %s.%9.9d" ,
236  zeitHeaven, (int)secondsToHeaven.tv_nsec);
237  s << line << std::endl;
238 
239  sprintf(line,
240  " LumiSegmentNr: %10u LumiSegmentOrbits: %10u",
241  c.lumiSegmentNr(), c.lumiSegmentOrbits());
242  s << line << std::endl;
243 
244  sprintf(line,
245  " LumiSegmentNrLumiSeg: %10u OrbitNr: %10u ",
246  c.lumiSegmentNrLumiSeg(), c.orbitNr());
247  s << line << std::endl;
248 
249  sprintf(line,
250  " GtResets: %10u BunchCrossingErrors: %10u",
251  c.gtResets(), c.bunchCrossingErrors());
252  s << line << std::endl;
253 
254  sprintf(line,
255  " PrescaleIndexAlgo: %10d PrescaleIndexTech: %10d",
256  c.prescaleIndexAlgo(), c.prescaleIndexTech());
257  s << line << std::endl;
258 
259  sprintf(line, " GtTriggers: %20llu %22.3f Hz",
260  c.gtTriggers(), c.gtTriggersRate());
261  s << line << std::endl;
262 
263  sprintf(line, " GtEvents: %20llu %22.3f Hz",
264  c.gtEvents(), c.gtEventsRate());
265  s << line << std::endl;
266 
267  secondsToHeaven = c.collectionTimeLumiSeg();
268  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
269  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
270  sprintf(line, " CollectionTimeLumiSeg: %s.%9.9d" ,
271  zeitHeaven, (int)secondsToHeaven.tv_nsec);
272  s << line << std::endl;
273 
274 
275  sprintf(line, " TriggersPhysicsGeneratedFDL: %20llu %22.3f Hz",
276  c.triggersPhysicsGeneratedFDL(),
277  Level1TriggerScalers::rateLS(c.triggersPhysicsGeneratedFDL()));
278  s << line << std::endl;
279 
280  sprintf(line, " TriggersPhysicsLost: %20llu %22.3f Hz",
281  c.triggersPhysicsLost(),
282  Level1TriggerScalers::rateLS(c.triggersPhysicsLost()));
283  s << line << std::endl;
284 
285  sprintf(line, " TriggersPhysicsLostBeamActive: %20llu %22.3f Hz",
286  c.triggersPhysicsLostBeamActive(),
287  Level1TriggerScalers::rateLS(c.triggersPhysicsLostBeamActive()));
288  s << line << std::endl;
289 
290  sprintf(line, " TriggersPhysicsLostBeamInactive: %20llu %22.3f Hz",
291  c.triggersPhysicsLostBeamInactive(),
292  Level1TriggerScalers::rateLS(c.triggersPhysicsLostBeamInactive()));
293  s << line << std::endl;
294 
295  sprintf(line, " L1AsPhysics: %20llu %22.3f Hz",
296  c.l1AsPhysics(),
297  Level1TriggerScalers::rateLS(c.l1AsPhysics()));
298  s << line << std::endl;
299 
300  sprintf(line, " L1AsRandom: %20llu %22.3f Hz",
301  c.l1AsRandom(),
302  Level1TriggerScalers::rateLS(c.l1AsRandom()));
303  s << line << std::endl;
304 
305  sprintf(line, " L1AsTest: %20llu %22.3f Hz",
306  c.l1AsTest(),
307  Level1TriggerScalers::rateLS(c.l1AsTest()));
308  s << line << std::endl;
309 
310  sprintf(line, " L1AsCalibration: %20llu %22.3f Hz",
311  c.l1AsCalibration(),
312  Level1TriggerScalers::rateLS(c.l1AsCalibration()));
313  s << line << std::endl;
314 
315  sprintf(line, " Deadtime: %20llu %17.3f%%",
316  c.deadtime(),
317  Level1TriggerScalers::percentLS(c.deadtime()));
318  s << line << std::endl;
319 
320  sprintf(line, " DeadtimeBeamActive: %20llu %17.3f%%",
321  c.deadtimeBeamActive(),
322  Level1TriggerScalers::percentLSActive(c.deadtimeBeamActive()));
323  s << line << std::endl;
324 
325  sprintf(line, " DeadtimeBeamActiveTriggerRules: %20llu %17.3f%%",
326  c.deadtimeBeamActiveTriggerRules(),
327  Level1TriggerScalers::percentLSActive(c.deadtimeBeamActiveTriggerRules()));
328  s << line << std::endl;
329 
330  sprintf(line, " DeadtimeBeamActiveCalibration: %20llu %17.3f%%",
331  c.deadtimeBeamActiveCalibration(),
332  Level1TriggerScalers::percentLSActive(c.deadtimeBeamActiveCalibration()));
333  s << line << std::endl;
334 
335  sprintf(line, " DeadtimeBeamActivePrivateOrbit: %20llu %17.3f%%",
336  c.deadtimeBeamActivePrivateOrbit(),
337  Level1TriggerScalers::percentLSActive(c.deadtimeBeamActivePrivateOrbit()));
338  s << line << std::endl;
339 
340  sprintf(line, " DeadtimeBeamActivePartitionController:%20llu %17.3f%%",
341  c.deadtimeBeamActivePartitionController(),
342  Level1TriggerScalers::percentLSActive(c.deadtimeBeamActivePartitionController()));
343  s << line << std::endl;
344 
345  sprintf(line, " DeadtimeBeamActiveTimeSlot: %20llu %17.3f%%",
346  c.deadtimeBeamActiveTimeSlot(),
347  Level1TriggerScalers::percentLSActive(c.deadtimeBeamActiveTimeSlot()));
348  s << line << std::endl;
349 
350  s << "Physics GtAlgoCounts" << std::endl;
351  const std::vector<unsigned int> gtAlgoCounts = c.gtAlgoCounts();
352  int length = gtAlgoCounts.size() / 4;
353  for ( int i=0; i<length; i++)
354  {
355  sprintf(line," %3.3d: %10u %3.3d: %10u %3.3d: %10u %3.3d: %10u",
356  i, gtAlgoCounts[i],
357  (i+length), gtAlgoCounts[i+length],
358  (i+(length*2)), gtAlgoCounts[i+(length*2)],
359  (i+(length*3)), gtAlgoCounts[i+(length*3)]);
360  s << line << std::endl;
361  }
362 
363  s << "Test GtTechCounts" << std::endl;
364  const std::vector<unsigned int> gtTechCounts = c.gtTechCounts();
365  length = gtTechCounts.size() / 4;
366  for ( int i=0; i<length; i++)
367  {
368  sprintf(line," %3.3d: %10u %3.3d: %10u %3.3d: %10u %3.3d: %10u",
369  i, gtTechCounts[i],
370  (i+length), gtTechCounts[i+length],
371  (i+(length*2)), gtTechCounts[i+(length*2)],
372  (i+(length*3)), gtTechCounts[i+(length*3)]);
373  s << line << std::endl;
374  }
375 
376  if ( c.version() >= 5 )
377  {
378  sprintf(line," LastOrbitCounter0: %10u 0x%8.8X", c.lastOrbitCounter0(),
379  c.lastOrbitCounter0());
380  s << line << std::endl;
381 
382  sprintf(line," LastTestEnable: %10u 0x%8.8X", c.lastTestEnable(),
383  c.lastTestEnable());
384  s << line << std::endl;
385 
386  sprintf(line," LastResync: %10u 0x%8.8X", c.lastResync(),
387  c.lastResync());
388  s << line << std::endl;
389 
390  sprintf(line," LastStart: %10u 0x%8.8X", c.lastStart(),
391  c.lastStart());
392  s << line << std::endl;
393 
394  sprintf(line," LastEventCounter0: %10u 0x%8.8X", c.lastEventCounter0(),
395  c.lastEventCounter0());
396  s << line << std::endl;
397 
398  sprintf(line," LastHardReset: %10u 0x%8.8X", c.lastHardReset(),
399  c.lastHardReset());
400  s << line << std::endl;
401  }
402 
403  return s;
404 }
int i
Definition: DBlmapReader.cc:9
static double rateLS(unsigned long long counts)
static double percentLSActive(unsigned long long counts)
static double percentLS(unsigned long long counts)