From b7d3468fe2fe279efb253536edeffe71cbb2929c Mon Sep 17 00:00:00 2001 From: jokonig Date: Mon, 19 Oct 2026 15:13:54 +0200 Subject: [PATCH 1/3] [PWGEM] PhotonMeson: Add configurables for number of bins and axis range for inv. mass --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 6 ++++-- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 7 +++++-- PWGEM/PhotonMeson/Utils/NMHistograms.h | 12 +++++++++--- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 85c74cc14bb..22ee95e1bc3 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -99,6 +99,8 @@ struct Pi0EtaToGammaGamma { o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {o2::framework::VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; o2::framework::Configurable cfgSparseFullAxes{"cfgSparseFullAxes", false, "add event plane, occupancy and z-vertex axes to Pair/same/hs and Pair/mix/hs"}; + o2::framework::Configurable cfgNbinsMass{"cfgNbinsMass", 400, "number of bins for the mass axis in same and mixed events"}; + o2::framework::Configurable> cfgMassBinRange{"cfgMassBinRange", {0., 0.8}, "range for the mass-axis in GeV/c2"}; o2::framework::Configurable cfgAlphaMesonCut{"cfgAlphaMesonCut", 0, "flag for photon energy asymmetry distribution cut: 0: no cut, 1: cut specific value, 2: cut depending on pT"}; o2::framework::Configurable cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"}; @@ -428,9 +430,9 @@ struct Pi0EtaToGammaGamma { std::vector epBinsForHs(ep_bin_edges.begin(), ep_bin_edges.end()); std::vector vtxBinsForHs(zvtx_bin_edges.begin(), zvtx_bin_edges.end()); if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { - o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs); + o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "ee#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)}); } else { - o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs); + o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, false, "#gamma#gamma", cfgSparseFullAxes.value, occBinsForHs, epBinsForHs, vtxBinsForHs, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)}); } DefineEMEventCut(); DefinePCMCut(); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 351bb86db35..e8c2333ccd3 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -89,6 +89,9 @@ struct Pi0EtaToGammaGammaMC { o2::framework::Configurable fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"}; o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + o2::framework::Configurable cfgNbinsMass{"cfgNbinsMass", 400, "number of bins for the mass axis in same and mixed events"}; + o2::framework::Configurable> cfgMassBinRange{"cfgMassBinRange", {0., 0.8}, "range for the mass-axis in GeV/c2"}; + o2::framework::Configurable cfgAlphaMesonCut{"cfgAlphaMesonCut", 0, "flag for photon energy asymmetry distribution cut: 0: no cut, 1: cut specific value, 2: cut depending on pT"}; o2::framework::Configurable cfgAlphaMeson{"cfgAlphaMeson", 0.65, "photon energy asymmetry distribution parameter for specific value cut"}; o2::framework::Configurable cfgAlphaMesonA{"cfgAlphaMesonA", 0.65, "photon energy asymmetry distribution parameter A for pT dependent cut (A * tanh(B*pT))"}; @@ -276,9 +279,9 @@ struct Pi0EtaToGammaGammaMC { { o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { - o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "ee#gamma"); + o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "ee#gamma", false, {}, {}, {}, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)}); } else { - o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#gamma#gamma"); + o2::aod::pwgem::photonmeson::utils::nmhistogram::addNMHistograms(&fRegistry, true, "#gamma#gamma", false, {}, {}, {}, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)}); } DefineEMEventCut(); DefinePCMCut(); diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index 448e94c3007..494e6c43c3b 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -40,12 +40,15 @@ namespace o2::aod::pwgem::photonmeson::utils::nmhistogram /// \param occBins data only: occupancy bin edges /// \param epBins data only: event plane bin edges /// \param vtxBins data only: z-vertex bin edges -inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool isMC, +inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, + bool isMC, const char* pairname = "#gamma#gamma", bool sparseFullAxes = false, std::vector const& occBins = {0, 500, 1000, 2000, 3000, 5000, 10000}, std::vector const& epBins = {-o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0, o2::constants::math::PIQuarter, o2::constants::math::PIHalf}, - std::vector const& vtxBins = {-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10}) + std::vector const& vtxBins = {-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10}, + const int nBinsMass = 400, + const std::array massBinRange = {0., 0.8}) { // !!Don't change pt,eta,y binning. These binnings have to be consistent with binned data at skimming.!! std::vector ptbins; @@ -63,7 +66,10 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, bool is ptbins.emplace_back(1.0 * (i - 61) + 10.0); // from 10 to 20 GeV/c, every 1 GeV/c } const o2::framework::AxisSpec axis_pt{ptbins, Form("p_{T,%s} (GeV/c)", pairname)}; - const o2::framework::AxisSpec axis_mass{400, 0, 0.8, Form("m_{%s} (GeV/c^{2})", pairname)}; + const o2::framework::AxisSpec axis_mass{nBinsMass, massBinRange[0], massBinRange[1], Form("m_{%s} (GeV/c^{2})", pairname)}; + const o2::framework::AxisSpec axis_occ{occBins, "occupancy"}; + const o2::framework::AxisSpec axis_ep{epBins, "#Psi_{2} (rad)"}; + const o2::framework::AxisSpec axis_vtx{vtxBins, "Z_{vtx} (cm)"}; if (isMC) { fRegistry->add("Pair/Pi0/hs_Primary", "rec. true pi0", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt}, true); From 7473d20102f018e38cf35263fb08fc8d8d9f22b1 Mon Sep 17 00:00:00 2001 From: jokonig Date: Mon, 19 Oct 2026 15:50:22 +0200 Subject: [PATCH 2/3] fix shadowed observables by deleting obsolete definition --- PWGEM/PhotonMeson/Utils/NMHistograms.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index 494e6c43c3b..bff50548e9d 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -94,9 +94,6 @@ inline void addNMHistograms(o2::framework::HistogramRegistry* fRegistry, fRegistry->get(HIST("Generated/Eta/hPtY"))->SetYTitle("rapidity |y|"); } else { if (sparseFullAxes) { - const o2::framework::AxisSpec axis_occ{occBins, "occupancy"}; - const o2::framework::AxisSpec axis_ep{epBins, "#Psi_{2} (rad)"}; - const o2::framework::AxisSpec axis_vtx{vtxBins, "Z_{vtx} (cm)"}; fRegistry->add("Pair/same/hs", "diphoton", o2::framework::HistType::kTHnSparseD, {axis_mass, axis_pt, axis_ep, axis_occ, axis_vtx}, true); From 7ee612eb26942878967c30f8e199ef4e940903cf Mon Sep 17 00:00:00 2001 From: jokonig Date: Mon, 19 Oct 2026 20:51:13 +0200 Subject: [PATCH 3/3] add include for array --- PWGEM/PhotonMeson/Utils/NMHistograms.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index bff50548e9d..d7c87380417 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -29,6 +29,7 @@ #include #include +#include #include namespace o2::aod::pwgem::photonmeson::utils::nmhistogram