CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_6/src/DataFormats/Scalers/src/L1TriggerScalers.cc File Reference

#include "DataFormats/Scalers/interface/L1TriggerScalers.h"
#include "DataFormats/Scalers/interface/ScalersRaw.h"
#include <iostream>
#include <cstdio>

Go to the source code of this file.

Functions

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

Function Documentation

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

Pretty-print operator for L1TriggerScalers.

Definition at line 109 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(), 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(), triggers, L1TriggerScalers::trigType(), and L1TriggerScalers::version().

{
  s << "L1TriggerScalers    Version:" << c.version() <<
    "   SourceID: " << c.sourceID() << std::endl;
  char line[128];
  char zeitHeaven[128];
  char zeitHell[128];
  char zeitLimbo[128];
  struct tm * horaHeaven;
  struct tm * horaHell;
  struct tm * horaLimbo;

  sprintf(line, " TrigType: %d   EventID: %d    BunchNumber: %d", 
          c.trigType(), c.eventID(), c.bunchNumber());
  s << line << std::endl;

  timespec secondsToHeaven = c.collectionTimeSummary();
  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
  sprintf(line, " CollectionTimeSummary: %s.%9.9d" , 
          zeitHeaven, (int)secondsToHeaven.tv_nsec);
  s << line << std::endl;

  timespec secondsToHell= c.collectionTimeSpecial();
  horaHell = gmtime(&secondsToHell.tv_sec);
  strftime(zeitHell, sizeof(zeitHell), "%Y.%m.%d %H:%M:%S", horaHell);
  sprintf(line, " CollectionTimeSpecial: %s.%9.9d" , 
          zeitHell, (int)secondsToHell.tv_nsec);
  s << line << std::endl;

  timespec secondsToLimbo= c.collectionTimeDetails();
  horaLimbo = gmtime(&secondsToLimbo.tv_sec);
  strftime(zeitLimbo, sizeof(zeitLimbo), "%Y.%m.%d %H:%M:%S", horaLimbo);
  sprintf(line, " CollectionTimeDetails: %s.%9.9d" , 
          zeitLimbo, (int)secondsToLimbo.tv_nsec);
  s << line << std::endl;

  sprintf(line,
          " LuminositySection: %15d  BunchCrossingErrors:      %15d",
          c.luminositySection(), c.bunchCrossingErrors());
  s << line << std::endl;

  sprintf(line,
          " TriggerNumber:     %15d  EventNumber:              %15d",
          c.triggerNumber(), c.eventNumber());
  s << line << std::endl;

  sprintf(line,
          " TriggersDistributed:    %10d  TriggersGenerated:        %15d",
          c.finalTriggersDistributed(), 
          c.finalTriggersGenerated());
  s << line << std::endl;

  sprintf(line,
          " TriggersInvalidBC: %15d  CalibrationTriggers:      %15d",
          c.finalTriggersInvalidBC(), c.calibrationTriggers());
  s << line << std::endl;

  sprintf(line,
          " TestTriggers:      %15d  RandomTriggers:           %15d",
          c.totalTestTriggers(), c.randomTriggers());
  s << line << std::endl;

  sprintf(line,
          " DeadTime:          %15d  DeadTimeActiveTimeSlot:   %15ld",
          c.numberResets(), (long int)c.deadTime());
  s << line << std::endl;

  sprintf(line,
          " DeadTimeActive:    %15ld  DeadTimeActiveCalibration:%15ld",
          (long int)c.deadTimeActive(), 
          (long int)c.deadTimeActiveCalibration());
  s << line << std::endl;

  sprintf(line,
          " LostTriggers:      %15ld  DeadTimeActivePartition:  %15ld",
          (long int)c.lostFinalTriggers(), 
          (long int)c.deadTimeActivePartition());
  s << line << std::endl;

  sprintf(line,
          " LostTriggersActive:%15ld  DeadTimeActiveThrottle:   %15ld",
          (long int)c.lostFinalTriggersActive(),
          (long int)c.deadTimeActiveThrottle());
  s << line << std::endl;

  sprintf(line,
          " NumberResets:      %15d  DeadTimeActivePrivate:    %15ld",
          c.numberResets(),
          (long int)c.deadTimeActivePrivate());
  s << line << std::endl;

  s << "Physics Triggers" << std::endl;
  std::vector<unsigned int> triggers = c.triggers();
  int length = triggers.size() / 4;
  for ( int i=0; i<length; i++)
  {
    sprintf(line," %3.3d: %10d    %3.3d: %10d    %3.3d: %10d    %3.3d: %10d",
            i,              triggers[i], 
            (i+length),     triggers[i+length], 
            (i+(length*2)), triggers[i+(length*2)], 
            (i+(length*3)), triggers[i+(length*3)]);
    s << line << std::endl;
  }

  s << "Test Triggers" << std::endl;
  std::vector<unsigned int> testTriggers = c.testTriggers();
  length = testTriggers.size() / 4;
  for ( int i=0; i<length; i++)
  {
    sprintf(line," %3.3d: %10d    %3.3d: %10d    %3.3d: %10d    %3.3d: %10d",
            i,              testTriggers[i], 
            (i+length),     testTriggers[i+length], 
            (i+(length*2)), testTriggers[i+(length*2)], 
            (i+(length*3)), testTriggers[i+(length*3)]);
    s << line << std::endl;
  }
  return s;
}