Skip to content

Commit 99595db

Browse files
committed
TPC Workflow: filter inputs by tpc sector mask
1 parent 75d40b1 commit 99595db

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

DataFormats/Detectors/TPC/include/DataFormatsTPC/WorkflowHelper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static auto getWorkflowTPCInput(o2::framework::ProcessingContext& pc, int verbos
9090
if (recvMask & sectorHeader->sectorBits) {
9191
throw std::runtime_error("can only have one MC data set per sector");
9292
}
93-
recvMask |= sectorHeader->sectorBits;
93+
recvMask |= (sectorHeader->sectorBits & tpcSectorMask);
9494
retVal->internal.inputrefs[sector].labels = ref;
9595
if (do_digits) {
9696
retVal->internal.inputDigitsMCIndex[sector] = retVal->internal.inputDigitsMC.size();
@@ -132,7 +132,7 @@ static auto getWorkflowTPCInput(o2::framework::ProcessingContext& pc, int verbos
132132
if (recvMask & sectorHeader->sectorBits) {
133133
throw std::runtime_error("can only have one cluster data set per sector");
134134
}
135-
recvMask |= sectorHeader->sectorBits;
135+
recvMask |= (sectorHeader->sectorBits & tpcSectorMask);
136136
retVal->internal.inputrefs[sector].data = ref;
137137
if (do_digits) {
138138
if (tpcSectorMask & (1ul << sector)) {

Detectors/TPC/workflow/include/TPCWorkflow/TPCSectorCompletionPolicy.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ class TPCSectorCompletionPolicy
8787
return std::regex_match(device.name.begin(), device.name.end(), std::regex(expression.c_str()));
8888
};
8989

90-
auto callback = [bRequireAll = mRequireAll, inputMatchers = mInputMatchers, externalInputMatchers = mExternalInputMatchers](framework::CompletionPolicy::InputSet inputs) -> framework::CompletionPolicy::CompletionOp {
90+
auto callback = [bRequireAll = mRequireAll, inputMatchers = mInputMatchers, externalInputMatchers = mExternalInputMatchers, pTpcSectorMask = mTpcSectorMask](framework::CompletionPolicy::InputSet inputs) -> framework::CompletionPolicy::CompletionOp {
91+
unsigned long tpcSectorMask = pTpcSectorMask ? *pTpcSectorMask : 0xFFFFFFFFF;
9192
std::bitset<NSectors> validSectors = 0;
9293
bool haveMatchedInput = false;
9394
uint64_t activeSectors = 0;
@@ -126,8 +127,8 @@ class TPCSectorCompletionPolicy
126127
if (sectorHeader == nullptr) {
127128
throw std::runtime_error("TPC sector header missing on header stack");
128129
}
129-
activeSectors |= sectorHeader->activeSectors;
130-
validSectors |= sectorHeader->sectorBits;
130+
activeSectors |= (sectorHeader->activeSectors & tpcSectorMask);
131+
validSectors |= (sectorHeader->sectorBits & tpcSectorMask);
131132
break;
132133
}
133134
}
@@ -141,8 +142,8 @@ class TPCSectorCompletionPolicy
141142
if (sectorHeader == nullptr) {
142143
throw std::runtime_error("TPC sector header missing on header stack");
143144
}
144-
activeSectors |= sectorHeader->activeSectors;
145-
validSectorsExternal[idx] |= sectorHeader->sectorBits;
145+
activeSectors |= (sectorHeader->activeSectors & tpcSectorMask);
146+
validSectorsExternal[idx] |= (sectorHeader->sectorBits & tpcSectorMask);
146147
break;
147148
}
148149
}
@@ -208,6 +209,8 @@ class TPCSectorCompletionPolicy
208209
}
209210
} else if constexpr (std::is_same<Type, std::vector<o2::framework::InputSpec>*>::value) {
210211
mExternalInputMatchers = arg;
212+
} else if constexpr (std::is_same<Type, unsigned long*>::value) {
213+
mTpcSectorMask = arg;
211214
} else {
212215
static_assert(framework::always_static_assert_v<Type>);
213216
}
@@ -222,6 +225,7 @@ class TPCSectorCompletionPolicy
222225
// - They are controlled externally and the external entity can modify them, e.g. after parsing command line arguments.
223226
// - They are all matched independently, it is not sufficient that one of them is present for all sectors
224227
const std::vector<framework::InputSpec>* mExternalInputMatchers = nullptr;
228+
unsigned long* mTpcSectorMask = nullptr;
225229
bool mRequireAll = false;
226230
};
227231
} // namespace tpc

Detectors/TPC/workflow/src/tpc-reco-workflow.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void customize(std::vector<o2::framework::CompletionPolicy>& policies)
9090
policies.push_back(CompletionPolicyHelpers::defineByName("tpc-cluster-decoder.*", CompletionPolicy::CompletionOp::Consume));
9191
policies.push_back(CompletionPolicyHelpers::defineByName("tpc-clusterer.*", CompletionPolicy::CompletionOp::Consume));
9292
// the custom completion policy for the tracker
93-
policies.push_back(o2::tpc::TPCSectorCompletionPolicy("tpc-tracker.*", o2::tpc::TPCSectorCompletionPolicy::Config::RequireAll, &gPolicyData)());
93+
policies.push_back(o2::tpc::TPCSectorCompletionPolicy("tpc-tracker.*", o2::tpc::TPCSectorCompletionPolicy::Config::RequireAll, &gPolicyData, &gTpcSectorMask)());
9494
}
9595

9696
#include "Framework/runDataProcessing.h" // the main driver

0 commit comments

Comments
 (0)