Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push CTF/SELIRFRAMES/0 even if run was not matched #13900

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Detectors/CTF/workflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

#add_compile_options(-O0 -g -fPIC)

o2_add_library(CTFWorkflow
SOURCES src/CTFWriterSpec.cxx
src/CTFReaderSpec.cxx
Expand Down
12 changes: 8 additions & 4 deletions Detectors/CTF/workflow/src/CTFReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class CTFReaderSpec : public o2::framework::Task
std::unique_ptr<TTree> mCTFTree;
bool mRunning = false;
bool mUseLocalTFCounter = false;
bool mIFRamesOut = false;
int mConvRunTimeRangesToOrbits = -1; // not defined yet
int mCTFCounter = 0;
int mCTFCounterAcc = 0;
Expand Down Expand Up @@ -172,9 +173,11 @@ void CTFReaderSpec::init(InitContext& ic)
const auto& hbfu = o2::raw::HBFUtils::Instance();
mTFLength = hbfu.nHBFPerTF;
LOGP(info, "IRFrames will be selected from {}, assumed TF length: {} HBF", mInput.fileIRFrames, mTFLength);
mIFRamesOut = true;
}
if (!mInput.fileRunTimeSpans.empty()) {
loadRunTimeSpans(mInput.fileRunTimeSpans);
mIFRamesOut = true;
}
}

Expand Down Expand Up @@ -418,11 +421,11 @@ bool CTFReaderSpec::processTF(ProcessingContext& pc)
runTimeRangesToIRFrameSelector(timingInfo);
}
mRunNumberPrev = timingInfo.runNumber;

gsl::span<const o2::dataformats::IRFrame> irSpan{};
if (mIRFrameSelector.isSet()) {
o2::InteractionRecord ir0(0, timingInfo.firstTForbit);
o2::InteractionRecord ir1(o2::constants::lhc::LHCMaxBunches - 1, timingInfo.firstTForbit < 0xffffffff - (mTFLength - 1) ? timingInfo.firstTForbit + (mTFLength - 1) : 0xffffffff);
auto irSpan = mIRFrameSelector.getMatchingFrames({ir0, ir1});
irSpan = mIRFrameSelector.getMatchingFrames({ir0, ir1});
bool acc = true;
if (mInput.skipSkimmedOutTF) {
acc = (irSpan.size() > 0) ? !mInput.invertIRFramesSelection : mInput.invertIRFramesSelection;
Expand All @@ -435,13 +438,14 @@ bool CTFReaderSpec::processTF(ProcessingContext& pc)
if (mInput.checkTFLimitBeforeReading) {
limiter.check(pc, mInput.tfRateLimit, mInput.minSHM);
}
auto outVec = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(OutputRef{"selIRFrames"}, irSpan.begin(), irSpan.end());
} else {
if (mInput.checkTFLimitBeforeReading) {
limiter.check(pc, mInput.tfRateLimit, mInput.minSHM);
}
}

if (mIFRamesOut) {
auto outVec = pc.outputs().make<std::vector<o2::dataformats::IRFrame>>(OutputRef{"selIRFrames"}, irSpan.begin(), irSpan.end());
}
// send CTF Header
pc.outputs().snapshot({"header", mInput.subspec}, ctfHeader);

Expand Down
Loading