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
3840template <size_t T>
39- concept isOneOrTwo = T == ParticleNo::ONE || T == ParticleNo::TWO;
41+ concept IsOneOrTwo = T == ParticleNo::ONE || T == ParticleNo::TWO;
4042
4143template <typename T>
4244consteval 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
0 commit comments