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 144 of file LumiScalers.h.

Function Documentation

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

Pretty-print operator for LumiScalers.

Definition at line 124 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(), mps_splice::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().

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