CMS 3D CMS Logo

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

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(), constexpr, 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(), mps_splice::line, alignCSCRings::s, Level1TriggerRates::triggersPhysicsGeneratedFDLRate(), Level1TriggerRates::triggersPhysicsLostBeamActiveRate(), Level1TriggerRates::triggersPhysicsLostBeamInactiveRate(), Level1TriggerRates::triggersPhysicsLostRate(), and Level1TriggerRates::version().

166 {
167  constexpr size_t kLineBufferSize = 164;
168  char line[kLineBufferSize];
169  char zeitHeaven[128];
170  struct tm * horaHeaven;
171 
172  s << "Level1TriggerRates Version: " << c.version()
173  << " Rates in Hz, DeltaT: ";
174 
175  if ( c.deltaNS() > 0 )
176  {
177  s << c.deltaT() << " sec" << std::endl;
178  }
179  else
180  {
181  s << "n/a" << std::endl;
182  }
183 
184  struct timespec secondsToHeaven = c.collectionTime();
185  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
186  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
187  snprintf(line, kLineBufferSize, " CollectionTime: %s.%9.9d" ,
188  zeitHeaven, (int)secondsToHeaven.tv_nsec);
189  s << line << std::endl;
190 
191  snprintf(line, kLineBufferSize,
192  " GtTriggersRate: %22.3f Hz",
193  c.gtTriggersRate());
194  s << line << std::endl;
195 
196  snprintf(line, kLineBufferSize,
197  " GtEventsRate: %22.3f Hz",
198  c.gtEventsRate());
199  s << line << std::endl;
200 
201  secondsToHeaven = c.collectionTimeLumiSeg();
202  horaHeaven = gmtime(&secondsToHeaven.tv_sec);
203  strftime(zeitHeaven, sizeof(zeitHeaven), "%Y.%m.%d %H:%M:%S", horaHeaven);
204  snprintf(line, kLineBufferSize, " CollectionTimeLumiSeg: %s.%9.9d" ,
205  zeitHeaven, (int)secondsToHeaven.tv_nsec);
206  s << line << std::endl;
207 
208  snprintf(line, kLineBufferSize,
209  " TriggersPhysicsGeneratedFDLRate: %22.3f Hz",
211  s << line << std::endl;
212 
213  snprintf(line, kLineBufferSize,
214  " TriggersPhysicsLostRate: %22.3f Hz",
216  s << line << std::endl;
217 
218  snprintf(line, kLineBufferSize,
219  " TriggersPhysicsLostBeamActiveRate: %22.3f Hz",
221  s << line << std::endl;
222 
223  snprintf(line, kLineBufferSize,
224  " TriggersPhysicsLostBeamInactiveRate: %22.3f Hz",
226  s << line << std::endl;
227 
228  snprintf(line, kLineBufferSize,
229  " L1AsPhysicsRate: %22.3f Hz",
230  c.l1AsPhysicsRate());
231  s << line << std::endl;
232 
233  snprintf(line, kLineBufferSize,
234  " L1AsRandomRate: %22.3f Hz",
235  c.l1AsRandomRate());
236  s << line << std::endl;
237 
238  snprintf(line, kLineBufferSize,
239  " L1AsTestRate: %22.3f Hz",
240  c.l1AsTestRate());
241  s << line << std::endl;
242 
243  snprintf(line, kLineBufferSize,
244  " L1AsCalibrationRate: %22.3f Hz",
245  c.l1AsCalibrationRate());
246  s << line << std::endl;
247 
248  snprintf(line, kLineBufferSize,
249  " DeadtimePercent: %22.3f %%",
250  c.deadtimePercent());
251  s << line << std::endl;
252 
253  snprintf(line, kLineBufferSize,
254  " DeadtimeBeamActivePercent: %22.3f %%",
256  s << line << std::endl;
257 
258  snprintf(line, kLineBufferSize,
259  " DeadtimeBeamActiveTriggerRulesPercent: %22.3f %%",
261  s << line << std::endl;
262 
263  snprintf(line, kLineBufferSize,
264  " DeadtimeBeamActiveCalibrationPercent: %22.3f %%",
266  s << line << std::endl;
267 
268  snprintf(line, kLineBufferSize,
269  " DeadtimeBeamActivePrivateOrbitPercent: %22.3f %%",
271  s << line << std::endl;
272 
273  snprintf(line, kLineBufferSize,
274  " DeadtimeBeamActivePartitionControllerPercent:%22.3f %%",
276  s << line << std::endl;
277 
278  snprintf(line, kLineBufferSize,
279  " DeadtimeBeamActiveTimeSlotPercent: %22.3f %%",
281  s << line << std::endl;
282 
283  s << "Physics GtAlgoCountsRate, Hz" << std::endl;
284  const std::vector<double> gtAlgoCountsRate = c.gtAlgoCountsRate();
285  int length = gtAlgoCountsRate.size() / 4;
286  for ( int i=0; i<length; i++)
287  {
288  snprintf(line, kLineBufferSize,
289  " %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f",
290  i, gtAlgoCountsRate[i],
291  (i+length), gtAlgoCountsRate[i+length],
292  (i+(length*2)), gtAlgoCountsRate[i+(length*2)],
293  (i+(length*3)), gtAlgoCountsRate[i+(length*3)]);
294  s << line << std::endl;
295  }
296 
297  s << "Test GtTechCountsRate, Hz" << std::endl;
298  const std::vector<double> gtTechCountsRate = c.gtTechCountsRate();
299  length = gtTechCountsRate.size() / 4;
300  for ( int i=0; i<length; i++)
301  {
302  snprintf(line, kLineBufferSize,
303  " %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f %3.3d: %12.3f",
304  i, gtTechCountsRate[i],
305  (i+length), gtTechCountsRate[i+length],
306  (i+(length*2)), gtTechCountsRate[i+(length*2)],
307  (i+(length*3)), gtTechCountsRate[i+(length*3)]);
308  s << line << std::endl;
309  }
310  return s;
311 }
double l1AsTestRate() const
double deadtimeBeamActivePartitionControllerPercent() const
double triggersPhysicsGeneratedFDLRate() const
double l1AsRandomRate() const
#define constexpr
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