13 collectionTimeSummary_(0, 0),
16 triggerNumberRate_(0.0),
17 eventNumberRate_(0.0),
18 finalTriggersDistributedRate_(0.0),
19 finalTriggersGeneratedRate_(0.0),
20 randomTriggersRate_(0.0),
21 calibrationTriggersRate_(0.0),
22 totalTestTriggersRate_(0.0),
23 orbitNumberRate_(0.0),
24 numberResetsRate_(0.0),
25 deadTimePercent_(0.0),
26 deadTimeActivePercent_(0.0),
27 deadTimeActiveCalibrationPercent_(0.0),
28 deadTimeActivePrivatePercent_(0.0),
29 deadTimeActivePartitionPercent_(0.0),
30 deadTimeActiveThrottlePercent_(0.0),
31 deadTimeActiveTimeSlotPercent_(0.0),
32 finalTriggersInvalidBCPercent_(0.0),
33 lostFinalTriggersPercent_(0.0),
34 lostFinalTriggersActivePercent_(0.0),
37 triggerNumberRunRate_(0.0),
38 eventNumberRunRate_(0.0),
39 finalTriggersDistributedRunRate_(0.0),
40 finalTriggersGeneratedRunRate_(0.0),
41 randomTriggersRunRate_(0.0),
42 calibrationTriggersRunRate_(0.0),
43 totalTestTriggersRunRate_(0.0),
44 orbitNumberRunRate_(0.0),
45 numberResetsRunRate_(0.0),
46 deadTimeRunPercent_(0.0),
47 deadTimeActiveRunPercent_(0.0),
48 deadTimeActiveCalibrationRunPercent_(0.0),
49 deadTimeActivePrivateRunPercent_(0.0),
50 deadTimeActivePartitionRunPercent_(0.0),
51 deadTimeActiveThrottleRunPercent_(0.0),
52 deadTimeActiveTimeSlotRunPercent_(0.0),
53 finalTriggersInvalidBCRunPercent_(0.0),
54 lostFinalTriggersRunPercent_(0.0),
55 lostFinalTriggersActiveRunPercent_(0.0),
56 collectionTimeDetails_(0, 0),
72 if (
t1->orbitNumber() >
t2->orbitNumber()) {
84 double deltaOrbit = (double)
t2.orbitNumber() - (double)
t1.orbitNumber();
87 double deltaBC = deltaOrbit *
N_BX;
95 ((double)
t2.finalTriggersDistributed() - (double)
t1.finalTriggersDistributed()) /
deltaT_;
106 100.0 * ((double)
t2.deadTimeActiveCalibration() - (double)
t1.deadTimeActiveCalibration()) / deltaBCActive;
108 100.0 * ((double)
t2.deadTimeActivePrivate() - (double)
t1.deadTimeActivePrivate()) / deltaBCActive;
110 100.0 * ((double)
t2.deadTimeActivePartition() - (double)
t1.deadTimeActivePartition()) / deltaBCActive;
112 100.0 * ((double)
t2.deadTimeActiveThrottle() - (double)
t1.deadTimeActiveThrottle()) / deltaBCActive;
114 100.0 * ((double)
t2.deadTimeActiveTimeSlot() - (double)
t1.deadTimeActiveTimeSlot()) / deltaBCActive;
116 100.0 * ((double)
t2.finalTriggersInvalidBC() - (double)
t1.finalTriggersInvalidBC()) / deltaBC;
119 100.0 * ((double)
t2.lostFinalTriggersActive() - (double)
t1.lostFinalTriggersActive()) / deltaBCActive;
121 int length1 =
t1.triggers().size();
122 int length2 =
t2.triggers().size();
124 (length1 >= length2) ? minLength = length2 : minLength = length1;
125 std::vector<unsigned int> triggers1 =
t1.triggers();
126 std::vector<unsigned int> triggers2 =
t2.triggers();
127 for (
int i = 0;
i < minLength;
i++) {
128 double rate = ((double)triggers2[
i] - (
double)triggers1[
i]) /
deltaT_;
132 length1 =
t1.testTriggers().size();
133 length2 =
t2.testTriggers().size();
134 (length1 >= length2) ? minLength = length2 : minLength = length1;
135 std::vector<unsigned int> testTriggers1 =
t1.testTriggers();
136 std::vector<unsigned int> testTriggers2 =
t2.testTriggers();
137 for (
int i = 0;
i < minLength;
i++) {
138 double rate = ((double)testTriggers2[
i] - (
double)testTriggers1[
i]) /
deltaT_;
153 double deltaOrbit = (double)
t.orbitNumber();
154 if (deltaOrbit > 0) {
156 double deltaBC = deltaOrbit *
N_BX;
182 int length =
t.triggers().size();
183 for (
int i = 0;
i < length;
i++) {
192 s <<
"L1TriggerRates Version: " <<
c.version() <<
" Differential Rates in Hz, DeltaT: " <<
c.deltaT() <<
" sec" 196 sprintf(
line,
" TriggerNumber: %e EventNumber: %e",
c.triggerNumberRate(),
c.eventNumberRate());
197 s <<
line << std::endl;
200 " TriggersDistributed: %e TriggersGenerated: %e",
201 c.finalTriggersDistributedRate(),
202 c.finalTriggersGeneratedRate());
203 s <<
line << std::endl;
206 " RandomTriggers: %e CalibrationTriggers: %e",
207 c.randomTriggersRate(),
208 c.calibrationTriggersRate());
209 s <<
line << std::endl;
212 line,
" TotalTestTriggers: %e OrbitNumber: %e",
c.totalTestTriggersRate(),
c.orbitNumberRate());
213 s <<
line << std::endl;
216 line,
" NumberResets: %e DeadTime: %3.3f%%",
c.numberResetsRate(),
c.deadTimePercent());
217 s <<
line << std::endl;
220 " DeadTimeActive: %3.3f%% DeadTimeActiveCalibration: %3.3f%%",
221 c.deadTimeActivePercent(),
222 c.deadTimeActiveCalibrationPercent());
223 s <<
line << std::endl;
226 " LostTriggers: %3.3f%% DeadTimeActivePartition: %3.3f%%",
227 c.lostFinalTriggersPercent(),
228 c.deadTimeActivePartitionPercent());
229 s <<
line << std::endl;
232 " LostTriggersActive: %3.3f%% DeadTimeActiveThrottle: %3.3f%%",
233 c.lostFinalTriggersActivePercent(),
234 c.deadTimeActiveThrottlePercent());
235 s <<
line << std::endl;
238 " TriggersInvalidBC: %3.3f%% DeadTimeActivePrivate: %3.3f%%",
239 c.finalTriggersInvalidBCPercent(),
240 c.deadTimeActivePrivatePercent());
241 s <<
line << std::endl;
244 " DeadTimeActiveTimeSlot: %3.3f%%",
245 c.deadTimeActiveTimeSlotPercent());
246 s <<
line << std::endl;
248 std::vector<double> triggersRate =
c.triggersRate();
249 int length = triggersRate.size() / 4;
250 for (
int i = 0;
i < length;
i++) {
252 " %3.3d:%e %3.3d:%e %3.3d:%e %3.3d:%e",
256 triggersRate[
i + length],
258 triggersRate[
i + (length * 2)],
260 triggersRate[
i + (length * 3)]);
261 s <<
line << std::endl;
264 std::vector<double> testTriggersRate =
c.testTriggersRate();
265 length = testTriggersRate.size() / 4;
266 for (
int i = 0;
i < length;
i++) {
268 " %3.3d:%e %3.3d:%e %3.3d:%e %3.3d:%e",
272 testTriggersRate[
i + length],
274 testTriggersRate[
i + (length * 2)],
276 testTriggersRate[
i + (length * 3)]);
277 s <<
line << std::endl;
282 s <<
"L1TriggerRates Version: " <<
c.version() <<
" Run Average Rates in Hz, DeltaT: " <<
c.deltaTRun() <<
" sec" 286 line,
" TriggerNumber: %e EventNumber: %e",
c.triggerNumberRunRate(),
c.eventNumberRunRate());
287 s <<
line << std::endl;
290 " TriggersDistributed: %e TriggersGenerated: %e",
291 c.finalTriggersDistributedRunRate(),
292 c.finalTriggersGeneratedRunRate());
293 s <<
line << std::endl;
296 " RandomTriggers: %e CalibrationTriggers: %e",
297 c.randomTriggersRunRate(),
298 c.calibrationTriggersRunRate());
299 s <<
line << std::endl;
302 " TotalTestTriggers: %e OrbitNumber: %e",
303 c.totalTestTriggersRunRate(),
304 c.orbitNumberRunRate());
305 s <<
line << std::endl;
308 " NumberResets: %e DeadTime: %3.3f%%",
309 c.numberResetsRunRate(),
310 c.deadTimeRunPercent());
311 s <<
line << std::endl;
314 " DeadTimeActive: %3.3f%% DeadTimeActiveCalibration: %3.3f%%",
315 c.deadTimeActiveRunPercent(),
316 c.deadTimeActiveCalibrationRunPercent());
317 s <<
line << std::endl;
320 " LostTriggers: %3.3f%% DeadTimeActivePartition: %3.3f%%",
321 c.lostFinalTriggersRunPercent(),
322 c.deadTimeActivePartitionRunPercent());
323 s <<
line << std::endl;
326 " LostTriggersActive: %3.3f%% DeadTimeActiveThrottle: %3.3f%%",
327 c.lostFinalTriggersActiveRunPercent(),
328 c.deadTimeActiveThrottleRunPercent());
329 s <<
line << std::endl;
332 " FinalTriggersInvalidBC: %3.3f%% DeadTimeActivePrivate: %3.3f%%",
333 c.finalTriggersInvalidBCRunPercent(),
334 c.deadTimeActivePrivateRunPercent());
335 s <<
line << std::endl;
337 sprintf(
line,
" DeadTimeActiveTimeSlot: %3.3f%%",
c.deadTimeActiveTimeSlotRunPercent());
338 s <<
line << std::endl;
340 std::vector<double> triggersRunRate =
c.triggersRunRate();
341 length = triggersRunRate.size() / 4;
342 for (
int i = 0;
i < length;
i++) {
344 " %3.3d:%e %3.3d:%e %3.3d:%e %3.3d:%e",
348 triggersRunRate[
i + length],
350 triggersRunRate[
i + (length * 2)],
352 triggersRunRate[
i + (length * 3)]);
353 s <<
line << std::endl;
double deadTimeActivePrivateRunPercent_
double lostFinalTriggersActiveRunPercent_
double deadTimeActiveCalibrationPercent_
double finalTriggersGeneratedRate_
std::vector< double > triggersRate_
double orbitNumberRunRate_
void set_tv_nsec(long value)
double finalTriggersInvalidBCPercent_
double deadTimeActiveThrottleRunPercent_
double numberResetsRunRate_
double finalTriggersDistributedRunRate_
std::ostream & operator<<(std::ostream &s, const L1TriggerRates &c)
Pretty-print operator for L1TriggerRates.
double deadTimeActiveRunPercent_
double randomTriggersRate_
double randomTriggersRunRate_
TimeSpec collectionTimeSummary_
double triggerNumberRate_
double deadTimeRunPercent_
static constexpr int N_BX_ACTIVE
double lostFinalTriggersActivePercent_
static constexpr int N_BX
double deadTimeActivePartitionRunPercent_
double finalTriggersInvalidBCRunPercent_
double deadTimeActivePercent_
double deadTimeActiveThrottlePercent_
double deadTimeActiveTimeSlotPercent_
double totalTestTriggersRunRate_
double deadTimeActivePartitionPercent_
double calibrationTriggersRate_
double deadTimeActiveTimeSlotRunPercent_
std::vector< double > testTriggersRate_
virtual ~L1TriggerRates()
void computeRunRates(L1TriggerScalers const &t)
double lostFinalTriggersPercent_
double deadTimeActiveCalibrationRunPercent_
void computeRates(L1TriggerScalers const &t1, L1TriggerScalers const &t2)
double triggerNumberRunRate_
double finalTriggersGeneratedRunRate_
double calibrationTriggersRunRate_
double deadTimeActivePrivatePercent_
TimeSpec collectionTimeDetails_
double eventNumberRunRate_
void set_tv_sec(long value)
std::vector< double > triggersRunRate_
double totalTestTriggersRate_
double lostFinalTriggersRunPercent_
double finalTriggersDistributedRate_