CMS 3D CMS Logo

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< Level1TriggerRatesLevel1TriggerRatesCollection
 

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 35 of file Level1TriggerRates.h.

Typedef Documentation

Definition at line 171 of file Level1TriggerRates.h.

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(), 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().

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