CMS 3D CMS Logo

Classes | Typedefs | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DataFormats/Scalers/interface/LumiScalers.h File Reference

#include "DataFormats/Scalers/interface/TimeSpec.h"
#include <ctime>
#include <iosfwd>
#include <vector>
#include <string>

Go to the source code of this file.

Classes

class  LumiScalers

Typedefs

typedef std::vector< LumiScalersLumiScalersCollection

Functions

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

Detailed Description

file for HF Lumi Scalers

Author:
: William Badgett

Definition in file LumiScalers.h.


Typedef Documentation

typedef std::vector<LumiScalers> LumiScalersCollection

Definition at line 160 of file LumiScalers.h.


Function Documentation

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

Pretty-print operator for LumiScalers.

Definition at line 142 of file LumiScalers.cc.

References LumiScalers::bunchLumi(), LumiScalers::bunchNumber(), LumiScalers::collectionTime(), LumiScalers::deadTimeNormalization(), LumiScalers::eventID(), i, LumiScalers::instantETLumi(), LumiScalers::instantETLumiErr(), LumiScalers::instantETLumiQlty(), LumiScalers::instantLumi(), LumiScalers::instantLumiErr(), LumiScalers::instantLumiQlty(), LumiScalers::instantOccLumi(), LumiScalers::instantOccLumiErr(), LumiScalers::instantOccLumiQlty(), geometryCSVtoXML::line, LumiScalers::liveLumiETFill(), LumiScalers::liveLumiETRun(), LumiScalers::liveLumiFill(), LumiScalers::liveLumiOccFill(), LumiScalers::liveLumiOccRun(), LumiScalers::liveLumiRun(), LumiScalers::lumiFill(), LumiScalers::lumiNoise(), LumiScalers::lumiOccFill(), LumiScalers::lumiOccRun(), LumiScalers::lumiRun(), LumiScalers::normalization(), LumiScalers::numOrbits(), LumiScalers::pileup(), LumiScalers::pileupRMS(), alignCSCRings::s, LumiScalers::sectionNumber(), LumiScalers::sourceID(), LumiScalers::spare(), LumiScalers::startOrbit(), LumiScalers::trigType(), and LumiScalers::version().

{
  char zeit[128];
  char line[128];
  struct tm * hora;

  s << "LumiScalers    Version: " << c.version() << 
    "   SourceID: "<< c.sourceID() << std::endl;

  timespec ts = c.collectionTime();
  hora = gmtime(&ts.tv_sec);
  strftime(zeit, sizeof(zeit), "%Y.%m.%d %H:%M:%S", hora);
  sprintf(line, " CollectionTime: %s.%9.9d", zeit, 
          (int)ts.tv_nsec);
  s << line << std::endl;

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

  sprintf(line," SectionNumber: %10d   StartOrbit: %10d  NumOrbits: %10d",
          c.sectionNumber(), c.startOrbit(), c.numOrbits());
  s << line << std::endl;

  sprintf(line," Normalization: %e  DeadTimeNormalization: %e",
          c.normalization(), c.deadTimeNormalization());
  s << line << std::endl;

  // Integrated Luminosity

  sprintf(line," LumiFill:            %e   LumiRun:            %e", 
          c.lumiFill(), c.lumiRun());
  s << line << std::endl;
  sprintf(line," LiveLumiFill:        %e   LiveLumiRun:        %e", 
          c.liveLumiFill(), c.liveLumiRun());
  s << line << std::endl;

  sprintf(line," LumiETFill:          %e   LumiETRun:          %e", 
          c.lumiFill(), c.lumiRun());
  s << line << std::endl;

  sprintf(line," LiveLumiETFill:      %e   LiveLumETiRun:      %e", 
          c.liveLumiETFill(), c.liveLumiETRun());
  s << line << std::endl;

  int length = c.instantOccLumi().size();
  for (int i=0; i<length; i++)
  {
    sprintf(line,
               " LumiOccFill[%d]:      %e   LumiOccRun[%d]:      %e", 
            i, c.lumiOccFill()[i], i, c.lumiOccRun()[i]);
    s << line << std::endl;

    sprintf(line,
               " LiveLumiOccFill[%d]:  %e   LiveLumiOccRun[%d]:  %e", 
            i, c.liveLumiOccFill()[i], i, c.liveLumiOccRun()[i]);
    s << line << std::endl;
  }

  // Instantaneous Luminosity

  sprintf(line," InstantLumi:       %e  Err: %e  Qlty: %d",
          c.instantLumi(), c.instantLumiErr(), c.instantLumiQlty());
  s << line << std::endl;

  sprintf(line," InstantETLumi:     %e  Err: %e  Qlty: %d",
          c.instantETLumi(), c.instantETLumiErr(), c.instantETLumiQlty());
  s << line << std::endl;

  for (int i=0; i<length; i++)
  {
    sprintf(line," InstantOccLumi[%d]: %e  Err: %e  Qlty: %d",
            i, c.instantOccLumi()[i], c.instantOccLumiErr()[i], 
            c.instantOccLumiQlty()[i]);
    s << line << std::endl;
    sprintf(line,"      LumiNoise[%d]: %e", i, c.lumiNoise()[i]);
    s << line << std::endl;
  }

  sprintf(line," Pileup: %f       PileupRMS: %f", 
          c.pileup(), c.pileupRMS());
  s << line << std::endl;

  sprintf(line," BunchLumi: %f    Spare: %f", 
           c.bunchLumi(), c.spare());
  s << line << std::endl;

  return s;
}