Skip to content

Commit 8239574

Browse files
authored
[PWGCF] FemtoUniverse: fixing efficiency correction (#13682)
1 parent 094434f commit 8239574

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseEfficiencyCalculator.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "CCDB/BasicCCDBManager.h"
2424
#include "Framework/Configurable.h"
2525

26+
#include <TH1.h>
27+
2628
#include <algorithm>
2729
#include <map>
2830
#include <string>
@@ -36,7 +38,7 @@ enum ParticleNo : size_t {
3638
};
3739

3840
template <size_t T>
39-
concept isOneOrTwo = T == ParticleNo::ONE || T == ParticleNo::TWO;
41+
concept IsOneOrTwo = T == ParticleNo::ONE || T == ParticleNo::TWO;
4042

4143
template <typename T>
4244
consteval auto getHistDim() -> int
@@ -104,7 +106,7 @@ class EfficiencyCalculator
104106
auto hEff = hLoaded[partNo - 1];
105107

106108
if (shouldApplyCorrections && hEff) {
107-
auto bin = hEff->FindBin(binVars...);
109+
auto bin = hEff->FindBin(static_cast<double>(binVars)...);
108110
auto eff = hEff->GetBinContent(bin);
109111
weight /= eff > 0 ? eff : 1.0f;
110112
}
@@ -149,16 +151,19 @@ class EfficiencyCalculator
149151
LOGF(warn, notify("Histogram \"%s/%ld\" has been loaded, but it is empty"), config->confCCDBPath.value, timestamp);
150152
}
151153

154+
auto clonedEffHist = static_cast<HistType*>(hEff->Clone());
155+
clonedEffHist->SetDirectory(nullptr);
156+
152157
LOGF(info, notify("Successfully loaded %ld"), timestamp);
153-
return hEff;
158+
return clonedEffHist;
154159
}
155160

156161
EfficiencyConfigurableGroup* config{};
157162

158163
bool shouldApplyCorrections = false;
159164

160165
o2::ccdb::BasicCCDBManager& ccdb{o2::ccdb::BasicCCDBManager::instance()};
161-
std::array<HistType*, 2> hLoaded{};
166+
std::array<HistType*, 2> hLoaded{nullptr, nullptr};
162167
};
163168

164169
} // namespace o2::analysis::femto_universe::efficiency

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,8 @@ struct FemtoUniversePairTaskTrackD0 {
13461346
mcRecoRegistry.fill(HIST("hMcRecD0PromptPhi"), part.phi());
13471347
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
13481348
mcRecoRegistry.fill(HIST("hMcRecD0NonPrompt"), part.pt(), part.eta());
1349-
mcRecoRegistry.fill(HIST("hMcRecD0PromptPt"), part.pt());
1350-
mcRecoRegistry.fill(HIST("hMcRecD0PromptPhi"), part.phi());
1349+
mcRecoRegistry.fill(HIST("hMcRecD0NonPromptPt"), part.pt());
1350+
mcRecoRegistry.fill(HIST("hMcRecD0NonPromptPhi"), part.phi());
13511351
}
13521352
} else if (mcpart.pdgMCTruth() == ConfDmesons.confPDGCodeD0bar) {
13531353
mcRecoRegistry.fill(HIST("hMcRecD0bar"), part.pt(), part.eta());

0 commit comments

Comments
 (0)