CMS 3D CMS Logo

Classes | Typedefs | Functions
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. More...
 

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(), constexpr, LumiScalers::deadTimeNormalization(), LumiScalers::eventID(), mps_fire::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().

143 {
144  char zeit[128];
145  constexpr size_t kLineBufferSize = 157;
146  char line[kLineBufferSize];
147  struct tm * hora;
148 
149  s << "LumiScalers Version: " << c.version() <<
150  " SourceID: "<< c.sourceID() << std::endl;
151 
152  timespec ts = c.collectionTime();
153  hora = gmtime(&ts.tv_sec);
154  strftime(zeit, sizeof(zeit), "%Y.%m.%d %H:%M:%S", hora);
155  snprintf(line, kLineBufferSize, " CollectionTime: %s.%9.9d", zeit,
156  (int)ts.tv_nsec);
157  s << line << std::endl;
158 
159  snprintf(line, kLineBufferSize, " TrigType: %d EventID: %d BunchNumber: %d",
160  c.trigType(), c.eventID(), c.bunchNumber());
161  s << line << std::endl;
162 
163  snprintf(line, kLineBufferSize," SectionNumber: %10d StartOrbit: %10d NumOrbits: %10d",
164  c.sectionNumber(), c.startOrbit(), c.numOrbits());
165  s << line << std::endl;
166 
167  snprintf(line, kLineBufferSize," Normalization: %e DeadTimeNormalization: %e",
169  s << line << std::endl;
170 
171  // Integrated Luminosity
172 
173  snprintf(line, kLineBufferSize," LumiFill: %e LumiRun: %e",
174  c.lumiFill(), c.lumiRun());
175  s << line << std::endl;
176  snprintf(line, kLineBufferSize," LiveLumiFill: %e LiveLumiRun: %e",
177  c.liveLumiFill(), c.liveLumiRun());
178  s << line << std::endl;
179 
180  snprintf(line, kLineBufferSize," LumiETFill: %e LumiETRun: %e",
181  c.lumiFill(), c.lumiRun());
182  s << line << std::endl;
183 
184  snprintf(line, kLineBufferSize," LiveLumiETFill: %e LiveLumETiRun: %e",
185  c.liveLumiETFill(), c.liveLumiETRun());
186  s << line << std::endl;
187 
188  int length = c.instantOccLumi().size();
189  for (int i=0; i<length; i++)
190  {
191  snprintf(line, kLineBufferSize,
192  " LumiOccFill[%d]: %e LumiOccRun[%d]: %e",
193  i, c.lumiOccFill()[i], i, c.lumiOccRun()[i]);
194  s << line << std::endl;
195 
196  snprintf(line, kLineBufferSize,
197  " LiveLumiOccFill[%d]: %e LiveLumiOccRun[%d]: %e",
198  i, c.liveLumiOccFill()[i], i, c.liveLumiOccRun()[i]);
199  s << line << std::endl;
200  }
201 
202  // Instantaneous Luminosity
203 
204  snprintf(line, kLineBufferSize," InstantLumi: %e Err: %e Qlty: %d",
206  s << line << std::endl;
207 
208  snprintf(line, kLineBufferSize," InstantETLumi: %e Err: %e Qlty: %d",
210  s << line << std::endl;
211 
212  for (int i=0; i<length; i++)
213  {
214  snprintf(line, kLineBufferSize," InstantOccLumi[%d]: %e Err: %e Qlty: %d",
215  i, c.instantOccLumi()[i], c.instantOccLumiErr()[i],
216  c.instantOccLumiQlty()[i]);
217  s << line << std::endl;
218  snprintf(line, kLineBufferSize," LumiNoise[%d]: %e", i, c.lumiNoise()[i]);
219  s << line << std::endl;
220  }
221 
222  snprintf(line, kLineBufferSize," Pileup: %f PileupRMS: %f",
223  c.pileup(), c.pileupRMS());
224  s << line << std::endl;
225 
226  snprintf(line, kLineBufferSize," BunchLumi: %f Spare: %f",
227  c.bunchLumi(), c.spare());
228  s << line << std::endl;
229 
230  return s;
231 }
std::vector< float > lumiOccFill() const
Definition: LumiScalers.h:75
unsigned int trigType() const
Definition: LumiScalers.h:48
unsigned char instantETLumiQlty() const
Definition: LumiScalers.h:73
unsigned int sectionNumber() const
Definition: LumiScalers.h:91
unsigned int bunchNumber() const
Definition: LumiScalers.h:51
int version() const
Definition: LumiScalers.h:53
float normalization() const
Definition: LumiScalers.h:55
float pileupRMS() const
Definition: LumiScalers.h:96
float instantETLumi() const
Definition: LumiScalers.h:71
std::vector< float > instantOccLumiErr() const
Definition: LumiScalers.h:85
float bunchLumi() const
Definition: LumiScalers.h:97
float pileup() const
Definition: LumiScalers.h:95
#define constexpr
float instantLumi() const
Definition: LumiScalers.h:63
float liveLumiETRun() const
Definition: LumiScalers.h:70
float liveLumiRun() const
Definition: LumiScalers.h:62
unsigned int numOrbits() const
Definition: LumiScalers.h:93
float lumiFill() const
Definition: LumiScalers.h:59
timespec collectionTime() const
Definition: LumiScalers.h:54
float instantETLumiErr() const
Definition: LumiScalers.h:72
std::vector< float > lumiOccRun() const
Definition: LumiScalers.h:77
std::vector< float > lumiNoise() const
Definition: LumiScalers.h:89
std::vector< unsigned char > instantOccLumiQlty() const
Definition: LumiScalers.h:87
float liveLumiETFill() const
Definition: LumiScalers.h:69
float lumiRun() const
Definition: LumiScalers.h:60
unsigned int eventID() const
Definition: LumiScalers.h:49
float spare() const
Definition: LumiScalers.h:98
unsigned char instantLumiQlty() const
Definition: LumiScalers.h:65
float liveLumiFill() const
Definition: LumiScalers.h:61
unsigned int startOrbit() const
Definition: LumiScalers.h:92
float instantLumiErr() const
Definition: LumiScalers.h:64
unsigned int sourceID() const
Definition: LumiScalers.h:50
std::vector< float > instantOccLumi() const
Definition: LumiScalers.h:83
std::vector< float > liveLumiOccRun() const
Definition: LumiScalers.h:81
float deadTimeNormalization() const
Definition: LumiScalers.h:56
std::vector< float > liveLumiOccFill() const
Definition: LumiScalers.h:79