From 9312ae71689f2bcc9f9905725a45ea6e292a3a30 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Wed, 4 Nov 2026 15:27:52 +0100 Subject: [PATCH 1/5] [PWGEM] PhotonMeson: merge EventHistograms into EMPhotonEventCut Move the event QA histograms from Utils/EventHistograms.h into EMPhotonEventCut so the histograms use the cut's actual settings. EventHistograms.h is removed; all users now call the member functions addEventHistograms(), fillEventInfo<0|1>() and fillAccepted(). EMPhotonEventCut: - Add track and FT0C occupancy cuts (SetTrackOccupancyRange, SetFT0COccupancyRange), applied in IsSelected(). Default is no cut. Skipped at compile time if the event table has no occupancy columns. - Add an optional Q vector cut (SetRequireGoodQvec, SetQvecDetectors, SetQvecHarmonic, SetMaxQvec). Off by default and skipped at compile time if the event table has no Q vector columns. - hCollisionCounter: fill the occupancy bins (10, 11), add a "good Q vector" bin (14), move "accepted" to bin 15. The Z vertex bin now uses the configured range instead of a fixed |z| < 10 cm. - Fix: all tasks filled "accepted" at bin 12, which is the "EMC MB Readout" bin. New Utils/EventUtilities.h (namespace o2::aod::pwgem::pm::utils::event) with the QvecEstimator/Harmonics enums, getQvec(), isQvecGood() and compile-time checks for Q vector and occupancy columns. Tasks: - Pass the occupancy configurables to the event cut and remove the duplicated manual occupancy checks. Collision Filters are kept. - taskPi0FlowEMC, taskPhotonFlow, taskFlowReso: remove the local Q vector enums, getQvec switch, isQvecGood and getAllQvec, and enable the Q vector cut through the event cut. processPCMMixed in taskPi0FlowEMC now also applies the Q vector check, like the other mixed-event processes. - taskFlowReso: cfgTrackOccupancyMin/Max are now applied (they were defined but unused). - Call DefineEMEventCut() before booking the histograms in Pi0EtaToGammaGamma(MC).h and TaggingPi0(MC).h. - calibTaskEmc: remove the unused Q vector and harmonics enums. --- PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx | 45 ++++ PWGEM/PhotonMeson/Core/EMPhotonEventCut.h | 225 ++++++++++++++++++ PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h | 18 +- PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h | 21 +- PWGEM/PhotonMeson/Core/TaggingPi0.h | 18 +- PWGEM/PhotonMeson/Core/TaggingPi0MC.h | 25 +- .../TableProducer/photonconversionbuilder.h | 15 +- PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx | 49 +--- PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx | 18 +- PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx | 21 +- PWGEM/PhotonMeson/Tasks/emcalMcTask.cxx | 15 +- PWGEM/PhotonMeson/Tasks/emcalPhotonMcTask.cxx | 15 +- PWGEM/PhotonMeson/Tasks/emcalQC.cxx | 14 +- PWGEM/PhotonMeson/Tasks/pairQcTask.cxx | 14 +- PWGEM/PhotonMeson/Tasks/photonResoTask.cxx | 15 +- PWGEM/PhotonMeson/Tasks/photonhbt.cxx | 19 +- PWGEM/PhotonMeson/Tasks/taskFlowReso.cxx | 158 +----------- PWGEM/PhotonMeson/Tasks/taskPhotonFlow.cxx | 157 +----------- PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx | 177 +------------- PWGEM/PhotonMeson/Tasks/twoPhotonMcTask.cxx | 15 +- PWGEM/PhotonMeson/Utils/EventHistograms.h | 114 --------- PWGEM/PhotonMeson/Utils/EventUtilities.h | 178 ++++++++++++++ 22 files changed, 593 insertions(+), 753 deletions(-) delete mode 100644 PWGEM/PhotonMeson/Utils/EventHistograms.h create mode 100644 PWGEM/PhotonMeson/Utils/EventUtilities.h diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx index f7eaea2fd44..97791f3d4d9 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx @@ -19,6 +19,9 @@ #include +#include +#include + ClassImp(EMPhotonEventCut); void EMPhotonEventCut::SetRequireSel8(bool flag) @@ -134,3 +137,45 @@ void EMPhotonEventCut::SetRequireEMCHardwareTriggered(bool flag) mRequireEMCHardwareTriggered = flag; LOG(info) << "EM Photon Event Cut, require the EMC to be triggered by requiring kEMC7 or kDMC7: " << mRequireEMCHardwareTriggered; } + +void EMPhotonEventCut::SetTrackOccupancyRange(float min, float max) +{ + mMinTrackOcc = min; + mMaxTrackOcc = max; + LOG(info) << "EM Photon Event Cut, set track occupancy range: " << mMinTrackOcc << " - " << mMaxTrackOcc; +} + +void EMPhotonEventCut::SetFT0COccupancyRange(float min, float max) +{ + mMinFT0COcc = min; + mMaxFT0COcc = max; + LOG(info) << "EM Photon Event Cut, set FT0C occupancy range: " << mMinFT0COcc << " - " << mMaxFT0COcc; +} + +void EMPhotonEventCut::SetRequireGoodQvec(bool flag) +{ + mRequireGoodQvec = flag; + LOG(info) << "EM Photon Event Cut, require good Q vectors (only applied if the collision table has Q vectors): " << mRequireGoodQvec; +} + +void EMPhotonEventCut::SetQvecHarmonic(int harmonic) +{ + mQvecHarmonic = harmonic; + LOG(info) << "EM Photon Event Cut, set Q vector harmonic: " << mQvecHarmonic; +} + +void EMPhotonEventCut::SetMaxQvec(float max) +{ + mMaxQvec = max; + LOG(info) << "EM Photon Event Cut, set max. absolute Q vector component: " << mMaxQvec; +} + +void EMPhotonEventCut::SetQvecDetectors(std::vector const& detectors) +{ + mQvecDetectors = detectors; + std::string list; + for (const auto& detector : mQvecDetectors) { + list += std::to_string(detector) + " "; + } + LOG(info) << "EM Photon Event Cut, set Q vector detectors for Q vector cut: " << list; +} diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h index 26b1f2c9490..9c03e498789 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h @@ -16,10 +16,26 @@ #ifndef PWGEM_PHOTONMESON_CORE_EMPHOTONEVENTCUT_H_ #define PWGEM_PHOTONMESON_CORE_EMPHOTONEVENTCUT_H_ +#include "PWGEM/PhotonMeson/Utils/EventUtilities.h" + #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include #include +#include +#include class EMPhotonEventCut { @@ -47,9 +63,31 @@ class EMPhotonEventCut kIsGoodITSLayersAll, kEMCReadoutInMB, kEMCHardwareTriggered, + kTrackOccupancy, + kFT0COccupancy, + kGoodQvec, kNCuts }; + /// bins of the Event/{before,after}/hCollisionCounter histogram + enum class EventCounterBin : uint8_t { + kAll = 1, + kNoTFBorder = 2, + kNoITSROFBorder = 3, + kNoSameBunchPileup = 4, + kVertexITSTPC = 5, + kGoodZVtxFT0vsPV = 6, + kFT0AND = 7, + kSel8 = 8, + kZVtx = 9, + kTrackOccupancy = 10, + kFT0COccupancy = 11, + kEMCMBReadout = 12, + kEMCL0Trigger = 13, + kGoodQvec = 14, + kAccepted = 15 + }; + [[nodiscard]] const std::string& getName() const { return name; } [[nodiscard]] const std::string& getTitle() const { return title; } @@ -113,6 +151,15 @@ class EMPhotonEventCut if (mRequireEMCHardwareTriggered && !IsSelected(collision, EMPhotonEventCuts::kEMCHardwareTriggered)) { return false; } + if (!IsSelected(collision, EMPhotonEventCuts::kTrackOccupancy)) { + return false; + } + if (!IsSelected(collision, EMPhotonEventCuts::kFT0COccupancy)) { + return false; + } + if (mRequireGoodQvec && !IsSelected(collision, EMPhotonEventCuts::kGoodQvec)) { + return false; + } return true; } @@ -177,11 +224,153 @@ class EMPhotonEventCut case EMPhotonEventCuts::kEMCHardwareTriggered: return (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7)); + case EMPhotonEventCuts::kTrackOccupancy: + if constexpr (o2::aod::pwgem::pm::utils::event::HasTrackOccupancy) { + return mMinTrackOcc <= collision.trackOccupancyInTimeRange() && collision.trackOccupancyInTimeRange() < mMaxTrackOcc; + } else { + // the event table has no track occupancy, the cut can not be applied + warnOccupancyNotAvailable(isTrackOccupancyCutSet(), "track"); + return true; + } + + case EMPhotonEventCuts::kFT0COccupancy: + if constexpr (o2::aod::pwgem::pm::utils::event::HasFT0COccupancy) { + return mMinFT0COcc <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < mMaxFT0COcc; + } else { + // the event table has no FT0C occupancy, the cut can not be applied + warnOccupancyNotAvailable(isFT0COccupancyCutSet(), "FT0C"); + return true; + } + + case EMPhotonEventCuts::kGoodQvec: + if constexpr (o2::aod::pwgem::pm::utils::event::HasQvec) { + return o2::aod::pwgem::pm::utils::event::isQvecGood(collision, mQvecDetectors, mQvecHarmonic, mMaxQvec); + } else { + // the event table has no Q vectors, the cut can not be applied + if (mRequireGoodQvec && !mWarnedNoQvec) { + LOG(warning) << "EM Photon Event Cut: Q vector cut requested, but the collision table has no Q vectors. Q vector cut is not applied!"; + mWarnedNoQvec = true; + } + return true; + } + default: return true; } } + /// \brief add the event QA histograms to the given registry. Call this after all cut values are set! + /// \param fRegistry pointer to the histogram registry of the task + /// \param useWeight whether the histograms should store weights (Sumw2) + void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool useWeight = false) const + { + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::HistType::kTH1D, {{static_cast(EventCounterBin::kAccepted), 0.5, static_cast(EventCounterBin::kAccepted) + 0.5f}}, useWeight); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kAll), "all"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kNoTFBorder), "No TF border"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kNoITSROFBorder), "No ITS ROF border"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kNoSameBunchPileup), "No Same Bunch Pileup"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kVertexITSTPC), "Is Vertex ITSTPC"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kGoodZVtxFT0vsPV), "Is Good Zvtx FT0vsPV"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kFT0AND), "FT0AND"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kSel8), "sel8"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kZVtx), std::format("{:g} < Z_{{vtx}} < {:g} cm", mMinZvtx, mMaxZvtx).c_str()); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kTrackOccupancy), "track occupancy"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kFT0COccupancy), "FT0C occupancy"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kEMCMBReadout), "EMC MB Readout"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kEMCL0Trigger), "EMC L0 Triggered"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kGoodQvec), "good Q vector"); + hCollisionCounter->GetXaxis()->SetBinLabel(static_cast(EventCounterBin::kAccepted), "accepted"); + + fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1D, {{220, -11, +11}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::HistType::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::HistType::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::HistType::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, useWeight); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::HistType::kTH1F, {{100, 0., 100.}}, useWeight); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::HistType::kTH1F, {{100, 0., 100.}}, useWeight); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::HistType::kTH1F, {{100, 0., 100.}}, useWeight); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::HistType::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::HistType::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::HistType::kTH2F, {{60, 0, 60000}, {500, 0, 10000}}, useWeight); + fRegistry->addClone("Event/before/", "Event/after/"); + } + + /// \brief fill the event QA histograms + /// \tparam ev_id 0 for before the event selection, 1 for after the event selection + /// \param fRegistry pointer to the histogram registry of the task + /// \param collision collision to fill + /// \param weight weight of the collision + template + void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, float weight = 1.f) const + { + static constexpr std::array EventTypes = {"before/", "after/"}; + auto fillCounter = [&](EventCounterBin bin) { + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), static_cast(bin), weight); + }; + + fillCounter(EventCounterBin::kAll); + if (IsSelected(collision, EMPhotonEventCuts::kNoTFB)) { + fillCounter(EventCounterBin::kNoTFBorder); + } + if (IsSelected(collision, EMPhotonEventCuts::kNoITSROFB)) { + fillCounter(EventCounterBin::kNoITSROFBorder); + } + if (IsSelected(collision, EMPhotonEventCuts::kNoSameBunchPileup)) { + fillCounter(EventCounterBin::kNoSameBunchPileup); + } + if (IsSelected(collision, EMPhotonEventCuts::kIsVertexITSTPC)) { + fillCounter(EventCounterBin::kVertexITSTPC); + } + if (IsSelected(collision, EMPhotonEventCuts::kIsGoodZvtxFT0vsPV)) { + fillCounter(EventCounterBin::kGoodZVtxFT0vsPV); + } + if (IsSelected(collision, EMPhotonEventCuts::kFT0AND)) { + fillCounter(EventCounterBin::kFT0AND); + } + if (IsSelected(collision, EMPhotonEventCuts::kSel8)) { + fillCounter(EventCounterBin::kSel8); + } + if (IsSelected(collision, EMPhotonEventCuts::kZvtx)) { + fillCounter(EventCounterBin::kZVtx); + } + if (IsSelected(collision, EMPhotonEventCuts::kTrackOccupancy)) { + fillCounter(EventCounterBin::kTrackOccupancy); + } + if (IsSelected(collision, EMPhotonEventCuts::kFT0COccupancy)) { + fillCounter(EventCounterBin::kFT0COccupancy); + } + if (IsSelected(collision, EMPhotonEventCuts::kEMCReadoutInMB)) { + fillCounter(EventCounterBin::kEMCMBReadout); + } + if (IsSelected(collision, EMPhotonEventCuts::kEMCHardwareTriggered)) { + fillCounter(EventCounterBin::kEMCL0Trigger); + } + if constexpr (o2::aod::pwgem::pm::utils::event::HasQvec) { + if (IsSelected(collision, EMPhotonEventCuts::kGoodQvec)) { + fillCounter(EventCounterBin::kGoodQvec); + } + } + + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPVeta1"), collision.multNTracksPVeta1(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0"), collision.multFT0A(), collision.multFT0C(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0A"), collision.centFT0A(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0C"), collision.centFT0C(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0M"), collision.centFT0M(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0CvsMultNTracksPV"), collision.centFT0C(), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsOccupancy"), collision.multFT0C(), collision.trackOccupancyInTimeRange(), weight); + } + + /// \brief fill the "accepted" bin of the before and after collision counter + /// \param fRegistry pointer to the histogram registry of the task + /// \param weight weight of the collision + void fillAccepted(o2::framework::HistogramRegistry* fRegistry, float weight = 1.f) const + { + fRegistry->fill(HIST("Event/before/hCollisionCounter"), static_cast(EventCounterBin::kAccepted), weight); + fRegistry->fill(HIST("Event/after/hCollisionCounter"), static_cast(EventCounterBin::kAccepted), weight); + } + // Setters void SetRequireSel8(bool flag); void SetRequireFT0AND(bool flag); @@ -202,8 +391,32 @@ class EMPhotonEventCut void SetRequireGoodITSLayersAll(bool flag); void SetRequireEMCReadoutInMB(bool flag); void SetRequireEMCHardwareTriggered(bool flag); + void SetTrackOccupancyRange(float min, float max); + void SetFT0COccupancyRange(float min, float max); + void SetRequireGoodQvec(bool flag); + void SetQvecHarmonic(int harmonic); + void SetMaxQvec(float max); + void SetQvecDetectors(std::vector const& detectors); private: + [[nodiscard]] bool isTrackOccupancyCutSet() const + { + return mMinTrackOcc != std::numeric_limits::lowest() || mMaxTrackOcc != std::numeric_limits::max(); + } + + [[nodiscard]] bool isFT0COccupancyCutSet() const + { + return mMinFT0COcc != std::numeric_limits::lowest() || mMaxFT0COcc != std::numeric_limits::max(); + } + + void warnOccupancyNotAvailable(bool cutSet, const char* estimator) const + { + if (cutSet && !mWarnedNoOccupancy) { + LOG(warning) << "EM Photon Event Cut: " << estimator << " occupancy cut set, but the collision table has no " << estimator << " occupancy. Occupancy cut is not applied!"; + mWarnedNoOccupancy = true; + } + } + std::string name; std::string title; bool mRequireSel8{false}; @@ -225,6 +438,18 @@ class EMPhotonEventCut bool mRequireGoodITSLayersAll{false}; bool mRequireEMCReadoutInMB{false}; bool mRequireEMCHardwareTriggered{false}; + + // occupancy cuts, by default no cut is applied + float mMinTrackOcc{std::numeric_limits::lowest()}, mMaxTrackOcc{std::numeric_limits::max()}; + float mMinFT0COcc{std::numeric_limits::lowest()}, mMaxFT0COcc{std::numeric_limits::max()}; + + // Q vector cut, off by default and only applied if the collision table has Q vectors + bool mRequireGoodQvec{false}; + int mQvecHarmonic{o2::aod::pwgem::pm::utils::event::kElliptic}; + float mMaxQvec{20.f}; + std::vector mQvecDetectors; + mutable bool mWarnedNoQvec{false}; + mutable bool mWarnedNoOccupancy{false}; }; #endif // PWGEM_PHOTONMESON_CORE_EMPHOTONEVENTCUT_H_ diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 22ee95e1bc3..20fdfc1bb59 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -26,7 +26,6 @@ #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EMPhoton.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/NMHistograms.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" // Dilepton headers @@ -282,8 +281,8 @@ struct Pi0EtaToGammaGamma { o2::framework::PresliceOptional perEMCClusterMT = o2::aod::mintm::minClusterId; o2::framework::PresliceOptional perEMCClusterMS = o2::aod::mintm::minClusterId; - o2::framework::Partition>> positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt&& nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; - o2::framework::Partition>> electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; + o2::framework::Partition>> positrons = o2::aod::emprimaryelectron::sign > static_cast(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt&& nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; + o2::framework::Partition>> electrons = o2::aod::emprimaryelectron::sign < static_cast(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::photonmeson::utils::EMPhoton>* emh1 = nullptr; o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::photonmeson::utils::EMPhoton>* emh2 = nullptr; @@ -425,7 +424,8 @@ struct Pi0EtaToGammaGamma { emh1 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::photonmeson::utils::EMPhoton>(ndepth); emh2 = new o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::photonmeson::utils::EMPhoton>(ndepth); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + DefineEMEventCut(); + fEMEventCut.addEventHistograms(&fRegistry); std::vector occBinsForHs(occ_bin_edges.begin(), occ_bin_edges.end()); std::vector epBinsForHs(ep_bin_edges.begin(), ep_bin_edges.end()); std::vector vtxBinsForHs(zvtx_bin_edges.begin(), zvtx_bin_edges.end()); @@ -434,7 +434,6 @@ struct Pi0EtaToGammaGamma { } else { 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(); mPhotonClassSelA = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassA); @@ -518,6 +517,8 @@ struct Pi0EtaToGammaGamma { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void DefinePCMCut() @@ -769,13 +770,12 @@ struct Pi0EtaToGammaGamma { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, weight); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, weight); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, weight); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, weight); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, weight); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, weight); + fEMEventCut.fillAccepted(&fRegistry, weight); int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1; if (zbin < 0) { diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index e8c2333ccd3..989196fd278 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -25,7 +25,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/NMHistograms.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" @@ -59,7 +58,6 @@ #include #include #include -#include #include #include @@ -277,13 +275,13 @@ struct Pi0EtaToGammaGammaMC { void init(o2::framework::InitContext&) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + DefineEMEventCut(); + fEMEventCut.addEventHistograms(&fRegistry); if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { 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", false, {}, {}, {}, cfgNbinsMass, {cfgMassBinRange->at(0), cfgMassBinRange->at(1)}); } - DefineEMEventCut(); DefinePCMCut(); mPhotonClassSelA = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassA); mPhotonClassSelB = o2::aod::pwgem::photonmeson::utils::pairutil::buildV0PhotonClassSelection(photonclassB); @@ -291,7 +289,7 @@ struct Pi0EtaToGammaGammaMC { DefineEMCCut(); DefinePHOSCut(); - f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", TString(fd_k0s_to_pi0), 0.f, 100.f); + f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", fd_k0s_to_pi0.value.c_str(), 0.f, 100.f); fRegistry.add("Event/hNrecPerMCCollision", "Nrec per mc collision;N_{rec} collisions per MC collision", o2::framework::HistType::kTH1F, {{21, -0.5f, 20.5f}}, false); if (cfgGGContaCheck) { @@ -360,6 +358,8 @@ struct Pi0EtaToGammaGammaMC { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void DefinePCMCut() @@ -482,8 +482,8 @@ struct Pi0EtaToGammaGammaMC { o2::framework::PresliceOptional perEMCClusterMT = o2::aod::mintm::minClusterId; o2::framework::PresliceOptional perEMCClusterMS = o2::aod::mintm::minClusterId; - o2::framework::Partition>> positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt&& nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; - o2::framework::Partition>> electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; + o2::framework::Partition>> positrons = o2::aod::emprimaryelectron::sign > static_cast(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt&& nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; + o2::framework::Partition>> electrons = o2::aod::emprimaryelectron::sign < static_cast(0) && dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track; //--------------------------------------------------------------------------- // In the following are tags defined which help to select the correct preslice and cuts @@ -631,13 +631,12 @@ struct Pi0EtaToGammaGammaMC { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, weight); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, weight); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, weight); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, weight); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, weight); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, weight); + fEMEventCut.fillAccepted(&fRegistry, weight); int photonid1 = -1, photonid2 = -1, pi0id = -1, etaid = -1; if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPCM || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPHOSPHOS || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kEMCEMC || pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // same kinds pairing and PCM-EMC diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0.h b/PWGEM/PhotonMeson/Core/TaggingPi0.h index 64080cd2a2d..c058fb110ff 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -23,7 +23,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EMPhoton.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" // #include "PWGEM/Dilepton/Utils/EventMixingHandler.h" @@ -244,10 +243,10 @@ struct TaggingPi0 { emh1 = new MyEMH(ndepth); emh2 = new MyEMH(ndepth); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + DefineEMEventCut(); + fEMEventCut.addEventHistograms(&fRegistry); addHistogrms(); - DefineEMEventCut(); DefinePCMCut(); DefineDileptonCut(); DefineEMCCut(); @@ -336,6 +335,8 @@ struct TaggingPi0 { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void DefinePCMCut() @@ -429,8 +430,8 @@ struct TaggingPi0 { // o2::framework::Preslice perCollision_phos = o2::aod::phoscluster::pmeventId; o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; - o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > static_cast(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < static_cast(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); MyEMH* emh1 = nullptr; MyEMH* emh2 = nullptr; @@ -463,13 +464,12 @@ struct TaggingPi0 { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, weight); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, weight); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, weight); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, weight); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, weight); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, weight); + fEMEventCut.fillAccepted(&fRegistry, weight); int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1; if (zbin < 0) { diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index 4588f70182d..18ddbe479f8 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -23,7 +23,6 @@ #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" // @@ -55,7 +54,6 @@ #include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include -#include #include #include @@ -221,9 +219,9 @@ struct TaggingPi0MC { void init(o2::framework::InitContext&) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); - addHistogrms(); DefineEMEventCut(); + fEMEventCut.addEventHistograms(&fRegistry); + addHistogrms(); DefinePCMCut(); DefineDileptonCut(); DefineEMCCut(); @@ -231,7 +229,7 @@ struct TaggingPi0MC { mRunNumber = 0; d_bz = 0; - f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", TString(fd_k0s_to_pi0), 0.f, 100.f); + f1fd_k0s_to_pi0 = new TF1("f1fd_k0s_to_pi0", fd_k0s_to_pi0.value.c_str(), 0.f, 100.f); ccdb->setURL(ccdburl); ccdb->setCaching(true); @@ -275,14 +273,14 @@ struct TaggingPi0MC { void addHistogrms() { - TString mggTitle = "ee#gamma"; + std::string mggTitle = "ee#gamma"; if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; + const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle)}; const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", o2::framework::HistType::kTH1D, {axis_pt}, true); // for purity @@ -311,6 +309,8 @@ struct TaggingPi0MC { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void DefinePCMCut() @@ -404,8 +404,8 @@ struct TaggingPi0MC { // o2::framework::Preslice perCollision_phos = o2::aod::phoscluster::pmeventId; o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; - o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > static_cast(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < static_cast(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); template void runTruePairing(TCollisions const& collisions, @@ -432,13 +432,12 @@ struct TaggingPi0MC { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, weight); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, weight); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, weight); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, weight); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, weight); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, weight); + fEMEventCut.fillAccepted(&fRegistry, weight); if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h index c74bc6fcbc4..d4edc620927 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.h @@ -1151,7 +1151,7 @@ struct PhotonConversionBuilder { const float gap = circleGap(o2::track::TrackAuxPar(pTrack, d_bz), o2::track::TrackAuxPar(nTrack, d_bz)); const float score = dedupScore(v0photoncandidate.getCosPA(), v0photoncandidate.getPCA(), gap); if (opt.probe != nullptr) { - *opt.probe = {true, score}; + *opt.probe = {.ok = true, .score = score}; return; } const float purity = usePurity() ? purityScore(pos, ele, cospa_kf, v0photoncandidate.getPCA(), meeSV, gap, v0photoncandidate.getPsiPair()) : -999.f; @@ -1275,7 +1275,7 @@ struct PhotonConversionBuilder { // bookkeeping of candidates and stored photons static CandKey keyOf(V0CandidateHelper const& c) { - return CandKey{c.v0ID, c.colID, c.posID, c.eleID}; + return CandKey{.v0Id = c.v0ID, .collisionId = c.colID, .posId = c.posID, .eleId = c.eleID}; } std::map candidateIndexByKey() const @@ -1612,8 +1612,8 @@ struct PhotonConversionBuilder { for (const auto& s : swaps) { const int64_t colId = s.keyI.collisionId; const int64_t posI = s.keyI.posId, eleI = s.keyI.eleId, posJ = s.keyJ.posId, eleJ = s.keyJ.eleId; - const CandKey a1 = CandKey{-1, colId, posI, eleJ}; - const CandKey a2 = CandKey{-1, colId, posJ, eleI}; + const CandKey a1 = CandKey{.v0Id = -1, .collisionId = colId, .posId = posI, .eleId = eleJ}; + const CandKey a2 = CandKey{.v0Id = -1, .collisionId = colId, .posId = posJ, .eleId = eleI}; if (storedBefore.contains(a1) || storedBefore.contains(a2)) { continue; } @@ -1708,7 +1708,7 @@ struct PhotonConversionBuilder { // fillV0Table(v0, true); stored_v0Ids.emplace_back(std::make_pair(posId, eleId)); - stored_fullv0Ids.push_back(CandKey{v0Id, collisionId, posId, eleId}); + stored_fullv0Ids.push_back(CandKey{.v0Id = v0Id, .collisionId = collisionId, .posId = posId, .eleId = eleId}); nv0_map[collisionId]++; } } // end of pca_map loop @@ -2080,7 +2080,7 @@ struct PhotonConversionBuilder { vecV0Dedup.clear(); } // end of build - o2::framework::expressions::Filter v0Filter = o2::aod::v0::v0Type > (uint8_t)0; + o2::framework::expressions::Filter v0Filter = o2::aod::v0::v0Type > static_cast(0); using FilteredV0s = o2::soa::Filtered; enum PairFate { @@ -2186,7 +2186,8 @@ struct PhotonConversionBuilder { } int choice = 3; // o2-linter: disable=magic-number (bin 3 = lost) if (f.alive) { - const bool storedRight = std::any_of(f.aliveColls.begin(), f.aliveColls.end(), [&](int64_t c) { return isRightColl(c, mid); }); + const auto& midRef = mid; // ordinary variable, not a structured binding + const bool storedRight = std::any_of(f.aliveColls.begin(), f.aliveColls.end(), [&](int64_t c) { return isRightColl(c, midRef); }); choice = storedRight ? 0 : (rightAvailable ? 1 : 2); } const int nCopies = static_cast(copyColls.size()); diff --git a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx index b2395f2fe65..6ae54d84dc1 100644 --- a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx +++ b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx @@ -20,7 +20,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/emcalHistoDefinitions.h" #include "Common/Core/RecoDecay.h" @@ -72,16 +71,6 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::photon; -enum QvecEstimator { - FT0M = 0, - FT0A, - FT0C, - TPCPos, - TPCNeg, - TPCTot, - FV0A -}; - enum CentralityEstimator { None = 0, CFT0A, @@ -90,18 +79,6 @@ enum CentralityEstimator { NCentralityEstimators }; -enum Harmonics { - kNone = 0, - kDirect = 1, - kElliptic = 2, - kTriangluar = 3, - kQuadrangular = 4, - kPentagonal = 5, - kHexagonal = 6, - kHeptagonal = 7, - kOctagonal = 8 -}; - enum class MapLevel { kGood = 1, kNoBad = 2, @@ -294,6 +271,7 @@ struct CalibTaskEmc { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void defineEMCCut() @@ -363,7 +341,7 @@ struct CalibTaskEmc { fEMCCut.addQAHistograms(®istry); definePCMCut(); fV0PhotonCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality (%)"}; @@ -587,25 +565,20 @@ struct CalibTaskEmc { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float cent = getCentrality(collision); if (cent < eventcuts.cfgMinCent || cent > eventcuts.cfgMaxCent) { // event selection return false; } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } @@ -714,10 +687,6 @@ struct CalibTaskEmc { // general event selection continue; } - if (!(eventcuts.cfgFT0COccupancyMin <= c1.ft0cOccupancyInTimeRange()) || !(c1.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax) || !(eventcuts.cfgFT0COccupancyMin <= c2.ft0cOccupancyInTimeRange()) || !(c2.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - continue; - } if (getCentrality(c1) < eventcuts.cfgMinCent || getCentrality(c1) > eventcuts.cfgMaxCent || getCentrality(c2) < eventcuts.cfgMinCent || getCentrality(c2) > eventcuts.cfgMaxCent) { // event selection continue; @@ -887,10 +856,6 @@ struct CalibTaskEmc { // general event selection continue; } - if (!(eventcuts.cfgFT0COccupancyMin <= c1.ft0cOccupancyInTimeRange()) || !(c1.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax) || !(eventcuts.cfgFT0COccupancyMin <= c2.ft0cOccupancyInTimeRange()) || !(c2.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - continue; - } if (getCentrality(c1) < eventcuts.cfgMinCent || getCentrality(c1) > eventcuts.cfgMaxCent || getCentrality(c2) < eventcuts.cfgMinCent || getCentrality(c2) > eventcuts.cfgMaxCent) { // event selection continue; @@ -1033,10 +998,6 @@ struct CalibTaskEmc { // general event selection continue; } - if (!(eventcuts.cfgFT0COccupancyMin <= c1.ft0cOccupancyInTimeRange()) || !(c1.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax) || !(eventcuts.cfgFT0COccupancyMin <= c2.ft0cOccupancyInTimeRange()) || !(c2.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - continue; - } if (getCentrality(c1) < eventcuts.cfgMinCent || getCentrality(c1) > eventcuts.cfgMaxCent || getCentrality(c2) < eventcuts.cfgMinCent || getCentrality(c2) > eventcuts.cfgMaxCent) { // event selection continue; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index 43f82e92041..da544e6847c 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -18,7 +18,6 @@ #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/PIDResponseTPC.h" @@ -198,7 +197,7 @@ struct DalitzEEQC { void addhistograms() { // event info - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + fEMEventCut.addEventHistograms(&fRegistry); // pair info const AxisSpec axis_mass{200, 0, 0.2, "m_{ee} (GeV/c^{2})"}; @@ -246,6 +245,7 @@ struct DalitzEEQC { fEMEventCut.SetRequireNoSameBunchPileup(eventcuts.cfgRequireNoSameBunchPileup); fEMEventCut.SetRequireVertexITSTPC(eventcuts.cfgRequireVertexITSTPC); fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgOccupancyMin, eventcuts.cfgOccupancyMax); } void DefineDileptonCut() @@ -356,8 +356,8 @@ struct DalitzEEQC { Filter trackFilter = dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track && o2::aod::track::tpcChi2NCl < dileptoncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dileptoncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dileptoncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dileptoncuts.cfg_max_dcaz; Filter pidFilter = dileptoncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dileptoncuts.cfg_max_TPCNsigmaEl && (o2::aod::pidtpc::tpcNSigmaPi < dileptoncuts.cfg_min_TPCNsigmaPi || dileptoncuts.cfg_max_TPCNsigmaPi < o2::aod::pidtpc::tpcNSigmaPi); using FilteredMyTracks = soa::Filtered; - Partition posTracks = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negTracks = o2::aod::emprimaryelectron::sign < int8_t(0); + Partition posTracks = o2::aod::emprimaryelectron::sign > static_cast(0); + Partition negTracks = o2::aod::emprimaryelectron::sign < static_cast(0); std::vector used_trackIds; void processQC(FilteredMyCollisions const& collisions, FilteredMyTracks const& /*tracks*/) @@ -369,16 +369,12 @@ struct DalitzEEQC { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision); if (!fEMEventCut.IsSelected(collision)) { continue; } - if (!(eventcuts.cfgOccupancyMin <= collision.trackOccupancyInTimeRange()) || !(collision.trackOccupancyInTimeRange() < eventcuts.cfgOccupancyMax)) { - continue; - } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision); + fEMEventCut.fillAccepted(&fRegistry); auto posTracks_per_coll = posTracks->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index c0dd75f3545..f9a5354d879 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -20,7 +20,6 @@ #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/PIDResponseTPC.h" @@ -157,7 +156,7 @@ struct DalitzEEQCMC { void addhistograms() { // event info - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + fEMEventCut.addEventHistograms(&fRegistry); const AxisSpec axis_mass{200, 0, 0.2, "m_{ee} (GeV/c^{2})"}; const AxisSpec axis_pt{200, 0, 2, "p_{T,ee} (GeV/c)"}; @@ -279,6 +278,7 @@ struct DalitzEEQCMC { fEMEventCut.SetRequireNoSameBunchPileup(eventcuts.cfgRequireNoSameBunchPileup); fEMEventCut.SetRequireVertexITSTPC(eventcuts.cfgRequireVertexITSTPC); fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgOccupancyMin, eventcuts.cfgOccupancyMax); } void DefineDileptonCut() @@ -506,8 +506,8 @@ struct DalitzEEQCMC { Filter trackFilter = dileptoncuts.cfg_min_pt_track < o2::aod::track::pt && nabs(o2::aod::track::eta) < dileptoncuts.cfg_max_eta_track && o2::aod::track::tpcChi2NCl < dileptoncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dileptoncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dileptoncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dileptoncuts.cfg_max_dcaz; Filter pidFilter = dileptoncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dileptoncuts.cfg_max_TPCNsigmaEl && (o2::aod::pidtpc::tpcNSigmaPi < dileptoncuts.cfg_min_TPCNsigmaPi || dileptoncuts.cfg_max_TPCNsigmaPi < o2::aod::pidtpc::tpcNSigmaPi); using FilteredMyMCTracks = soa::Filtered; - Partition posTracks = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negTracks = o2::aod::emprimaryelectron::sign < int8_t(0); + Partition posTracks = o2::aod::emprimaryelectron::sign > static_cast(0); + Partition negTracks = o2::aod::emprimaryelectron::sign < static_cast(0); Filter collisionFilter_centrality = (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); using FilteredMyCollisions = soa::Filtered; @@ -524,16 +524,12 @@ struct DalitzEEQCMC { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision); if (!fEMEventCut.IsSelected(collision)) { continue; } - if (!(eventcuts.cfgOccupancyMin <= collision.trackOccupancyInTimeRange()) || !(collision.trackOccupancyInTimeRange() < eventcuts.cfgOccupancyMax)) { - continue; - } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision); + fEMEventCut.fillAccepted(&fRegistry); auto posTracks_per_coll = posTracks->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); @@ -567,9 +563,6 @@ struct DalitzEEQCMC { if (!fEMEventCut.IsSelected(collision)) { continue; } - if (!(eventcuts.cfgOccupancyMin <= collision.trackOccupancyInTimeRange()) || !(collision.trackOccupancyInTimeRange() < eventcuts.cfgOccupancyMax)) { - continue; - } auto mccollision = collision.emmcevent_as(); auto posTracks_per_coll = posTracksMC->sliceByCachedUnsorted(o2::aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); diff --git a/PWGEM/PhotonMeson/Tasks/emcalMcTask.cxx b/PWGEM/PhotonMeson/Tasks/emcalMcTask.cxx index 073479c2c9e..2ccf37fd92b 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalMcTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalMcTask.cxx @@ -18,7 +18,6 @@ #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include #include @@ -166,6 +165,7 @@ struct EmcalMcTask { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void defineEMCCut() @@ -198,7 +198,7 @@ struct EmcalMcTask { defineEMEventCut(); defineEMCCut(); fEMCCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisERec{thnConfigAxisE, "#it{E}_{Rec} (GeV)"}; @@ -272,25 +272,20 @@ struct EmcalMcTask { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float centOrMult = getCentralityOrMultiplicity(collision); if (useCent && (centOrMult < eventcuts.cfgMinCent || centOrMult > eventcuts.cfgMaxCent)) { // event selection return false; } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } diff --git a/PWGEM/PhotonMeson/Tasks/emcalPhotonMcTask.cxx b/PWGEM/PhotonMeson/Tasks/emcalPhotonMcTask.cxx index 9d233f75ca0..f3f90bd7e44 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPhotonMcTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPhotonMcTask.cxx @@ -22,7 +22,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/ParticleOrigin.h" @@ -361,6 +360,7 @@ struct EmcalPhotonMcTask { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void defineEMCCut() @@ -393,7 +393,7 @@ struct EmcalPhotonMcTask { defineEMEventCut(); defineEMCCut(); fEMCCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisERec{thnConfigAxisPt, "#it{E}_{Rec} (GeV)"}; const AxisSpec thnAxisPtRec{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -568,25 +568,20 @@ struct EmcalPhotonMcTask { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float centOrMult = getCentralityOrMultiplicity(collision); if (useCent && (centOrMult < eventcuts.cfgMinCent || centOrMult > eventcuts.cfgMaxCent)) { // event selection return false; } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } diff --git a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx index def4442d5d5..b8007742c20 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalQC.cxx @@ -20,7 +20,6 @@ #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/ClusterHistograms.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" @@ -118,6 +117,7 @@ struct EmcalQC { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgOccupancyMin, eventcuts.cfgOccupancyMax); } void defineEMCCut() @@ -159,7 +159,7 @@ struct EmcalQC { const AxisSpec thAxisdEta{200, -0.06, 0.06, "#Delta#eta"}; const AxisSpec thAxisdPhi{200, -0.06, 0.06, "#Delta#varphi (rad)"}; - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + fEMEventCut.addEventHistograms(&fRegistry); auto hEMCCollisionCounter = fRegistry.add("Event/hEMCCollisionCounter", "Number of collisions after event cuts", HistType::kTH1D, {{7, 0.5, 7.5}}, false); hEMCCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hEMCCollisionCounter->GetXaxis()->SetBinLabel(2, "+TVX"); // TVX @@ -210,17 +210,13 @@ struct EmcalQC { } } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, collision.weight()); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, collision.weight()); if (!fEMEventCut.IsSelected(collision)) { return false; } - if (!(eventcuts.cfgOccupancyMin <= collision.trackOccupancyInTimeRange()) || !(collision.trackOccupancyInTimeRange() < eventcuts.cfgOccupancyMax)) { - return false; - } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, collision.weight()); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, collision.weight()); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, collision.weight()); // accepted + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, collision.weight()); + fEMEventCut.fillAccepted(&fRegistry, collision.weight()); return true; } diff --git a/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx b/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx index d2d05d32ae5..229df5fba2e 100644 --- a/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx @@ -18,7 +18,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/AnalyticV0.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" @@ -389,7 +388,7 @@ struct PairQCTask { ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + fEMEventCut.addEventHistograms(&fRegistry); fRegistry.add("Photon/hPtEtaPhi", "selected V0 photons;p_{T} (GeV/c);#eta;#varphi (rad)", kTH3F, {{100, 0.f, 2.f}, {40, -0.8f, 0.8f}, {72, 0.f, 6.2832f}}, true); // o2-linter: disable=magic-number (axis definition) fRegistry.add("Photon/hNPhotonsPerEvent", "selected V0 photons per event;N_{#gamma};events", kTH1F, {{21, -0.5f, 20.5f}}, true); fRegistry.add("Photon/hV0LegClass", "leg classes of the selected V0s;;V0s", kTH1F, {makeAxisEnum(kNV0Classes, kV0ClassTitle)}, true); @@ -442,6 +441,8 @@ struct PairQCTask { fEMEventCut.SetRequireGoodITSLayer3(eventcuts.cfgRequireGoodITSLayer3); fEMEventCut.SetRequireGoodITSLayer0123(eventcuts.cfgRequireGoodITSLayer0123); fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void definePCMCut() @@ -1004,7 +1005,7 @@ struct PairQCTask { } if (mcutil::classifyDupPair(a.mc, b.mc) == mcutil::DupClass::SameMcPhoton) { // 0 no split leg, 1 split e+, 2 split e-, 3 both - const float splitType = static_cast((split[0] ? 1 : 0) + (split[1] ? 2 : 0)); // o2-linter: disable=magic-number (bit code, see booking) + const auto splitType = static_cast((split[0] ? 1 : 0) + (split[1] ? 2 : 0)); // o2-linter: disable=magic-number (bit code, see booking) fRegistry.fill(HIST("Dedup/MC/hSamePhotonDuplicateType"), splitType); fRegistry.fill(HIST("Dedup/MC/hSamePhotonDuplicateType_vs_Flagged"), splitType, flagged ? 1.f : 0.f); fRegistry.fill(HIST("Dedup/MC/hDupTrackClassMatrix"), static_cast(a.dedupCand.nITSTPC), static_cast(b.dedupCand.nITSTPC)); @@ -1413,13 +1414,12 @@ struct PairQCTask { centralitySelection.cfgCentMax < cent[centralitySelection.cfgCentEstimator]) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // o2-linter: disable=magic-number (counter bin, as in photonhbt) - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // o2-linter: disable=magic-number (counter bin, as in photonhbt) + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, 1.f); + fEMEventCut.fillAccepted(&fRegistry); auto photonsColl = photons.sliceBy(perCollisionPCM, collision.globalIndex()); collectPhotons(photonsColl, mcParticles, collision.posZ(), cands); diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index a51c8533f95..1e8e04cee93 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -21,7 +21,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "Common/Core/RecoDecay.h" @@ -211,6 +210,7 @@ struct PhotonResoTask { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void defineEMCCut() @@ -283,7 +283,7 @@ struct PhotonResoTask { fEMCCut.addQAHistograms(®istry); definePCMCut(); fV0PhotonCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisPtGen{thnConfigAxisPt, "#it{p}_{T,Gen} (GeV/#it{c})"}; const AxisSpec thnAxisPtRec{thnConfigAxisPt, "#it{p}_{T,Rec} (GeV/#it{c})"}; @@ -405,25 +405,20 @@ struct PhotonResoTask { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float centOrMult = getCentralityOrMultiplicity(collision); if (useCent && (centOrMult < eventcuts.cfgMinCent || centOrMult > eventcuts.cfgMaxCent)) { // event selection return false; } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 23cb1db4a70..fa490de325d 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -19,7 +19,6 @@ #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" @@ -809,6 +808,8 @@ struct Photonhbt { fEMEventCut.SetRequireGoodITSLayer3(eventcuts.cfgRequireGoodITSLayer3); fEMEventCut.SetRequireGoodITSLayer0123(eventcuts.cfgRequireGoodITSLayer0123); fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void DefinePCMCut() @@ -973,7 +974,7 @@ struct Photonhbt { { static constexpr std::array det = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg"}; - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); + fEMEventCut.addEventHistograms(&fRegistry); fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[mixing.cfgEP2EstimatorForMix].data()), kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); @@ -2657,13 +2658,12 @@ struct Photonhbt { collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; const float ep2 = epArr[mixing.cfgEP2EstimatorForMix]; fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, 1.f); + fEMEventCut.fillAccepted(&fRegistry); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); const float occupancy = (mixing.cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) @@ -2888,13 +2888,12 @@ struct Photonhbt { collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; const float ep2 = epArr[mixing.cfgEP2EstimatorForMix]; fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); + fEMEventCut.fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) { continue; } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); + fEMEventCut.fillEventInfo<1>(&fRegistry, collision, 1.f); + fEMEventCut.fillAccepted(&fRegistry); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); const float occupancy = (mixing.cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) diff --git a/PWGEM/PhotonMeson/Tasks/taskFlowReso.cxx b/PWGEM/PhotonMeson/Tasks/taskFlowReso.cxx index 6c4b0ecaed8..dcd322c2ef7 100644 --- a/PWGEM/PhotonMeson/Tasks/taskFlowReso.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskFlowReso.cxx @@ -16,7 +16,7 @@ #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" +#include "PWGEM/PhotonMeson/Utils/EventUtilities.h" #include "Common/Core/EventPlaneHelper.h" #include "Common/Core/RecoDecay.h" @@ -35,9 +35,7 @@ #include -#include #include -#include #include #include #include @@ -48,16 +46,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::photon; - -enum QvecEstimator { - FT0M = 0, - FT0A, - FT0C, - TPCPos, - TPCNeg, - TPCTot, - FV0A -}; +using namespace o2::aod::pwgem::pm::utils::event; enum CentralityEstimator { None = 0, @@ -67,18 +56,6 @@ enum CentralityEstimator { NCentralityEstimators }; -enum Harmonics { - kNone = 0, - kDirect = 1, - kElliptic = 2, - kTriangluar = 3, - kQuadrangular = 4, - kPentagonal = 5, - kHexagonal = 6, - kHeptagonal = 7, - kOctagonal = 8 -}; - struct TaskFlowReso { // configurable for flow @@ -123,8 +100,6 @@ struct TaskFlowReso { using CollsWithQvecs = soa::Join; using CollWithQvec = CollsWithQvecs::iterator; - static constexpr std::size_t NQVecEntries = 6; - HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; void defineEMEventCut() @@ -140,6 +115,12 @@ struct TaskFlowReso { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetTrackOccupancyRange(eventcuts.cfgTrackOccupancyMin, eventcuts.cfgTrackOccupancyMax); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); + fEMEventCut.SetRequireGoodQvec(true); + fEMEventCut.SetQvecHarmonic(harmonic); + fEMEventCut.SetMaxQvec(cfgMaxQVector); + fEMEventCut.SetQvecDetectors({qvecDetector.value, qvecSubADetector.value, qvecSubBDetector.value}); } void init(InitContext&) @@ -149,7 +130,7 @@ struct TaskFlowReso { } defineEMEventCut(); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality (%)"}; const AxisSpec thnAxisCosNPhi{thnConfigAxisCosNPhi, Form("cos(%d#varphi)", harmonic.value)}; @@ -262,142 +243,29 @@ struct TaskFlowReso { return cent; } - /// Get all used Q vector - /// \param collision is the collision with the Q vector information - template - std::array getAllQvec(TCollision const& collision) - { - // Retrieve the Q vectors using the helper function for each detector - auto [xQVecMain, yQVecMain] = getQvec(collision, qvecDetector); - auto [xQVecSubA, yQVecSubA] = getQvec(collision, qvecSubADetector); - auto [xQVecSubB, yQVecSubB] = getQvec(collision, qvecSubBDetector); - - return {xQVecMain, yQVecMain, xQVecSubA, yQVecSubA, xQVecSubB, yQVecSubB}; - } - /// Get the Q vector /// \param collision is the collision with the Q vector information template std::pair getQvec(TCollision const& collision, int detector) { - float xQVec = -999.f; - float yQVec = -999.f; - - switch (detector) { - case QvecEstimator::FT0M: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0m(); - yQVec = collision.q2yft0m(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0m(); - yQVec = collision.q3yft0m(); - } - break; - case QvecEstimator::FT0A: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0a(); - yQVec = collision.q2yft0a(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0a(); - yQVec = collision.q3yft0a(); - } - break; - case QvecEstimator::FT0C: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0c(); - yQVec = collision.q2yft0c(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0c(); - yQVec = collision.q3yft0c(); - } - break; - case QvecEstimator::TPCPos: - if (harmonic == kElliptic) { - xQVec = collision.q2xbpos(); - yQVec = collision.q2ybpos(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbpos(); - yQVec = collision.q3ybpos(); - } - break; - case QvecEstimator::TPCNeg: - if (harmonic == kElliptic) { - xQVec = collision.q2xbneg(); - yQVec = collision.q2ybneg(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbneg(); - yQVec = collision.q3ybneg(); - } - break; - case QvecEstimator::TPCTot: - if (harmonic == kElliptic) { - xQVec = collision.q2xbtot(); - yQVec = collision.q2ybtot(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbtot(); - yQVec = collision.q3ybtot(); - } - break; - case QvecEstimator::FV0A: - if (harmonic == kElliptic) { - xQVec = collision.q2xfv0a(); - yQVec = collision.q2yfv0a(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xfv0a(); - yQVec = collision.q3yfv0a(); - } - break; - default: - LOG(warning) << "Q vector estimator not valid. Falling back to FT0M"; - if (harmonic == kElliptic) { - xQVec = collision.q2xft0m(); - yQVec = collision.q2yft0m(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0m(); - yQVec = collision.q3yft0m(); - } - break; - } - return {xQVec, yQVec}; - } - - /// Check if the QVector values are within reasonable range - /// \param collision is the collision with the Q vector information - bool isQvecGood(std::array const& QVecs) - { - bool isgood = true; - for (const auto& QVec : QVecs) { - if (std::fabs(QVec) > cfgMaxQVector) { - isgood = false; - break; - } - } - return isgood; + return o2::aod::pwgem::pm::utils::event::getQvec(collision, detector, harmonic); } // Resolution void processResolution(CollWithQvec const& collision) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); if (!(fEMEventCut.IsSelected(collision))) { // no selection on the centrality is applied on purpose to allow for the resolution study in post-processing return; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange()) || !(collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - return; - } float cent = getCentrality(collision); if (cent < eventcuts.cfgMinCent || cent > eventcuts.cfgMaxCent) { // event selection return; } - if (!isQvecGood(getAllQvec(collision))) { - // selection based on QVector - return; - } - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); float centrality = getCentrality(collision); // centrality not updated in the rejection mask function float xQVecFT0a = -999.f; diff --git a/PWGEM/PhotonMeson/Tasks/taskPhotonFlow.cxx b/PWGEM/PhotonMeson/Tasks/taskPhotonFlow.cxx index 41f47171448..9ef5ba0e761 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPhotonFlow.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPhotonFlow.cxx @@ -20,7 +20,7 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" +#include "PWGEM/PhotonMeson/Utils/EventUtilities.h" #include "Common/Core/EventPlaneHelper.h" #include "Common/Core/RecoDecay.h" @@ -48,7 +48,6 @@ #include #include -#include #include #include #include @@ -61,16 +60,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::photon; - -enum QvecEstimator { - FT0M = 0, - FT0A = 1, - FT0C = 2, - TPCPos = 3, - TPCNeg = 4, - TPCTot = 5, - FV0A = 6 -}; +using namespace o2::aod::pwgem::pm::utils::event; enum CentralityEstimator { None = 0, @@ -80,18 +70,6 @@ enum CentralityEstimator { NCentralityEstimators = 4 }; -enum Harmonics { - kNone = 0, - kDirect = 1, - kElliptic = 2, - kTriangluar = 3, - kQuadrangular = 4, - kPentagonal = 5, - kHexagonal = 6, - kHeptagonal = 7, - kOctagonal = 8 -}; - enum class MapLevel { kGood = 1, kNoBad = 2, @@ -220,8 +198,6 @@ struct TaskPhotonFlow { Partition emcalPhotons = aod::mincluster::storedPhi < MaxPhiEMCalUint; Partition dcalPhotons = aod::mincluster::storedPhi >= MaxPhiEMCalUint; - static constexpr std::size_t NQVecEntries = 6; - PresliceOptional perCollisionEMC = o2::aod::emccluster::pmeventId; PresliceOptional perCollisionPCM = aod::v0photonkf::pmeventId; PresliceOptional perEMCClusterMT = o2::aod::mintm::minClusterId; @@ -274,6 +250,11 @@ struct TaskPhotonFlow { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); + fEMEventCut.SetRequireGoodQvec(true); + fEMEventCut.SetQvecHarmonic(harmonic); + fEMEventCut.SetMaxQvec(cfgMaxQVector); + fEMEventCut.SetQvecDetectors({qvecDetector.value, qvecSubADetector.value, qvecSubBDetector.value}); } void defineEMCCut() @@ -342,7 +323,7 @@ struct TaskPhotonFlow { fEMCCut.addQAHistograms(®istry); definePCMCut(); fV0PhotonCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; const AxisSpec thnAxisCent{thnConfigAxisCent, "Centrality (%)"}; @@ -428,117 +409,12 @@ struct TaskPhotonFlow { return cent; } - /// Get all used Q vector - /// \param collision is the collision with the Q vector information - template - std::array getAllQvec(TCollision const& collision) - { - // Retrieve the Q vectors using the helper function for each detector - auto [xQVecMain, yQVecMain] = getQvec(collision, qvecDetector); - auto [xQVecSubA, yQVecSubA] = getQvec(collision, qvecSubADetector); - auto [xQVecSubB, yQVecSubB] = getQvec(collision, qvecSubBDetector); - - return {xQVecMain, yQVecMain, xQVecSubA, yQVecSubA, xQVecSubB, yQVecSubB}; - } - /// Get the Q vector /// \param collision is the collision with the Q vector information template std::pair getQvec(TCollision const& collision, int detector) { - float xQVec = -999.f; - float yQVec = -999.f; - - switch (detector) { - case QvecEstimator::FT0M: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0m(); - yQVec = collision.q2yft0m(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0m(); - yQVec = collision.q3yft0m(); - } - break; - case QvecEstimator::FT0A: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0a(); - yQVec = collision.q2yft0a(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0a(); - yQVec = collision.q3yft0a(); - } - break; - case QvecEstimator::FT0C: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0c(); - yQVec = collision.q2yft0c(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0c(); - yQVec = collision.q3yft0c(); - } - break; - case QvecEstimator::TPCPos: - if (harmonic == kElliptic) { - xQVec = collision.q2xbpos(); - yQVec = collision.q2ybpos(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbpos(); - yQVec = collision.q3ybpos(); - } - break; - case QvecEstimator::TPCNeg: - if (harmonic == kElliptic) { - xQVec = collision.q2xbneg(); - yQVec = collision.q2ybneg(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbneg(); - yQVec = collision.q3ybneg(); - } - break; - case QvecEstimator::TPCTot: - if (harmonic == kElliptic) { - xQVec = collision.q2xbtot(); - yQVec = collision.q2ybtot(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbtot(); - yQVec = collision.q3ybtot(); - } - break; - case QvecEstimator::FV0A: - if (harmonic == kElliptic) { - xQVec = collision.q2xfv0a(); - yQVec = collision.q2yfv0a(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xfv0a(); - yQVec = collision.q3yfv0a(); - } - break; - default: - LOG(warning) << "Q vector estimator not valid. Falling back to FT0M"; - if (harmonic == kElliptic) { - xQVec = collision.q2xft0m(); - yQVec = collision.q2yft0m(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0m(); - yQVec = collision.q3yft0m(); - } - break; - } - return {xQVec, yQVec}; - } - - /// Check if the QVector values are within reasonable range - /// \param collision is the collision with the Q vector information - bool isQvecGood(std::array const& QVecs) - { - bool isgood = true; - for (const auto& QVec : QVecs) { - if (std::fabs(QVec) > cfgMaxQVector) { - isgood = false; - break; - } - } - return isgood; + return o2::aod::pwgem::pm::utils::event::getQvec(collision, detector, harmonic); } bool isTooCloseToEdge(const int cellID, const int DistanceToBorder = 1) @@ -638,29 +514,20 @@ struct TaskPhotonFlow { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float cent = getCentrality(collision); if (cent < eventcuts.cfgMinCent || cent > eventcuts.cfgMaxCent) { // event selection return false; } - if (!isQvecGood(getAllQvec(collision))) { - // selection based on QVector - return false; - } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index 230ad975aec..5e518f8f507 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -20,7 +20,7 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" +#include "PWGEM/PhotonMeson/Utils/EventUtilities.h" #include "Common/Core/EventPlaneHelper.h" #include "Common/Core/RecoDecay.h" @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -73,16 +72,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::photon; - -enum QvecEstimator { - FT0M = 0, - FT0A = 1, - FT0C = 2, - TPCPos = 3, - TPCNeg = 4, - TPCTot = 5, - FV0A = 6 -}; +using namespace o2::aod::pwgem::pm::utils::event; enum CentralityEstimator { None = 0, @@ -92,18 +82,6 @@ enum CentralityEstimator { NCentralityEstimators = 4 }; -enum Harmonics { - kNone = 0, - kDirect = 1, - kElliptic = 2, - kTriangluar = 3, - kQuadrangular = 4, - kPentagonal = 5, - kHexagonal = 6, - kHeptagonal = 7, - kOctagonal = 8 -}; - enum class MapLevel { kGood = 1, kNoBad = 2, @@ -275,8 +253,6 @@ struct TaskPi0FlowEMC { Partition emcalPhotons = aod::mincluster::storedPhi < MaxPhiEMCalUint; Partition dcalPhotons = aod::mincluster::storedPhi >= MaxPhiEMCalUint; - static constexpr std::size_t NQVecEntries = 6; - PresliceOptional perCollisionEMC = o2::aod::emccluster::pmeventId; PresliceOptional perCollisionPCM = aod::v0photonkf::pmeventId; PresliceOptional perEMCClusterMT = o2::aod::mintm::minClusterId; @@ -335,6 +311,11 @@ struct TaskPi0FlowEMC { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); + fEMEventCut.SetRequireGoodQvec(true); + fEMEventCut.SetQvecHarmonic(harmonic); + fEMEventCut.SetMaxQvec(cfgMaxQVector); + fEMEventCut.SetQvecDetectors({qvecDetector.value, qvecSubADetector.value, qvecSubBDetector.value}); } void defineEMCCut() @@ -403,7 +384,7 @@ struct TaskPi0FlowEMC { fEMCCut.addQAHistograms(®istry); definePCMCut(); fV0PhotonCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisInvMass{thnConfigAxisInvMass, "#it{M}_{#gamma#gamma} (GeV/#it{c}^{2})"}; const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -618,117 +599,12 @@ struct TaskPi0FlowEMC { return cent; } - /// Get all used Q vector - /// \param collision is the collision with the Q vector information - template - std::array getAllQvec(TCollision const& collision) - { - // Retrieve the Q vectors using the helper function for each detector - auto [xQVecMain, yQVecMain] = getQvec(collision, qvecDetector); - auto [xQVecSubA, yQVecSubA] = getQvec(collision, qvecSubADetector); - auto [xQVecSubB, yQVecSubB] = getQvec(collision, qvecSubBDetector); - - return {xQVecMain, yQVecMain, xQVecSubA, yQVecSubA, xQVecSubB, yQVecSubB}; - } - /// Get the Q vector /// \param collision is the collision with the Q vector information template std::pair getQvec(TCollision const& collision, int detector) { - float xQVec = -999.f; - float yQVec = -999.f; - - switch (detector) { - case QvecEstimator::FT0M: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0m(); - yQVec = collision.q2yft0m(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0m(); - yQVec = collision.q3yft0m(); - } - break; - case QvecEstimator::FT0A: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0a(); - yQVec = collision.q2yft0a(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0a(); - yQVec = collision.q3yft0a(); - } - break; - case QvecEstimator::FT0C: - if (harmonic == kElliptic) { - xQVec = collision.q2xft0c(); - yQVec = collision.q2yft0c(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0c(); - yQVec = collision.q3yft0c(); - } - break; - case QvecEstimator::TPCPos: - if (harmonic == kElliptic) { - xQVec = collision.q2xbpos(); - yQVec = collision.q2ybpos(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbpos(); - yQVec = collision.q3ybpos(); - } - break; - case QvecEstimator::TPCNeg: - if (harmonic == kElliptic) { - xQVec = collision.q2xbneg(); - yQVec = collision.q2ybneg(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbneg(); - yQVec = collision.q3ybneg(); - } - break; - case QvecEstimator::TPCTot: - if (harmonic == kElliptic) { - xQVec = collision.q2xbtot(); - yQVec = collision.q2ybtot(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xbtot(); - yQVec = collision.q3ybtot(); - } - break; - case QvecEstimator::FV0A: - if (harmonic == kElliptic) { - xQVec = collision.q2xfv0a(); - yQVec = collision.q2yfv0a(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xfv0a(); - yQVec = collision.q3yfv0a(); - } - break; - default: - LOG(warning) << "Q vector estimator not valid. Falling back to FT0M"; - if (harmonic == kElliptic) { - xQVec = collision.q2xft0m(); - yQVec = collision.q2yft0m(); - } else if (harmonic == kTriangluar) { - xQVec = collision.q3xft0m(); - yQVec = collision.q3yft0m(); - } - break; - } - return {xQVec, yQVec}; - } - - /// Check if the QVector values are within reasonable range - /// \param collision is the collision with the Q vector information - bool isQvecGood(std::array const& QVecs) - { - bool isgood = true; - for (const auto& QVec : QVecs) { - if (std::fabs(QVec) > cfgMaxQVector) { - isgood = false; - break; - } - } - return isgood; + return o2::aod::pwgem::pm::utils::event::getQvec(collision, detector, harmonic); } bool isTooCloseToEdge(const int cellID, const int DistanceToBorder = 1) @@ -1068,29 +944,20 @@ struct TaskPi0FlowEMC { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float cent = getCentrality(collision); if (cent < eventcuts.cfgMinCent || cent > eventcuts.cfgMaxCent) { // event selection return false; } - if (!isQvecGood(getAllQvec(collision))) { - // selection based on QVector - return false; - } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } @@ -1237,18 +1104,10 @@ struct TaskPi0FlowEMC { // general event selection continue; } - if (!(eventcuts.cfgFT0COccupancyMin <= c1.ft0cOccupancyInTimeRange()) || !(c1.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax) || !(eventcuts.cfgFT0COccupancyMin <= c2.ft0cOccupancyInTimeRange()) || !(c2.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - continue; - } if (getCentrality(c1) < eventcuts.cfgMinCent || getCentrality(c1) > eventcuts.cfgMaxCent || getCentrality(c2) < eventcuts.cfgMinCent || getCentrality(c2) > eventcuts.cfgMaxCent) { // event selection continue; } - if (!isQvecGood(getAllQvec(c1)) || !isQvecGood(getAllQvec(c2))) { - // selection based on QVector - continue; - } runNow = c1.runNumber(); if (runNow != runBefore) { initCCDB(c1); @@ -1456,18 +1315,10 @@ struct TaskPi0FlowEMC { // general event selection continue; } - if (!(eventcuts.cfgFT0COccupancyMin <= c1.ft0cOccupancyInTimeRange()) || !(c1.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax) || !(eventcuts.cfgFT0COccupancyMin <= c2.ft0cOccupancyInTimeRange()) || !(c2.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - continue; - } if (getCentrality(c1) < eventcuts.cfgMinCent || getCentrality(c1) > eventcuts.cfgMaxCent || getCentrality(c2) < eventcuts.cfgMinCent || getCentrality(c2) > eventcuts.cfgMaxCent) { // event selection continue; } - if (!isQvecGood(getAllQvec(c1)) || !isQvecGood(getAllQvec(c2))) { - // selection based on QVector - continue; - } runNow = c1.runNumber(); if (runNow != runBefore) { initCCDB(c1); @@ -1673,10 +1524,6 @@ struct TaskPi0FlowEMC { // general event selection continue; } - if (!(eventcuts.cfgFT0COccupancyMin <= c1.ft0cOccupancyInTimeRange()) || !(c1.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax) || !(eventcuts.cfgFT0COccupancyMin <= c2.ft0cOccupancyInTimeRange()) || !(c2.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - continue; - } if (getCentrality(c1) < eventcuts.cfgMinCent || getCentrality(c1) > eventcuts.cfgMaxCent || getCentrality(c2) < eventcuts.cfgMinCent || getCentrality(c2) > eventcuts.cfgMaxCent) { // event selection continue; diff --git a/PWGEM/PhotonMeson/Tasks/twoPhotonMcTask.cxx b/PWGEM/PhotonMeson/Tasks/twoPhotonMcTask.cxx index 348f54a7868..9f080d9a02d 100644 --- a/PWGEM/PhotonMeson/Tasks/twoPhotonMcTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/twoPhotonMcTask.cxx @@ -21,7 +21,6 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/EventHistograms.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "Common/DataModel/Centrality.h" @@ -355,6 +354,7 @@ struct TwoPhotonMcTask { fEMEventCut.SetRequireGoodZvtxFT0vsPV(eventcuts.cfgRequireGoodZvtxFT0vsPV); fEMEventCut.SetRequireEMCReadoutInMB(eventcuts.cfgRequireEMCReadoutInMB); fEMEventCut.SetRequireEMCHardwareTriggered(eventcuts.cfgRequireEMCHardwareTriggered); + fEMEventCut.SetFT0COccupancyRange(eventcuts.cfgFT0COccupancyMin, eventcuts.cfgFT0COccupancyMax); } void defineEMCCut() @@ -425,7 +425,7 @@ struct TwoPhotonMcTask { fEMCCut.addQAHistograms(®istry); definePCMCut(); fV0PhotonCut.addQAHistograms(®istry); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(®istry); + fEMEventCut.addEventHistograms(®istry); const AxisSpec thnAxisPtGen{thnConfigAxisPt, "#it{p}_{T,Gen} (GeV/#it{c})"}; const AxisSpec thnAxisPtRec{thnConfigAxisPt, "#it{p}_{T,Rec} (GeV/#it{c})"}; @@ -620,25 +620,20 @@ struct TwoPhotonMcTask { bool isFullEventSelected(TCollision const& collision, bool fillHisto = false) { if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(®istry, collision); + fEMEventCut.fillEventInfo<0>(®istry, collision); } if (!(fEMEventCut.IsSelected(collision))) { // general event selection return false; } - if (!(eventcuts.cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < eventcuts.cfgFT0COccupancyMax)) { - // occupancy selection - return false; - } float centOrMult = getCentralityOrMultiplicity(collision); if (useCent && (centOrMult < eventcuts.cfgMinCent || centOrMult > eventcuts.cfgMaxCent)) { // event selection return false; } if (fillHisto) { - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(®istry, collision); - registry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - registry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fEMEventCut.fillEventInfo<1>(®istry, collision); + fEMEventCut.fillAccepted(®istry); } return true; } diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h deleted file mode 100644 index f9f9fcdec0b..00000000000 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ /dev/null @@ -1,114 +0,0 @@ -// 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 EventHistograms.h -/// \brief header file for event histograms -/// \author daiki.sekihata@cern.ch - -#ifndef PWGEM_PHOTONMESON_UTILS_EVENTHISTOGRAMS_H_ -#define PWGEM_PHOTONMESON_UTILS_EVENTHISTOGRAMS_H_ - -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" - -#include -#include -#include - -#include - -#include -#include - -namespace o2::aod::pwgem::photonmeson::utils::eventhistogram -{ -inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool useWeight = false) -{ - // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::HistType::kTH1D, {{12, 0.5, 12.5}}, useWeight); - hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); - hCollisionCounter->GetXaxis()->SetBinLabel(2, "No TF border"); - hCollisionCounter->GetXaxis()->SetBinLabel(3, "No ITS ROF border"); - hCollisionCounter->GetXaxis()->SetBinLabel(4, "No Same Bunch Pileup"); - hCollisionCounter->GetXaxis()->SetBinLabel(5, "Is Vertex ITSTPC"); - hCollisionCounter->GetXaxis()->SetBinLabel(6, "Is Good Zvtx FT0vsPV"); - hCollisionCounter->GetXaxis()->SetBinLabel(7, "FT0AND"); - hCollisionCounter->GetXaxis()->SetBinLabel(8, "sel8"); - hCollisionCounter->GetXaxis()->SetBinLabel(9, "|Z_{vtx}| < 10 cm"); - hCollisionCounter->GetXaxis()->SetBinLabel(10, "EMC MB Readout"); - hCollisionCounter->GetXaxis()->SetBinLabel(11, "EMC L0 Triggered"); - hCollisionCounter->GetXaxis()->SetBinLabel(12, "accepted"); - - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::HistType::kTH1D, {{220, -11, +11}}, useWeight); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::HistType::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); - fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::HistType::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::HistType::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, useWeight); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::HistType::kTH1F, {{100, 0., 100.}}, useWeight); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::HistType::kTH1F, {{100, 0., 100.}}, useWeight); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::HistType::kTH1F, {{100, 0., 100.}}, useWeight); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::HistType::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, useWeight); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::HistType::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, useWeight); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::HistType::kTH2F, {{60, 0, 60000}, {500, 0, 10000}}, useWeight); - fRegistry->addClone("Event/before/", "Event/after/"); -} - -template -void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, float weight = 1.) -{ - const float maxZ = 10.f; - static constexpr std::array EventTypes = {"before/", "after/"}; - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); - if (collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); - } - if (collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); - } - if (collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); - } - if (collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); - } - if (collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); - } - if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); - } - if (collision.sel8()) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); - } - if (std::abs(collision.posZ()) < maxZ) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); - } - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); - if (collision.alias_bit(kTVXinEMC)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); - } - if (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7)) { - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, weight); - } - - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPVeta1"), collision.multNTracksPVeta1(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0"), collision.multFT0A(), collision.multFT0C(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0A"), collision.centFT0A(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0C"), collision.centFT0C(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0M"), collision.centFT0M(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0CvsMultNTracksPV"), collision.centFT0C(), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsOccupancy"), collision.multFT0C(), collision.trackOccupancyInTimeRange(), weight); -} - -} // namespace o2::aod::pwgem::photonmeson::utils::eventhistogram - -#endif // PWGEM_PHOTONMESON_UTILS_EVENTHISTOGRAMS_H_ diff --git a/PWGEM/PhotonMeson/Utils/EventUtilities.h b/PWGEM/PhotonMeson/Utils/EventUtilities.h new file mode 100644 index 00000000000..bffd220a945 --- /dev/null +++ b/PWGEM/PhotonMeson/Utils/EventUtilities.h @@ -0,0 +1,178 @@ +// 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 EventUtilities.h +/// \brief Utilities for event level variables (e.g. Q vectors) used in PWGEM/PhotonMeson +/// \author M. Hemmer, marvin.hemmer@cern.ch + +#ifndef PWGEM_PHOTONMESON_UTILS_EVENTUTILITIES_H_ +#define PWGEM_PHOTONMESON_UTILS_EVENTUTILITIES_H_ + +#include +#include + +#include +#include +#include +#include + +namespace o2::aod::pwgem::pm::utils::event +{ + +/// Detectors that provide a Q vector in the EMEventsQvec tables +enum QvecEstimator { + FT0M = 0, + FT0A = 1, + FT0C = 2, + TPCPos = 3, + TPCNeg = 4, + TPCTot = 5, + FV0A = 6 +}; + +/// Supported flow harmonics +enum Harmonics { + kNone = 0, + kDirect = 1, + kElliptic = 2, + kTriangluar = 3, + kQuadrangular = 4, + kPentagonal = 5, + kHexagonal = 6, + kHeptagonal = 7, + kOctagonal = 8 +}; + +/// Value returned for Q vectors that are not available +constexpr float InvalidQvec = -999.f; + +// Compile-time checks for the availability of Q vector columns. +// EMEventsQvec_000 has q2 and q3 without FV0A, EMEventsQvec_001 has q2 and q3 with FV0A, +// EMEventsQvec2 has only q2 (with FV0A) and EMEventsQvec3 has only q3 (with FV0A). +template +concept HasQvec2 = requires(T const& c) { c.q2xft0m(); }; + +template +concept HasQvec3 = requires(T const& c) { c.q3xft0m(); }; + +template +concept HasQvec2FV0A = requires(T const& c) { c.q2xfv0a(); }; + +template +concept HasQvec3FV0A = requires(T const& c) { c.q3xfv0a(); }; + +template +concept HasQvec = HasQvec2 || HasQvec3; + +// Compile-time checks for the availability of the occupancy columns (evsel::NumTracksInTimeRange and evsel::SumAmpFT0CInTimeRange) +template +concept HasTrackOccupancy = requires(T const& c) { c.trackOccupancyInTimeRange(); }; + +template +concept HasFT0COccupancy = requires(T const& c) { c.ft0cOccupancyInTimeRange(); }; + +/// \brief Get the Q vector of a given detector and harmonic +/// \param collision collision with the Q vector information +/// \param detector detector used for the Q vector (see QvecEstimator) +/// \param harmonic harmonic of the Q vector (see Harmonics) +/// \return pair of (Qx, Qy). {InvalidQvec, InvalidQvec} if not available in the table or for an unsupported harmonic +template +std::pair getQvec(TCollision const& collision, int detector, int harmonic) +{ + if (harmonic == kElliptic) { + if constexpr (HasQvec2) { + switch (detector) { + case QvecEstimator::FT0M: + return {collision.q2xft0m(), collision.q2yft0m()}; + case QvecEstimator::FT0A: + return {collision.q2xft0a(), collision.q2yft0a()}; + case QvecEstimator::FT0C: + return {collision.q2xft0c(), collision.q2yft0c()}; + case QvecEstimator::TPCPos: + return {collision.q2xbpos(), collision.q2ybpos()}; + case QvecEstimator::TPCNeg: + return {collision.q2xbneg(), collision.q2ybneg()}; + case QvecEstimator::TPCTot: + return {collision.q2xbtot(), collision.q2ybtot()}; + case QvecEstimator::FV0A: + if constexpr (HasQvec2FV0A) { + return {collision.q2xfv0a(), collision.q2yfv0a()}; + } else { + return {InvalidQvec, InvalidQvec}; + } + default: + LOG(warning) << "Q vector estimator not valid. Falling back to FT0M"; + return {collision.q2xft0m(), collision.q2yft0m()}; + } + } + } else if (harmonic == kTriangluar) { + if constexpr (HasQvec3) { + switch (detector) { + case QvecEstimator::FT0M: + return {collision.q3xft0m(), collision.q3yft0m()}; + case QvecEstimator::FT0A: + return {collision.q3xft0a(), collision.q3yft0a()}; + case QvecEstimator::FT0C: + return {collision.q3xft0c(), collision.q3yft0c()}; + case QvecEstimator::TPCPos: + return {collision.q3xbpos(), collision.q3ybpos()}; + case QvecEstimator::TPCNeg: + return {collision.q3xbneg(), collision.q3ybneg()}; + case QvecEstimator::TPCTot: + return {collision.q3xbtot(), collision.q3ybtot()}; + case QvecEstimator::FV0A: + if constexpr (HasQvec3FV0A) { + return {collision.q3xfv0a(), collision.q3yfv0a()}; + } else { + return {InvalidQvec, InvalidQvec}; + } + default: + LOG(warning) << "Q vector estimator not valid. Falling back to FT0M"; + return {collision.q3xft0m(), collision.q3yft0m()}; + } + } + } + return {InvalidQvec, InvalidQvec}; +} + +/// \brief Check if all given Q vector components are within a reasonable range +/// \param qvecs Q vector components (e.g. {Qx_1, Qy_1, Qx_2, Qy_2, ...}) +/// \param maxQvec maximum allowed absolute value of each component +inline bool isQvecGood(std::span qvecs, float maxQvec) +{ + for (const auto& qvec : qvecs) { + if (std::fabs(qvec) > maxQvec) { + return false; + } + } + return true; +} + +/// \brief Check if the Q vectors of all given detectors are within a reasonable range +/// \param collision collision with the Q vector information +/// \param detectors detectors to check (see QvecEstimator) +/// \param harmonic harmonic of the Q vectors (see Harmonics) +/// \param maxQvec maximum allowed absolute value of Qx and Qy +template +bool isQvecGood(TCollision const& collision, std::vector const& detectors, int harmonic, float maxQvec) +{ + for (const auto& detector : detectors) { + auto [xQvec, yQvec] = getQvec(collision, detector, harmonic); + if (std::fabs(xQvec) > maxQvec || std::fabs(yQvec) > maxQvec) { + return false; + } + } + return true; +} + +} // namespace o2::aod::pwgem::pm::utils::event + +#endif // PWGEM_PHOTONMESON_UTILS_EVENTUTILITIES_H_ From f0c985ac5be5b424e8ea9cdf2014824adfab4b1a Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Thu, 5 Nov 2026 08:53:28 +0100 Subject: [PATCH 2/5] Fixing more code check errors and warnings --- PWGEM/PhotonMeson/Core/TaggingPi0MC.h | 3 ++- PWGEM/PhotonMeson/Tasks/pairQcTask.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index 18ddbe479f8..9173ac293cf 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -280,7 +281,7 @@ struct TaggingPi0MC { mggTitle = "#gamma#gamma"; } - const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle)}; + const o2::framework::AxisSpec axis_m{200, 0, 0.4, std::format("m_{} (GeV/c^{{2}})", mggTitle)}; const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", o2::framework::HistType::kTH1D, {axis_pt}, true); // for purity diff --git a/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx b/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx index 229df5fba2e..5844fab6531 100644 --- a/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/pairQcTask.cxx @@ -1454,7 +1454,7 @@ struct PairQCTask { PROCESS_SWITCH(PairQCTask, processMC, "pair QC on MC", false); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +WorkflowSpec defineDataProcessing(ConfigContext const& context) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(context)}; } From 96f81a844276cddc255b0246ee4c2c4dc448ed2e Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Thu, 5 Nov 2026 09:23:50 +0100 Subject: [PATCH 3/5] Fix MegaLinter ... --- PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx | 54 ++++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index f9a5354d879..a345e195c23 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -148,7 +148,7 @@ struct DalitzEEQCMC { } mctrackcuts; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - static constexpr std::array event_cut_types = {"before/", "after/"}; + // static constexpr std::array event_cut_types = {"before/", "after/"}; // unused static constexpr std::array track_types = {"primary/", "secondary/"}; ~DalitzEEQCMC() = default; @@ -594,34 +594,34 @@ struct DalitzEEQCMC { continue; } - if (mother_id > -1) { - auto mcmother = mcparticles.iteratorAt(mother_id); - if (mcmother.isPhysicalPrimary() || mcmother.producedByGenerator()) { - - switch (std::abs(mcmother.pdgCode())) { - case 111: - fRegistry.fill(HIST("Generated/sm/Pi0/hMvsPt"), v12.M(), v12.Pt()); - break; - case 221: - fRegistry.fill(HIST("Generated/sm/Eta/hMvsPt"), v12.M(), v12.Pt()); - break; - case 331: - fRegistry.fill(HIST("Generated/sm/EtaPrime/hMvsPt"), v12.M(), v12.Pt()); - break; - case 113: - fRegistry.fill(HIST("Generated/sm/Rho/hMvsPt"), v12.M(), v12.Pt()); - break; - case 223: - fRegistry.fill(HIST("Generated/sm/Omega/hMvsPt"), v12.M(), v12.Pt()); - break; - case 333: - fRegistry.fill(HIST("Generated/sm/Phi/hMvsPt"), v12.M(), v12.Pt()); - break; - default: - break; - } + // if (mother_id > -1) { // not needed because of + auto mcmother = mcparticles.iteratorAt(mother_id); + if (mcmother.isPhysicalPrimary() || mcmother.producedByGenerator()) { + + switch (std::abs(mcmother.pdgCode())) { + case 111: + fRegistry.fill(HIST("Generated/sm/Pi0/hMvsPt"), v12.M(), v12.Pt()); + break; + case 221: + fRegistry.fill(HIST("Generated/sm/Eta/hMvsPt"), v12.M(), v12.Pt()); + break; + case 331: + fRegistry.fill(HIST("Generated/sm/EtaPrime/hMvsPt"), v12.M(), v12.Pt()); + break; + case 113: + fRegistry.fill(HIST("Generated/sm/Rho/hMvsPt"), v12.M(), v12.Pt()); + break; + case 223: + fRegistry.fill(HIST("Generated/sm/Omega/hMvsPt"), v12.M(), v12.Pt()); + break; + case 333: + fRegistry.fill(HIST("Generated/sm/Phi/hMvsPt"), v12.M(), v12.Pt()); + break; + default: + break; } } + // } } // end of true ULS pair loop } // end of collision loop } From 5eea72468d6ab33196165f5fdb317701574caff3 Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Thu, 5 Nov 2026 09:32:30 +0100 Subject: [PATCH 4/5] Fixing more MegaLinter Errors that keep appearing ... --- PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx | 2 +- PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index da544e6847c..34c03596499 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -135,7 +135,7 @@ struct DalitzEEQC { float d_bz = 0; HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; - static constexpr std::array event_cut_types = {"before/", "after/"}; + // static constexpr std::array event_cut_types = {"before/", "after/"}; // unused void init(InitContext& /*context*/) { diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index a345e195c23..064dc2d0633 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -362,7 +362,8 @@ struct DalitzEEQCMC { } float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), d_bz); - if (mother_id > -1 && t1mc.pdgCode() * t2mc.pdgCode() < 0) { + // if (mother_id > -1 && t1mc.pdgCode() * t2mc.pdgCode() < 0) { + if (t1mc.pdgCode() * t2mc.pdgCode() < 0) { auto mcmother = mcparticles.iteratorAt(mother_id); if (cfgRequireTrueAssociation && (mcmother.emmceventId() != collision.emmceventId())) { return false; From 340236ce2e9c6d18a944b6ac364866715615782f Mon Sep 17 00:00:00 2001 From: Marvin Hemmer Date: Thu, 5 Nov 2026 10:04:08 +0100 Subject: [PATCH 5/5] Fix more errors --- PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index 34c03596499..c18b6e319a6 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -51,7 +51,6 @@ #include #include #include -#include #include using namespace o2;