Skip to content

Commit 4aa6a30

Browse files
committed
o2-readout-rawreader new options
1 parent c2ab71d commit 4aa6a30

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,3 +577,6 @@ This file describes the main feature changes for each readout.exe released versi
577577
- added readout.numberOfRuns: in standalone mode, number of START/STOP cycles to execute (used for testing).
578578
- added readout.tfRateLimitMode: can be set to 1 to use number of TF instead of computed TF id for rate throttling. Useful when replaying files with jumps in TF ids. (not needed with autoTimeframeId)
579579
- added equipment.autoTimeframeId: to force incremental timeframe IDs. Useful when replaying files with jumps in TF ids. BC still used to detect boundaries between TFs.
580+
581+
## next version
582+
- o2-readout-rawreader: added options logOff and dumpOrbitStats.

src/readRaw.cxx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "CounterStats.h"
2222

2323
//#define ERRLOG(args...) fprintf(stderr,args)
24-
#define ERRLOG(args...) fprintf(stdout, args)
24+
#define ERRLOG(args...) if (!logOff) {fprintf(stdout, args);}
2525

2626
int main(int argc, const char* argv[])
2727
{
@@ -52,6 +52,11 @@ int main(int argc, const char* argv[])
5252
uint32_t firstTimeframeHbOrbitBegin = 0;
5353
bool isDefinedFirstTimeframeHbOrbitBegin = 0;
5454
uint32_t maxOrbit = 0;
55+
uint32_t minOrbit = 0;
56+
uint32_t firstOrbit = 0;
57+
58+
bool logOff = 0;
59+
bool dumpOrbitStats =0;
5560

5661
// parse input arguments
5762
// format is a list of key=value pairs
@@ -72,6 +77,8 @@ int main(int argc, const char* argv[])
7277
" dumpStats=(int) : if set, some statistics are printed on HBF/TF size.\n"
7378
" fileReadVerbose=(int) : if set, more information is printed when reading/decoding file.\n"
7479
" timeframePeriodOrbits=(int) : if set, TF id computed (and printed, when dump enabled) for each RDH. Typically, 128 or 256.\n"
80+
" logOff=(int) : if set, logs disabled.\n"
81+
" dumpOrbitStats=(int) : if set, first / min / max orbits are printed after file read.\n"
7582
" \n",
7683
argv[0]);
7784
return -1;
@@ -124,6 +131,10 @@ int main(int argc, const char* argv[])
124131
timeframePeriodOrbits = (uint32_t) std::stoi(value);
125132
} else if (key == "dumpStats") {
126133
dumpStats = std::stoi(value);
134+
} else if (key == "logOff") {
135+
logOff = std::stoi(value);
136+
} else if (key == "dumpOrbitStats") {
137+
dumpOrbitStats = std::stoi(value);
127138
} else {
128139
ERRLOG("unknown option %s\n", key.c_str());
129140
}
@@ -368,6 +379,12 @@ int main(int argc, const char* argv[])
368379
h.computeTimeframeId(firstTimeframeHbOrbitBegin, timeframePeriodOrbits);
369380
}
370381

382+
if (RDHBlockCount == 1) {
383+
firstOrbit = h.getTriggerOrbit();
384+
minOrbit = firstOrbit;
385+
maxOrbit = firstOrbit;
386+
}
387+
371388
if (dumpRDH) {
372389
h.dumpRdh(pageOffset + blockOffset, 1);
373390
}
@@ -423,6 +440,9 @@ int main(int argc, const char* argv[])
423440
if (h.getTriggerOrbit() > maxOrbit) {
424441
maxOrbit = h.getTriggerOrbit();
425442
}
443+
if ((h.getTriggerOrbit() < minOrbit) || (minOrbit == 0)) {
444+
minOrbit = h.getTriggerOrbit();
445+
}
426446

427447
unsigned int linkId = h.getLinkId();
428448
if (linkId <= RdhMaxLinkId) {
@@ -496,6 +516,10 @@ int main(int argc, const char* argv[])
496516
ERRLOG("max orbit 0x%X\n", maxOrbit);
497517
}
498518

519+
if (dumpOrbitStats) {
520+
printf("Orbits:\t first = 0x%X\tmin = 0x%X\tmax = 0x%X\n", firstOrbit, minOrbit, maxOrbit);
521+
}
522+
499523
if (dumpStats) {
500524
// register final HBF size
501525
int nLinksActive = 0;

0 commit comments

Comments
 (0)