Skip to content

Commit 2c42629

Browse files
committed
Option to manage ROF length reporting
Option --rof-lenght-error-freq <float_time_in_seconds> will set the interval between successive error reports (if any) about the wrong ROF length. No reporting is done if negative or 0 (to be used in calibration runs). Default interval is 60s.
1 parent 94eca0d commit 2c42629

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Detectors/ITSMFT/common/workflow/include/ITSMFTWorkflow/STFDecoderSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class STFDecoder : public Task
8282
int mDumpOnError = 0;
8383
int mNThreads = 1;
8484
int mVerbosity = 0;
85+
long mROFErrRepIntervalMS = 0;
8586
size_t mTFCounter = 0;
8687
size_t mEstNDig = 0;
8788
size_t mEstNClus = 0;

Detectors/ITSMFT/common/workflow/src/STFDecoderSpec.cxx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ void STFDecoder<Mapping>::init(InitContext& ic)
8181
mApplyNoiseMap = !ic.options().get<bool>("ignore-noise-map");
8282
mUseClusterDictionary = !ic.options().get<bool>("ignore-cluster-dictionary");
8383
try {
84+
float fr = ic.options().get<float>("rof-lenght-error-freq");
85+
mROFErrRepIntervalMS = fr <= 0. ? -1 : long(fr * 1e3);
8486
mNThreads = std::max(1, ic.options().get<int>("nthreads"));
8587
mDecoder->setNThreads(mNThreads);
8688
mUnmutExtraLanes = ic.options().get<bool>("unmute-extra-lanes");
@@ -160,6 +162,7 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
160162
mDecoder->setDecodeNextAuto(false);
161163
o2::InteractionRecord lastIR{}, firstIR{0, pc.services().get<o2::framework::TimingInfo>().firstTForbit};
162164
int nTriggersProcessed = mDecoder->getNROFsProcessed();
165+
static long lastErrReportTS = 0;
163166
while (mDecoder->decodeNextTrigger() >= 0) {
164167
if ((!lastIR.isDummy() && lastIR >= mDecoder->getInteractionRecord()) || firstIR > mDecoder->getInteractionRecord()) {
165168
const int MaxErrLog = 2;
@@ -186,8 +189,12 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
186189

187190
const auto& alpParams = o2::itsmft::DPLAlpideParam<Mapping::getDetID()>::Instance();
188191
int expectedTFSize = static_cast<int>(o2::constants::lhc::LHCMaxBunches * o2::base::GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF() / alpParams.roFrameLengthInBC); // 3564*32 / ROF Length in BS = number of ROFs per TF
189-
if ((expectedTFSize != nTriggersProcessed) && mTFCounter > 1 && nTriggersProcessed > 0) {
190-
LOG(error) << "Inconsistent number of ROF per TF. From parameters: " << expectedTFSize << " from readout: " << nTriggersProcessed;
192+
if ((expectedTFSize != nTriggersProcessed) && mROFErrRepIntervalMS > 0 && mTFCounter > 1 && nTriggersProcessed > 0) {
193+
long currTS = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now()).time_since_epoch().count();
194+
if (currTS - lastErrReportTS > mROFErrRepIntervalMS) {
195+
LOGP(error, "Inconsistent number of ROF per TF. From parameters: {} from readout: {} (muting further reporting for {} ms)", expectedTFSize, nTriggersProcessed, mROFErrRepIntervalMS);
196+
lastErrReportTS = currTS;
197+
}
191198
}
192199
if (mDoClusters && mClusterer->getMaxROFDepthToSquash()) {
193200
// Digits squashing require to run on a batch of digits and uses a digit reader, cannot (?) run with decoder
@@ -413,6 +420,7 @@ DataProcessorSpec getSTFDecoderSpec(const STFDecoderInp& inp)
413420
{"allow-empty-rofs", VariantType::Bool, false, {"record ROFs w/o any hit"}},
414421
{"ignore-noise-map", VariantType::Bool, false, {"do not mask pixels flagged in the noise map"}},
415422
{"accept-rof-rampup-data", VariantType::Bool, false, {"do not discard data during ROF ramp up"}},
423+
{"rof-lenght-error-freq", VariantType::Float, 60.f, {"do not report ROF lenght error more frequently than this value, disable if negative"}},
416424
{"ignore-cluster-dictionary", VariantType::Bool, false, {"do not use cluster dictionary, always store explicit patterns"}}}};
417425
}
418426

0 commit comments

Comments
 (0)