Skip to content

Commit f6623ea

Browse files
author
David Dobrigkeit Chinellato
committed
Small simplifications
1 parent 87130c2 commit f6623ea

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

Common/Tools/PID/pidTPCModule.h

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,7 @@ class pidTPCModule
258258
// loop over devices in this execution
259259
auto& workflows = context.services().template get<o2::framework::RunningWorkflowInfo const>();
260260
for (o2::framework::DeviceSpec const& device : workflows.devices) {
261-
262-
// Check 1: the photon builder (in any configuration) needs TPC only
263-
if (device.name.compare("photon-conversion-builder") == 0) {
264-
LOGF(info, " ---> photon conversion builder detected! ");
265-
LOGF(info, " ---> enabling TPC only track TPC PID calculations now.");
266-
pidTPCopts.skipTPCOnly.value = 0;
267-
}
268-
269-
// Check 2: propagation service with generation of photons
261+
// Look for propagation service
270262
if (device.name.compare("propagation-service") == 0) {
271263
LOGF(info, " ---> propagation service detected, checking if photons enabled...");
272264
for (auto const& option : device.options) {
@@ -282,15 +274,31 @@ class pidTPCModule
282274
}
283275
}
284276

285-
// if extra tasks require TPC PID and enabling is to be automatic,
277+
// if extra tasks require TPC PID for TPC-only tracks and enabling is to be automatic,
286278
// this is the place where one should add the conditionals.
279+
//
280+
// note: this should be the device name (the name that gets printed in the
281+
// logs when executing the task) and it is sufficient to just extend this array
282+
// with the corresponding string.
283+
std::vector<std::string> devicesRequiringTPCOnlyPID = {"photon-conversion-builder"};
284+
285+
// Check 2: specific tasks that require TPC PID
286+
for (const std::string requiringDevice : devicesRequiringTPCOnlyPID) {
287+
if (device.name.compare(requiringDevice) == 0) {
288+
LOGF(info, " ---> %s detected! ", requiringDevice);
289+
LOGF(info, " ---> enabling TPC only track TPC PID calculations now.");
290+
pidTPCopts.skipTPCOnly.value = 0;
291+
}
292+
}
287293
}
288294

289295
if (pidTPCopts.skipTPCOnly.value == 1) {
296+
LOGF(info, "***************************************************");
290297
LOGF(info, "No need for TPC only information detected. Will not generate Nsigma for TPC only tracks");
291298
LOGF(info, "If this is unexpected behaviour and a necessity was not identified, please add the");
292-
LOGF(info, "corresponding task to the list in pidTPCModule::Init().");
299+
LOGF(info, "corresponding task to the list 'devicesRequiringTPCOnlyPID' in pidTPCModule::Init()");
293300
}
301+
LOGF(info, "***************************************************");
294302
}
295303

296304
// initialize PID response

0 commit comments

Comments
 (0)