From 81cc8a7c7ecde8519c218b120ec37cb6c013a4de Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Tue, 24 Feb 2026 11:53:03 +0100 Subject: [PATCH 1/9] Add optional PCM material-budget weights in PCMPCM Add a V0 photon material-budget weight table (Omega MB weights) and join it in the PCMPCM pi0/eta workflow. The weights are applied only when the joined column is available, using compile-time guarded access. Introduce a configurable switch (runWithMBWeights) in MaterialBudgetWeights: - false: no CCDB query, write weight=1 - true: require CCDB histogram and abort if missing --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 12 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 17 ++- PWGEM/PhotonMeson/DataModel/gammaTables.h | 10 ++ .../PhotonMeson/TableProducer/CMakeLists.txt | 5 + .../TableProducer/materialBudgetWeights.cxx | 27 ++++ .../Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx | 6 +- .../Tasks/Pi0EtaToGammaGammaPCMPCM.cxx | 4 +- .../PhotonMeson/Utils/MaterialBudgetWeights.h | 115 ++++++++++++++++++ 8 files changed, 188 insertions(+), 8 deletions(-) create mode 100644 PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx create mode 100644 PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 0ff535f45dc..4be2745c867 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -238,7 +238,7 @@ struct Pi0EtaToGammaGamma { //--------------------------------------------------------------------------- // Preslices and partitions o2::framework::SliceCache cache; - o2::framework::PresliceOptional>> perCollision_pcm = o2::aod::v0photonkf::pmeventId; + o2::framework::PresliceOptional>> perCollision_pcm = o2::aod::v0photonkf::pmeventId; o2::framework::PresliceOptional> perCollision_emc = o2::aod::emccluster::pmeventId; o2::framework::PresliceOptional> perCollision_phos = o2::aod::phoscluster::pmeventId; o2::framework::PresliceOptional>> perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; @@ -911,6 +911,16 @@ struct Pi0EtaToGammaGamma { } fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), weight); + float wpair = weight; + + if constexpr (requires { g1.omegaMBWeight(); }) { + wpair *= g1.omegaMBWeight(); + } + if constexpr (requires { g2.omegaMBWeight(); }) { + wpair *= g2.omegaMBWeight(); + } + + fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), wpair); if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) { emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index a44ec614df0..6af4a4521c2 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -435,7 +435,7 @@ struct Pi0EtaToGammaGammaMC { } o2::framework::SliceCache cache; - o2::framework::PresliceOptional>> perCollision_pcm = o2::aod::v0photonkf::pmeventId; + o2::framework::PresliceOptional>> perCollision_pcm = o2::aod::v0photonkf::pmeventId; o2::framework::PresliceOptional> perCollision_emc = o2::aod::emccluster::pmeventId; o2::framework::PresliceOptional> perCollision_phos = o2::aod::phoscluster::pmeventId; o2::framework::PresliceOptional>> perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; @@ -700,6 +700,13 @@ struct Pi0EtaToGammaGammaMC { } if (alphaMeson > alphaCut) { continue; + float wpair = weight; + + if constexpr (requires { g1.omegaMBWeight(); }) { + wpair *= g1.omegaMBWeight(); + } + if constexpr (requires { g2.omegaMBWeight(); }) { + wpair *= g2.omegaMBWeight(); } if (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kEMCEMC) { @@ -711,9 +718,9 @@ struct Pi0EtaToGammaGammaMC { if (g1mc.globalIndex() == g2mc.globalIndex()) { if (o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(g1mc, mcparticles) == 111) - fRegistry.fill(HIST("Pair/Pi0/hs_FromSameGamma"), v12.M(), v12.Pt(), weight); + fRegistry.fill(HIST("Pair/Pi0/hs_FromSameGamma"), v12.M(), v12.Pt(), wpair); else if (o2::aod::pwgem::dilepton::utils::mcutil::getMotherPDGCode(g1mc, mcparticles) == 221) - fRegistry.fill(HIST("Pair/Eta/hs_FromSameGamma"), v12.M(), v12.Pt(), weight); + fRegistry.fill(HIST("Pair/Eta/hs_FromSameGamma"), v12.M(), v12.Pt(), wpair); continue; } @@ -722,13 +729,13 @@ struct Pi0EtaToGammaGammaMC { if (cfgRequireTrueAssociation && (pi0mc.emmceventId() != collision.emmceventId())) { continue; } - o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); + o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, pi0mc, mcparticles, mccollisions, f1fd_k0s_to_pi0, wpair); } else if (etaid > 0) { auto etamc = mcparticles.iteratorAt(etaid); if (cfgRequireTrueAssociation && (etamc.emmceventId() != collision.emmceventId())) { continue; } - o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); + o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, wpair); } } // end of pairing loop } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index ee3d89310fa..ccddbe98a04 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -719,6 +719,16 @@ DECLARE_SOA_TABLE(NonLinV0s, "AOD", "NONLINV0", //! table of non lin corrected v DECLARE_SOA_TABLE(NonLinEmcClusters, "AOD", "NONLINEMCCLUSTER", //! table of non lin corrected values for EMCal Photons (so far only E and pT) nonlin::CorrE, nonlin::CorrPt); //! +namespace v0photonMBweights +{ +DECLARE_SOA_COLUMN(OmegaMBWeight, omegaMBWeight, float); +} + +DECLARE_SOA_TABLE(V0PhotonOmegaMBWeights, "AOD", "V0PHOTONMBW", v0photonMBweights::OmegaMBWeight); // store MB weights. To be joined with V0PhotonsKF table at analysis level. + +using V0PhotonOmegaMBWeight = V0PhotonOmegaMBWeights::iterator; } // namespace o2::aod + + #endif // PWGEM_PHOTONMESON_DATAMODEL_GAMMATABLES_H_ diff --git a/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt b/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt index 5c265e57d96..99bccdf5c49 100644 --- a/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt +++ b/PWGEM/PhotonMeson/TableProducer/CMakeLists.txt @@ -75,3 +75,8 @@ o2physics_add_dpl_workflow(pm-qvector-dummy-otf SOURCES pmQvectorDummyOtf.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGEMPhotonMesonCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(material-budget-weights + SOURCES materialBudgetWeights.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::CCDB ROOT::Hist ROOT::Core + COMPONENT_NAME Analysis) diff --git a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx new file mode 100644 index 00000000000..12a0ea2e6d8 --- /dev/null +++ b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx @@ -0,0 +1,27 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \file MaterialBudgetWeights.h +/// +/// \brief This code produces a table to retrieve material budget weights. The table is to be join with V0PhotonKF +/// +/// \author Youssef El Mard (youssef.el.mard.bouziani@cern.ch) + + +#include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" +#include "Framework/runDataProcessing.h" + +using namespace o2::framework; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} \ No newline at end of file diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx index 62c57593fd0..bf28a8795a8 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx @@ -16,6 +16,8 @@ #include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" +#include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" + #include #include @@ -26,12 +28,14 @@ using namespace o2::aod; using namespace o2::framework; using namespace o2::aod::pwgem::photonmeson::photonpair; -using MyV0Photons = o2::soa::Filtered>; +using MyV0Photons = o2::soa::Filtered>; using MyMCV0Legs = soa::Join; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ + adaptAnalysisTask(cfgc), adaptAnalysisTask>(cfgc, TaskName{"pi0eta-to-gammagamma-mc-pcmpcm"}), }; } + diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx index 6272af75da6..8894b6f3ec8 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx @@ -16,6 +16,7 @@ #include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" +#include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" #include #include @@ -26,11 +27,12 @@ using namespace o2::aod; using namespace o2::framework; using namespace o2::aod::pwgem::photonmeson::photonpair; -using MyV0Photons = o2::soa::Filtered>; +using MyV0Photons = o2::soa::Filtered>; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ + adaptAnalysisTask(cfgc), adaptAnalysisTask>(cfgc, TaskName{"pi0eta-to-gammagamma-pcmpcm"}), }; } diff --git a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h new file mode 100644 index 00000000000..4873a162722 --- /dev/null +++ b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h @@ -0,0 +1,115 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \file materialBudgetWeights.cxx +/// +/// \brief This code produces a table to retrieve material budget weights. The table is to be join with V0PhotonKF +/// +/// \author Youssef El Mard (youssef.el.mard.bouziani@cern.ch) +/// + +#ifndef PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ +#define PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ + +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" + +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Logger.h" +#include +#include +#include + +#include +#include + +using namespace o2; +using namespace o2::soa; +using namespace o2::framework; + +using MyV0PhotonsMB = o2::soa::Join; +using MyV0PhotonMB = MyV0PhotonsMB::iterator; + +struct MaterialBudgetWeights { + Produces omegaMBWeight; + + Configurable ccdbUrl{"ccdbUrl", "http://ccdb-test.cern.ch:8080", "CCDB url"}; + Configurable mbWeightsPath{"mbWeightsPath", "Users/y/yelmard/MaterialBudget/OmegaMBWeights", "Path of the mb weights"}; + + o2::ccdb::CcdbApi ccdbApi; + TH1F* hOmegaMBFromCCDB = nullptr; + + void init(InitContext&) + { + // Load CCDB object only when the real process is enabled + if (!doprocessMC) { + LOG(info) << "MaterialBudgetWeights: dummy mode enabled -> no CCDB query, will write weight=1"; + return; + } + + ccdbApi.init(ccdbUrl.value); + std::map metadata; + LOG(info) << "MaterialBudgetWeights: loading Omega MB histogram from CCDB at path: " << mbWeightsPath.value; + + hOmegaMBFromCCDB = ccdbApi.retrieveFromTFileAny(mbWeightsPath, metadata, -1); + + if (!hOmegaMBFromCCDB) { + LOG(fatal) << "MaterialBudgetWeights: CCDB object is missing. Path=" << mbWeightsPath.value; + } + } + + float computeMBWeight(float v0Rxy) + { + if (!hOmegaMBFromCCDB) { + return 1.f; + } + + int binMBWeight = hOmegaMBFromCCDB->FindBin(v0Rxy); + if (binMBWeight < 1 || binMBWeight > hOmegaMBFromCCDB->GetNbinsX()) { + LOG(debug) << "MaterialBudgetWeights: v0Rxy out of histogram range, returning 1"; + return 1.f; + } + + return hOmegaMBFromCCDB->GetBinContent(binMBWeight); + } + + // real process (weights from CCDB) + void processMC(MyV0PhotonMB const& v0) + { + static bool once = false; + if (!once) { + LOG(info) << "MaterialBudgetWeights: standard process running"; + once = true; + } + if (!hOmegaMBFromCCDB) { // histogram not loaded => behave like dummy + omegaMBWeight(1.f); + return; + } + omegaMBWeight(computeMBWeight(v0.v0radius())); + } + + // dummy process (always weight = 1) + void processDummy(MyV0PhotonMB const&) + { + static bool once = false; + if (!once) { + LOG(info) << "MaterialBudgetWeights: processDummy running"; + once = true; + } + omegaMBWeight(1.f); + } + + PROCESS_SWITCH(MaterialBudgetWeights, processMC, "Fill MB weights from CCDB", false); + PROCESS_SWITCH(MaterialBudgetWeights, processDummy, "Fill dummy MB weights (=1)", true); +}; + +#endif // PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ \ No newline at end of file From d6ddbb568a31f6d4caf25fba70027a83256fde04 Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Tue, 24 Feb 2026 13:42:00 +0100 Subject: [PATCH 2/9] Apply formatting fixes --- PWGEM/PhotonMeson/DataModel/gammaTables.h | 4 +--- PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx | 4 ++-- PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx | 2 +- PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h | 8 +++++++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index ccddbe98a04..afb88c6694a 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -726,9 +726,7 @@ DECLARE_SOA_COLUMN(OmegaMBWeight, omegaMBWeight, float); DECLARE_SOA_TABLE(V0PhotonOmegaMBWeights, "AOD", "V0PHOTONMBW", v0photonMBweights::OmegaMBWeight); // store MB weights. To be joined with V0PhotonsKF table at analysis level. -using V0PhotonOmegaMBWeight = V0PhotonOmegaMBWeights::iterator; +using V0PhotonOmegaMBWeight = V0PhotonOmegaMBWeights::iterator; } // namespace o2::aod - - #endif // PWGEM_PHOTONMESON_DATAMODEL_GAMMATABLES_H_ diff --git a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx index 12a0ea2e6d8..9759d1ec5a1 100644 --- a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx +++ b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx @@ -15,8 +15,8 @@ /// /// \author Youssef El Mard (youssef.el.mard.bouziani@cern.ch) - #include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" + #include "Framework/runDataProcessing.h" using namespace o2::framework; @@ -24,4 +24,4 @@ using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx index 8894b6f3ec8..8a1c1c9992c 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx @@ -15,8 +15,8 @@ #include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include #include diff --git a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h index 4873a162722..26df5c126fd 100644 --- a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h @@ -19,6 +19,9 @@ #ifndef PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ #define PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ +#include +#include + #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "Framework/ASoAHelpers.h" @@ -29,9 +32,12 @@ #include #include +<<<<<<< HEAD #include #include +======= +>>>>>>> 947616059 (Apply formatting fixes) using namespace o2; using namespace o2::soa; using namespace o2::framework; @@ -112,4 +118,4 @@ struct MaterialBudgetWeights { PROCESS_SWITCH(MaterialBudgetWeights, processDummy, "Fill dummy MB weights (=1)", true); }; -#endif // PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ \ No newline at end of file +#endif // PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ From 96aa676aed5cab5c6fa801726255dc173168fdca Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Tue, 24 Feb 2026 14:07:55 +0100 Subject: [PATCH 3/9] Apply clang-format include ordering --- PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h index 26df5c126fd..d639e8e9592 100644 --- a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h @@ -32,12 +32,9 @@ #include #include -<<<<<<< HEAD #include #include -======= ->>>>>>> 947616059 (Apply formatting fixes) using namespace o2; using namespace o2::soa; using namespace o2::framework; From 8b00868792efacc6682bcb7a5cc8561aea80a323 Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Wed, 11 Mar 2026 16:35:52 +0100 Subject: [PATCH 4/9] Apply clang-format --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 6 +++--- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 8 ++++---- PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx | 4 +--- PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h | 5 +---- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 4be2745c867..dc3e8f0c529 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -851,8 +851,8 @@ struct Pi0EtaToGammaGamma { used_dileptonIds_per_col.emplace_back(tuple_tmp_id2); } ndiphoton++; - } // end of dielectron loop - } // end of g1 loop + } // end of dielectron loop + } // end of g1 loop } else { // PCM-PCM, EMC-EMC, PHOS-PHOS, PCM-EMC and PCM-PHOS. auto photons1_per_collision = photons1.sliceByCached(TDetectorTag1::perCollision(), collision.globalIndex(), cache); auto photons2_per_collision = photons2.sliceByCached(TDetectorTag2::perCollision(), collision.globalIndex(), cache); @@ -932,7 +932,7 @@ struct Pi0EtaToGammaGamma { } ndiphoton++; } // end of pairing loop - } // end of pairing in same event + } // end of pairing in same event used_photonIds_per_col.clear(); used_photonIds_per_col.shrink_to_fit(); diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 6af4a4521c2..8f4b33b67aa 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -813,8 +813,8 @@ struct Pi0EtaToGammaGammaMC { } o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); } - } // end of dielectron loop - } // end of pcm loop + } // end of dielectron loop + } // end of pcm loop } else { // PCM-EMC, PCM-PHOS. // TODO: implement proper functionality if we ever want to run this in Pb-Pb auto photons1_per_collision = photons1.sliceByCached(TDetectorTag1::perCollision(), collision.globalIndex(), cache); @@ -861,8 +861,8 @@ struct Pi0EtaToGammaGammaMC { // o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); // } } // end of pairing loop - } // end of pairing in same event - } // end of collision loop + } // end of pairing in same event + } // end of collision loop } template diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx index bf28a8795a8..9b5b6897098 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx @@ -15,9 +15,8 @@ #include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" - +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include #include @@ -38,4 +37,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) adaptAnalysisTask>(cfgc, TaskName{"pi0eta-to-gammagamma-mc-pcmpcm"}), }; } - diff --git a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h index d639e8e9592..90afde51dc8 100644 --- a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h @@ -19,9 +19,6 @@ #ifndef PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ #define PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ -#include -#include - #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "Framework/ASoAHelpers.h" @@ -93,7 +90,7 @@ struct MaterialBudgetWeights { LOG(info) << "MaterialBudgetWeights: standard process running"; once = true; } - if (!hOmegaMBFromCCDB) { // histogram not loaded => behave like dummy + if (!hOmegaMBFromCCDB) { // histogram not loaded => behave like dummy omegaMBWeight(1.f); return; } From 9a42fad100c9a01e4896f774ec024ddfea2e0060 Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Wed, 11 Mar 2026 17:20:07 +0100 Subject: [PATCH 5/9] Resolve rebase conflict in Pi0EtaToGammaGamma.h --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index dc3e8f0c529..4be2745c867 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -851,8 +851,8 @@ struct Pi0EtaToGammaGamma { used_dileptonIds_per_col.emplace_back(tuple_tmp_id2); } ndiphoton++; - } // end of dielectron loop - } // end of g1 loop + } // end of dielectron loop + } // end of g1 loop } else { // PCM-PCM, EMC-EMC, PHOS-PHOS, PCM-EMC and PCM-PHOS. auto photons1_per_collision = photons1.sliceByCached(TDetectorTag1::perCollision(), collision.globalIndex(), cache); auto photons2_per_collision = photons2.sliceByCached(TDetectorTag2::perCollision(), collision.globalIndex(), cache); @@ -932,7 +932,7 @@ struct Pi0EtaToGammaGamma { } ndiphoton++; } // end of pairing loop - } // end of pairing in same event + } // end of pairing in same event used_photonIds_per_col.clear(); used_photonIds_per_col.shrink_to_fit(); From b264ddc78a8f0eca0c7a4ab9043cb36f94cff7f0 Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Wed, 11 Mar 2026 17:58:07 +0100 Subject: [PATCH 6/9] Resolve remaining rebase conflicts in Pi0EtaToGammaGamma headers --- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 1 - PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 4be2745c867..1eb74391520 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -910,7 +910,6 @@ struct Pi0EtaToGammaGamma { continue; } - fRegistry.fill(HIST("Pair/same/hs"), v12.M(), v12.Pt(), weight); float wpair = weight; if constexpr (requires { g1.omegaMBWeight(); }) { diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 8f4b33b67aa..442cf9d13b6 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -700,6 +700,8 @@ struct Pi0EtaToGammaGammaMC { } if (alphaMeson > alphaCut) { continue; + } + float wpair = weight; if constexpr (requires { g1.omegaMBWeight(); }) { @@ -813,8 +815,8 @@ struct Pi0EtaToGammaGammaMC { } o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, veeg, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); } - } // end of dielectron loop - } // end of pcm loop + } // end of dielectron loop + } // end of pcm loop } else { // PCM-EMC, PCM-PHOS. // TODO: implement proper functionality if we ever want to run this in Pb-Pb auto photons1_per_collision = photons1.sliceByCached(TDetectorTag1::perCollision(), collision.globalIndex(), cache); @@ -861,8 +863,8 @@ struct Pi0EtaToGammaGammaMC { // o2::aod::pwgem::photonmeson::utils::nmhistogram::fillTruePairInfo(&fRegistry, v12, etamc, mcparticles, mccollisions, f1fd_k0s_to_pi0, weight); // } } // end of pairing loop - } // end of pairing in same event - } // end of collision loop + } // end of pairing in same event + } // end of collision loop } template From 0b26ccb686fc40db4d9b09d14628d4c81ceeb06a Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Wed, 11 Mar 2026 20:24:39 +0100 Subject: [PATCH 7/9] Move MaterialBudgetWeights header to Core and update includes --- PWGEM/PhotonMeson/{Utils => Core}/MaterialBudgetWeights.h | 6 +++--- PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx | 2 +- PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx | 2 +- PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename PWGEM/PhotonMeson/{Utils => Core}/MaterialBudgetWeights.h (95%) diff --git a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h similarity index 95% rename from PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h rename to PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h index 90afde51dc8..41f4169f3bb 100644 --- a/PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h @@ -16,8 +16,8 @@ /// \author Youssef El Mard (youssef.el.mard.bouziani@cern.ch) /// -#ifndef PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ -#define PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ +#ifndef PWGEM_PHOTONMESON_CORE_MATERIALBUDGETWEIGHTS_H_ +#define PWGEM_PHOTONMESON_CORE_MATERIALBUDGETWEIGHTS_H_ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -112,4 +112,4 @@ struct MaterialBudgetWeights { PROCESS_SWITCH(MaterialBudgetWeights, processDummy, "Fill dummy MB weights (=1)", true); }; -#endif // PWGEM_PHOTONMESON_UTILS_MATERIALBUDGETWEIGHTS_H_ +#endif // PWGEM_PHOTONMESON_CORE_MATERIALBUDGETWEIGHTS_H_ diff --git a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx index 9759d1ec5a1..6d235b0db0c 100644 --- a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx +++ b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx @@ -15,7 +15,7 @@ /// /// \author Youssef El Mard (youssef.el.mard.bouziani@cern.ch) -#include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" +#include "PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h" #include "Framework/runDataProcessing.h" diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx index 9b5b6897098..8f655910ad3 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx @@ -13,9 +13,9 @@ /// \brief This code loops over photons and makes pairs for neutral mesons analyses in MC for PCM-PCM. /// \author D. Sekihata, daiki.sekihata@cern.ch +#include "PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h" #include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx index 8a1c1c9992c..07b50d7801e 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx @@ -13,9 +13,9 @@ /// \brief This code loops over photons and makes pairs for neutral mesons analyses for PCM-PCM. /// \author D. Sekihata, daiki.sekihata@cern.ch +#include "PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h" #include "PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/MaterialBudgetWeights.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include From 145ad269b91f7083867f3da9de70c22404993cc1 Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Wed, 11 Mar 2026 20:32:51 +0100 Subject: [PATCH 8/9] Keep o2::aod::V0PhotonsKFPrefilterBitDerived in Pi0EtaToGammaGammaMCPMCPMC --- PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx index 8f655910ad3..6820d86a924 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx @@ -27,7 +27,7 @@ using namespace o2::aod; using namespace o2::framework; using namespace o2::aod::pwgem::photonmeson::photonpair; -using MyV0Photons = o2::soa::Filtered>; +using MyV0Photons = o2::soa::Filtered>; using MyMCV0Legs = soa::Join; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 2978846d34c1a72b4b8ffd677ae020e15085fd90 Mon Sep 17 00:00:00 2001 From: Youssef El Mard Bouziani Date: Thu, 12 Mar 2026 11:25:40 +0100 Subject: [PATCH 9/9] Remove adaptAnalysisTask(cfgc) lines in both Pi0EtaToGammaGammaPCMPCM tasks --- PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx | 1 - PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx | 1 - 2 files changed, 2 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx index 6820d86a924..9ec33da1389 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaMCPCMPCM.cxx @@ -33,7 +33,6 @@ using MyMCV0Legs = soa::Join; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), adaptAnalysisTask>(cfgc, TaskName{"pi0eta-to-gammagamma-mc-pcmpcm"}), }; } diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx index 07b50d7801e..a19c2ac5be0 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMPCM.cxx @@ -32,7 +32,6 @@ using MyV0Photons = o2::soa::Filtered(cfgc), adaptAnalysisTask>(cfgc, TaskName{"pi0eta-to-gammagamma-pcmpcm"}), }; }