CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_3_0/src/DataFormats/Scalers/src/Level1TriggerRates.cc File Reference

#include "DataFormats/Scalers/interface/Level1TriggerRates.h"
#include "DataFormats/Scalers/interface/Level1TriggerScalers.h"
#include <iostream>
#include <cstdio>

Go to the source code of this file.

Functions

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

Function Documentation

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

Pretty-print operator for Level1TriggerRates.

Definition at line 165 of file Level1TriggerRates.cc.

References Level1TriggerRates::collectionTime(), Level1TriggerRates::collectionTimeLumiSeg(), Level1TriggerRates::deadtimeBeamActiveCalibrationPercent(), Level1TriggerRates::deadtimeBeamActivePartitionControllerPercent(), Level1TriggerRates::deadtimeBeamActivePercent(), Level1TriggerRates::deadtimeBeamActivePrivateOrbitPercent(), Level1TriggerRates::deadtimeBeamActiveTimeSlotPercent(), Level1TriggerRates::deadtimeBeamActiveTriggerRulesPercent(), Level1TriggerRates::deadtimePercent(), Level1TriggerRates::deltaNS(), Level1TriggerRates::deltaT(), Level1TriggerRates::gtAlgoCountsRate(), Level1TriggerRates::gtEventsRate(), Level1TriggerRates::gtTechCountsRate(), Level1TriggerRates::gtTriggersRate(), i, Level1TriggerRates::l1AsCalibrationRate(), Level1TriggerRates::l1AsPhysicsRate(), Level1TriggerRates::l1AsRandomRate(), Level1TriggerRates::l1AsTestRate(), geometryCSVtoXML::line, alignCSCRings::s, Level1TriggerRates::triggersPhysicsGeneratedFDLRate(), Level1TriggerRates::triggersPhysicsLostBeamActiveRate(), Level1TriggerRates::triggersPhysicsLostBeamInactiveRate(), Level1TriggerRates::triggersPhysicsLostRate(), and Level1TriggerRates::version().

{
  char line[128];
  char zeitHeaven[128];
  struct tm * horaHeaven;

  s << "Level1TriggerRates Version: " << c.version() 
    << " Rates in Hz, DeltaT: ";

  if ( c.deltaNS() > 0 )
  {
    s << c.deltaT() << " sec" << std::endl;
  }
  else
  {
    s << "n/a" << std::endl;
  }

  struct timespec secondsToHeaven = c.collectionTime();
  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
  sprintf(line, " CollectionTime:        %s.%9.9d" , 
          zeitHeaven, (int)secondsToHeaven.tv_nsec);
  s << line << std::endl;
  
  sprintf(line, " GtTriggersRate:                              %22.3f Hz",
          c.gtTriggersRate());
  s << line << std::endl;
  
  sprintf(line, " GtEventsRate:                                %22.3f Hz",
          c.gtEventsRate());
  s << line << std::endl;

  secondsToHeaven = c.collectionTimeLumiSeg();
  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
  sprintf(line, " CollectionTimeLumiSeg: %s.%9.9d" , 
          zeitHeaven, (int)secondsToHeaven.tv_nsec);
  s << line << std::endl;
  
  sprintf(line, " TriggersPhysicsGeneratedFDLRate:             %22.3f Hz",
          c.triggersPhysicsGeneratedFDLRate());
  s << line << std::endl;

  sprintf(line, " TriggersPhysicsLostRate:                     %22.3f Hz",
          c.triggersPhysicsLostRate());
  s << line << std::endl;

  sprintf(line, " TriggersPhysicsLostBeamActiveRate:           %22.3f Hz",
          c.triggersPhysicsLostBeamActiveRate());
  s << line << std::endl;

  sprintf(line, " TriggersPhysicsLostBeamInactiveRate:         %22.3f Hz",
          c.triggersPhysicsLostBeamInactiveRate());
  s << line << std::endl;

  sprintf(line, " L1AsPhysicsRate:                             %22.3f Hz",
          c.l1AsPhysicsRate());
  s << line << std::endl;

  sprintf(line, " L1AsRandomRate:                              %22.3f Hz",
          c.l1AsRandomRate());
  s << line << std::endl;

  sprintf(line, " L1AsTestRate:                                %22.3f Hz",
          c.l1AsTestRate());
  s << line << std::endl;

  sprintf(line, " L1AsCalibrationRate:                         %22.3f Hz",
          c.l1AsCalibrationRate());
  s << line << std::endl;

  sprintf(line, " DeadtimePercent:                             %22.3f %%",
          c.deadtimePercent());
  s << line << std::endl;

  sprintf(line, " DeadtimeBeamActivePercent:                   %22.3f %%",
          c.deadtimeBeamActivePercent());
  s << line << std::endl;

  sprintf(line, " DeadtimeBeamActiveTriggerRulesPercent:       %22.3f %%",
          c.deadtimeBeamActiveTriggerRulesPercent());
  s << line << std::endl;

  sprintf(line, " DeadtimeBeamActiveCalibrationPercent:        %22.3f %%",
          c.deadtimeBeamActiveCalibrationPercent());
  s << line << std::endl;

  sprintf(line, " DeadtimeBeamActivePrivateOrbitPercent:       %22.3f %%",
          c.deadtimeBeamActivePrivateOrbitPercent());
  s << line << std::endl;

  sprintf(line, " DeadtimeBeamActivePartitionControllerPercent:%22.3f %%",
          c.deadtimeBeamActivePartitionControllerPercent());
  s << line << std::endl;

  sprintf(line, " DeadtimeBeamActiveTimeSlotPercent:           %22.3f %%",
          c.deadtimeBeamActiveTimeSlotPercent());
  s << line << std::endl;

  s << "Physics GtAlgoCountsRate, Hz" << std::endl;
  const std::vector<double> gtAlgoCountsRate = c.gtAlgoCountsRate();
  int length = gtAlgoCountsRate.size() / 4;
  for ( int i=0; i<length; i++)
  {
    sprintf(line,
            " %3.3d: %12.3f  %3.3d: %12.3f  %3.3d: %12.3f  %3.3d: %12.3f",
            i,              gtAlgoCountsRate[i], 
            (i+length),     gtAlgoCountsRate[i+length], 
            (i+(length*2)), gtAlgoCountsRate[i+(length*2)], 
            (i+(length*3)), gtAlgoCountsRate[i+(length*3)]);
    s << line << std::endl;
  }

  s << "Test GtTechCountsRate, Hz" << std::endl;
  const std::vector<double> gtTechCountsRate = c.gtTechCountsRate();
  length = gtTechCountsRate.size() / 4;
  for ( int i=0; i<length; i++)
  {
    sprintf(line,
            " %3.3d: %12.3f  %3.3d: %12.3f  %3.3d: %12.3f  %3.3d: %12.3f",
            i,              gtTechCountsRate[i], 
            (i+length),     gtTechCountsRate[i+length], 
            (i+(length*2)), gtTechCountsRate[i+(length*2)], 
            (i+(length*3)), gtTechCountsRate[i+(length*3)]);
    s << line << std::endl;
  }
  return s;
}