Skip to content
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
8 changes: 5 additions & 3 deletions Detectors/CPV/workflow/src/ClusterReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file ClusterReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>
#include <cassert>
#include "Framework/ControlService.h"
Expand Down Expand Up @@ -40,15 +42,15 @@ void ClusterReader::init(InitContext& ic)

void ClusterReader::run(ProcessingContext& pc)
{
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -59,7 +61,7 @@ void ClusterReader::run(ProcessingContext& pc)
pc.outputs().snapshot(Output{mOrigin, "CLUSTERTRUEMC", 0}, mMCTruth);
}

if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/CPV/workflow/src/DigitReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file DigitReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>
#include <cassert>
#include "Framework/ControlService.h"
Expand Down Expand Up @@ -40,15 +42,15 @@ void DigitReader::init(InitContext& ic)

void DigitReader::run(ProcessingContext& pc)
{
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -59,7 +61,7 @@ void DigitReader::run(ProcessingContext& pc)
pc.outputs().snapshot(Output{mOrigin, "DIGITSMCTR", 0}, mMCTruth);
}

if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/CTP/workflowIO/src/DigitReaderSpec.cxx
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.

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include "CTPWorkflowIO/DigitReaderSpec.h"

#include "TFile.h"
Expand Down Expand Up @@ -85,22 +87,22 @@ void DigitReader::run(ProcessingContext& pc)
}
auto ent = mTree->GetReadEntry();
if (!mUseIRFrames) {
ent++;
ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
LOG(info) << "DigitReader pushes " << mDigits.size() << " digits at entry " << ent;
pc.outputs().snapshot(Output{"CTP", "DIGITS", 0}, mDigits);
pc.outputs().snapshot(Output{"CTP", "LUMI", 0}, mLumi);
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/FIT/FDD/workflow/src/DigitReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file DigitReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>

#include "TTree.h"
Expand Down Expand Up @@ -76,15 +78,15 @@ void DigitReader::run(ProcessingContext& pc)
mUseMC = false;
}
}
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -110,7 +112,7 @@ void DigitReader::run(ProcessingContext& pc)
}
pc.outputs().snapshot(Output{mOrigin, "DIGITLBL", 0}, mcTruth);
}
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/FIT/FDD/workflow/src/RecPointReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file RecPointReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include "Framework/ConfigParamRegistry.h"
#include "Framework/ControlService.h"
#include "Framework/Logger.h"
Expand Down Expand Up @@ -44,15 +46,15 @@ void RecPointReader::init(InitContext& ic)

void RecPointReader::run(ProcessingContext& pc)
{
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -65,7 +67,7 @@ void RecPointReader::run(ProcessingContext& pc)
pc.outputs().snapshot(Output{mOrigin, "RECPOINTS", 0}, recPoints);
pc.outputs().snapshot(Output{mOrigin, "RECCHDATA", 0}, channelData);

if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/FIT/FT0/workflow/src/DigitReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file DigitReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>
#include <TTree.h>
#include "Framework/ConfigParamRegistry.h"
Expand Down Expand Up @@ -60,15 +62,15 @@ void DigitReader::run(ProcessingContext& pc)
if (mUseMC) {
mTree->SetBranchAddress("FT0DIGITSMCTR", &plabels);
}
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -81,7 +83,7 @@ void DigitReader::run(ProcessingContext& pc)
if (mUseTrgInput) {
pc.outputs().snapshot(Output{"FT0", "TRIGGERINPUT", 0}, trgInput);
}
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/FIT/FT0/workflow/src/RecPointReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file RecPointReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>

#include "Framework/ConfigParamRegistry.h"
Expand Down Expand Up @@ -44,15 +46,15 @@ void RecPointReader::init(InitContext& ic)

void RecPointReader::run(ProcessingContext& pc)
{
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -65,7 +67,7 @@ void RecPointReader::run(ProcessingContext& pc)
pc.outputs().snapshot(Output{mOrigin, "RECPOINTS", 0}, recPoints);
pc.outputs().snapshot(Output{mOrigin, "RECCHDATA", 0}, channelData);

if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/FIT/FV0/workflow/src/DigitReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file DigitReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>
#include <TTree.h>
#include "Framework/ConfigParamRegistry.h"
Expand Down Expand Up @@ -61,15 +63,15 @@ void DigitReader::run(ProcessingContext& pc)
if (mUseMC) {
mTree->SetBranchAddress("FV0DigitLabels", &plabels);
}
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -82,7 +84,7 @@ void DigitReader::run(ProcessingContext& pc)
if (mUseTrgInput) {
pc.outputs().snapshot(Output{"FV0", "TRIGGERINPUT", 0}, trgInput);
}
if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
8 changes: 5 additions & 3 deletions Detectors/FIT/FV0/workflow/src/RecPointReaderSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/// @file RecPointReaderSpec.cxx

#include "Framework/DeviceSpec.h"
#include "Framework/TimingInfo.h"
#include <vector>

#include "Framework/ConfigParamRegistry.h"
Expand Down Expand Up @@ -44,15 +46,15 @@ void RecPointReader::init(InitContext& ic)

void RecPointReader::run(ProcessingContext& pc)
{
auto ent = mTree->GetReadEntry() + 1;
long ent = pc.services().get<o2::framework::TimingInfo>().timeslice;
// A timeframe holds no collision at all whenever the interaction rate is low enough, and
// the tree then has no entry to read. Publish empty containers instead of reading past the
// end and pushing branch addresses that GetEntry has not filled, so that the consumers
// downstream still see the timeframe. (This used to be an assert, which is compiled out of
// every production build since ENABLE_CASSERT defaults to OFF.)
const bool noEntry = ent >= mTree->GetEntries();
if (noEntry) {
LOG(info) << "no entry to read, publishing empty output";
LOGP(warning, "No entry {} to read, tree contains {} entries, publishing empty output", ent, mTree->GetEntries());
} else {
mTree->GetEntry(ent);
}
Expand All @@ -65,7 +67,7 @@ void RecPointReader::run(ProcessingContext& pc)
pc.outputs().snapshot(Output{mOrigin, "RECPOINTS", 0}, recPoints);
pc.outputs().snapshot(Output{mOrigin, "RECCHDATA", 0}, channelData);

if (noEntry || mTree->GetReadEntry() + 1 >= mTree->GetEntries()) {
if (noEntry || mTree->GetReadEntry() + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mTree->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#ifndef O2_FIT_FITINTEGRATECLUSTERREADER_SPEC
#define O2_FIT_FITINTEGRATECLUSTERREADER_SPEC

#include "Framework/DeviceSpec.h"
#include <vector>
#include <boost/algorithm/string/predicate.hpp>

Expand Down Expand Up @@ -97,7 +98,7 @@ template <typename DataT>
void IntegratedClusterReader<DataT>::run(ProcessingContext& pc)
{
// check time order inside the TChain
if (mChainEntry == 0) {
if (mIndices.empty()) {
mIndices.clear();
mIndices.reserve(mChain->GetEntries());
// disable all branches except the firstTForbit branch to significantly speed up the loop over the TTree
Expand All @@ -111,8 +112,16 @@ void IntegratedClusterReader<DataT>::run(ProcessingContext& pc)
std::sort(mIndices.begin(), mIndices.end());
}

mChainEntry = pc.services().get<o2::framework::TimingInfo>().timeslice;
if (mChainEntry >= mIndices.size()) {
LOG(warning) << "No entry " << mChainEntry << " to read in chain with " << mIndices.size() << " entries";
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
return;
}

LOGP(debug, "Processing entry {}", mIndices[mChainEntry].second);
mChain->GetEntry(mIndices[mChainEntry++].second);
mChain->GetEntry(mIndices[mChainEntry].second);

// inject correct timing informations
auto& timingInfo = pc.services().get<o2::framework::TimingInfo>();
Expand All @@ -125,7 +134,7 @@ void IntegratedClusterReader<DataT>::run(ProcessingContext& pc)
pc.outputs().snapshot(Output{FitType::getDataOrigin(), FitType::getDataDescriptionFITC()}, mFITC);
usleep(100);

if (mChainEntry >= mChain->GetEntries()) {
if (mChainEntry + pc.services().get<const o2::framework::DeviceSpec>().maxInputTimeslices >= mChain->GetEntries()) {
pc.services().get<ControlService>().endOfStream();
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
}
Expand Down
Loading