Skip to content

Commit 6ba1607

Browse files
authored
[PWGHF] taskOmegac0ToOmegapi: Fix bug introduced in #11881 (#11979)
1 parent 6e05d66 commit 6ba1607

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,17 @@ struct HfTaskOmegac0ToOmegapi {
121121
void init(InitContext&)
122122
{
123123
std::array<bool, 6> doprocess{doprocessDataWithKFParticle, doprocessDataWithKFParticleMl, doprocessDataWithKFParticleFT0C, doprocessDataWithKFParticleMlFT0C, doprocessDataWithKFParticleFT0M, doprocessDataWithKFParticleMlFT0M};
124-
if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) {
125-
LOGP(fatal, "One and only one data process function should be enabled at a time.");
124+
if (std::accumulate(doprocess.begin(), doprocess.end(), 0) > 1) {
125+
LOGP(fatal, "At most one data process function should be enabled at a time.");
126126
}
127127

128128
std::array<bool, 2> doprocessMc{doprocessMcWithKFParticle, doprocessMcWithKFParticleMl};
129-
if ((std::accumulate(doprocessMc.begin(), doprocessMc.end(), 0)) != 1) {
130-
LOGP(fatal, "One and only one MC process function should be enabled at a time.");
129+
if (std::accumulate(doprocessMc.begin(), doprocessMc.end(), 0) > 1) {
130+
LOGP(fatal, "At most one MC process function should be enabled at a time.");
131+
}
132+
133+
if ((std::accumulate(doprocess.begin(), doprocess.end(), 0) + std::accumulate(doprocessMc.begin(), doprocessMc.end(), 0)) == 0) {
134+
LOGP(fatal, "At least one process function should be enabled.");
131135
}
132136

133137
const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (#Omega#pi) (GeV/#it{c}^{2})"};

0 commit comments

Comments
 (0)