Skip to content

Commit d26f229

Browse files
committed
Push CTF/SELIRFRAMES/0 even if run was not matched
1 parent fb7b17c commit d26f229

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Detectors/CTF/workflow/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12+
#add_compile_options(-O0 -g -fPIC)
13+
1214
o2_add_library(CTFWorkflow
1315
SOURCES src/CTFWriterSpec.cxx
1416
src/CTFReaderSpec.cxx

Detectors/CTF/workflow/src/CTFReaderSpec.cxx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class CTFReaderSpec : public o2::framework::Task
102102
std::unique_ptr<TTree> mCTFTree;
103103
bool mRunning = false;
104104
bool mUseLocalTFCounter = false;
105+
bool mIFRamesOut = false;
105106
int mConvRunTimeRangesToOrbits = -1; // not defined yet
106107
int mCTFCounter = 0;
107108
int mCTFCounterAcc = 0;
@@ -172,9 +173,11 @@ void CTFReaderSpec::init(InitContext& ic)
172173
const auto& hbfu = o2::raw::HBFUtils::Instance();
173174
mTFLength = hbfu.nHBFPerTF;
174175
LOGP(info, "IRFrames will be selected from {}, assumed TF length: {} HBF", mInput.fileIRFrames, mTFLength);
176+
mIFRamesOut = true;
175177
}
176178
if (!mInput.fileRunTimeSpans.empty()) {
177179
loadRunTimeSpans(mInput.fileRunTimeSpans);
180+
mIFRamesOut = true;
178181
}
179182
}
180183

@@ -418,11 +421,11 @@ bool CTFReaderSpec::processTF(ProcessingContext& pc)
418421
runTimeRangesToIRFrameSelector(timingInfo);
419422
}
420423
mRunNumberPrev = timingInfo.runNumber;
421-
424+
gsl::span<const o2::dataformats::IRFrame> irSpan{};
422425
if (mIRFrameSelector.isSet()) {
423426
o2::InteractionRecord ir0(0, timingInfo.firstTForbit);
424427
o2::InteractionRecord ir1(o2::constants::lhc::LHCMaxBunches - 1, timingInfo.firstTForbit < 0xffffffff - (mTFLength - 1) ? timingInfo.firstTForbit + (mTFLength - 1) : 0xffffffff);
425-
auto irSpan = mIRFrameSelector.getMatchingFrames({ir0, ir1});
428+
irSpan = mIRFrameSelector.getMatchingFrames({ir0, ir1});
426429
bool acc = true;
427430
if (mInput.skipSkimmedOutTF) {
428431
acc = (irSpan.size() > 0) ? !mInput.invertIRFramesSelection : mInput.invertIRFramesSelection;
@@ -435,13 +438,14 @@ bool CTFReaderSpec::processTF(ProcessingContext& pc)
435438
if (mInput.checkTFLimitBeforeReading) {
436439
limiter.check(pc, mInput.tfRateLimit, mInput.minSHM);
437440
}
438-
auto outVec = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(OutputRef{"selIRFrames"}, irSpan.begin(), irSpan.end());
439441
} else {
440442
if (mInput.checkTFLimitBeforeReading) {
441443
limiter.check(pc, mInput.tfRateLimit, mInput.minSHM);
442444
}
443445
}
444-
446+
if (mIFRamesOut) {
447+
auto outVec = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(OutputRef{"selIRFrames"}, irSpan.begin(), irSpan.end());
448+
}
445449
// send CTF Header
446450
pc.outputs().snapshot({"header", mInput.subspec}, ctfHeader);
447451

0 commit comments

Comments
 (0)