CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Typedefs | Functions
Level1TriggerRates.h File Reference
#include "DataFormats/Scalers/interface/TimeSpec.h"
#include <ctime>
#include <iosfwd>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  Level1TriggerRates
 

Macros

#define BX_SPACING   (double)25E-9
 

Typedefs

typedef std::vector
< Level1TriggerRates
Level1TriggerRatesCollection
 

Functions

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

Detailed Description

file for Level 1 Global Trigger Rates

Author
: William Badgett

Definition in file Level1TriggerRates.h.

Macro Definition Documentation

#define BX_SPACING   (double)25E-9

Definition at line 32 of file Level1TriggerRates.h.

Typedef Documentation

Definition at line 145 of file Level1TriggerRates.h.

Function Documentation

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

Pretty-print operator for Level1TriggerRates.

Definition at line 133 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(), mps_fire::i, Level1TriggerRates::l1AsCalibrationRate(), Level1TriggerRates::l1AsPhysicsRate(), Level1TriggerRates::l1AsRandomRate(), Level1TriggerRates::l1AsTestRate(), geometryCSVtoXML::line, alignCSCRings::s, Level1TriggerRates::triggersPhysicsGeneratedFDLRate(), Level1TriggerRates::triggersPhysicsLostBeamActiveRate(), Level1TriggerRates::triggersPhysicsLostBeamInactiveRate(), Level1TriggerRates::triggersPhysicsLostRate(), and Level1TriggerRates::version().

133  {
134  constexpr size_t kLineBufferSize = 164;
135  char line[kLineBufferSize];
136  char zeitHeaven[128];
137  struct tm* horaHeaven;
138 
139  s << "Level1TriggerRates Version: " << c.version() << " Rates in Hz, DeltaT: ";
140 
141  if (c.deltaNS() > 0) {
142  s << c.deltaT() << " sec" << std::endl;
143  } else {
144  s << "n/a" << std::endl;
145  }
146 
147  struct timespec secondsToHeaven = c.collectionTime();
148  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
149  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
150  snprintf(line, kLineBufferSize, " CollectionTime: %s.%9.9d", zeitHeaven, (int)secondsToHeaven.tv_nsec);
151  s << line << std::endl;
152 
153  snprintf(line, kLineBufferSize, " GtTriggersRate: %22.3f Hz", c.gtTriggersRate());
154  s << line << std::endl;
155 
156  snprintf(line, kLineBufferSize, " GtEventsRate: %22.3f Hz", c.gtEventsRate());
157  s << line << std::endl;
158 
159  secondsToHeaven = c.collectionTimeLumiSeg();
160  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
161  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
162  snprintf(line, kLineBufferSize, " CollectionTimeLumiSeg: %s.%9.9d", zeitHeaven, (int)secondsToHeaven.tv_nsec);
163  s << line << std::endl;
164 
165  snprintf(line,
166  kLineBufferSize,
167  " TriggersPhysicsGeneratedFDLRate: %22.3f Hz",
169  s << line << std::endl;
170 
171  snprintf(
172  line, kLineBufferSize, " TriggersPhysicsLostRate: %22.3f Hz", c.triggersPhysicsLostRate());
173  s << line << std::endl;
174 
175  snprintf(line,
176  kLineBufferSize,
177  " TriggersPhysicsLostBeamActiveRate: %22.3f Hz",
179  s << line << std::endl;
180 
181  snprintf(line,
182  kLineBufferSize,
183  " TriggersPhysicsLostBeamInactiveRate: %22.3f Hz",
185  s << line << std::endl;
186 
187  snprintf(line, kLineBufferSize, " L1AsPhysicsRate: %22.3f Hz", c.l1AsPhysicsRate());
188  s << line << std::endl;
189 
190  snprintf(line, kLineBufferSize, " L1AsRandomRate: %22.3f Hz", c.l1AsRandomRate());
191  s << line << std::endl;
192 
193  snprintf(line, kLineBufferSize, " L1AsTestRate: %22.3f Hz", c.l1AsTestRate());
194  s << line << std::endl;
195 
196  snprintf(line, kLineBufferSize, " L1AsCalibrationRate: %22.3f Hz", c.l1AsCalibrationRate());
197  s << line << std::endl;
198 
199  snprintf(line, kLineBufferSize, " DeadtimePercent: %22.3f %%", c.deadtimePercent());
200  s << line << std::endl;
201 
202  snprintf(
203  line, kLineBufferSize, " DeadtimeBeamActivePercent: %22.3f %%", c.deadtimeBeamActivePercent());
204  s << line << std::endl;
205 
206  snprintf(line,
207  kLineBufferSize,
208  " DeadtimeBeamActiveTriggerRulesPercent: %22.3f %%",
210  s << line << std::endl;
211 
212  snprintf(line,
213  kLineBufferSize,
214  " DeadtimeBeamActiveCalibrationPercent: %22.3f %%",
216  s << line << std::endl;
217 
218  snprintf(line,
219  kLineBufferSize,
220  " DeadtimeBeamActivePrivateOrbitPercent: %22.3f %%",
222  s << line << std::endl;
223 
224  snprintf(line,
225  kLineBufferSize,
226  " DeadtimeBeamActivePartitionControllerPercent:%22.3f %%",
228  s << line << std::endl;
229 
230  snprintf(line,
231  kLineBufferSize,
232  " DeadtimeBeamActiveTimeSlotPercent: %22.3f %%",
234  s << line << std::endl;
235 
236  s << "Physics GtAlgoCountsRate, Hz" << std::endl;
237  const std::vector<double> gtAlgoCountsRate = c.gtAlgoCountsRate();
238  int length = gtAlgoCountsRate.size() / 4;
239  for (int i = 0; i < length; i++) {
240  snprintf(line,
241  kLineBufferSize,
242  " %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f",
243  i,
244  gtAlgoCountsRate[i],
245  (i + length),
246  gtAlgoCountsRate[i + length],
247  (i + (length * 2)),
248  gtAlgoCountsRate[i + (length * 2)],
249  (i + (length * 3)),
250  gtAlgoCountsRate[i + (length * 3)]);
251  s << line << std::endl;
252  }
253 
254  s << "Test GtTechCountsRate, Hz" << std::endl;
255  const std::vector<double> gtTechCountsRate = c.gtTechCountsRate();
256  length = gtTechCountsRate.size() / 4;
257  for (int i = 0; i < length; i++) {
258  snprintf(line,
259  kLineBufferSize,
260  " %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f",
261  i,
262  gtTechCountsRate[i],
263  (i + length),
264  gtTechCountsRate[i + length],
265  (i + (length * 2)),
266  gtTechCountsRate[i + (length * 2)],
267  (i + (length * 3)),
268  gtTechCountsRate[i + (length * 3)]);
269  s << line << std::endl;
270  }
271  return s;
272 }
double l1AsTestRate() const
double deadtimeBeamActivePartitionControllerPercent() const
double triggersPhysicsGeneratedFDLRate() const
double l1AsRandomRate() const
double triggersPhysicsLostBeamActiveRate() const
double gtTriggersRate() const
std::vector< double > gtAlgoCountsRate() const
int version() const
get the data
double triggersPhysicsLostBeamInactiveRate() const
double deadtimeBeamActivePercent() const
double deadtimeBeamActiveTriggerRulesPercent() const
double deadtimeBeamActivePrivateOrbitPercent() const
unsigned long long deltaNS() const
timespec collectionTimeLumiSeg()
double deadtimeBeamActiveTimeSlotPercent() const
double gtEventsRate() const
double deadtimePercent() const
double triggersPhysicsLostRate() const
double deadtimeBeamActiveCalibrationPercent() const
std::vector< double > gtTechCountsRate() const
double l1AsCalibrationRate() const
double l1AsPhysicsRate() const
double deltaT() const