18 collectionTimeLumiSeg_(0,0),
19 triggersPhysicsGeneratedFDLRate_(0.0),
20 triggersPhysicsLostRate_(0.0),
21 triggersPhysicsLostBeamActiveRate_(0.0),
22 triggersPhysicsLostBeamInactiveRate_(0.0),
23 l1AsPhysicsRate_(0.0),
26 l1AsCalibrationRate_(0.0),
27 deadtimePercent_(0.0),
28 deadtimeBeamActivePercent_(0.0),
29 deadtimeBeamActiveTriggerRulesPercent_(0.0),
30 deadtimeBeamActiveCalibrationPercent_(0.0),
31 deadtimeBeamActivePrivateOrbitPercent_(0.0),
32 deadtimeBeamActivePartitionControllerPercent_(0.0),
33 deadtimeBeamActiveTimeSlotPercent_(0.0),
113 const std::vector<unsigned int> gtAlgoCounts = t.
gtAlgoCounts();
114 for ( std::vector<unsigned int>::const_iterator counts = gtAlgoCounts.begin();
115 counts != gtAlgoCounts.end(); ++counts)
120 const std::vector<unsigned int> gtTechCounts = t.
gtTechCounts();
121 for ( std::vector<unsigned int>::const_iterator counts = gtTechCounts.begin();
122 counts != gtTechCounts.end(); ++counts)
143 unsigned long long zeit1 =
144 ( (
unsigned long long)t1.
collectionTime().tv_sec * 1000000000ULL)|
146 unsigned long long zeit2 =
147 ( (
unsigned long long)t2.
collectionTime().tv_sec * 1000000000ULL)|
168 char line[kLineBufferSize];
169 char zeitHeaven[128];
170 struct tm * horaHeaven;
172 s <<
"Level1TriggerRates Version: " << c.
version()
173 <<
" Rates in Hz, DeltaT: ";
177 s << c.
deltaT() <<
" sec" << std::endl;
181 s <<
"n/a" << std::endl;
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;
191 snprintf(line, kLineBufferSize,
192 " GtTriggersRate: %22.3f Hz",
194 s << line << std::endl;
196 snprintf(line, kLineBufferSize,
197 " GtEventsRate: %22.3f Hz",
199 s << line << std::endl;
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;
208 snprintf(line, kLineBufferSize,
209 " TriggersPhysicsGeneratedFDLRate: %22.3f Hz",
211 s << line << std::endl;
213 snprintf(line, kLineBufferSize,
214 " TriggersPhysicsLostRate: %22.3f Hz",
216 s << line << std::endl;
218 snprintf(line, kLineBufferSize,
219 " TriggersPhysicsLostBeamActiveRate: %22.3f Hz",
221 s << line << std::endl;
223 snprintf(line, kLineBufferSize,
224 " TriggersPhysicsLostBeamInactiveRate: %22.3f Hz",
226 s << line << std::endl;
228 snprintf(line, kLineBufferSize,
229 " L1AsPhysicsRate: %22.3f Hz",
231 s << line << std::endl;
233 snprintf(line, kLineBufferSize,
234 " L1AsRandomRate: %22.3f Hz",
236 s << line << std::endl;
238 snprintf(line, kLineBufferSize,
239 " L1AsTestRate: %22.3f Hz",
241 s << line << std::endl;
243 snprintf(line, kLineBufferSize,
244 " L1AsCalibrationRate: %22.3f Hz",
246 s << line << std::endl;
248 snprintf(line, kLineBufferSize,
249 " DeadtimePercent: %22.3f %%",
251 s << line << std::endl;
253 snprintf(line, kLineBufferSize,
254 " DeadtimeBeamActivePercent: %22.3f %%",
256 s << line << std::endl;
258 snprintf(line, kLineBufferSize,
259 " DeadtimeBeamActiveTriggerRulesPercent: %22.3f %%",
261 s << line << std::endl;
263 snprintf(line, kLineBufferSize,
264 " DeadtimeBeamActiveCalibrationPercent: %22.3f %%",
266 s << line << std::endl;
268 snprintf(line, kLineBufferSize,
269 " DeadtimeBeamActivePrivateOrbitPercent: %22.3f %%",
271 s << line << std::endl;
273 snprintf(line, kLineBufferSize,
274 " DeadtimeBeamActivePartitionControllerPercent:%22.3f %%",
276 s << line << std::endl;
278 snprintf(line, kLineBufferSize,
279 " DeadtimeBeamActiveTimeSlotPercent: %22.3f %%",
281 s << line << std::endl;
283 s <<
"Physics GtAlgoCountsRate, Hz" << std::endl;
285 int length = gtAlgoCountsRate.size() / 4;
286 for (
int i=0;
i<length;
i++)
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;
297 s <<
"Test GtTechCountsRate, Hz" << std::endl;
299 length = gtTechCountsRate.size() / 4;
300 for (
int i=0;
i<length;
i++)
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;
double deadtimeBeamActiveTimeSlotPercent_
float gtEventsRate() const
double l1AsTestRate() const
static double rateLS(unsigned long long counts)
unsigned long long gtEvents() const
unsigned long long deadtimeBeamActive() const
unsigned long long deadtimeBeamActivePrivateOrbit() const
unsigned long long triggersPhysicsGeneratedFDL() const
double deadtimeBeamActivePartitionControllerPercent() const
double triggersPhysicsGeneratedFDLRate() const
timespec collectionTime()
virtual ~Level1TriggerRates()
void set_tv_nsec(long value)
unsigned long long l1AsRandom() const
double triggersPhysicsLostRate_
unsigned long long deltaNS_
std::vector< unsigned int > gtTechCounts() const
double deadtimeBeamActivePercent_
unsigned long long triggersPhysicsLost() const
unsigned long long triggersPhysicsLostBeamActive() const
double l1AsRandomRate() const
double triggersPhysicsLostBeamActiveRate() const
unsigned long long l1AsCalibration() const
double gtTriggersRate() const
std::ostream & operator<<(std::ostream &s, const Level1TriggerRates &c)
Pretty-print operator for Level1TriggerRates.
std::vector< double > gtAlgoCountsRate() const
double triggersPhysicsLostBeamInactiveRate_
double triggersPhysicsLostBeamActiveRate_
double deadtimeBeamActiveCalibrationPercent_
int version() const
get the data
double l1AsCalibrationRate_
std::vector< double > gtAlgoCountsRate_
double triggersPhysicsLostBeamInactiveRate() const
double deadtimeBeamActivePercent() const
std::vector< unsigned int > gtAlgoCounts() const
double deadtimeBeamActiveTriggerRulesPercent_
double deadtimeBeamActiveTriggerRulesPercent() const
double deadtimeBeamActivePrivateOrbitPercent() const
unsigned long long l1AsPhysics() const
static double percentLSActive(unsigned long long counts)
unsigned long long deadtimeBeamActiveTriggerRules() const
unsigned long long deltaNS() const
timespec collectionTimeLumiSeg()
unsigned long long l1AsTest() const
double deadtimeBeamActiveTimeSlotPercent() const
double gtEventsRate() const
unsigned long long deadtime() const
unsigned long long gtTriggers() const
static double percentLS(unsigned long long counts)
float gtTriggersRate() const
void computeRates(Level1TriggerScalers const &t1)
std::vector< double > gtTechCountsRate_
struct timespec collectionTimeLumiSeg() const
unsigned long long deadtimeBeamActiveTimeSlot() const
double triggersPhysicsGeneratedFDLRate_
double deadtimeBeamActivePrivateOrbitPercent_
unsigned long long deadtimeBeamActiveCalibration() const
double deadtimePercent() const
double triggersPhysicsLostRate() const
TimeSpec collectionTimeLumiSeg_
double deadtimeBeamActiveCalibrationPercent() const
unsigned long long triggersPhysicsLostBeamInactive() const
void set_tv_sec(long value)
std::vector< double > gtTechCountsRate() const
unsigned long long deadtimeBeamActivePartitionController() const
double l1AsCalibrationRate() const
double deadtimeBeamActivePartitionControllerPercent_
double l1AsPhysicsRate() const
struct timespec collectionTime() const