Skip to content

Commit b13ad43

Browse files
JianLIUhepshahor02
authored andcommitted
Fixed cases when nROFs could be calculated wrongly
1 parent 8cbe46e commit b13ad43

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/RawPixelDecoder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class RawPixelDecoder final : public PixelReader
120120

121121
void setSkipRampUpData(bool v = true) { mSkipRampUpData = v; }
122122
bool getSkipRampUpData() const { return mSkipRampUpData; }
123+
auto getNROFsProcessed() const { return mROFCounter; }
123124

124125
struct LinkEntry {
125126
int entry = -1;

Detectors/ITSMFT/common/reconstruction/src/RawPixelDecoder.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
9595
collectROFCableData(iru);
9696
}
9797

98+
mROFCounter++;
99+
98100
if (!doIRMajorityPoll()) {
99101
continue; // no links with data
100102
}
@@ -114,7 +116,6 @@ int RawPixelDecoder<Mapping>::decodeNextTrigger()
114116

115117
if (mNChipsFiredROF || (mAlloEmptyROFs && mNLinksDone < mNLinksInTF)) { // fill some statistics
116118
mTrigger = mLinkForTriggers ? mLinkForTriggers->trigger : 0;
117-
mROFCounter++;
118119
mNChipsFired += mNChipsFiredROF;
119120
mNPixelsFired += mNPixelsFiredROF;
120121
mCurRUDecodeID = 0; // getNextChipData will start from here

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,15 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
159159

160160
mDecoder->setDecodeNextAuto(false);
161161
o2::InteractionRecord lastIR{}, firstIR{0, pc.services().get<o2::framework::TimingInfo>().firstTForbit};
162-
int nTriggersProcessed = 0;
162+
int nTriggersProcessed = mDecoder->getNROFsProcessed();
163163
while (mDecoder->decodeNextTrigger() >= 0) {
164164
if ((!lastIR.isDummy() && lastIR >= mDecoder->getInteractionRecord()) || firstIR > mDecoder->getInteractionRecord()) {
165165
const int MaxErrLog = 2;
166166
static int errLocCount = 0;
167167
if (errLocCount++ < MaxErrLog) {
168168
LOGP(warn, "Impossible ROF IR {}, previous was {}, TF 1st IR was {}, discarding in decoding", mDecoder->getInteractionRecord().asString(), lastIR.asString(), firstIR.asString());
169169
}
170+
nTriggersProcessed = 0x7fffffff; // to account for a problem with event
170171
continue;
171172
}
172173
lastIR = mDecoder->getInteractionRecord();
@@ -182,8 +183,8 @@ void STFDecoder<Mapping>::run(ProcessingContext& pc)
182183
if (mDoClusters && !mClusterer->getMaxROFDepthToSquash()) { // !!! THREADS !!!
183184
mClusterer->process(mNThreads, *mDecoder.get(), &clusCompVec, mDoPatterns ? &clusPattVec : nullptr, &clusROFVec);
184185
}
185-
nTriggersProcessed++;
186186
}
187+
nTriggersProcessed = mDecoder->getNROFsProcessed() - nTriggersProcessed - 1;
187188

188189
const auto& alpParams = o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>::Instance();
189190
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

0 commit comments

Comments
 (0)