From 8c74731f534b022d7c92e8bcb32efff43fd811f0 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Thu, 19 Nov 2026 13:33:15 +0100 Subject: [PATCH 1/2] Fix cast --- PWGLF/Utils/mcCentralityModule.h | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/PWGLF/Utils/mcCentralityModule.h b/PWGLF/Utils/mcCentralityModule.h index 0aa51448914..9e937f4640c 100644 --- a/PWGLF/Utils/mcCentralityModule.h +++ b/PWGLF/Utils/mcCentralityModule.h @@ -174,20 +174,20 @@ struct BuilderModule { coreConfigurables baseOpts; TList* MCCentralityCalibObjects = nullptr; - TH1D* h1dFV0A = nullptr; - TH1D* h1dFT0M = nullptr; - TH1D* h1dFT0A = nullptr; - TH1D* h1dFT0C = nullptr; - TH1D* h1dFT0CVariant1 = nullptr; - TH1D* h1dFT0CVariant2 = nullptr; - TH1D* h1dFDDM = nullptr; - TH1D* h1dNTPV = nullptr; - TH1D* h1dNGlobal = nullptr; - TH1D* h1dMFT = nullptr; + TH1* h1dFV0A = nullptr; + TH1* h1dFT0M = nullptr; + TH1* h1dFT0A = nullptr; + TH1* h1dFT0C = nullptr; + TH1* h1dFT0CVariant1 = nullptr; + TH1* h1dFT0CVariant2 = nullptr; + TH1* h1dFDDM = nullptr; + TH1* h1dNTPV = nullptr; + TH1* h1dNGlobal = nullptr; + TH1* h1dMFT = nullptr; // Calibration objects for candidate-by-candidate sampling (assignCentralityPerCandidate): // x = centrality (%) of the matched reconstructed MC collision, y = generated multiplicity (|eta| < 0.5) - std::vector h2dCentVsGenMult; + std::vector h2dCentVsGenMult; TRandom3 fRandomSampler; // QA of the on-the-fly calibration (recalibrateCentrality): mean _{|eta|<0.5} in data and MC @@ -229,7 +229,7 @@ struct BuilderModule { // sampled percentile vs the generated multiplicity (|eta| < 0.5) actually used to key the sampling, so // it can be visually compared against the input calibration (hGenMultEta05VsCentrality) to // check that the sampled distribution reproduces the expected P(centrality|genMult). This is a plain - // TH2D (not a TProfile): unlike the calibration QA above, it stores a distribution to look at, not a + // TH2 (not a TProfile): unlike the calibration QA above, it stores a distribution to look at, not a // mean to merge, so ordinary bin-content-sum merging across grid jobs is exactly what's wanted here. template void registerCandidateQAHistos(THistoRegistry& histos, const char* name) @@ -393,7 +393,7 @@ struct BuilderModule { return hist; } - TH1D* extractCentralityCalibration(int idx, const char* name, bool reverse = false) + TH1* extractCentralityCalibration(int idx, const char* name, bool reverse = false) { auto CalibMC = [&](TString const& estimator) { @@ -403,10 +403,10 @@ struct BuilderModule { std::vector epercentile_center(nCentBins); // Histograms - TH2D* h2dMultVsCent_Data = getHist(Form("hMultEta05VsCent%s_Data", estimator.Data())); - TH2D* h2dMultRecoVsMultGen_MC = getHist(Form("hMultEta05VsGenMult%s", estimator.Data())); + TH2* h2dMultVsCent_Data = getHist(Form("hMultEta05VsCent%s_Data", estimator.Data())); + TH2* h2dMultRecoVsMultGen_MC = getHist(Form("hMultEta05VsGenMult%s", estimator.Data())); if (!h2dMultVsCent_Data || !h2dMultRecoVsMultGen_MC) { - return static_cast(nullptr); + return static_cast(nullptr); } // QA of this on-the-fly calibration: mean _{|eta|<0.5} in data/MC per centrality class, @@ -416,7 +416,7 @@ struct BuilderModule { TProfile* hPVData = hCalibPVData[idx].get(); TProfile* hPVMC = hCalibPVMC[idx].get(); - TH1D* h1dCalib = h2dMultRecoVsMultGen_MC->ProjectionX(Form("h1d%s", estimator.Data()), 1, h2dMultRecoVsMultGen_MC->GetNbinsX()); + TH1* h1dCalib = h2dMultRecoVsMultGen_MC->ProjectionX(Form("h1d%s", estimator.Data()), 1, h2dMultRecoVsMultGen_MC->GetNbinsX()); h1dCalib->Reset(); h1dCalib->SetTitle(Form("%s calibration object", estimator.Data())); h1dCalib->GetXaxis()->SetTitle(Form("#it{N}_{%s, gen.}", estimator.Data())); @@ -438,7 +438,7 @@ struct BuilderModule { for (int i = 0; i < nCentBins; i++) { // Loop over centrality bins // start from the end (from the high multiplicity collisions) int irev = i; - TH1D* projData = h2dMultVsCent_Data->ProjectionY(Form("projData_%d", i), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev] + 1e-5), + TH1* projData = h2dMultVsCent_Data->ProjectionY(Form("projData_%d", i), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev] + 1e-5), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev + 1] - 1e-5)); double meanMult_Data = projData->GetMean(); @@ -448,7 +448,7 @@ struct BuilderModule { int endBinMc = startBinMc; for (int j = startBinMc - 1; j >= 1; j--) { // Loop over MC bins - TH1D* projMC = h2dMultRecoVsMultGen_MC->ProjectionY("", j, startBinMc); + TH1* projMC = h2dMultRecoVsMultGen_MC->ProjectionY("", j, startBinMc); int nEntries = projMC->Integral(); double meanMC = projMC->GetMean(); double ldiff = std::abs(meanMC - meanMult_Data); @@ -469,7 +469,7 @@ struct BuilderModule { endBinMc = 1; } - TH1D* projMC = h2dMultRecoVsMultGen_MC->ProjectionY(Form("projMC_%d", i), endBinMc, startBinMc); + TH1* projMC = h2dMultRecoVsMultGen_MC->ProjectionY(Form("projMC_%d", i), endBinMc, startBinMc); // Refill the per-class mean from the underlying (data/MC) multiplicity distributions, bin by // bin, so the TProfile accumulates real sum(w)/sum(wy)/sum(wy^2) rather than a precomputed mean. @@ -511,7 +511,7 @@ struct BuilderModule { for (int i = 0; i < nCentBins; i++) { // Loop over centrality bins // start from the end (from the low multiplicity collisions) int irev = nCentBins - i; - TH1D* projData = h2dMultVsCent_Data->ProjectionY(Form("projData_%d", i), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev - 1] + 1e-5), + TH1* projData = h2dMultVsCent_Data->ProjectionY(Form("projData_%d", i), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev - 1] + 1e-5), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev] - 1e-5)); double meanMult_Data = projData->GetMean(); @@ -521,7 +521,7 @@ struct BuilderModule { int endBinMc = h1dCalib->GetNbinsX(); for (int j = startBinMc + 1; j <= h1dCalib->GetNbinsX(); j++) { // Loop over MC bins - TH1D* projMC = h2dMultRecoVsMultGen_MC->ProjectionY("", startBinMc, j); + TH1* projMC = h2dMultRecoVsMultGen_MC->ProjectionY("", startBinMc, j); int nEntries = projMC->Integral(); double meanMC = projMC->GetMean(); double ldiff = std::abs(meanMC - meanMult_Data); @@ -542,7 +542,7 @@ struct BuilderModule { endBinMc = h2dMultRecoVsMultGen_MC->GetNbinsX(); } - TH1D* projMC = h2dMultRecoVsMultGen_MC->ProjectionY(Form("projMC_%d", i), startBinMc, endBinMc); + TH1* projMC = h2dMultRecoVsMultGen_MC->ProjectionY(Form("projMC_%d", i), startBinMc, endBinMc); // Refill the per-class mean from the underlying (data/MC) multiplicity distributions, bin by // bin, so the TProfile accumulates real sum(w)/sum(wy)/sum(wy^2) rather than a precomputed mean. @@ -586,7 +586,7 @@ struct BuilderModule { // Loads the calibration object(s) for a single estimator: either the class-averaged TH1D (statistical // assignment) or, in candidate-by-candidate mode, the raw joint TH2D used to sample P(centrality|genMult). - void loadEstimatorCalibration(int idx, const char* name, TH1D*& h1dOut) + void loadEstimatorCalibration(int idx, const char* name, TH1*& h1dOut) { if (!baseOpts.mEnabledTables[idx]) { return; @@ -595,10 +595,10 @@ struct BuilderModule { // x = reco centrality of the matched MC collision, y = generated multiplicity (|eta| < 0.5) // filled directly by the calibration-producing task (e.g. centralityQa.cxx); used as-is, no // mean-matching required since it is already a genuine joint distribution. - h2dCentVsGenMult[idx] = getHist(Form("hGenMultEta05VsCentrality%s", name)); + h2dCentVsGenMult[idx] = getHist(Form("hGenMultEta05VsCentrality%s", name)); return; } - h1dOut = baseOpts.recalibrateCentrality ? extractCentralityCalibration(idx, name, baseOpts.recalibrateMode) : getHist(Form("h1d%s", name)); + h1dOut = baseOpts.recalibrateCentrality ? extractCentralityCalibration(idx, name, baseOpts.recalibrateMode) : getHist(Form("h1d%s", name)); } template @@ -691,7 +691,7 @@ struct BuilderModule { const double nFT0M = nFT0A + nFT0C; const double nFDDM = nFDDA + nFDDC; - auto populateTable = [&](auto& table, TH1D* h1dMultCalib, TH2D* h2dCentCalib, double multiplicity, auto tableIndex) { + auto populateTable = [&](auto& table, TH1* h1dMultCalib, TH2* h2dCentCalib, double multiplicity, auto tableIndex) { double percentile = 105.0f; if (baseOpts.mEnabledTables[tableIndex]) { if (baseOpts.assignCentralityPerCandidate && h2dCentCalib) { @@ -699,7 +699,7 @@ struct BuilderModule { // y-bin (generated mult |eta|<0.5) matching this collision and draw from that 1-D distribution. fRandomSampler.SetSeed(computeSamplingSeed(mcCollisionCounter, tableIndex.value)); int yBin = h2dCentCalib->GetYaxis()->FindBin(nGenMultEta05); - std::unique_ptr pdf{h2dCentCalib->ProjectionX(Form("pdfCent_%d", tableIndex.value), yBin, yBin)}; + std::unique_ptr pdf{h2dCentCalib->ProjectionX(Form("pdfCent_%d", tableIndex.value), yBin, yBin)}; if (pdf->Integral() > 0) { percentile = pdf->GetRandom(&fRandomSampler); } From 9f30a5c78ebf5fdfc5cda5e5df1a9e854fb66cc3 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 19 Nov 2026 12:35:04 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGLF/Utils/mcCentralityModule.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Utils/mcCentralityModule.h b/PWGLF/Utils/mcCentralityModule.h index 9e937f4640c..8416daedf37 100644 --- a/PWGLF/Utils/mcCentralityModule.h +++ b/PWGLF/Utils/mcCentralityModule.h @@ -439,7 +439,7 @@ struct BuilderModule { // start from the end (from the high multiplicity collisions) int irev = i; TH1* projData = h2dMultVsCent_Data->ProjectionY(Form("projData_%d", i), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev] + 1e-5), - h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev + 1] - 1e-5)); + h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev + 1] - 1e-5)); double meanMult_Data = projData->GetMean(); @@ -512,7 +512,7 @@ struct BuilderModule { // start from the end (from the low multiplicity collisions) int irev = nCentBins - i; TH1* projData = h2dMultVsCent_Data->ProjectionY(Form("projData_%d", i), h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev - 1] + 1e-5), - h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev] - 1e-5)); + h2dMultVsCent_Data->GetXaxis()->FindBin(centralityBins[irev] - 1e-5)); double meanMult_Data = projData->GetMean();