Skip to content

Commit 7a0fb74

Browse files
committed
GloHelper: Allow also enable-root-input in InputHelper
1 parent 651d9e5 commit 7a0fb74

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

Detectors/GlobalTrackingWorkflow/helpers/include/GlobalTrackingWorkflowHelpers/InputHelper.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ class InputHelper
4141
static int addInputSpecsStrangeTrack(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs, bool mc);
4242
static int addInputSpecsCosmics(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs, bool mc);
4343
static int addInputSpecsIRFramesITS(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs);
44+
45+
private:
46+
static bool isROOTInputDisabled(const o2::framework::ConfigContext& ctx)
47+
{
48+
const auto& opts = ctx.options();
49+
if (opts.hasOption("disable-root-input")) {
50+
return opts.get<bool>("disable-root-input");
51+
} else if (opts.hasOption("enable-root-input")) {
52+
return !opts.get<bool>("enable-root-input");
53+
} else {
54+
throw "ConfigContext does not contain option to disable/enable root input for readers!";
55+
}
56+
}
4457
};
4558

4659
} // namespace globaltracking

Detectors/GlobalTrackingWorkflow/helpers/src/InputHelper.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int InputHelper::addInputSpecs(const ConfigContext& configcontext, WorkflowSpec&
5858
bool useMC, GID::mask_t maskClustersMC, GID::mask_t maskTracksMC,
5959
bool subSpecStrict)
6060
{
61-
if (configcontext.options().get<bool>("disable-root-input")) {
61+
if (isROOTInputDisabled(configcontext)) {
6262
return 0;
6363
}
6464
if (useMC && configcontext.options().get<bool>("disable-mc")) {
@@ -185,7 +185,7 @@ int InputHelper::addInputSpecs(const ConfigContext& configcontext, WorkflowSpec&
185185
// attach primary vertex reader
186186
int InputHelper::addInputSpecsPVertex(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs, bool mc)
187187
{
188-
if (configcontext.options().get<bool>("disable-root-input")) {
188+
if (isROOTInputDisabled(configcontext)) {
189189
return 0;
190190
}
191191
specs.emplace_back(o2::vertexing::getPrimaryVertexReaderSpec(mc));
@@ -195,7 +195,7 @@ int InputHelper::addInputSpecsPVertex(const o2::framework::ConfigContext& config
195195
// attach secondary vertex reader
196196
int InputHelper::addInputSpecsSVertex(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs)
197197
{
198-
if (configcontext.options().get<bool>("disable-root-input")) {
198+
if (isROOTInputDisabled(configcontext)) {
199199
return 0;
200200
}
201201
specs.emplace_back(o2::vertexing::getSecondaryVertexReaderSpec());
@@ -205,7 +205,7 @@ int InputHelper::addInputSpecsSVertex(const o2::framework::ConfigContext& config
205205
// attach strangeness tracking reader
206206
int InputHelper::addInputSpecsStrangeTrack(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs, bool mc)
207207
{
208-
if (configcontext.options().get<bool>("disable-root-input")) {
208+
if (isROOTInputDisabled(configcontext)) {
209209
return 0;
210210
}
211211
specs.emplace_back(o2::strangeness_tracking::getStrangenessTrackingReaderSpec(mc));
@@ -215,7 +215,7 @@ int InputHelper::addInputSpecsStrangeTrack(const o2::framework::ConfigContext& c
215215
// attach cosmic tracks reader
216216
int InputHelper::addInputSpecsCosmics(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs, bool mc)
217217
{
218-
if (configcontext.options().get<bool>("disable-root-input")) {
218+
if (isROOTInputDisabled(configcontext)) {
219219
return 0;
220220
}
221221
specs.emplace_back(o2::globaltracking::getTrackCosmicsReaderSpec(mc));
@@ -225,7 +225,7 @@ int InputHelper::addInputSpecsCosmics(const o2::framework::ConfigContext& config
225225
// attach vector of ITS reconstructed IRFrames
226226
int InputHelper::addInputSpecsIRFramesITS(const o2::framework::ConfigContext& configcontext, o2::framework::WorkflowSpec& specs)
227227
{
228-
if (configcontext.options().get<bool>("disable-root-input")) {
228+
if (isROOTInputDisabled(configcontext)) {
229229
return 0;
230230
}
231231
specs.emplace_back(o2::globaltracking::getIRFrameReaderSpec("ITS", 0, "its-irframe-reader", "o2_its_irframe.root"));

0 commit comments

Comments
 (0)