From f4d85b845b9638f356ff5348eedf1b018bf394d5 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Mon, 30 Jun 2025 17:43:39 +0900 Subject: [PATCH 01/29] [PWGLF] Add the PID option for using TOF Apply TPC and TOF cuts for PID, depending on the availability of TOF. --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 29 +++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 01b059a7f29..63b8956ef2c 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -14,7 +14,6 @@ #include #include #include "TVector2.h" -#include #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" @@ -47,8 +46,6 @@ struct f0980analysis { "Maximum transverse DCA"}; Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, "Maximum longitudinal DCA"}; - Configurable cfgMaxTPC{"cfgMaxTPC", 5.0, "Maximum TPC PID with TOF"}; - Configurable cfgMaxTOF{"cfgMaxTOF", 3.0, "Maximum TOF PID with TPC"}; Configurable cfgMinRap{"cfgMinRap", -0.5, "Minimum rapidity for pair"}; Configurable cfgMaxRap{"cfgMaxRap", 0.5, "Maximum rapidity for pair"}; Configurable cfgFindRT{"cfgFindRT", false, "boolean for RT analysis"}; @@ -80,7 +77,8 @@ struct f0980analysis { // PID Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF - Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTPCnSigmaPionWoTOF{"cMaxTPCnSigmaPionWoTOF", 2.0, "TPC nSigma cut without TOF for Pion"}; Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; Configurable SelectType{"SelectType", 0, "PID selection type"}; @@ -199,6 +197,15 @@ struct f0980analysis { if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) return false; } + if (SelectType == 3) { + if (track.hasTOF()) { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) + return false; + } else if (!track.hasTOF()) { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) + return false; + } + } return true; } @@ -227,17 +234,14 @@ struct f0980analysis { TLorentzVector Pion1, Pion2, Reco; for (auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { - if (trk1.index() == trk2.index()) { - if (!SelTrack(trk1)) - continue; - histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); - histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); - histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); - continue; - } if (!SelTrack(trk1) || !SelTrack(trk2)) continue; + // TPC, TOF Nsigma distributions + histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); + histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); + histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); + if (!SelPion(trk1) || !SelPion(trk2)) continue; @@ -305,7 +309,6 @@ struct f0980analysis { void processMCTrue(aod::ResoMCParents& resoParents) { - for (auto& part : resoParents) { // loop over all pre-filtered MC particles if (abs(part.pdgCode()) != 9010221) continue; From 2b014368fe75a690ff7d3e08c2d84ef7cd0fb4d7 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Mon, 30 Jun 2025 22:28:26 +0900 Subject: [PATCH 02/29] [PWGLF] Apply clang-format Reformatted code with clang-format. --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 63b8956ef2c..2f6d32aa9a6 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -11,19 +11,22 @@ /// \author Junlee Kim (jikim1290@gmail.com) -#include -#include -#include "TVector2.h" +#include "PWGLF/DataModel/LFResonanceTables.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" + +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" -#include "PWGLF/DataModel/LFResonanceTables.h" -#include "CommonConstants/PhysicsConstants.h" +#include + +#include "TVector2.h" +#include +#include using namespace o2; using namespace o2::framework; From dd005a4fe091e6f88a83a4f5b7f4353067c56f06 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Mon, 30 Jun 2025 23:24:15 +0900 Subject: [PATCH 03/29] [PWGLF] Apply O2 linter --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 37 ++++++++++-------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 2f6d32aa9a6..2015f63eb97 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -17,6 +17,7 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" +#include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" @@ -25,14 +26,8 @@ #include #include "TVector2.h" -#include -#include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::constants::physics; +#include struct f0980analysis { SliceCache cache; @@ -98,9 +93,9 @@ struct f0980analysis { AxisSpec PIDqaAxis = {120, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0., 2.0 * constants::math::PI}; - AxisSpec EPAxis = {10, 0, constants::math::PI}; - AxisSpec EPqaAxis = {200, -constants::math::PI, constants::math::PI}; + AxisSpec phiqaAxis = {72, 0., 2.0 * o2::constants::math::PI}; + AxisSpec EPAxis = {10, 0, o2::constants::math::PI}; + AxisSpec EPqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec EPresAxis = {200, -2, 2}; if (cfgFindRT) { @@ -144,11 +139,11 @@ struct f0980analysis { int RTIndex(double pairphi, double lhphi) { double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi)); - if (dphi < constants::math::PI / 3.0) + if (dphi < o2::constants::math::PI / 3.0) return 0; - if (dphi < 2.0 * constants::math::PI / 3.0 && dphi > constants::math::PI / 3.0) + if (dphi < 2.0 * o2::constants::math::PI / 3.0 && dphi > o2::constants::math::PI / 3.0) return 1; - if (dphi > 2.0 * constants::math::PI / 3.0) + if (dphi > 2.0 * o2::constants::math::PI / 3.0) return 2; return -1; @@ -234,7 +229,7 @@ struct f0980analysis { histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC()); histos.fill(HIST("QA/LTpt"), LHpt, collision.cent(), LHphi); - TLorentzVector Pion1, Pion2, Reco; + ROOT::Math::LorentzVector> Pion1, Pion2, Reco; for (auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { @@ -256,8 +251,8 @@ struct f0980analysis { continue; relPhi = TVector2::Phi_0_2pi(Reco.Phi() - collision.evtPl()); - if (relPhi > constants::math::PI) { - relPhi -= constants::math::PI; + if (relPhi > o2::constants::math::PI) { + relPhi -= o2::constants::math::PI; } if (trk1.sign() * trk2.sign() < 0) { @@ -268,11 +263,11 @@ struct f0980analysis { histos.fill(HIST("hInvMass_f0980_US_EPA"), Reco.M(), Reco.Pt(), collision.cent(), relPhi); if constexpr (IsMC) { - if (abs(trk1.pdgCode()) != 211 || abs(trk2.pdgCode()) != 211) + if (std::abs(trk1.pdgCode()) != 211 || std::abs(trk2.pdgCode()) != 211) continue; if (trk1.motherId() != trk2.motherId()) continue; - if (abs(trk1.motherPDG()) != 9010221) + if (std::abs(trk1.motherPDG()) != 9010221) continue; histos.fill(HIST("MCL/hpT_f0980_REC"), Reco.M(), Reco.Pt(), collision.cent()); @@ -313,7 +308,7 @@ struct f0980analysis { void processMCTrue(aod::ResoMCParents& resoParents) { for (auto& part : resoParents) { // loop over all pre-filtered MC particles - if (abs(part.pdgCode()) != 9010221) + if (std::abs(part.pdgCode()) != 9010221) continue; if (!part.producedByGenerator()) continue; @@ -321,8 +316,8 @@ struct f0980analysis { continue; } bool pass = false; - if ((abs(part.daughterPDG1()) == 211 && - abs(part.daughterPDG2()) == 211)) { + if ((std::abs(part.daughterPDG1()) == 211 && + std::abs(part.daughterPDG2()) == 211)) { pass = true; } if (!pass) // If we have both decay products From 063d268e9d47c628346b59f77b18af9740ccf30f Mon Sep 17 00:00:00 2001 From: Yunseul Date: Tue, 1 Jul 2025 00:34:02 +0900 Subject: [PATCH 04/29] [PWGLF] O2 linter --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 149 +++++++++++++---------- 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 2015f63eb97..340ae17b7a1 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -8,8 +8,11 @@ // 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. - -/// \author Junlee Kim (jikim1290@gmail.com) +/// +/// \file f0980analysis.cxx +/// \brief f0(980) analysis in pp 13.6 TeV +/// \author Yunseul Bae (ybae@cern.ch), Junlee Kim (jikim1290@gmail.com) +/// \since 30/06/2025 #include "PWGLF/DataModel/LFResonanceTables.h" @@ -29,6 +32,8 @@ #include +using namespace o2::constants::physics; + struct f0980analysis { SliceCache cache; HistogramRegistry histos{ @@ -78,7 +83,7 @@ struct f0980analysis { Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC Configurable cMaxTPCnSigmaPionWoTOF{"cMaxTPCnSigmaPionWoTOF", 2.0, "TPC nSigma cut without TOF for Pion"}; Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; - Configurable SelectType{"SelectType", 0, "PID selection type"}; + Configurable selectType{"SelectType", 0, "PID selection type"}; // Axis ConfigurableAxis massAxis{"massAxis", {400, 0.2, 2.2}, "Invariant mass axis"}; @@ -88,41 +93,41 @@ struct f0980analysis { { std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; - AxisSpec RTAxis = {3, 0, 3}; - AxisSpec LptAxis = {lptBinning}; // Minimum leading hadron pT selection + AxisSpec rtAxis = {3, 0, 3}; + AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection - AxisSpec PIDqaAxis = {120, -6, 6}; + AxisSpec pidQaAxis = {120, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0., 2.0 * o2::constants::math::PI}; - AxisSpec EPAxis = {10, 0, o2::constants::math::PI}; - AxisSpec EPqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; - AxisSpec EPresAxis = {200, -2, 2}; + AxisSpec phiqaAxis = {72, 0, o2::constants::math::TWOPI}; + AxisSpec epAxis = {10, 0, o2::constants::math::PI}; + AxisSpec epQaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; + AxisSpec epResAxis = {200, -2, 2}; if (cfgFindRT) { histos.add("hInvMass_f0980_US", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSpp", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSmm", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); } histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); - histos.add("QA/hEPResAB", "", {HistType::kTH2F, {centAxis, EPresAxis}}); - histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, EPresAxis}}); - histos.add("QA/hEPResBC", "", {HistType::kTH2F, {centAxis, EPresAxis}}); + histos.add("QA/hEPResAB", "", {HistType::kTH2F, {centAxis, epResAxis}}); + histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, epResAxis}}); + histos.add("QA/hEPResBC", "", {HistType::kTH2F, {centAxis, epResAxis}}); - histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, PIDqaAxis}}); - histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, PIDqaAxis}}); - histos.add("QA/TPC_TOF", "", {HistType::kTH2F, {PIDqaAxis, PIDqaAxis}}); + histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); + histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); + histos.add("QA/TPC_TOF", "", {HistType::kTH2F, {pidQaAxis, pidQaAxis}}); histos.add("QA/LTpt", "", {HistType::kTH3F, {pTqaAxis, centAxis, phiqaAxis}}); - histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, EPqaAxis}}); + histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epQaAxis}}); if (doprocessMCLight) { histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, @@ -136,21 +141,26 @@ struct f0980analysis { double massPi = MassPionCharged; - int RTIndex(double pairphi, double lhphi) + constexpr float OneThird = 1.0f / 3.0f; + constexpr float PIthird = o2::constants::math::PI * OneThird; + constexpr float TWOPIthird = o2::constants::math::TWOPI * OneThird; + + int rtIndex(double pairphi, double lhPhi) { - double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi)); - if (dphi < o2::constants::math::PI / 3.0) + double dphi = std::fabs(TVector2::Phi_mpi_pi(lhPhi - pairphi)); + + if (dphi < PIthird) return 0; - if (dphi < 2.0 * o2::constants::math::PI / 3.0 && dphi > o2::constants::math::PI / 3.0) + if (dphi < TWOPIthird && dphi > PIthird) return 1; - if (dphi > 2.0 * o2::constants::math::PI / 3.0) + if (dphi > TWOPIthird) return 2; return -1; } template - bool SelTrack(const TrackType track) + bool selTrack(const TrackType track) { if (std::abs(track.pt()) < cfgMinPt) return false; @@ -181,21 +191,26 @@ struct f0980analysis { } template - bool SelPion(const TrackType track) + bool selPion(const TrackType track) { - if (SelectType == 0) { + constexpr int TPCorTOF = 0; + constexpr int TPCOnly = 1; + constexpr int Combined = 2; + constexpr int Run2Like = 3; + + if (selectType == TPCorTOF) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; } - if (SelectType == 1) { + if (selectType == TPConly) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) return false; } - if (SelectType == 2) { + if (selectType == Combined) { if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) return false; } - if (SelectType == 3) { + if (selectType == Run2Like) { if (track.hasTOF()) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; @@ -211,14 +226,14 @@ struct f0980analysis { void fillHistograms(const CollisionType& collision, const TracksType& dTracks) { - double LHpt = 0.; - double LHphi = 0.; + double lhPt = 0.; + double lhPhi = 0.; double relPhi = 0.; if (cfgFindRT) { - for (auto& trk : dTracks) { - if (trk.pt() > LHpt) { - LHpt = trk.pt(); - LHphi = trk.phi(); + for (const auto& trk : dTracks) { + if (trk.pt() > lhPt) { + lhPt = trk.pt(); + lhPhi = trk.phi(); } } } @@ -227,64 +242,64 @@ struct f0980analysis { histos.fill(HIST("QA/hEPResAB"), collision.cent(), collision.evtPlResAB()); histos.fill(HIST("QA/hEPResAC"), collision.cent(), collision.evtPlResBC()); histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC()); - histos.fill(HIST("QA/LTpt"), LHpt, collision.cent(), LHphi); + histos.fill(HIST("QA/LTpt"), lhPt, collision.cent(), lhPhi); - ROOT::Math::LorentzVector> Pion1, Pion2, Reco; - for (auto& [trk1, trk2] : + ROOT::Math::LorentzVector> pion1, pion2, reco; + for (const auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { - if (!SelTrack(trk1) || !SelTrack(trk2)) + if (!selTrack(trk1) || !selTrack(trk2)) continue; // TPC, TOF Nsigma distributions histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); - if (!SelPion(trk1) || !SelPion(trk2)) + if (!selPion(trk1) || !selPion(trk2)) continue; - Pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPi); - Pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); - Reco = Pion1 + Pion2; + pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPi); + pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + reco = pion1 + pion2; - if (Reco.Rapidity() > cfgMaxRap || Reco.Rapidity() < cfgMinRap) + if (reco.Rapidity() > cfgMaxRap || reco.Rapidity() < cfgMinRap) continue; - relPhi = TVector2::Phi_0_2pi(Reco.Phi() - collision.evtPl()); + relPhi = TVector2::Phi_0_2pi(reco.Phi() - collision.evtPl()); if (relPhi > o2::constants::math::PI) { relPhi -= o2::constants::math::PI; } if (trk1.sign() * trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_US"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + histos.fill(HIST("hInvMass_f0980_US"), reco.M(), reco.Pt(), + collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); } - histos.fill(HIST("hInvMass_f0980_US_EPA"), Reco.M(), Reco.Pt(), + histos.fill(HIST("hInvMass_f0980_US_EPA"), reco.M(), reco.Pt(), collision.cent(), relPhi); if constexpr (IsMC) { - if (std::abs(trk1.pdgCode()) != 211 || std::abs(trk2.pdgCode()) != 211) + if (std::abs(trk1.pdgCode()) != Pdg::PiPlus || std::abs(trk2.pdgCode()) != Pdg::PiPlus) continue; if (trk1.motherId() != trk2.motherId()) continue; - if (std::abs(trk1.motherPDG()) != 9010221) + if (std::abs(trk1.motherPDG()) != Pdg::f0_980) // 9010221 continue; - histos.fill(HIST("MCL/hpT_f0980_REC"), Reco.M(), Reco.Pt(), + histos.fill(HIST("MCL/hpT_f0980_REC"), reco.M(), reco.Pt(), collision.cent()); } } else if (trk1.sign() > 0 && trk2.sign() > 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSpp"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + histos.fill(HIST("hInvMass_f0980_LSpp"), reco.M(), reco.Pt(), + collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); } - histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), Reco.M(), Reco.Pt(), + histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), reco.M(), reco.Pt(), collision.cent(), relPhi); } else if (trk1.sign() < 0 && trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSmm"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), + collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); } - histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), Reco.M(), Reco.Pt(), + histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relPhi); } } @@ -305,10 +320,10 @@ struct f0980analysis { } PROCESS_SWITCH(f0980analysis, processMCLight, "Process Event for MC", false); - void processMCTrue(aod::ResoMCParents& resoParents) + void processMCTrue(const aod::ResoMCParents& resoParents) { - for (auto& part : resoParents) { // loop over all pre-filtered MC particles - if (std::abs(part.pdgCode()) != 9010221) + for (const auto& part : resoParents) { // loop over all pre-filtered MC particles + if (std::abs(part.pdgCode()) != Pdg::f0_980) continue; if (!part.producedByGenerator()) continue; @@ -316,8 +331,8 @@ struct f0980analysis { continue; } bool pass = false; - if ((std::abs(part.daughterPDG1()) == 211 && - std::abs(part.daughterPDG2()) == 211)) { + if ((std::abs(part.daughterPDG1()) == Pdg::PiPlus && + std::abs(part.daughterPDG2()) == Pdg::PiPlus)) { pass = true; } if (!pass) // If we have both decay products From a307d739e528db81678035aeb3abf0e5bb50b970 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Thu, 3 Jul 2025 15:38:54 +0900 Subject: [PATCH 05/29] [PWGLF] *Debug* and Change PID select type with "switch" - Reorganised overall - Fixed build error --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 287 ++++++++++------------- 1 file changed, 126 insertions(+), 161 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 340ae17b7a1..f3a3257b615 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -12,128 +12,114 @@ /// \file f0980analysis.cxx /// \brief f0(980) analysis in pp 13.6 TeV /// \author Yunseul Bae (ybae@cern.ch), Junlee Kim (jikim1290@gmail.com) -/// \since 30/06/2025 +/// \since 01/07/2024 #include "PWGLF/DataModel/LFResonanceTables.h" - #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" - #include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" +#include "Framework/AnalysisHelpers.h" #include "Framework/runDataProcessing.h" #include - #include "TVector2.h" - +#include "Math/LorentzVector.h" +#include "Math/Vector4D.h" +#include #include +using namespace o2; using namespace o2::constants::physics; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod; +using namespace o2::soa; struct f0980analysis { SliceCache cache; - HistogramRegistry histos{ - "histos", - {}, - OutputObjHandlingPolicy::AnalysisObject}; - - Configurable cfgMinPt{"cfgMinPt", 0.15, - "Minimum transverse momentum for charged track"}; - Configurable cfgMaxEta{"cfgMaxEta", 0.8, - "Maximum pseudorapidiy for charged track"}; - Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.5, - "Maximum transverse DCA"}; - Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, - "Maximum longitudinal DCA"}; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Event selections + Configurable cfgMinpT{"cfgMinpT", 0.15, "Minimum transverse momentum for charged track"}; + Configurable cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"}; + Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.5, "Maximum transverse DCA"}; + Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, "Maximum longitudinal DCA"}; Configurable cfgMinRap{"cfgMinRap", -0.5, "Minimum rapidity for pair"}; Configurable cfgMaxRap{"cfgMaxRap", 0.5, "Maximum rapidity for pair"}; Configurable cfgFindRT{"cfgFindRT", false, "boolean for RT analysis"}; - // Track selection - Configurable cfgPrimaryTrack{ - "cfgPrimaryTrack", true, - "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgGlobalWoDCATrack{ - "cfgGlobalWoDCATrack", true, - "Global track selection without DCA"}; // kQualityTracks (kTrackType | - // kTPCNCls | kTPCCrossedRows | - // kTPCCrossedRowsOverNCls | - // kTPCChi2NDF | kTPCRefit | - // kITSNCls | kITSChi2NDF | - // kITSRefit | kITSHits) | - // kInAcceptanceTracks (kPtRange | - // kEtaRange) - Configurable cfgPVContributor{ - "cfgPVContributor", true, - "PV contributor track selection"}; // PV Contriuibutor - Configurable cfgGlobalTrack{ - "cfgGlobalTrack", false, - "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; + // Track selections + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | + // kTPCNCls | kTPCCrossedRows | + // kTPCCrossedRowsOverNCls | + // kTPCChi2NDF | kTPCRefit | + // kITSNCls | kITSChi2NDF | + // kITSRefit | kITSHits) | + // kInAcceptanceTracks (kPtRange | + // kEtaRange) + Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; - // PID - Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF - Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC + // PID + Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; Configurable cMaxTPCnSigmaPionWoTOF{"cMaxTPCnSigmaPionWoTOF", 2.0, "TPC nSigma cut without TOF for Pion"}; Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; Configurable selectType{"SelectType", 0, "PID selection type"}; - // Axis + // Axis ConfigurableAxis massAxis{"massAxis", {400, 0.2, 2.2}, "Invariant mass axis"}; - ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"}; - ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 95.0, 100.0, 105.0, 110.0}, "Centrality Binning"}; - void init(o2::framework::InitContext&) - { - std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; + ConfigurableAxis pTAxis{"pTAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"}; + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 95.0, 100.0, 105.0, 110.0}, "Centrality Binning"}; + void init (o2::framework::InitContext&) { + std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; + AxisSpec rtAxis = {3, 0, 3}; - AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection + AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection - AxisSpec pidQaAxis = {120, -6, 6}; + AxisSpec pidqaAxis = {60, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0, o2::constants::math::TWOPI}; - AxisSpec epAxis = {10, 0, o2::constants::math::PI}; - AxisSpec epQaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; + AxisSpec phiqaAxis = {72, 0, o2::constants::math::TwoPI}; // Azimuthal angle axis + + AxisSpec epAxis = {10, 0, o2::constants::math::PI}; // Event Plane + AxisSpec epqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec epResAxis = {200, -2, 2}; if (cfgFindRT) { - histos.add("hInvMass_f0980_US", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); - histos.add("hInvMass_f0980_LSpp", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); - histos.add("hInvMass_f0980_LSmm", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); + histos.add("hInvMass_f0980_US", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); + histos.add("hInvMass_f0980_LSpp", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); + histos.add("hInvMass_f0980_LSmm", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); + } + else { + histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); + histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); + histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); } - histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); - histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); - histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); + histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epqaAxis}}); histos.add("QA/hEPResAB", "", {HistType::kTH2F, {centAxis, epResAxis}}); - histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, epResAxis}}); histos.add("QA/hEPResBC", "", {HistType::kTH2F, {centAxis, epResAxis}}); - - histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); - histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); - histos.add("QA/TPC_TOF", "", {HistType::kTH2F, {pidQaAxis, pidQaAxis}}); + histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, epResAxis}}); histos.add("QA/LTpt", "", {HistType::kTH3F, {pTqaAxis, centAxis, phiqaAxis}}); - histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epQaAxis}}); + + histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, pidqaAxis}}); + histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, pidqaAxis}}); + histos.add("QA/Nsigma_TPC_TOF", "", {HistType::kTH2F, {pidqaAxis, pidqaAxis}}); if (doprocessMCLight) { - histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, - {pTqaAxis}); - histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", - HistType::kTH3F, {massAxis, pTqaAxis, centAxis}); + histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F,{pTqaAxis}); + histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", HistType::kTH3F, {massAxis, pTqaAxis, centAxis}); } histos.print(); @@ -141,13 +127,13 @@ struct f0980analysis { double massPi = MassPionCharged; - constexpr float OneThird = 1.0f / 3.0f; - constexpr float PIthird = o2::constants::math::PI * OneThird; - constexpr float TWOPIthird = o2::constants::math::TWOPI * OneThird; + static constexpr float OneThird = 1.0f / 3.0f; + static constexpr float PIthird = o2::constants::math::PI * OneThird; + static constexpr float TWOPIthird = o2::constants::math::TwoPI * OneThird; - int rtIndex(double pairphi, double lhPhi) + int rtIndex(double pairphi, double lhphi) { - double dphi = std::fabs(TVector2::Phi_mpi_pi(lhPhi - pairphi)); + double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi)); if (dphi < PIthird) return 0; @@ -160,9 +146,8 @@ struct f0980analysis { } template - bool selTrack(const TrackType track) - { - if (std::abs(track.pt()) < cfgMinPt) + bool selTrack (const TrackType track) { + if (std::abs(track.pt()) < cfgMinpT) return false; if (std::fabs(track.eta()) > cfgMaxEta) return false; @@ -172,158 +157,138 @@ struct f0980analysis { return false; if (track.tpcNClsFound() < cfgTPCcluster) return false; - if (cfgHasTOF && !track.hasTOF()) + if (cfgPrimaryTrack && !track.isPrimaryTrack()) return false; - if (cfgUseITSRefit && !track.passedITSRefit()) + if (cfgGlobalTrack && !track.isGlobalTrack()) return false; - if (cfgUseTPCRefit && !track.passedTPCRefit()) + if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) return false; if (cfgPVContributor && !track.isPVContributor()) return false; - if (cfgPrimaryTrack && !track.isPrimaryTrack()) + if (cfgUseITSRefit && !track.passedITSRefit()) return false; - if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + if (cfgUseTPCRefit && !track.passedTPCRefit()) return false; - if (cfgGlobalTrack && !track.isGlobalTrack()) + if (cfgHasTOF && !track.hasTOF()) return false; return true; } template - bool selPion(const TrackType track) - { - constexpr int TPCorTOF = 0; - constexpr int TPCOnly = 1; - constexpr int Combined = 2; - constexpr int Run2Like = 3; - - if (selectType == TPCorTOF) { - if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) - return false; - } - if (selectType == TPConly) { - if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) - return false; - } - if (selectType == Combined) { - if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) - return false; - } - if (selectType == Run2Like) { - if (track.hasTOF()) { + bool selPion (const TrackType track) { + switch (selectType) { + case 0: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; - } else if (!track.hasTOF()) { - if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) + case 1: + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) return false; - } + case 2: + if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) + return false; + case 3: + if (track.hasTOF()) { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) + return false; + } + else { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) + return false; + } } return true; } template - void fillHistograms(const CollisionType& collision, - const TracksType& dTracks) - { - double lhPt = 0.; - double lhPhi = 0.; - double relPhi = 0.; + void fillHistograms(const CollisionType& collision, const TracksType& dTracks) { + double lhpT = 0.; + double lhphi = 0.; + double relphi = 0.; if (cfgFindRT) { for (const auto& trk : dTracks) { - if (trk.pt() > lhPt) { - lhPt = trk.pt(); - lhPhi = trk.phi(); + if (trk.pt() > lhpT) { + lhpT = trk.pt(); + lhphi = trk.phi(); } } } - histos.fill(HIST("QA/EPhist"), collision.cent(), collision.evtPl()); histos.fill(HIST("QA/hEPResAB"), collision.cent(), collision.evtPlResAB()); - histos.fill(HIST("QA/hEPResAC"), collision.cent(), collision.evtPlResBC()); - histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC()); - histos.fill(HIST("QA/LTpt"), lhPt, collision.cent(), lhPhi); + histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResBC()); + histos.fill(HIST("QA/hEPResAC"), collision.cent(), collision.evtPlResAC()); + histos.fill(HIST("QA/LTpt"), lhpT, collision.cent(), lhphi); - ROOT::Math::LorentzVector> pion1, pion2, reco; - for (const auto& [trk1, trk2] : - combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { + ROOT::Math::LorentzVector> pion1, pion2, reco; + for (const auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { if (!selTrack(trk1) || !selTrack(trk2)) continue; - // TPC, TOF Nsigma distributions histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); - histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); + histos.fill(HIST("QA/Nsigma_TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); if (!selPion(trk1) || !selPion(trk2)) continue; - pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPi); - pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + pion1 = ROOT::Math::PxPyPzMVector(trk1.px(), trk1.py(), trk1.pz(), massPi); + pion2 = ROOT::Math::PxPyPzMVector(trk2.px(), trk2.py(), trk2.pz(), massPi); reco = pion1 + pion2; - if (reco.Rapidity() > cfgMaxRap || reco.Rapidity() < cfgMinRap) continue; - relPhi = TVector2::Phi_0_2pi(reco.Phi() - collision.evtPl()); - if (relPhi > o2::constants::math::PI) { - relPhi -= o2::constants::math::PI; + relphi = TVector2::Phi_0_2pi(reco.Phi() - collision.evtPl()); + if (relphi > o2::constants::math::PI) { + relphi -= o2::constants::math::PI; } if (trk1.sign() * trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_US"), reco.M(), reco.Pt(), - collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); + histos.fill(HIST("hInvMass_f0980_US"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_US_EPA"), reco.M(), reco.Pt(), - collision.cent(), relPhi); + histos.fill(HIST("hInvMass_f0980_US_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); if constexpr (IsMC) { - if (std::abs(trk1.pdgCode()) != Pdg::PiPlus || std::abs(trk2.pdgCode()) != Pdg::PiPlus) + if (std::abs(trk1.pdgCode()) != kPiPlus || std::abs(trk2.pdgCode()) != kPiPlus) continue; if (trk1.motherId() != trk2.motherId()) continue; - if (std::abs(trk1.motherPDG()) != Pdg::f0_980) // 9010221 + if (std::abs(trk1.motherPDG()) != 9010221) continue; - histos.fill(HIST("MCL/hpT_f0980_REC"), reco.M(), reco.Pt(), - collision.cent()); + histos.fill(HIST("MCL/hpT_f0980_REC"), reco.M(), reco.Pt(), collision.cent()); } } else if (trk1.sign() > 0 && trk2.sign() > 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSpp"), reco.M(), reco.Pt(), - collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); + histos.fill(HIST("hInvMass_f0980_LSpp"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), reco.M(), reco.Pt(), - collision.cent(), relPhi); + histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); } else if (trk1.sign() < 0 && trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), - collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); + histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), - collision.cent(), relPhi); + histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); } } } - void processData(soa::Join::iterator const& collision, - aod::ResoTracks const& resotracks) + void processData(o2::soa::Join::iterator const& collision, + o2::aod::ResoTracks const& resotracks) { fillHistograms(collision, resotracks); } PROCESS_SWITCH(f0980analysis, processData, "Process Event for data", true); void processMCLight( - soa::Join::iterator const& collision, - soa::Join const& resotracks) + o2::soa::Join::iterator const& collision, + o2::soa::Join const& resotracks) { fillHistograms(collision, resotracks); } PROCESS_SWITCH(f0980analysis, processMCLight, "Process Event for MC", false); - void processMCTrue(const aod::ResoMCParents& resoParents) + void processMCTrue(const o2::aod::ResoMCParents& resoParents) { for (const auto& part : resoParents) { // loop over all pre-filtered MC particles - if (std::abs(part.pdgCode()) != Pdg::f0_980) + if (std::abs(part.pdgCode()) != 9010221) continue; if (!part.producedByGenerator()) continue; @@ -331,8 +296,8 @@ struct f0980analysis { continue; } bool pass = false; - if ((std::abs(part.daughterPDG1()) == Pdg::PiPlus && - std::abs(part.daughterPDG2()) == Pdg::PiPlus)) { + if ((std::abs(part.daughterPDG1()) == kPiPlus && + std::abs(part.daughterPDG2()) == kPiPlus)) { pass = true; } if (!pass) // If we have both decay products From ab12549fc6d18fe101b7b14f5720962f439805e6 Mon Sep 17 00:00:00 2001 From: feisenhu <53603353+feisenhu@users.noreply.github.com> Date: Thu, 3 Jul 2025 09:00:36 +0200 Subject: [PATCH 06/29] [PWGEM] DielectronMC.h momentum loss of both tracks vs DCA (#11876) --- PWGEM/Dilepton/Core/DileptonMC.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 86274047388..6efda61919c 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -425,10 +425,10 @@ struct DileptonMC { fRegistry.add("Pair/sm/Photon/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); fRegistry.add("Pair/sm/PromptPi0/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); fRegistry.add("Pair/sm/NonPromptPi0/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/sm/PromptPi0/hDeltaPtvsDCA", Form("p^{gen}_{T,e} - p^{rec}_{T,e} vs. DCA_{ee};%s;p^{gen}_{T,e} - p^{rec}_{T,e} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); - fRegistry.add("Pair/sm/NonPromptPi0/hDeltaPtvsDCA", Form("p^{gen}_{T,e} - p^{rec}_{T,e} vs. DCA_{ee};%s;p^{gen}_{T,e} - p^{rec}_{T,e} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); - fRegistry.add("Pair/sm/PromptJPsi/hDeltaPtvsDCA", Form("p^{gen}_{T,e} - p^{rec}_{T,e} vs. DCA_{ee};%s;p^{gen}_{T,e} - p^{rec}_{T,e} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); - fRegistry.add("Pair/sm/NonPromptJPsi/hDeltaPtvsDCA", Form("p^{gen}_{T,e} - p^{rec}_{T,e} vs. DCA_{ee};%s;p^{gen}_{T,e} - p^{rec}_{T,e} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); + fRegistry.add("Pair/sm/PromptPi0/hDeltaPtvsDCA", Form("#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee};%s;#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); + fRegistry.add("Pair/sm/NonPromptPi0/hDeltaPtvsDCA", Form("#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee};%s;#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); + fRegistry.add("Pair/sm/PromptJPsi/hDeltaPtvsDCA", Form("#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee};%s;#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); + fRegistry.add("Pair/sm/NonPromptJPsi/hDeltaPtvsDCA", Form("#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee};%s;#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)", pair_dca_axis_title.c_str()), kTH2F, {{160, 0, 8.}, {220, -1.f, +10.f}}, true); } fRegistry.add("Pair/ccbar/c2l_c2l/hadron_hadron/hs", "hs pair", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_cs, axis_phi_cs, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); @@ -983,15 +983,13 @@ struct DileptonMC { case 111: if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 fRegistry.fill(HIST("Pair/sm/PromptPi0/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, std::fabs(cos_thetaCS), std::fabs(phiCS), aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); - fRegistry.fill(HIST("Pair/sm/PromptPi0/hDeltaPtvsDCA"), pair_dca, deltaPt1); - fRegistry.fill(HIST("Pair/sm/PromptPi0/hDeltaPtvsDCA"), pair_dca, deltaPt2); + fRegistry.fill(HIST("Pair/sm/PromptPi0/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/sm/PromptPi0/hMvsPhiV"), phiv, v12.M()); } } else { // non-prompt pi0 fRegistry.fill(HIST("Pair/sm/NonPromptPi0/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, std::fabs(cos_thetaCS), std::fabs(phiCS), aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/hDeltaPtvsDCA"), pair_dca, deltaPt1); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/hDeltaPtvsDCA"), pair_dca, deltaPt2); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { fRegistry.fill(HIST("Pair/sm/NonPromptPi0/hMvsPhiV"), phiv, v12.M()); } @@ -1021,12 +1019,10 @@ struct DileptonMC { case 443: { if (IsFromBeauty(mcmother, mcparticles) > 0) { fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, std::fabs(cos_thetaCS), std::fabs(phiCS), aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/hDeltaPtvsDCA"), pair_dca, deltaPt1); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/hDeltaPtvsDCA"), pair_dca, deltaPt2); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); } else { fRegistry.fill(HIST("Pair/sm/PromptJPsi/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, std::fabs(cos_thetaCS), std::fabs(phiCS), aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/hDeltaPtvsDCA"), pair_dca, deltaPt1); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/hDeltaPtvsDCA"), pair_dca, deltaPt2); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); } break; } From 2e2ccdc7ffd10a9c2a57e3fc87fc055fae13feda Mon Sep 17 00:00:00 2001 From: Yunseul Date: Thu, 3 Jul 2025 16:07:34 +0900 Subject: [PATCH 07/29] [PWGLF] Apply clang-format --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 60 +++++++++++++----------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index f3a3257b615..f92d58f7577 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -15,21 +15,25 @@ /// \since 01/07/2024 #include "PWGLF/DataModel/LFResonanceTables.h" + #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" + #include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" #include "Framework/AnalysisHelpers.h" +#include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include -#include "TVector2.h" + #include "Math/LorentzVector.h" #include "Math/Vector4D.h" +#include "TVector2.h" #include + #include using namespace o2; @@ -42,7 +46,7 @@ using namespace o2::soa; struct f0980analysis { SliceCache cache; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - + // Event selections Configurable cfgMinpT{"cfgMinpT", 0.15, "Minimum transverse momentum for charged track"}; Configurable cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"}; @@ -53,16 +57,16 @@ struct f0980analysis { Configurable cfgFindRT{"cfgFindRT", false, "boolean for RT analysis"}; // Track selections - Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | - // kTPCNCls | kTPCCrossedRows | - // kTPCCrossedRowsOverNCls | - // kTPCChi2NDF | kTPCRefit | - // kITSNCls | kITSChi2NDF | - // kITSRefit | kITSHits) | - // kInAcceptanceTracks (kPtRange | - // kEtaRange) + // kTPCNCls | kTPCCrossedRows | + // kTPCCrossedRowsOverNCls | + // kTPCChi2NDF | kTPCRefit | + // kITSNCls | kITSChi2NDF | + // kITSRefit | kITSHits) | + // kInAcceptanceTracks (kPtRange | + // kEtaRange) Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; @@ -81,17 +85,18 @@ struct f0980analysis { ConfigurableAxis pTAxis{"pTAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"}; ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 95.0, 100.0, 105.0, 110.0}, "Centrality Binning"}; - void init (o2::framework::InitContext&) { + void init(o2::framework::InitContext&) + { std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; - + AxisSpec rtAxis = {3, 0, 3}; - AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection + AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection AxisSpec pidqaAxis = {60, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0, o2::constants::math::TwoPI}; // Azimuthal angle axis + AxisSpec phiqaAxis = {72, 0, o2::constants::math::TwoPI}; // Azimuthal angle axis - AxisSpec epAxis = {10, 0, o2::constants::math::PI}; // Event Plane + AxisSpec epAxis = {10, 0, o2::constants::math::PI}; // Event Plane AxisSpec epqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec epResAxis = {200, -2, 2}; @@ -99,11 +104,10 @@ struct f0980analysis { histos.add("hInvMass_f0980_US", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSpp", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSmm", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); - } - else { + } else { histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); - histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); + histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); } histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epqaAxis}}); @@ -118,7 +122,7 @@ struct f0980analysis { histos.add("QA/Nsigma_TPC_TOF", "", {HistType::kTH2F, {pidqaAxis, pidqaAxis}}); if (doprocessMCLight) { - histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F,{pTqaAxis}); + histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, {pTqaAxis}); histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", HistType::kTH3F, {massAxis, pTqaAxis, centAxis}); } @@ -146,7 +150,8 @@ struct f0980analysis { } template - bool selTrack (const TrackType track) { + bool selTrack(const TrackType track) + { if (std::abs(track.pt()) < cfgMinpT) return false; if (std::fabs(track.eta()) > cfgMaxEta) @@ -176,7 +181,8 @@ struct f0980analysis { } template - bool selPion (const TrackType track) { + bool selPion(const TrackType track) + { switch (selectType) { case 0: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) @@ -191,8 +197,7 @@ struct f0980analysis { if (track.hasTOF()) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; - } - else { + } else { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) return false; } @@ -201,7 +206,8 @@ struct f0980analysis { } template - void fillHistograms(const CollisionType& collision, const TracksType& dTracks) { + void fillHistograms(const CollisionType& collision, const TracksType& dTracks) + { double lhpT = 0.; double lhphi = 0.; double relphi = 0.; @@ -265,7 +271,7 @@ struct f0980analysis { if (cfgFindRT) { histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); + histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); } } } From 8876e545bfc273ce2354eb6cead5360fb7a81359 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Thu, 3 Jul 2025 16:11:52 +0900 Subject: [PATCH 08/29] [PWGLF] Apply clang-format --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index f92d58f7577..eac70aa392d 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -60,13 +60,13 @@ struct f0980analysis { Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | - // kTPCNCls | kTPCCrossedRows | - // kTPCCrossedRowsOverNCls | - // kTPCChi2NDF | kTPCRefit | - // kITSNCls | kITSChi2NDF | - // kITSRefit | kITSHits) | - // kInAcceptanceTracks (kPtRange | - // kEtaRange) + // kTPCNCls | kTPCCrossedRows | + // kTPCCrossedRowsOverNCls | + // kTPCChi2NDF | kTPCRefit | + // kITSNCls | kITSChi2NDF | + // kITSRefit | kITSHits) | + // kInAcceptanceTracks (kPtRange | + // kEtaRange) Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; From e4aa4c821510b5e19ebbf4d75c7a006644258242 Mon Sep 17 00:00:00 2001 From: Fabio Catalano Date: Thu, 3 Jul 2025 10:39:33 +0200 Subject: [PATCH 09/29] =?UTF-8?q?[PWGHF]=20OmegaC=20task,=20enable=20runni?= =?UTF-8?q?ng=20one=20data=20and=20one=20MC=20process=20function=20at=20t?= =?UTF-8?q?=E2=80=A6=20(#11881)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx index 4e9c3ccc412..73511652f69 100644 --- a/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx +++ b/PWGHF/D2H/Tasks/taskOmegac0ToOmegapi.cxx @@ -102,9 +102,14 @@ struct HfTaskOmegac0ToOmegapi { void init(InitContext&) { - std::array doprocess{doprocessDataWithKFParticle, doprocessMcWithKFParticle, doprocessDataWithKFParticleMl, doprocessMcWithKFParticleMl, doprocessDataWithKFParticleFT0C, doprocessDataWithKFParticleMlFT0C, doprocessDataWithKFParticleFT0M, doprocessDataWithKFParticleMlFT0M}; + std::array doprocess{doprocessDataWithKFParticle, doprocessDataWithKFParticleMl, doprocessDataWithKFParticleFT0C, doprocessDataWithKFParticleMlFT0C, doprocessDataWithKFParticleFT0M, doprocessDataWithKFParticleMlFT0M}; if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { - LOGP(fatal, "One and only one process function should be enabled at a time."); + LOGP(fatal, "One and only one data process function should be enabled at a time."); + } + + std::array doprocessMc{doprocessMcWithKFParticle, doprocessMcWithKFParticleMl}; + if ((std::accumulate(doprocessMc.begin(), doprocessMc.end(), 0)) != 1) { + LOGP(fatal, "One and only one MC process function should be enabled at a time."); } const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (#Omega#pi) (GeV/#it{c}^{2})"}; From 98370a573852ba077a82a6c50b29d43c87ae4c9f Mon Sep 17 00:00:00 2001 From: Katarzyna <116073883+kgwizdzi@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:48:16 +0200 Subject: [PATCH 10/29] [PWGCF] FemtoUniverse - MCTruth producer update (#11842) --- .../femtoUniverseProducerMCTruthTask.cxx | 116 +++++++++--------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx index 8152aee0d5e..9ab5dcecd68 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerMCTruthTask.cxx @@ -14,35 +14,35 @@ /// \author Malgorzata Janik, WUT Warsaw, majanik@cern.ch /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch -#include -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h" -#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" -#include "Framework/ASoAHelpers.h" +#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" + +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" + #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" -#include "Math/Vector4D.h" -#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "ReconstructionDataFormats/Track.h" -#include "TMath.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::analysis::femto_universe; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::constants::physics; namespace o2::aod { @@ -71,7 +71,7 @@ int getRowDaughters(int daughID, T const& vecID) return rowInPrimaryTrackTableDaugh; } -struct femtoUniverseProducerMCTruthTask { +struct FemtoUniverseProducerMCTruthTask { int mRunNumber; float mMagField; Service ccdb; /// Accessing the CCDB @@ -83,29 +83,26 @@ struct femtoUniverseProducerMCTruthTask { // Produces outputPartsMC; // Analysis configs - Configurable ConfIsTrigger{"ConfIsTrigger", false, "Store all collisions"}; // Choose if filtering or skimming version is run - Configurable ConfIsRun3{"ConfIsRun3", false, "Running on Run3 or pilot"}; - Configurable ConfIsMC{"ConfIsMC", false, "Running on MC; implemented only for Run3"}; - Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; - Configurable ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtouniverse tables"}; - Configurable ConfIsActivatePhi{"ConfIsActivatePhi", true, "Activate filling of Phi into femtouniverse tables"}; - Configurable> ConfPDGCodes{"ConfPDGCodes", std::vector{211, -211, 2212, -2212, 333}, "PDG of particles to be stored"}; - Configurable ConfAnalysisWithPID{"ConfAnalysisWithPID", true, "1: take only particles with specified PDG, 0: all particles"}; + Configurable confIsRun3{"confIsRun3", false, "Running on Run3 or pilot"}; + Configurable confIsMC{"confIsMC", false, "Running on MC; implemented only for Run3"}; + Configurable confIsForceGRP{"confIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; + Configurable> confPDGCodes{"confPDGCodes", std::vector{211, -211, 2212, -2212, 333}, "PDG of particles to be stored"}; + Configurable confAnalysisWithPID{"confAnalysisWithPID", true, "1: take only particles with specified PDG, 0: all particles"}; /// Event cuts - Configurable ConfEvtUseTPCmult{"ConfEvtUseTPCmult", false, "Use multiplicity based on the number of tracks with TPC information"}; - Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"}; - Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"}; - Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"}; - Configurable ConfCentFT0Min{"ConfCentFT0Min", 0.f, "Min CentFT0 value for centrality selection"}; - Configurable ConfCentFT0Max{"ConfCentFT0Max", 200.f, "Max CentFT0 value for centrality selection"}; + Configurable confEvtZvtx{"confEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable confEvtTriggerCheck{"confEvtTriggerCheck", true, "Evt sel: check for trigger"}; + Configurable confEvtTriggerSel{"confEvtTriggerSel", kINT7, "Evt sel: trigger"}; + Configurable confEvtOfflineCheck{"confEvtOfflineCheck", false, "Evt sel: check for offline selection"}; + Configurable confCentFT0Min{"confCentFT0Min", 0.f, "Min CentFT0 value for centrality selection"}; + Configurable confCentFT0Max{"confCentFT0Max", 200.f, "Max CentFT0 value for centrality selection"}; + Configurable confDoSpher{"confDoSpher", false, "Calculate sphericity. If false sphericity will take value of 2."}; // Track cuts struct : o2::framework::ConfigurableGroup { - Configurable ConfPtLowFilterCut{"ConfPtLowFilterCut", 0.14, "Lower limit for Pt for the filtering tracks"}; // pT low - Configurable ConfPtHighFilterCut{"ConfPtHighFilterCut", 5.0, "Higher limit for Pt for the filtering tracks"}; // pT high - Configurable ConfEtaFilterCut{"ConfEtaFilterCut", 0.8, "Eta cut for the filtering tracks"}; + Configurable confPtLowFilterCut{"confPtLowFilterCut", 0.14, "Lower limit for Pt for the filtering tracks"}; // pT low + Configurable confPtHighFilterCut{"confPtHighFilterCut", 5.0, "Higher limit for Pt for the filtering tracks"}; // pT high + Configurable confEtaFilterCut{"confEtaFilterCut", 0.8, "Eta cut for the filtering tracks"}; } ConfFilteringTracks; FemtoUniverseCollisionSelection colCuts; @@ -118,7 +115,7 @@ struct femtoUniverseProducerMCTruthTask { LOGF(fatal, "Neither processFullData nor processFullMC enabled. Please choose one."); } - colCuts.setCuts(ConfEvtZvtx, ConfEvtTriggerCheck, ConfEvtTriggerSel, ConfEvtOfflineCheck, ConfIsRun3, ConfCentFT0Min, ConfCentFT0Max); + colCuts.setCuts(confEvtZvtx, confEvtTriggerCheck, confEvtTriggerSel, confEvtOfflineCheck, confIsRun3, confCentFT0Min, confCentFT0Max); colCuts.init(&qaRegistry); trackCuts.init(&qaRegistry); @@ -135,16 +132,23 @@ struct femtoUniverseProducerMCTruthTask { } template - void fillCollisions(CollisionType const& col, TrackType const& /*tracks*/) + void fillCollisions(CollisionType const& col, TrackType const& tracks) { - for (auto& c : col) { + for (const auto& c : col) { const auto vtxZ = c.posZ(); - const auto spher = 0; // colCuts.computeSphericity(col, tracks); - int mult = 0; - int multNtr = 0; + float mult = confIsRun3 ? c.multFV0M() : 0.5 * (c.multFV0M()); + int multNtr = confIsRun3 ? c.multNTracksPV() : c.multTracklets(); + // Removing collisions with Zvtx > 10 cm + if (std::abs(vtxZ) > confEvtZvtx) { + continue; + } // colCuts.fillQA(c); //for now, TODO: create a configurable so in the FemroUniverseCollisionSelection.h there is an option to plot QA just for the posZ - outputCollision(vtxZ, mult, multNtr, spher, mMagField); + if (confDoSpher) { + outputCollision(vtxZ, mult, multNtr, colCuts.computeSphericity(col, tracks), mMagField); + } else { + outputCollision(vtxZ, mult, multNtr, 2, mMagField); + } } } @@ -153,26 +157,26 @@ struct femtoUniverseProducerMCTruthTask { { std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children - for (auto& particle : tracks) { + for (const auto& particle : tracks) { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track - if (particle.eta() < -ConfFilteringTracks.ConfEtaFilterCut || particle.eta() > ConfFilteringTracks.ConfEtaFilterCut) + if (particle.eta() < -ConfFilteringTracks.confEtaFilterCut || particle.eta() > ConfFilteringTracks.confEtaFilterCut) continue; - if (particle.pt() < ConfFilteringTracks.ConfPtLowFilterCut || particle.pt() > ConfFilteringTracks.ConfPtHighFilterCut) + if (particle.pt() < ConfFilteringTracks.confPtLowFilterCut || particle.pt() > ConfFilteringTracks.confPtHighFilterCut) continue; - uint32_t pdgCode = (uint32_t)particle.pdgCode(); + int pdgCode = particle.pdgCode(); - if (ConfAnalysisWithPID) { + if (confAnalysisWithPID) { bool pass = false; - std::vector tmpPDGCodes = ConfPDGCodes; // necessary due to some features of the Configurable - for (uint32_t pdg : tmpPDGCodes) { - if (pdgCode == 333) { // phi meson + std::vector tmpPDGCodes = confPDGCodes; // necessary due to some features of the Configurable + for (const int& pdg : tmpPDGCodes) { + if (pdgCode == Pdg::kPhi) { // phi meson pass = true; - } else if (pdgCode == 421) { // D0 meson + } else if (pdgCode == Pdg::kD0) { // D0 meson pass = true; - } else if (pdgCode == 411) { // D+ meson + } else if (pdgCode == Pdg::kDPlus) { // D+ meson pass = true; } else if (static_cast(pdg) == static_cast(pdgCode)) { if (particle.isPhysicalPrimary()) @@ -220,11 +224,11 @@ struct femtoUniverseProducerMCTruthTask { fillCollisions(collisions, mcParticles); fillParticles(mcParticles); } - PROCESS_SWITCH(femtoUniverseProducerMCTruthTask, processTrackMC, "Provide MC data for track analysis", true); + PROCESS_SWITCH(FemtoUniverseProducerMCTruthTask, processTrackMC, "Provide MC data for track analysis", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; return workflow; } From f1da368399b4663b76325b66a4a77a81ebac4b97 Mon Sep 17 00:00:00 2001 From: lucamicheletti93 <38209984+lucamicheletti93@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:52:28 +0200 Subject: [PATCH 11/29] [PWGDQ] Temporary test for issues in running in hyperloop (#11889) Co-authored-by: Lucamicheletti93 --- PWGDQ/Tasks/tableReader.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index b57feaa8afc..22a8d82e2d8 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -218,11 +218,12 @@ struct AnalysisEventSelection { void runEventSelection(TEvent const& event) { if (event.runNumber() != fLastRun) { - auto alppar = fCCDB->getForTimeStamp>("ITS/Config/AlpideParam", event.timestamp()); - EventSelectionParams* par = fCCDB->getForTimeStamp("EventSelection/EventSelectionParams", event.timestamp()); - int itsROFrameStartBorderMargin = fConfigITSROFrameStartBorderMargin < 0 ? par->fITSROFrameStartBorderMargin : fConfigITSROFrameStartBorderMargin; - int itsROFrameEndBorderMargin = fConfigITSROFrameEndBorderMargin < 0 ? par->fITSROFrameEndBorderMargin : fConfigITSROFrameEndBorderMargin; - VarManager::SetITSROFBorderselection(alppar->roFrameBiasInBC, alppar->roFrameLengthInBC, itsROFrameStartBorderMargin, itsROFrameEndBorderMargin); + // Part temporary removed to study the issue to run on derived data on hyperloop + // auto alppar = fCCDB->getForTimeStamp>("ITS/Config/AlpideParam", event.timestamp()); + // EventSelectionParams* par = fCCDB->getForTimeStamp("EventSelection/EventSelectionParams", event.timestamp()); + // int itsROFrameStartBorderMargin = fConfigITSROFrameStartBorderMargin < 0 ? par->fITSROFrameStartBorderMargin : fConfigITSROFrameStartBorderMargin; + // int itsROFrameEndBorderMargin = fConfigITSROFrameEndBorderMargin < 0 ? par->fITSROFrameEndBorderMargin : fConfigITSROFrameEndBorderMargin; + // VarManager::SetITSROFBorderselection(alppar->roFrameBiasInBC, alppar->roFrameLengthInBC, itsROFrameStartBorderMargin, itsROFrameEndBorderMargin); fLastRun = event.runNumber(); } From dcb065a7e53fb7108a5f94a5ecabb42304049ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Thu, 3 Jul 2025 10:57:17 +0200 Subject: [PATCH 12/29] [Common] Add Oxygen and Neon to CollisionTypeHelper (#11879) --- Common/Core/CollisionTypeHelper.cxx | 27 ++++++++++++++---- Common/Core/CollisionTypeHelper.h | 5 +++- Common/Core/macros/testCollisionTypeHelper.C | 30 ++++++++++++++++++++ 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 Common/Core/macros/testCollisionTypeHelper.C diff --git a/Common/Core/CollisionTypeHelper.cxx b/Common/Core/CollisionTypeHelper.cxx index 2396a217215..4d7e1de3f87 100644 --- a/Common/Core/CollisionTypeHelper.cxx +++ b/Common/Core/CollisionTypeHelper.cxx @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// -/// \file CollisionTypeHelper.h +/// \file CollisionTypeHelper.cxx /// \author Nicolò Jacazio nicolo.jacazio@cern.ch /// \brief Utility to handle the collision type from the GRP information /// @@ -34,17 +34,26 @@ std::string o2::common::core::CollisionSystemType::getCollisionSystemName(collTy return "XeXe"; case kCollSyspPb: return "pPb"; + case kCollSysOO: + return "OO"; + case kCollSyspO: + return "pO"; + case kCollSysNeNe: + return "NeNe"; + case kCollSysUndef: + return "Undefined"; default: + LOG(warning) << "Undefined collision system type: " << collSys; return "Undefined"; } } int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif) { - const int ZBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA); - const int ZBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC); - LOG(debug) << "Collision system: " << ZBeamA << " * " << ZBeamC << " detected"; - switch (ZBeamA * ZBeamC) { + const int zBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA); + const int zBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC); + LOG(debug) << "Collision system Z: " << zBeamA << " * " << zBeamC << " detected = " << zBeamA * zBeamC; + switch (zBeamA * zBeamC) { case 1: // pp 1*1 return kCollSyspp; case 6724: // Pb-Pb 82*82 @@ -53,8 +62,14 @@ int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameter return kCollSysXeXe; case 82: // p-Pb 82*1 return kCollSyspPb; + case 64: // O-O 8*8 + return kCollSysOO; + case 8: // p-O 8*1 + return kCollSyspO; + case 100: // Ne-Ne 10*10 + return kCollSysNeNe; default: - LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with BeamA = " << ZBeamA << " and BeamC = " << ZBeamC; + LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with Z of BeamA = " << zBeamA << " and Z of BeamC = " << zBeamC; return kCollSysUndef; } return kCollSysUndef; diff --git a/Common/Core/CollisionTypeHelper.h b/Common/Core/CollisionTypeHelper.h index 523d3d049c4..c8dc7a21842 100644 --- a/Common/Core/CollisionTypeHelper.h +++ b/Common/Core/CollisionTypeHelper.h @@ -34,7 +34,10 @@ struct CollisionSystemType { static constexpr collType kCollSysPbPb = 1; // PbPb static constexpr collType kCollSysXeXe = 2; // XeXe static constexpr collType kCollSyspPb = 3; // pPb - static constexpr collType kNCollSys = 4; // Number of collision systems + static constexpr collType kCollSysOO = 4; // OO (Oxygen-Oxygen) + static constexpr collType kCollSyspO = 5; // pO (proton-Oxygen) + static constexpr collType kCollSysNeNe = 6; // NeNe (Neon-Neon) + static constexpr collType kNCollSys = 7; // Number of collision systems static std::string getCollisionSystemName(collType collSys); diff --git a/Common/Core/macros/testCollisionTypeHelper.C b/Common/Core/macros/testCollisionTypeHelper.C new file mode 100644 index 00000000000..43624ea697e --- /dev/null +++ b/Common/Core/macros/testCollisionTypeHelper.C @@ -0,0 +1,30 @@ +// 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 testCollisionTypeHelper.C +/// \author Nicolò Jacazio nicolo.jacazio@cern.ch +/// \brief Test the CollisionTypeHelper functionality + +#include "Common/Core/CollisionTypeHelper.h" + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/GRPLHCIFData.h" + +void testCollisionTypeHelper(int runNumber = 544124) +{ + + auto& ccdb = o2::ccdb::BasicCCDBManager::instance(); + ccdb.setURL("http://alice-ccdb.cern.ch"); + o2::parameters::GRPLHCIFData* grpo = ccdb.getSpecificForRun("GLO/Config/GRPLHCIF", + runNumber); + grpo->print(); + int collsys = o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(grpo); +} From 8ca5f353892d4814a45fb87cb9a48cacbe7557ff Mon Sep 17 00:00:00 2001 From: Zhenjun Xiong <108917659+zjxiongOvO@users.noreply.github.com> Date: Thu, 3 Jul 2025 11:08:26 +0200 Subject: [PATCH 13/29] [PWGDQ] add histograms,Cuts for Polarization (#11887) --- PWGDQ/Core/CutsLibrary.cxx | 23 +++++++++++++++++++++++ PWGDQ/Core/HistogramsLibrary.cxx | 3 +++ PWGDQ/Core/VarManager.h | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index ec017da8ac8..8eacab59397 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -1121,6 +1121,13 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare("Jpsi_TPCPost_calib_debug10")) { + cut->AddCut(GetAnalysisCut("jpsiKineSkimmed")); + cut->AddCut(GetAnalysisCut("jpsi_trackCut_debug6")); + cut->AddCut(GetAnalysisCut("jpsi_TPCPID_debug10")); + return cut; + } + if (!nameStr.compare("LMee_TPCPost_calib_debug1")) { cut->AddCut(GetAnalysisCut("lmee_trackCut_debug")); cut->AddCut(GetAnalysisCut("lmee_TPCPID_debug1")); @@ -4400,6 +4407,15 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("jpsi_trackCut_debug6")) { + cut->AddCut(VarManager::kTPCchi2, 0.0, 4.0); + cut->AddCut(VarManager::kTPCncls, 120., 159); + cut->AddCut(VarManager::kTPCnclsCR, 140., 159); + cut->AddCut(VarManager::kIsITSibAny, 0.5, 1.5); + cut->AddCut(VarManager::kIsSPDfirst, 0.5, 1.5); + return cut; + } + if (!nameStr.compare("lmee_trackCut_debug")) { cut->AddCut(VarManager::kEta, -0.9, 0.9); cut->AddCut(VarManager::kTPCchi2, 0.0, 4.0); @@ -5030,6 +5046,13 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare("jpsi_TPCPID_debug10")) { + cut->AddCut(VarManager::kTPCnSigmaEl, -1.5, 2.0); + cut->AddCut(VarManager::kTPCnSigmaPi, 4.0, 999); + cut->AddCut(VarManager::kTPCnSigmaPr, 3.5, 999); + return cut; + } + if (!nameStr.compare("pidCut_lowP_Corr")) { cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -3.0, 3.0, false, VarManager::kP, 0.0, 5.0); cut->AddCut(VarManager::kTPCnSigmaPi_Corr, 3.0, 999, false, VarManager::kP, 0.0, 5.0); diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 4018486eff6..11c87e700de 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -274,6 +274,9 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h hm->AddHistogram(histClass, "Q2Y0B_Cent", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kQ2Y0B); hm->AddHistogram(histClass, "Q2X0C_Cent", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kQ2X0C); hm->AddHistogram(histClass, "Q2Y0C_Cent", "", true, 18, 0.0, 90.0, VarManager::kCentVZERO, 500, -10.0, 10.0, VarManager::kQ2Y0C); + hm->AddHistogram(histClass, "Q2X0A_Q2Y0A_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2X0A, 500, -10.0, 10.0, VarManager::kQ2Y0A); + hm->AddHistogram(histClass, "Q2X0B_Q2Y0B_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2X0B, 500, -10.0, 10.0, VarManager::kQ2Y0B); + hm->AddHistogram(histClass, "Q2X0C_Q2Y0C_CentFT0C", "", false, 18, 0.0, 90.0, VarManager::kCentFT0C, 500, -10.0, 10.0, VarManager::kQ2X0C, 500, -10.0, 10.0, VarManager::kQ2Y0C); hm->AddHistogram(histClass, "Q3X0A", "", false, 500, -10.0, 10.0, VarManager::kQ3X0A); hm->AddHistogram(histClass, "Q3Y0A", "", false, 500, -10.0, 10.0, VarManager::kQ3Y0A); hm->AddHistogram(histClass, "Q3X0B", "", false, 500, -10.0, 10.0, VarManager::kQ3X0B); diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index f0537a41d66..0d56f77491a 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -5296,7 +5296,7 @@ void VarManager::FillDileptonTrackTrackVertexing(C const& collision, T1 const& l KFGeoTwoTracks.SetConstructMethod(2); KFGeoTwoTracks.AddDaughter(trk1KF); - KFGeoTwoTracks.AddDaughter(trk1KF); + KFGeoTwoTracks.AddDaughter(trk2KF); if (fgUsedVars[kDitrackMass] || fgUsedVars[kDitrackPt]) { values[VarManager::kDitrackMass] = KFGeoTwoTracks.GetMass(); From a997888a6f40a2dd48a138104ef6308dda6c7669 Mon Sep 17 00:00:00 2001 From: sawan <124118453+sawankumawat@users.noreply.github.com> Date: Thu, 3 Jul 2025 17:42:26 +0530 Subject: [PATCH 14/29] [PWGLF] Optimised code (#11891) Co-authored-by: Sawan Sawan --- PWGLF/Tasks/Resonances/kaonkaonanalysis.cxx | 717 ++++++++------------ 1 file changed, 280 insertions(+), 437 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kaonkaonanalysis.cxx b/PWGLF/Tasks/Resonances/kaonkaonanalysis.cxx index 81af59575ab..7db6d327c15 100644 --- a/PWGLF/Tasks/Resonances/kaonkaonanalysis.cxx +++ b/PWGLF/Tasks/Resonances/kaonkaonanalysis.cxx @@ -12,77 +12,86 @@ // (1) For Run3 // (2) Event and track selection need to be optimized // (3) particle = 0 --> phi -// (4) particle = 1 --> kstar +// (4) particle = 1 --> Phi // (5) particle = 2 --> lambdastar // (6) 4 process function (a) Data same event (b) Data mixed event (c) MC generated (d) MC reconstructed /// \brief kaon kaon analysis for higher mass resonances (code taken from phianalysisrun3) /// \author Sawan (sawan.sawan@cern.ch) -#include +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Math/GenVector/Boost.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "TF1.h" +#include "TRandom3.h" +#include #include +#include +#include +#include #include -#include #include #include -#include -#include -#include #include -#include -#include + #include +#include #include -#include "TF1.h" -#include "TRandom3.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "Math/GenVector/Boost.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/Core/TrackSelection.h" -#include "Framework/ASoAHelpers.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; +using namespace o2::aod::rctsel; + struct kaonkaonAnalysisRun3 { + struct : ConfigurableGroup { + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; + Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; + Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; + Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; + } rctCut; + RCTFlagsChecker rctChecker; + SliceCache cache; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry hInvMass{"hInvMass", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // For histograms + Configurable calcLikeSign{"calcLikeSign", true, "Calculate Like Sign"}; + Configurable calcRotational{"calcRotational", false, "Calculate Rotational"}; // events Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; - Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; - Configurable goodzvertex{"goodzvertex", false, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference."}; - Configurable itstpctracks{"itstpctracks", false, "selects collisions with at least one ITS-TPC track,"}; + // Configurable piluprejection{"piluprejection", false, "Pileup rejection"}; + // Configurable goodzvertex{"goodzvertex", false, "removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference."}; + // Configurable itstpctracks{"itstpctracks", false, "selects collisions with at least one ITS-TPC track,"}; Configurable timFrameEvsel{"timFrameEvsel", true, "TPC Time frame boundary cut"}; - Configurable additionalEvsel{"additionalEvsel", false, "Additional event selcection"}; Configurable otherQAplots{"otherQAplots", true, "Other QA plots"}; Configurable QAPID{"QAPID", true, "QA PID plots"}; Configurable QAevents{"QAevents", true, "QA events"}; Configurable cfgMultFT0M{"cfgMultFT0M", true, "true for pp (FT0M estimator) and false for PbPb (FT0C estimator)"}; - // Event selection cuts - Alex (Temporary, need to fix!) - TF1* fMultPVCutLow = nullptr; - TF1* fMultPVCutHigh = nullptr; - TF1* fMultCutLow = nullptr; - TF1* fMultCutHigh = nullptr; - TF1* fMultMultPVCut = nullptr; - // track - Configurable rotational_cut{"rotational_cut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; Configurable cfgCutPT{"cfgCutPT", 0.2, "PT cut on daughter track"}; Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta cut on daughter track"}; Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; @@ -94,24 +103,16 @@ struct kaonkaonAnalysisRun3 { Configurable iscustomDCAcut{"iscustomDCAcut", false, "iscustomDCAcut"}; Configurable isNoTOF{"isNoTOF", false, "isNoTOF"}; Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; - Configurable isITSOnlycut{"isITSOnlycut", true, "isITSOnlycut"}; + Configurable isITSOnlycut{"isITSOnlycut", false, "isITSOnlycut"}; Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; Configurable isDeepAngle{"isDeepAngle", false, "Deep Angle cut"}; Configurable cfgDeepAngle{"cfgDeepAngle", 0.04, "Deep Angle cut value"}; - Configurable cmultLow{"cmultLow", 0.0f, "Low centrality percentile"}; - Configurable cmultHigh{"cmultHigh", 150.0f, "High centrality percentile"}; - Configurable cmultBins{"cmultBins", 150, "Number of centrality bins"}; - Configurable cpTlow{"cpTlow", 0.0f, "Low pT"}; - Configurable cpThigh{"cpThigh", 10.0f, "High pT"}; - Configurable cpTbins{"cpTbins", 100, "Number of pT bins"}; - Configurable cMasslow{"cMasslow", 0.9f, "Low mass"}; - Configurable cMasshigh{"cMasshigh", 2.5f, "High mass"}; - Configurable cMassbins{"cMassbins", 320, "Number of mass bins"}; - Configurable c_nof_rotations{"c_nof_rotations", 3, "Number of random rotations in the rotational background"}; - ConfigurableAxis axisdEdx{"axisdEdx", {20000, 0.0f, 200.0f}, "dE/dx (a.u.)"}; - ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {2000, 0, 20}, "pT (GeV/c)"}; - ConfigurableAxis axisMultdist{"axisMultdist", {3500, 0, 70000}, "Multiplicity distribution"}; + + Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; + ConfigurableAxis axisdEdx{"axisdEdx", {1, 0.0f, 200.0f}, "dE/dx (a.u.)"}; + ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {1, 0, 20}, "pT (GeV/c)"}; + ConfigurableAxis axisMultdist{"axisMultdist", {1, 0, 70000}, "Multiplicity distribution"}; // different frames Configurable activateTHnSparseCosThStarHelicity{"activateTHnSparseCosThStarHelicity", true, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; @@ -119,6 +120,9 @@ struct kaonkaonAnalysisRun3 { Configurable activateTHnSparseCosThStarBeam{"activateTHnSparseCosThStarBeam", false, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateTHnSparseCosThStarRandom{"activateTHnSparseCosThStarRandom", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; + ConfigurableAxis invMassKKAxis{"invMassKKAxis", {200, 1.0f, 3.0f}, "KK pair invariant mass axis"}; + ConfigurableAxis ptAxisKK{"ptAxisKK", {200, 0.0f, 20.0f}, "KK pair pT axis"}; + ConfigurableAxis multAxis{"multAxis", {110, 0.0f, 110.0f}, "THnSparse multiplicity axis"}; // MC Configurable isMC{"isMC", false, "Run MC"}; @@ -127,9 +131,10 @@ struct kaonkaonAnalysisRun3 { void init(o2::framework::InitContext&) { - AxisSpec axisMult{cmultBins, cmultLow, cmultHigh, "Multiplicity"}; - AxisSpec axisPt{cpTbins, cpTlow, cpThigh, "pT (GeV/c)"}; - AxisSpec axisMass{cMassbins, cMasslow, cMasshigh, "Invariant mass (GeV/c^2)"}; + rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); + AxisSpec axisMult{multAxis, "Multiplicity"}; + AxisSpec axisPt{ptAxisKK, "pT (GeV/c)"}; + AxisSpec axisMass{invMassKKAxis, "Invariant mass (GeV/c^2)"}; const AxisSpec thnAxisPOL{configThnAxisPOL, "Frame axis"}; // THnSparses @@ -189,46 +194,30 @@ struct kaonkaonAnalysisRun3 { histos.add("Chi2perclusterTOF", "Chi2 / cluster for the TOF track segment", kTH1F, {{50, 0.0f, 50.0f}}); } if (!isMC) { - histos.add("h3PhiInvMassUnlikeSign", "KK Unlike Sign", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); - histos.add("h3PhiInvMassLikeSignPP", "KK Like Sign +", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); - histos.add("h3PhiInvMassLikeSignMM", "KK Like Sign -", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); - histos.add("h3PhiInvMassMixed", "KK Mixed", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); - histos.add("h3PhiInvMassRotation", "KK Rotation", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); + hInvMass.add("h3PhiInvMassUnlikeSign", "KK Unlike Sign", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); + hInvMass.add("h3PhiInvMassLikeSignPP", "KK Like Sign +", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); + hInvMass.add("h3PhiInvMassLikeSignMM", "KK Like Sign -", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); + hInvMass.add("h3PhiInvMassMixed", "KK Mixed", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); + hInvMass.add("h3PhiInvMassRotated", "KK Rotation", kTHnSparseF, {axisMult, axisPt, axisMass, thnAxisPOL}, true); } else if (isMC) { + hInvMass.add("h1PhiGen", "Phi meson Gen", kTH1F, {axisMult, axisPt}); + hInvMass.add("h3PhiRec", "Phi meson Rec", kTHnSparseF, {axisMult, axisPt, axisMass}); histos.add("hMC", "MC Event statistics", kTH1F, {{6, 0.0f, 6.0f}}); - histos.add("h1PhiGen", "Phi meson Gen", kTH1F, {axisPt}); histos.add("h1PhiRecsplit", "Phi meson Rec split", kTH1F, {axisPt}); - histos.add("h3PhiRec", "Phi meson Rec", kTHnSparseF, {axisPt, axisPt, {200, -0.1, 0.1}}, true); - } - if (additionalEvsel) { - fMultPVCutLow = new TF1("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - fMultPVCutLow->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); - fMultPVCutHigh = new TF1("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 2.5*([4]+[5]*x+[6]*x*x+[7]*x*x*x+[8]*x*x*x*x)", 0, 100); - fMultPVCutHigh->SetParameters(2834.66, -87.0127, 0.915126, -0.00330136, 332.513, -12.3476, 0.251663, -0.00272819, 1.12242e-05); - fMultCutLow = new TF1("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x - 2.5*([4]+[5]*x)", 0, 100); - fMultCutLow->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); - fMultCutHigh = new TF1("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x + 3.*([4]+[5]*x)", 0, 100); - fMultCutHigh->SetParameters(1893.94, -53.86, 0.502913, -0.0015122, 109.625, -1.19253); - fMultMultPVCut = new TF1("fMultMultPVCut", "[0]+[1]*x+[2]*x*x", 0, 5000); - fMultMultPVCut->SetParameters(-0.1, 0.785, -4.7e-05); + histos.add("Recmutiplicity", "Reconstructed multiplicity distribution", kTH1F, {axisMult}); + histos.add("Genmutiplicity", "Generated multiplicity distribution", kTH1F, {axisMult}); } } double massKa = o2::constants::physics::MassKPlus; - double rapidity; - double genMass, recMass, resolution; - double mass{0.}; - double massrotation1{0.}; - double massrotation2{0.}; - double pT{0.}; - array pvec0; - array pvec1; - array pvec1rotation; - array pvec2rotation; - ROOT::Math::PxPyPzMVector daughter1, daughter2; + double rapidity{0.0}, mass{0.}, massrotation1{0.}, massrotation2{0.}, pT{0.}; + float theta2; + ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterRot, mother, motherRot, daughterSelected, fourVecDauCM, daughterRotCM; + ROOT::Math::XYZVector randomVec, beamVec, normalVec; + bool isMix = false; template - bool eventselection(Collision const& collision, const float& multiplicity) + bool eventselection(Collision const& collision) { if (!collision.sel8()) { return false; @@ -236,32 +225,15 @@ struct kaonkaonAnalysisRun3 { if (timFrameEvsel && (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder))) { return false; } - if (piluprejection && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - return false; - } - if (goodzvertex && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - return false; - } - if (itstpctracks && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - return false; - } - // if (collision.alias_bit(kTVXinTRD)) { - // // TRD triggered - // // return 0; + // if (piluprejection && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + // return false; + // } + // if (goodzvertex && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + // return false; + // } + // if (itstpctracks && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + // return false; // } - auto multNTracksPV = collision.multNTracksPV(); - if (additionalEvsel && multNTracksPV < fMultPVCutLow->Eval(multiplicity)) { - return false; - } - if (additionalEvsel && multNTracksPV > fMultPVCutHigh->Eval(multiplicity)) { - return false; - } - // if (multTrk < fMultCutLow->Eval(multiplicity)) - // return 0; - // if (multTrk > fMultCutHigh->Eval(multiplicity)) - // return 0; - // if (multTrk > fMultMultPVCut->Eval(multNTracksPV)) - // return 0; return true; } @@ -310,73 +282,141 @@ struct kaonkaonAnalysisRun3 { } return true; } - template - void FillinvMass(const T1& candidate1, const T2& candidate2, const T3& framecalculation, float multiplicity, bool unlike, bool mix, bool likesign, bool rotation, float massd1, float massd2) + + template + void fillInvMass(const T1& daughter1, const T1& daughter2, const T1& mother, float multiplicity, bool isMix, const T2& track1, const T2& track2) { - int track1Sign = candidate1.sign(); - int track2Sign = candidate2.sign(); - TLorentzVector vec1, vec2, vec3, vec4, vec5; - vec1.SetPtEtaPhiM(candidate1.pt(), candidate1.eta(), candidate1.phi(), massd1); - vec2.SetPtEtaPhiM(candidate2.pt(), candidate2.eta(), candidate2.phi(), massd2); - vec3 = vec1 + vec2; - // daughter1 = ROOT::Math::PxPyPzMVector(candidate1.px(), candidate1.py(), candidate1.pz(), massd1); // Kplus - // daughter2 = ROOT::Math::PxPyPzMVector(candidate2.px(), candidate2.py(), candidate2.pz(), massd2); // Kminus - double rapidity = vec3.Rapidity(); + ROOT::Math::Boost boost{mother.BoostToCM()}; + fourVecDauCM = boost(daughter1); - if (otherQAplots) { - histos.fill(HIST("Chi2perclusterITS"), candidate1.itsChi2NCl()); - histos.fill(HIST("Chi2perclusterITS"), candidate2.itsChi2NCl()); - histos.fill(HIST("Chi2perclusterTPC"), candidate1.tpcChi2NCl()); - histos.fill(HIST("Chi2perclusterTPC"), candidate2.tpcChi2NCl()); - histos.fill(HIST("Chi2perclusterTRD"), candidate1.trdChi2()); - histos.fill(HIST("Chi2perclusterTRD"), candidate2.trdChi2()); - histos.fill(HIST("Chi2perclusterTOF"), candidate1.tofChi2()); - histos.fill(HIST("Chi2perclusterTOF"), candidate2.tofChi2()); - } - if (QAPID) { - histos.fill(HIST("dE_by_dx_TPC"), candidate1.p(), candidate1.tpcSignal()); - histos.fill(HIST("dE_by_dx_TPC"), candidate2.p(), candidate2.tpcSignal()); - } + if (std::abs(mother.Rapidity()) < 0.5) { + if (activateTHnSparseCosThStarHelicity) { + auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2())); - // polarization calculations - // auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); - // auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - // ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massd1); // Kaon - - // ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(vec3.Px(), vec3.Py(), vec3.Pz(), vec3.M()); // mass of KaonKaon pair - // ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame - // ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother - // ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - - // default filling - // if (activateTHnSparseCosThStarHelicity) { - // ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame - // auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - if (std::abs(rapidity) < 0.5 && track1Sign * track2Sign < 0) { - if (unlike) { - histos.fill(HIST("h3PhiInvMassUnlikeSign"), multiplicity, vec3.Pt(), vec3.M(), framecalculation); - } - if (mix) { - histos.fill(HIST("h3PhiInvMassMixed"), multiplicity, vec3.Pt(), vec3.M(), framecalculation); - } + if (track1.sign() * track2.sign() < 0) { + if (!isMix) { + hInvMass.fill(HIST("h3PhiInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); + + for (int i = 0; i < cRotations; i++) { + theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut); - if (rotation) { - for (int i = 0; i < c_nof_rotations; i++) { - float theta2 = rn->Uniform(TMath::Pi() - TMath::Pi() / rotational_cut, TMath::Pi() + TMath::Pi() / rotational_cut); - vec4.SetPtEtaPhiM(candidate1.pt(), candidate1.eta(), candidate1.phi() + theta2, massd1); // for rotated background - vec5 = vec4 + vec2; - histos.fill(HIST("h3PhiInvMassRotation"), multiplicity, vec5.Pt(), vec5.M(), framecalculation); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + + ROOT::Math::Boost boost2{motherRot.BoostToCM()}; + daughterRotCM = boost2(daughterRot); + + auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2())); + + if (calcRotational) + hInvMass.fill(HIST("h3PhiInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot); + } + } else { + hInvMass.fill(HIST("h3PhiInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); + } + } else { + if (!isMix) { + if (calcLikeSign) { + if (track1.sign() * track2.sign() > 0) { + hInvMass.fill(HIST("h3PhiInvMasslikeSignPP"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); + } else { + hInvMass.fill(HIST("h3PhiInvMasslikeSignMM"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); + } + } + } + } + + } else if (activateTHnSparseCosThStarProduction) { + normalVec = ROOT::Math::XYZVector(mother.Py(), -mother.Px(), 0.f); + auto cosThetaStarProduction = normalVec.Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(normalVec.Mag2())); + + if (track1.sign() * track2.sign() < 0) { + if (!isMix) { + hInvMass.fill(HIST("h3PhiInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction); + for (int i = 0; i < cRotations; i++) { + theta2 = rn->Uniform(0, o2::constants::math::PI); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + if (calcRotational) + hInvMass.fill(HIST("h3PhiInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarProduction); + } + } else { + hInvMass.fill(HIST("h3PhiInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction); + } + } else { + if (!isMix) { + if (calcLikeSign) { + if (track1.sign() * track2.sign() > 0) { + hInvMass.fill(HIST("h3PhiInvMasslikeSignPP"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction); + } else { + hInvMass.fill(HIST("h3PhiInvMasslikeSignMM"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction); + } + } + } + } + } else if (activateTHnSparseCosThStarBeam) { + beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); + auto cosThetaStarBeam = beamVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); + + if (track1.sign() * track2.sign() < 0) { + if (!isMix) { + hInvMass.fill(HIST("h3PhiInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); + for (int i = 0; i < cRotations; i++) { + theta2 = rn->Uniform(0, o2::constants::math::PI); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + if (calcRotational) + hInvMass.fill(HIST("h3PhiInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam); + } + } else { + hInvMass.fill(HIST("h3PhiInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); + } + } else { + if (calcLikeSign) { + if (track1.sign() * track2.sign() > 0) { + hInvMass.fill(HIST("h3PhiInvMasslikeSignPP"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); + } else { + hInvMass.fill(HIST("h3PhiInvMasslikeSignMM"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); + } + } + } + } else if (activateTHnSparseCosThStarRandom) { + auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); + auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); + + randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); + auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); + + if (track1.sign() * track2.sign() < 0) { + if (!isMix) { + hInvMass.fill(HIST("h3PhiInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); + for (int i = 0; i < cRotations; i++) { + theta2 = rn->Uniform(0, o2::constants::math::PI); + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + if (calcRotational) + hInvMass.fill(HIST("h3PhiInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom); + } + } else { + hInvMass.fill(HIST("h3PhiInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); + } + } else { + if (!isMix) { + if (calcLikeSign) { + if (track1.sign() * track2.sign() > 0) { + hInvMass.fill(HIST("h3PhiInvMasslikeSignPP"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); + } else { + hInvMass.fill(HIST("h3PhiInvMasslikeSignMM"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); + } + } + } } } } - if (std::abs(rapidity) < 0.5 && track1Sign * track2Sign > 0 && likesign) { - if (track1Sign > 0 && track2Sign > 0) { - histos.fill(HIST("h3PhiInvMassLikeSignPP"), multiplicity, vec3.Pt(), vec3.M(), framecalculation); - } else { - histos.fill(HIST("h3PhiInvMassLikeSignMM"), multiplicity, vec3.Pt(), vec3.M(), framecalculation); - } - } - // } } Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; @@ -387,12 +427,15 @@ struct kaonkaonAnalysisRun3 { using TrackCandidates = soa::Filtered>; // using EventCandidatesMC = soa::Join; - using EventCandidatesMC = soa::Join; + using EventCandidatesMC = soa::Join; using TrackCandidatesMC = soa::Filtered>; void processSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&) { - if (!eventselection(collision, collision.centFT0M())) { + if (rctCut.requireRCTFlagChecker && !rctChecker(collision)) { + return; + } + if (!eventselection(collision)) { return; } float multiplicity; @@ -433,74 +476,16 @@ struct kaonkaonAnalysisRun3 { continue; } - // calculation of event planes - daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); // Kplus - daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa); // Kminus - - ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massKa); // Kaon - TLorentzVector lv1, lv2, lv3; - lv1.SetPtEtaPhiM(track1.pt(), track1.eta(), track1.phi(), massKa); - lv2.SetPtEtaPhiM(track2.pt(), track2.eta(), track2.phi(), massKa); - lv3 = lv1 + lv2; - - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KaonKaon pair - ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame - ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother - ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - - bool unlike = true; - bool mix = false; - bool likesign = true; - bool rotation = true; - if (activateTHnSparseCosThStarHelicity) { - ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame - auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - - if (isITSOnlycut) { - FillinvMass(track1, track2, cosThetaStarHelicity, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(track1) && selectionPID(track2)) { - FillinvMass(track1, track2, cosThetaStarHelicity, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarProduction) { - ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); - auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); - - if (isITSOnlycut) { - FillinvMass(track1, track2, cosThetaStarProduction, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(track1) && selectionPID(track2)) { - FillinvMass(track1, track2, cosThetaStarProduction, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarBeam) { - ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); - auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - - if (isITSOnlycut) { - FillinvMass(track1, track2, cosThetaStarBeam, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(track1) && selectionPID(track2)) { - FillinvMass(track1, track2, cosThetaStarBeam, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarRandom) { - auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); - auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); - auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - - if (isITSOnlycut) { - FillinvMass(track1, track2, cosThetaStarRandom, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(track1) && selectionPID(track2)) { - FillinvMass(track1, track2, cosThetaStarRandom, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } + if (!selectionPID(track1)) // Track 1 is checked with Kaon + continue; + if (!selectionPID(track2)) // Track 2 is checked with Pion + continue; - // if (!isITSOnlycut && selectionPID(track1) && selectionPID(track2)) { - // // histos.fill(HIST("hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa()); - // // histos.fill(HIST("hNsigmaKaonTOF_after"), track1.pt(), track1.tofNSigmaKa()); - // // histos.fill(HIST("hNsigmaKaonTOF_TPC_after"), track1.tofNSigmaKa(), track1.tpcNSigmaKa()); - // } + daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa); + mother = daughter1 + daughter2; // Kstar meson + isMix = false; + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); } } } @@ -516,204 +501,53 @@ struct kaonkaonAnalysisRun3 { { auto tracksTuple = std::make_tuple(tracks); //////// currently mixing the event with similar TPC multiplicity //////// - BinningTypeVertexContributor1 binningOnPositions1{{axisVertex, axisMultiplicity}, true}; - BinningTypeVertexContributor2 binningOnPositions2{{axisVertex, axisMultiplicity}, true}; + BinningTypeVertexContributor1 binningOnPositions1{{axisVertex, axisMultiplicity}, true}; // for pp + BinningTypeVertexContributor2 binningOnPositions2{{axisVertex, axisMultiplicity}, true}; // for PbPb SameKindPair pair1{binningOnPositions1, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; SameKindPair pair2{binningOnPositions2, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache}; - if (cfgMultFT0M == true) { - for (auto& [c1, tracks1, c2, tracks2] : pair1) { - float multiplicity = c1.centFT0M(); - if (!eventselection(c1, multiplicity)) { - continue; - } - if (!eventselection(c2, multiplicity)) { - continue; - } - - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - bool unlike = false; - bool mix = true; - bool likesign = false; - bool rotation = false; - if (!selectionTrack(t1)) { - continue; - } - if (!selectionTrack(t2)) { - continue; - } - if (!selectionPair(t1, t2)) { - continue; - } + for (auto& [c1, tracks1, c2, tracks2] : pair1) { + float multiplicity = c1.centFT0M(); - // calculation of event planes - daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); // Kplus - daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massKa); // Kminus - - ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massKa); // Kaon - TLorentzVector lv1, lv2, lv3; - lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - lv2.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massKa); - lv3 = lv1 + lv2; - - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KaonKaon pair - ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame - ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother - ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - - if (activateTHnSparseCosThStarHelicity) { - ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame - auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); - - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarHelicity, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarHelicity, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarProduction) { - ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); - auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); + if (rctCut.requireRCTFlagChecker && !rctChecker(c1)) { + continue; + } + if (rctCut.requireRCTFlagChecker && !rctChecker(c2)) { + continue; + } - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarProduction, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarProduction, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarBeam) { - ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); - auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + if (!eventselection(c1)) { + continue; + } + if (!eventselection(c2)) { + continue; + } - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarBeam, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarBeam, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarRandom) { - auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); - auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); - auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarRandom, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarRandom, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } + for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - // if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - // histos.fill(HIST("hNsigmaKaonTPC_after"), t1.pt(), t1.tpcNSigmaKa()); - // histos.fill(HIST("hNsigmaKaonTOF_after"), t1.pt(), t1.tofNSigmaKa()); - // histos.fill(HIST("hNsigmaKaonTOF_TPC_after"), t1.tofNSigmaKa(), t1.tpcNSigmaKa()); - // } - // if (isITSOnlycut) { - // FillinvMass(t1, t2, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - // } - // if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - // FillinvMass(t1, t2, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - // } + if (!selectionTrack(t1)) { + continue; } - } - } else { - for (auto& [c1, tracks1, c2, tracks2] : pair2) { - float multiplicity = c1.centFT0C(); - - if (!eventselection(c1, multiplicity)) { + if (!selectionTrack(t2)) { continue; } - if (!eventselection(c2, multiplicity)) { + if (!selectionPair(t1, t2)) { continue; } - for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - bool unlike = false; - bool mix = true; - bool likesign = false; - bool rotation = false; - if (!selectionTrack(t1)) { - continue; - } - if (!selectionTrack(t2)) { - continue; - } - if (!selectionPair(t1, t2)) { - continue; - } - // calculation of event planes - daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); // Kplus - daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massKa); // Kminus - - ROOT::Math::PxPyPzMVector fourVecDau = ROOT::Math::PxPyPzMVector(daughter1.Px(), daughter1.Py(), daughter1.Pz(), massKa); // Kaon - TLorentzVector lv1, lv2, lv3; - lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massKa); - lv2.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massKa); - lv3 = lv1 + lv2; - - ROOT::Math::PxPyPzMVector fourVecMother = ROOT::Math::PxPyPzMVector(lv3.Px(), lv3.Py(), lv3.Pz(), lv3.M()); // mass of KaonKaon pair - ROOT::Math::Boost boost{fourVecMother.BoostToCM()}; // boost mother to center of mass frame - ROOT::Math::PxPyPzMVector fourVecDauCM = boost(fourVecDau); // boost the frame of daughter same as mother - ROOT::Math::XYZVector threeVecDauCM = fourVecDauCM.Vect(); // get the 3 vector of daughter in the frame of mother - - if (activateTHnSparseCosThStarHelicity) { - ROOT::Math::XYZVector helicityVec = fourVecMother.Vect(); // 3 vector of mother in COM frame - auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2())); + if (!selectionPID(t1)) + continue; + if (!selectionPID(t2)) + continue; - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarHelicity, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarHelicity, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarProduction) { - ROOT::Math::XYZVector normalVec = ROOT::Math::XYZVector(lv3.Py(), -lv3.Px(), 0.f); - auto cosThetaStarProduction = normalVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(normalVec.Mag2())); + daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massKa); + mother = daughter1 + daughter2; // Kstar meson - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarProduction, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarProduction, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarBeam) { - ROOT::Math::XYZVector beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); - auto cosThetaStarBeam = beamVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); + isMix = true; - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarBeam, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarBeam, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } else if (activateTHnSparseCosThStarRandom) { - auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); - auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI); - ROOT::Math::XYZVector randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom)); - auto cosThetaStarRandom = randomVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()); - - if (isITSOnlycut) { - FillinvMass(t1, t2, cosThetaStarRandom, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - FillinvMass(t1, t2, cosThetaStarRandom, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - } - } - - // if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - // histos.fill(HIST("hNsigmaKaonTPC_after"), t1.pt(), t1.tpcNSigmaKa()); - // histos.fill(HIST("hNsigmaKaonTOF_after"), t1.pt(), t1.tofNSigmaKa()); - // histos.fill(HIST("hNsigmaKaonTOF_TPC_after"), t1.tofNSigmaKa(), t1.tpcNSigmaKa()); - // } - - // if (isITSOnlycut) { - // FillinvMass(t1, t2, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - // } - // if (!isITSOnlycut && selectionPID(t1) && selectionPID(t2)) { - // FillinvMass(t1, t2, multiplicity, unlike, mix, likesign, rotation, massKa, massKa); - // } + if (std::abs(mother.Rapidity()) < 0.5) { + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, t1, t2); } } } @@ -726,6 +560,7 @@ struct kaonkaonAnalysisRun3 { if (std::abs(mcCollision.posZ()) < cfgCutVertex) { histos.fill(HIST("hMC"), 1.5); } + auto multiplicity = -1; int Nchinel = 0; for (auto& mcParticle : mcParticles) { auto pdgcode = std::abs(mcParticle.pdgCode()); @@ -744,6 +579,7 @@ struct kaonkaonAnalysisRun3 { continue; } SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + multiplicity = collision.centFT0M(); } SelectedEvents.resize(nevts); const auto evtReconstructedAndSelected = std::find(SelectedEvents.begin(), SelectedEvents.end(), mcCollision.globalIndex()) != SelectedEvents.end(); @@ -751,6 +587,7 @@ struct kaonkaonAnalysisRun3 { if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection return; } + histos.fill(HIST("Genmutiplicity"), multiplicity); histos.fill(HIST("hMC"), 4.5); for (auto& mcParticle : mcParticles) { if (std::abs(mcParticle.y()) > 0.5) { @@ -776,7 +613,7 @@ struct kaonkaonAnalysisRun3 { } } if (daughtp && daughtm) { - histos.fill(HIST("h1PhiGen"), mcParticle.pt()); + hInvMass.fill(HIST("h1PhiGen"), multiplicity, mcParticle.pt()); } } } @@ -790,6 +627,8 @@ struct kaonkaonAnalysisRun3 { if (std::abs(collision.mcCollision().posZ()) > cfgCutVertex || !collision.sel8()) { return; } + auto multiplicity = collision.centFT0M(); + histos.fill(HIST("Recmutiplicity"), multiplicity); histos.fill(HIST("hMC"), 5.5); auto oldindex = -999; for (auto track1 : tracks) { @@ -847,23 +686,27 @@ struct kaonkaonAnalysisRun3 { if (std::abs(mothertrack1.pdgCode()) != 333) { continue; } - if (!isITSOnlycut && !(selectionPID(track1) && selectionPID(track2))) { + if (!(selectionPID(track1))) { + continue; + } + if (!(selectionPID(track2))) { continue; } if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { histos.fill(HIST("h1PhiRecsplit"), mothertrack1.pt()); continue; } - oldindex = mothertrack1.globalIndex(); - pvec0 = array{track1.px(), track1.py(), track1.pz()}; - pvec1 = array{track2.px(), track2.py(), track2.pz()}; - auto arrMomrec = array{pvec0, pvec1}; - auto motherP = mothertrack1.p(); - auto motherE = mothertrack1.e(); - genMass = std::sqrt(motherE * motherE - motherP * motherP); - recMass = RecoDecay::m(arrMomrec, array{massKa, massKa}); - auto recpt = TMath::Sqrt((track1.px() + track2.px()) * (track1.px() + track2.px()) + (track1.py() + track2.py()) * (track1.py() + track2.py())); - histos.fill(HIST("h3PhiRec"), mothertrack1.pt(), recpt, recMass - genMass); + + if (track1.sign() * track2.sign() < 0) { + daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massKa); + } + mother = daughter1 + daughter2; + + if (TMath::Abs(mother.Rapidity()) >= 0.5) { + continue; + } + hInvMass.fill(HIST("h3PhiRec"), multiplicity, mother.Pt(), mother.M()); } } } From 2566e6262aacf1710df148d69f75270a38ef2288 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Thu, 3 Jul 2025 14:32:04 +0200 Subject: [PATCH 15/29] [PWGEM/Dilepton] add mc-tuned TPC dE/dx in MC and remove columns (#11894) --- PWGEM/Dilepton/Core/DielectronCut.cxx | 112 +++++++++--------- PWGEM/Dilepton/Core/DielectronCut.h | 76 ++++++------ PWGEM/Dilepton/Core/Dilepton.h | 30 ++--- PWGEM/Dilepton/Core/DileptonMC.h | 30 ++--- PWGEM/Dilepton/Core/PhotonHBT.h | 30 ++--- PWGEM/Dilepton/Core/SingleTrackQC.h | 72 +++++------ PWGEM/Dilepton/Core/SingleTrackQCMC.h | 72 +++++------ PWGEM/Dilepton/DataModel/dileptonTables.h | 35 +++++- PWGEM/Dilepton/DataModel/lmeeMLTables.h | 25 ++-- .../TableProducer/filterDielectronEvent.cxx | 51 ++++---- .../TableProducer/skimmerPrimaryElectron.cxx | 31 +++-- .../skimmerSecondaryElectron.cxx | 47 ++++---- .../TableProducer/treeCreatorElectronML.cxx | 54 +++++---- .../treeCreatorElectronMLDDA.cxx | 15 ++- .../Dilepton/Tasks/Converters/CMakeLists.txt | 5 + .../Tasks/Converters/electronConverter3.cxx | 85 +++++++++++++ PWGEM/Dilepton/Tasks/prefilterDielectron.cxx | 6 +- PWGEM/Dilepton/Tasks/vpPairQC.cxx | 18 +-- PWGEM/Dilepton/Tasks/vpPairQCMC.cxx | 6 +- .../Utils/MlResponseDielectronSingleTrack.h | 18 +-- PWGEM/Dilepton/Utils/PairUtilities.h | 14 ++- 21 files changed, 487 insertions(+), 345 deletions(-) create mode 100644 PWGEM/Dilepton/Tasks/Converters/electronConverter3.cxx diff --git a/PWGEM/Dilepton/Core/DielectronCut.cxx b/PWGEM/Dilepton/Core/DielectronCut.cxx index 9407e6413eb..7156fb658f9 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.cxx +++ b/PWGEM/Dilepton/Core/DielectronCut.cxx @@ -220,12 +220,12 @@ void DielectronCut::SetTPCNsigmaElRange(float min, float max) mMaxTPCNsigmaEl = max; LOG(info) << "Dielectron Cut, set TPC n sigma El range: " << mMinTPCNsigmaEl << " - " << mMaxTPCNsigmaEl; } -void DielectronCut::SetTPCNsigmaMuRange(float min, float max) -{ - mMinTPCNsigmaMu = min; - mMaxTPCNsigmaMu = max; - LOG(info) << "Dielectron Cut, set TPC n sigma Mu range: " << mMinTPCNsigmaMu << " - " << mMaxTPCNsigmaMu; -} +// void DielectronCut::SetTPCNsigmaMuRange(float min, float max) +// { +// mMinTPCNsigmaMu = min; +// mMaxTPCNsigmaMu = max; +// LOG(info) << "Dielectron Cut, set TPC n sigma Mu range: " << mMinTPCNsigmaMu << " - " << mMaxTPCNsigmaMu; +// } void DielectronCut::SetTPCNsigmaPiRange(float min, float max) { mMinTPCNsigmaPi = min; @@ -251,12 +251,12 @@ void DielectronCut::SetTOFNsigmaElRange(float min, float max) mMaxTOFNsigmaEl = max; LOG(info) << "Dielectron Cut, set TOF n sigma El range: " << mMinTOFNsigmaEl << " - " << mMaxTOFNsigmaEl; } -void DielectronCut::SetTOFNsigmaMuRange(float min, float max) -{ - mMinTOFNsigmaMu = min; - mMaxTOFNsigmaMu = max; - LOG(info) << "Dielectron Cut, set TOF n sigma Mu range: " << mMinTOFNsigmaMu << " - " << mMaxTOFNsigmaMu; -} +// void DielectronCut::SetTOFNsigmaMuRange(float min, float max) +// { +// mMinTOFNsigmaMu = min; +// mMaxTOFNsigmaMu = max; +// LOG(info) << "Dielectron Cut, set TOF n sigma Mu range: " << mMinTOFNsigmaMu << " - " << mMaxTOFNsigmaMu; +// } void DielectronCut::SetTOFNsigmaPiRange(float min, float max) { mMinTOFNsigmaPi = min; @@ -276,50 +276,50 @@ void DielectronCut::SetTOFNsigmaPrRange(float min, float max) LOG(info) << "Dielectron Cut, set TOF n sigma Pr range: " << mMinTOFNsigmaPr << " - " << mMaxTOFNsigmaPr; } -void DielectronCut::SetITSNsigmaElRange(float min, float max) -{ - mMinITSNsigmaEl = min; - mMaxITSNsigmaEl = max; - LOG(info) << "Dielectron Cut, set ITS n sigma El range: " << mMinITSNsigmaEl << " - " << mMaxITSNsigmaEl; -} -void DielectronCut::SetITSNsigmaMuRange(float min, float max) -{ - mMinITSNsigmaMu = min; - mMaxITSNsigmaMu = max; - LOG(info) << "Dielectron Cut, set ITS n sigma Mu range: " << mMinITSNsigmaMu << " - " << mMaxITSNsigmaMu; -} -void DielectronCut::SetITSNsigmaPiRange(float min, float max) -{ - mMinITSNsigmaPi = min; - mMaxITSNsigmaPi = max; - LOG(info) << "Dielectron Cut, set ITS n sigma Pi range: " << mMinITSNsigmaPi << " - " << mMaxITSNsigmaPi; -} -void DielectronCut::SetITSNsigmaKaRange(float min, float max) -{ - mMinITSNsigmaKa = min; - mMaxITSNsigmaKa = max; - LOG(info) << "Dielectron Cut, set ITS n sigma Ka range: " << mMinITSNsigmaKa << " - " << mMaxITSNsigmaKa; -} -void DielectronCut::SetITSNsigmaPrRange(float min, float max) -{ - mMinITSNsigmaPr = min; - mMaxITSNsigmaPr = max; - LOG(info) << "Dielectron Cut, set ITS n sigma Pr range: " << mMinITSNsigmaPr << " - " << mMaxITSNsigmaPr; -} - -void DielectronCut::SetPRangeForITSNsigmaKa(float min, float max) -{ - mMinP_ITSNsigmaKa = min; - mMaxP_ITSNsigmaKa = max; - LOG(info) << "Dielectron Cut, set p range for ITS n sigma Ka: " << mMinP_ITSNsigmaKa << " - " << mMaxP_ITSNsigmaKa; -} - -void DielectronCut::SetPRangeForITSNsigmaPr(float min, float max) -{ - mMinP_ITSNsigmaPr = min; - mMaxP_ITSNsigmaPr = max; - LOG(info) << "Dielectron Cut, set p range for ITS n sigma Pr: " << mMinP_ITSNsigmaPr << " - " << mMaxP_ITSNsigmaPr; -} +// void DielectronCut::SetITSNsigmaElRange(float min, float max) +// { +// mMinITSNsigmaEl = min; +// mMaxITSNsigmaEl = max; +// LOG(info) << "Dielectron Cut, set ITS n sigma El range: " << mMinITSNsigmaEl << " - " << mMaxITSNsigmaEl; +// } +// void DielectronCut::SetITSNsigmaMuRange(float min, float max) +// { +// mMinITSNsigmaMu = min; +// mMaxITSNsigmaMu = max; +// LOG(info) << "Dielectron Cut, set ITS n sigma Mu range: " << mMinITSNsigmaMu << " - " << mMaxITSNsigmaMu; +// } +// void DielectronCut::SetITSNsigmaPiRange(float min, float max) +// { +// mMinITSNsigmaPi = min; +// mMaxITSNsigmaPi = max; +// LOG(info) << "Dielectron Cut, set ITS n sigma Pi range: " << mMinITSNsigmaPi << " - " << mMaxITSNsigmaPi; +// } +// void DielectronCut::SetITSNsigmaKaRange(float min, float max) +// { +// mMinITSNsigmaKa = min; +// mMaxITSNsigmaKa = max; +// LOG(info) << "Dielectron Cut, set ITS n sigma Ka range: " << mMinITSNsigmaKa << " - " << mMaxITSNsigmaKa; +// } +// void DielectronCut::SetITSNsigmaPrRange(float min, float max) +// { +// mMinITSNsigmaPr = min; +// mMaxITSNsigmaPr = max; +// LOG(info) << "Dielectron Cut, set ITS n sigma Pr range: " << mMinITSNsigmaPr << " - " << mMaxITSNsigmaPr; +// } +// +// void DielectronCut::SetPRangeForITSNsigmaKa(float min, float max) +// { +// mMinP_ITSNsigmaKa = min; +// mMaxP_ITSNsigmaKa = max; +// LOG(info) << "Dielectron Cut, set p range for ITS n sigma Ka: " << mMinP_ITSNsigmaKa << " - " << mMaxP_ITSNsigmaKa; +// } +// +// void DielectronCut::SetPRangeForITSNsigmaPr(float min, float max) +// { +// mMinP_ITSNsigmaPr = min; +// mMaxP_ITSNsigmaPr = max; +// LOG(info) << "Dielectron Cut, set p range for ITS n sigma Pr: " << mMinP_ITSNsigmaPr << " - " << mMaxP_ITSNsigmaPr; +// } void DielectronCut::SetMaxPinMuonTPConly(float max) { diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index b69bd4b047f..35daf5ab346 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -310,9 +310,9 @@ class DielectronCut : public TNamed bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl; bool is_pi_excluded_TPC = (track.tpcInnerParam() > mMinPinForPionRejectionTPC && track.tpcInnerParam() < mMaxPinForPionRejectionTPC) ? (track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi()) : true; bool is_el_included_TOF = (mMinTOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < mMaxTOFNsigmaEl) && (track.hasTOF() && track.tofChi2() < mMaxChi2TOF); - bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; - bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; - return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF && is_ka_excluded_ITS && is_pr_excluded_ITS; + // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; + // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; + return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF; } template @@ -321,45 +321,45 @@ class DielectronCut : public TNamed bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl; bool is_pi_excluded_TPC = track.tpcInnerParam() < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi()) : true; bool is_el_included_TOF = (mMinTOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < mMaxTOFNsigmaEl) && (track.hasTOF() && track.tofChi2() < mMaxChi2TOF); - bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; - bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; - return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF && is_ka_excluded_ITS && is_pr_excluded_ITS; + // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; + // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; + return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF; } template bool PassTPChadrej(T const& track) const { bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl; - bool is_mu_excluded_TPC = mMuonExclusionTPC ? track.tpcNSigmaMu() < mMinTPCNsigmaMu || mMaxTPCNsigmaMu < track.tpcNSigmaMu() : true; + // bool is_mu_excluded_TPC = mMuonExclusionTPC ? track.tpcNSigmaMu() < mMinTPCNsigmaMu || mMaxTPCNsigmaMu < track.tpcNSigmaMu() : true; bool is_pi_excluded_TPC = track.tpcInnerParam() < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi()) : true; bool is_ka_excluded_TPC = track.tpcNSigmaKa() < mMinTPCNsigmaKa || mMaxTPCNsigmaKa < track.tpcNSigmaKa(); bool is_pr_excluded_TPC = track.tpcNSigmaPr() < mMinTPCNsigmaPr || mMaxTPCNsigmaPr < track.tpcNSigmaPr(); bool is_el_included_TOF = track.hasTOF() ? (mMinTOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < mMaxTOFNsigmaEl && track.tofChi2() < mMaxChi2TOF) : true; - bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; - bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; - return is_el_included_TPC && is_mu_excluded_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC && is_el_included_TOF && is_ka_excluded_ITS && is_pr_excluded_ITS; + // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; + // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; + return is_el_included_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC && is_el_included_TOF; } template bool PassTPConly(T const& track) const { bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl; - bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; - bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; - return is_el_included_TPC && is_ka_excluded_ITS && is_pr_excluded_ITS; + // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; + // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; + return is_el_included_TPC; } template bool PassTPConlyhadrej(T const& track) const { bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl; - bool is_mu_excluded_TPC = mMuonExclusionTPC ? track.tpcNSigmaMu() < mMinTPCNsigmaMu || mMaxTPCNsigmaMu < track.tpcNSigmaMu() : true; + // bool is_mu_excluded_TPC = mMuonExclusionTPC ? track.tpcNSigmaMu() < mMinTPCNsigmaMu || mMaxTPCNsigmaMu < track.tpcNSigmaMu() : true; bool is_pi_excluded_TPC = track.tpcInnerParam() < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi()) : true; bool is_ka_excluded_TPC = track.tpcNSigmaKa() < mMinTPCNsigmaKa || mMaxTPCNsigmaKa < track.tpcNSigmaKa(); bool is_pr_excluded_TPC = track.tpcNSigmaPr() < mMinTPCNsigmaPr || mMaxTPCNsigmaPr < track.tpcNSigmaPr(); - bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; - bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; - return is_el_included_TPC && is_mu_excluded_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC && is_ka_excluded_ITS && is_pr_excluded_ITS; + // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; + // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; + return is_el_included_TPC && is_pi_excluded_TPC && is_ka_excluded_TPC && is_pr_excluded_TPC; } template @@ -368,9 +368,9 @@ class DielectronCut : public TNamed bool is_el_included_TPC = mMinTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < mMaxTPCNsigmaEl; bool is_pi_excluded_TPC = track.tpcInnerParam() < mMaxPinForPionRejectionTPC ? (track.tpcNSigmaPi() < mMinTPCNsigmaPi || mMaxTPCNsigmaPi < track.tpcNSigmaPi()) : true; bool is_el_included_TOF = track.hasTOF() ? (mMinTOFNsigmaEl < track.tofNSigmaEl() && track.tofNSigmaEl() < mMaxTOFNsigmaEl && track.tofChi2() < mMaxChi2TOF) : true; - bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; - bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; - return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF && is_ka_excluded_ITS && is_pr_excluded_ITS; + // bool is_ka_excluded_ITS = (mMinP_ITSNsigmaKa < track.p() && track.p() < mMaxP_ITSNsigmaKa) ? (track.itsNSigmaKa() < mMinITSNsigmaKa || mMaxITSNsigmaKa < track.itsNSigmaKa()) : true; + // bool is_pr_excluded_ITS = (mMinP_ITSNsigmaPr < track.p() && track.p() < mMaxP_ITSNsigmaPr) ? (track.itsNSigmaPr() < mMinITSNsigmaPr || mMaxITSNsigmaPr < track.itsNSigmaPr()) : true; + return is_el_included_TPC && is_pi_excluded_TPC && is_el_included_TOF; } template @@ -457,23 +457,23 @@ class DielectronCut : public TNamed void SetMuonExclusionTPC(bool flag); void SetTOFbetaRange(float min, float max); void SetTPCNsigmaElRange(float min, float max); - void SetTPCNsigmaMuRange(float min, float max); + // void SetTPCNsigmaMuRange(float min, float max); void SetTPCNsigmaPiRange(float min, float max); void SetTPCNsigmaKaRange(float min, float max); void SetTPCNsigmaPrRange(float min, float max); void SetTOFNsigmaElRange(float min, float max); - void SetTOFNsigmaMuRange(float min, float max); + // void SetTOFNsigmaMuRange(float min, float max); void SetTOFNsigmaPiRange(float min, float max); void SetTOFNsigmaKaRange(float min, float max); void SetTOFNsigmaPrRange(float min, float max); - void SetITSNsigmaElRange(float min, float max); - void SetITSNsigmaMuRange(float min, float max); - void SetITSNsigmaPiRange(float min, float max); - void SetITSNsigmaKaRange(float min, float max); - void SetITSNsigmaPrRange(float min, float max); + // void SetITSNsigmaElRange(float min, float max); + // void SetITSNsigmaMuRange(float min, float max); + // void SetITSNsigmaPiRange(float min, float max); + // void SetITSNsigmaKaRange(float min, float max); + // void SetITSNsigmaPrRange(float min, float max); - void SetPRangeForITSNsigmaKa(float min, float max); - void SetPRangeForITSNsigmaPr(float min, float max); + // void SetPRangeForITSNsigmaKa(float min, float max); + // void SetPRangeForITSNsigmaPr(float min, float max); void SetMaxPinMuonTPConly(float max); void SetPinRangeForPionRejectionTPC(float min, float max); @@ -551,24 +551,24 @@ class DielectronCut : public TNamed bool mMuonExclusionTPC{false}; // flag to reject muon in TPC for low B float mMinTOFbeta{-999}, mMaxTOFbeta{999}; float mMinTPCNsigmaEl{-1e+10}, mMaxTPCNsigmaEl{+1e+10}; - float mMinTPCNsigmaMu{-1e+10}, mMaxTPCNsigmaMu{+1e+10}; + // float mMinTPCNsigmaMu{-1e+10}, mMaxTPCNsigmaMu{+1e+10}; float mMinTPCNsigmaPi{-1e+10}, mMaxTPCNsigmaPi{+1e+10}; float mMinTPCNsigmaKa{-1e+10}, mMaxTPCNsigmaKa{+1e+10}; float mMinTPCNsigmaPr{-1e+10}, mMaxTPCNsigmaPr{+1e+10}; float mMinTOFNsigmaEl{-1e+10}, mMaxTOFNsigmaEl{+1e+10}; - float mMinTOFNsigmaMu{-1e+10}, mMaxTOFNsigmaMu{+1e+10}; + // float mMinTOFNsigmaMu{-1e+10}, mMaxTOFNsigmaMu{+1e+10}; float mMinTOFNsigmaPi{-1e+10}, mMaxTOFNsigmaPi{+1e+10}; float mMinTOFNsigmaKa{-1e+10}, mMaxTOFNsigmaKa{+1e+10}; float mMinTOFNsigmaPr{-1e+10}, mMaxTOFNsigmaPr{+1e+10}; - float mMinITSNsigmaEl{-1e+10}, mMaxITSNsigmaEl{+1e+10}; - float mMinITSNsigmaMu{-1e+10}, mMaxITSNsigmaMu{+1e+10}; - float mMinITSNsigmaPi{-1e+10}, mMaxITSNsigmaPi{+1e+10}; - float mMinITSNsigmaKa{-1e+10}, mMaxITSNsigmaKa{+1e+10}; - float mMinITSNsigmaPr{-1e+10}, mMaxITSNsigmaPr{+1e+10}; - float mMinP_ITSNsigmaKa{0.0}, mMaxP_ITSNsigmaKa{0.0}; - float mMinP_ITSNsigmaPr{0.0}, mMaxP_ITSNsigmaPr{0.0}; + // float mMinITSNsigmaEl{-1e+10}, mMaxITSNsigmaEl{+1e+10}; + // float mMinITSNsigmaMu{-1e+10}, mMaxITSNsigmaMu{+1e+10}; + // float mMinITSNsigmaPi{-1e+10}, mMaxITSNsigmaPi{+1e+10}; + // float mMinITSNsigmaKa{-1e+10}, mMaxITSNsigmaKa{+1e+10}; + // float mMinITSNsigmaPr{-1e+10}, mMaxITSNsigmaPr{+1e+10}; + // float mMinP_ITSNsigmaKa{0.0}, mMaxP_ITSNsigmaKa{0.0}; + // float mMinP_ITSNsigmaPr{0.0}, mMaxP_ITSNsigmaPr{0.0}; o2::analysis::MlResponseDielectronSingleTrack* mPIDMlResponse{nullptr}; diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 0abb72b615e..ddf453779a7 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -216,8 +216,8 @@ struct Dilepton { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; @@ -228,14 +228,14 @@ struct Dilepton { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; - Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; - Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; - Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; - Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; - Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; + // Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; + // Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; + // Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; + // Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; + // Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; + // Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; Configurable includeITSsa{"includeITSsa", false, "Flag to enable ITSsa tracks"}; Configurable cfg_max_pt_track_ITSsa{"cfg_max_pt_track_ITSsa", 0.15, "max pt for ITSsa tracks"}; @@ -695,16 +695,16 @@ struct Dilepton { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); fDielectronCut.SetTOFNsigmaElRange(dielectroncuts.cfg_min_TOFNsigmaEl, dielectroncuts.cfg_max_TOFNsigmaEl); fDielectronCut.SetPinRangeForPionRejectionTPC(dielectroncuts.cfg_min_pin_pirejTPC, dielectroncuts.cfg_max_pin_pirejTPC); - fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); - fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); - fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); - fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); + // fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); + // fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); + // fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); + // fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut static constexpr int nClassesMl = 2; diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 6efda61919c..f69ed6fcc61 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -207,8 +207,8 @@ struct DileptonMC { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; @@ -219,14 +219,14 @@ struct DileptonMC { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; - Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; - Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; - Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; - Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; - Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; + // Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; + // Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; + // Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; + // Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; + // Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; + // Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; Configurable includeITSsa{"includeITSsa", false, "Flag to enable ITSsa tracks"}; Configurable cfg_max_pt_track_ITSsa{"cfg_max_pt_track_ITSsa", 0.15, "max pt for ITSsa tracks"}; @@ -664,16 +664,16 @@ struct DileptonMC { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); fDielectronCut.SetTOFNsigmaElRange(dielectroncuts.cfg_min_TOFNsigmaEl, dielectroncuts.cfg_max_TOFNsigmaEl); fDielectronCut.SetPinRangeForPionRejectionTPC(dielectroncuts.cfg_min_pin_pirejTPC, dielectroncuts.cfg_max_pin_pirejTPC); - fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); - fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); - fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); - fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); + // fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); + // fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); + // fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); + // fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut static constexpr int nClassesMl = 2; diff --git a/PWGEM/Dilepton/Core/PhotonHBT.h b/PWGEM/Dilepton/Core/PhotonHBT.h index bd37690eb24..f9c7b46a013 100644 --- a/PWGEM/Dilepton/Core/PhotonHBT.h +++ b/PWGEM/Dilepton/Core/PhotonHBT.h @@ -217,8 +217,8 @@ struct PhotonHBT { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -3.0, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; @@ -229,14 +229,14 @@ struct PhotonHBT { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 0.5, "max. pin for pion rejection in TPC"}; - Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; - Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; - Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; - Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; - Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; - Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; + // Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; + // Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; + // Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; + // Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; + // Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; + // Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; Configurable includeITSsa{"includeITSsa", false, "Flag to enable ITSsa tracks"}; Configurable cfg_max_pt_track_ITSsa{"cfg_max_pt_track_ITSsa", 0.15, "max pt for ITSsa tracks"}; @@ -578,16 +578,16 @@ struct PhotonHBT { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); fDielectronCut.SetTOFNsigmaElRange(dielectroncuts.cfg_min_TOFNsigmaEl, dielectroncuts.cfg_max_TOFNsigmaEl); fDielectronCut.SetPinRangeForPionRejectionTPC(dielectroncuts.cfg_min_pin_pirejTPC, dielectroncuts.cfg_max_pin_pirejTPC); - fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); - fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); - fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); - fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); + // fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); + // fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); + // fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); + // fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut static constexpr int nClassesMl = 2; diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 4209184cc01..575bc0a4f9e 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -148,8 +148,8 @@ struct SingleTrackQC { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; @@ -160,14 +160,14 @@ struct SingleTrackQC { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; - Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; - Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; - Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; - Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; - Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; + // Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; + // Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; + // Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; + // Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; + // Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; + // Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; Configurable includeITSsa{"includeITSsa", false, "Flag to enable ITSsa tracks"}; Configurable cfg_max_pt_track_ITSsa{"cfg_max_pt_track_ITSsa", 0.15, "max pt for ITSsa tracks"}; @@ -255,14 +255,14 @@ struct SingleTrackQC { fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); @@ -270,11 +270,11 @@ struct SingleTrackQC { fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hITSNsigmaEl", "ITS n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hITSNsigmaMu", "ITS n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hITSNsigmaPi", "ITS n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hITSNsigmaKa", "ITS n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hITSNsigmaPr", "ITS n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hITSNsigmaEl", "ITS n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hITSNsigmaMu", "ITS n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hITSNsigmaPi", "ITS n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hITSNsigmaKa", "ITS n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hITSNsigmaPr", "ITS n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { @@ -403,16 +403,16 @@ struct SingleTrackQC { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); fDielectronCut.SetTOFNsigmaElRange(dielectroncuts.cfg_min_TOFNsigmaEl, dielectroncuts.cfg_max_TOFNsigmaEl); fDielectronCut.SetPinRangeForPionRejectionTPC(dielectroncuts.cfg_min_pin_pirejTPC, dielectroncuts.cfg_max_pin_pirejTPC); - fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); - fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); - fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); - fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); + // fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); + // fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); + // fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); + // fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut static constexpr int nClassesMl = 2; @@ -501,20 +501,20 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/positive/hMeanClusterSizeITSib"), track.p(), track.meanClusterSizeITSib() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/positive/hMeanClusterSizeITSob"), track.p(), track.meanClusterSizeITSob() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/positive/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/positive/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + // fRegistry.fill(HIST("Track/positive/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/positive/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + // fRegistry.fill(HIST("Track/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); - fRegistry.fill(HIST("Track/positive/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); - fRegistry.fill(HIST("Track/positive/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); - fRegistry.fill(HIST("Track/positive/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); - fRegistry.fill(HIST("Track/positive/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); - fRegistry.fill(HIST("Track/positive/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); + // fRegistry.fill(HIST("Track/positive/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); + // fRegistry.fill(HIST("Track/positive/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); + // fRegistry.fill(HIST("Track/positive/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); + // fRegistry.fill(HIST("Track/positive/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); + // fRegistry.fill(HIST("Track/positive/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); } else { fRegistry.fill(HIST("Track/negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, weight); fRegistry.fill(HIST("Track/negative/hQoverPt"), track.sign() / track.pt()); @@ -541,20 +541,20 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/negative/hMeanClusterSizeITSib"), track.p(), track.meanClusterSizeITSib() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/negative/hMeanClusterSizeITSob"), track.p(), track.meanClusterSizeITSob() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/negative/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/negative/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + // fRegistry.fill(HIST("Track/negative/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/negative/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + // fRegistry.fill(HIST("Track/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); - fRegistry.fill(HIST("Track/negative/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); - fRegistry.fill(HIST("Track/negative/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); - fRegistry.fill(HIST("Track/negative/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); - fRegistry.fill(HIST("Track/negative/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); - fRegistry.fill(HIST("Track/negative/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); + // fRegistry.fill(HIST("Track/negative/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); + // fRegistry.fill(HIST("Track/negative/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); + // fRegistry.fill(HIST("Track/negative/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); + // fRegistry.fill(HIST("Track/negative/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); + // fRegistry.fill(HIST("Track/negative/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); } } diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index 5f63fb7acd7..0b6da25eddc 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -155,8 +155,8 @@ struct SingleTrackQCMC { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; @@ -167,14 +167,14 @@ struct SingleTrackQCMC { Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; - Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; - Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; - Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; - Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; - Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; - Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; + // Configurable cfg_min_ITSNsigmaKa{"cfg_min_ITSNsigmaKa", -1.0, "min. ITS n sigma for kaon exclusion"}; + // Configurable cfg_max_ITSNsigmaKa{"cfg_max_ITSNsigmaKa", 1e+10, "max. ITS n sigma for kaon exclusion"}; + // Configurable cfg_min_ITSNsigmaPr{"cfg_min_ITSNsigmaPr", -1.0, "min. ITS n sigma for proton exclusion"}; + // Configurable cfg_max_ITSNsigmaPr{"cfg_max_ITSNsigmaPr", 1e+10, "max. ITS n sigma for proton exclusion"}; + // Configurable cfg_min_p_ITSNsigmaKa{"cfg_min_p_ITSNsigmaKa", 0.0, "min p for kaon exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaKa{"cfg_max_p_ITSNsigmaKa", 0.0, "max p for kaon exclusion in ITS"}; + // Configurable cfg_min_p_ITSNsigmaPr{"cfg_min_p_ITSNsigmaPr", 0.0, "min p for proton exclusion in ITS"}; + // Configurable cfg_max_p_ITSNsigmaPr{"cfg_max_p_ITSNsigmaPr", 0.0, "max p for proton exclusion in ITS"}; Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; Configurable includeITSsa{"includeITSsa", false, "Flag to enable ITSsa tracks"}; Configurable cfg_max_pt_track_ITSsa{"cfg_max_pt_track_ITSsa", 0.15, "max pt for ITSsa tracks"}; @@ -301,24 +301,24 @@ struct SingleTrackQCMC { if (cfgFillQA) { fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hITSNsigmaEl", "ITS n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hITSNsigmaMu", "ITS n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hITSNsigmaPi", "ITS n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hITSNsigmaKa", "ITS n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hITSNsigmaPr", "ITS n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hITSNsigmaEl", "ITS n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hITSNsigmaMu", "ITS n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hITSNsigmaPi", "ITS n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hITSNsigmaKa", "ITS n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hITSNsigmaPr", "ITS n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{ITS}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.addClone("Track/PID/positive/", "Track/PID/negative/"); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { @@ -462,16 +462,16 @@ struct SingleTrackQCMC { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); fDielectronCut.SetTOFNsigmaElRange(dielectroncuts.cfg_min_TOFNsigmaEl, dielectroncuts.cfg_max_TOFNsigmaEl); fDielectronCut.SetPinRangeForPionRejectionTPC(dielectroncuts.cfg_min_pin_pirejTPC, dielectroncuts.cfg_max_pin_pirejTPC); - fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); - fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); - fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); - fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); + // fDielectronCut.SetITSNsigmaKaRange(dielectroncuts.cfg_min_ITSNsigmaKa, dielectroncuts.cfg_max_ITSNsigmaKa); + // fDielectronCut.SetITSNsigmaPrRange(dielectroncuts.cfg_min_ITSNsigmaPr, dielectroncuts.cfg_max_ITSNsigmaPr); + // fDielectronCut.SetPRangeForITSNsigmaKa(dielectroncuts.cfg_min_p_ITSNsigmaKa, dielectroncuts.cfg_max_p_ITSNsigmaKa); + // fDielectronCut.SetPRangeForITSNsigmaPr(dielectroncuts.cfg_min_p_ITSNsigmaPr, dielectroncuts.cfg_max_p_ITSNsigmaPr); if (dielectroncuts.cfg_pid_scheme == static_cast(DielectronCut::PIDSchemes::kPIDML)) { // please call this at the end of DefineDileptonCut static constexpr int nClassesMl = 2; @@ -608,20 +608,20 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/PID/positive/hMeanClusterSizeITSib"), track.p(), track.meanClusterSizeITSib() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/PID/positive/hMeanClusterSizeITSob"), track.p(), track.meanClusterSizeITSob() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + // fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + // fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); - fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); - fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); - fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); - fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); - fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); + // fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); + // fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); + // fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); + // fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); + // fRegistry.fill(HIST("Track/PID/positive/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); } } else { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, -mctrack.pdgCode() / pdg_lepton, weight); @@ -653,20 +653,20 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/PID/negative/hMeanClusterSizeITSib"), track.p(), track.meanClusterSizeITSib() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/PID/negative/hMeanClusterSizeITSob"), track.p(), track.meanClusterSizeITSob() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + // fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + // fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); - fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); - fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); - fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); - fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); - fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); + // fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaEl"), track.p(), track.itsNSigmaEl()); + // fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaMu"), track.p(), track.itsNSigmaMu()); + // fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaPi"), track.p(), track.itsNSigmaPi()); + // fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaKa"), track.p(), track.itsNSigmaKa()); + // fRegistry.fill(HIST("Track/PID/negative/hITSNsigmaPr"), track.p(), track.itsNSigmaPr()); } } } diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 7da56ec4255..4398e30206d 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -392,6 +392,7 @@ DECLARE_SOA_COLUMN(ITSNSigmaMu, itsNSigmaMu, float); //! DECLARE_SOA_COLUMN(ITSNSigmaPi, itsNSigmaPi, float); //! DECLARE_SOA_COLUMN(ITSNSigmaKa, itsNSigmaKa, float); //! DECLARE_SOA_COLUMN(ITSNSigmaPr, itsNSigmaPr, float); //! +// DECLARE_SOA_COLUMN(TPCSignalMC, mcTunedtpcSignal, float); //! DECLARE_SOA_DYNAMIC_COLUMN(Signed1Pt, signed1Pt, [](float pt, int8_t sign) -> float { return sign * 1. / pt; }); DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); }); DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) -> float { return pt * std::cos(phi); }); @@ -504,7 +505,39 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_002, "AOD", "EMPRIMARYEL", 2, //! emprimaryelectron::MeanClusterSizeITSib, emprimaryelectron::MeanClusterSizeITSob); -using EMPrimaryElectrons = EMPrimaryElectrons_002; +DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_003, "AOD", "EMPRIMARYEL", 3, //! + o2::soa::Index<>, emprimaryelectron::CollisionId, + emprimaryelectron::TrackId, emprimaryelectron::Sign, + track::Pt, track::Eta, track::Phi, track::DcaXY, track::DcaZ, + track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, + track::TPCChi2NCl, track::TPCInnerParam, + track::TPCSignal, pidtpc::TPCNSigmaEl, /*pidtpc::TPCNSigmaMu,*/ pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, + pidtofbeta::Beta, pidtof::TOFNSigmaEl, /*pidtof::TOFNSigmaMu,*/ pidtof::TOFNSigmaPi, pidtof::TOFNSigmaKa, pidtof::TOFNSigmaPr, + track::ITSClusterSizes, + // emprimaryelectron::ITSNSigmaEl, emprimaryelectron::ITSNSigmaMu, emprimaryelectron::ITSNSigmaPi, emprimaryelectron::ITSNSigmaKa, emprimaryelectron::ITSNSigmaPr, + track::ITSChi2NCl, track::TOFChi2, track::DetectorMap, + track::X, track::Alpha, track::Y, track::Z, track::Snp, track::Tgl, emprimaryelectron::IsAssociatedToMPC, + mcpidtpc::DeDxTunedMc, + + // dynamic column + track::TPCNClsFound, + track::TPCNClsCrossedRows, + track::TPCCrossedRowsOverFindableCls, + track::TPCFoundOverFindableCls, + track::TPCFractionSharedCls, + track::v001::ITSClusterMap, track::v001::ITSNCls, track::v001::ITSNClsInnerBarrel, + track::HasITS, track::HasTPC, track::HasTRD, track::HasTOF, + emprimaryelectron::Signed1Pt, + emprimaryelectron::P, + emprimaryelectron::Px, + emprimaryelectron::Py, + emprimaryelectron::Pz, + emprimaryelectron::Theta, + emprimaryelectron::MeanClusterSizeITS, + emprimaryelectron::MeanClusterSizeITSib, + emprimaryelectron::MeanClusterSizeITSob); + +using EMPrimaryElectrons = EMPrimaryElectrons_003; // iterators using EMPrimaryElectron = EMPrimaryElectrons::iterator; diff --git a/PWGEM/Dilepton/DataModel/lmeeMLTables.h b/PWGEM/Dilepton/DataModel/lmeeMLTables.h index 147729b238f..c97cc75ffc3 100644 --- a/PWGEM/Dilepton/DataModel/lmeeMLTables.h +++ b/PWGEM/Dilepton/DataModel/lmeeMLTables.h @@ -42,16 +42,17 @@ enum class Track_Type : uint8_t { } // namespace pwgem::dilepton::ml -namespace emprimarytrack +namespace emmltrack { -// DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! +DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! DECLARE_SOA_COLUMN(PIDLabel, pidlabel, uint8_t); //! DECLARE_SOA_COLUMN(TrackType, tracktype, uint8_t); //! DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, uint8_t); //! DECLARE_SOA_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, uint8_t); //! DECLARE_SOA_COLUMN(IsForValidation, isForValidation, bool); //! DECLARE_SOA_COLUMN(Sign, sign, short); //! -DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); }); +DECLARE_SOA_COLUMN(P, p, float); //! +// DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) -> float { return pt * std::cosh(eta); }); DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITS, meanClusterSizeITS, [](uint32_t itsClusterSizes) -> float { int total_cluster_size = 0, nl = 0; for (unsigned int layer = 0; layer < 7; layer++) { @@ -82,26 +83,24 @@ DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32 return 0; } }); -} // namespace emprimarytrack +} // namespace emmltrack // reconstructed track information -DECLARE_SOA_TABLE(EMMLPrimaryTracks, "AOD", "EMMLPTRACK", //! +DECLARE_SOA_TABLE(EMTracksForMLPID, "AOD", "EMTRACKMLPID", //! o2::soa::Index<>, collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, - track::Pt, track::Eta, track::Phi, track::Tgl, emprimarytrack::Sign, - track::DcaXY, track::DcaZ, track::CYY, track::CZZ, track::CZY, - track::TPCNClsFindable, emprimarytrack::TPCNClsFound, emprimarytrack::TPCNClsCrossedRows, + emmltrack::P, track::Tgl, emmltrack::Sign, + track::TPCNClsFindable, emmltrack::TPCNClsFound, emmltrack::TPCNClsCrossedRows, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaMu, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, pidtofbeta::Beta, pidtof::TOFNSigmaEl, pidtof::TOFNSigmaMu, pidtof::TOFNSigmaPi, pidtof::TOFNSigmaKa, pidtof::TOFNSigmaPr, - track::ITSClusterSizes, track::ITSChi2NCl, track::TOFChi2, track::DetectorMap, emprimarytrack::PIDLabel, emprimarytrack::TrackType, emprimarytrack::IsForValidation, + track::ITSClusterSizes, track::ITSChi2NCl, track::TOFChi2, track::DetectorMap, emmltrack::PIDLabel, emmltrack::IsForValidation, // dynamic column - emprimarytrack::P, - emprimarytrack::MeanClusterSizeITS, - emprimarytrack::MeanClusterSizeITSob); + emmltrack::MeanClusterSizeITS, + emmltrack::MeanClusterSizeITSob); // iterators -using EMMLPrimaryTrack = EMMLPrimaryTracks::iterator; +using EMTrackForMLPID = EMTracksForMLPID::iterator; } // namespace o2::aod diff --git a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx index b0332194b55..de91b961120 100644 --- a/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx +++ b/PWGEM/Dilepton/TableProducer/filterDielectronEvent.cxx @@ -12,30 +12,32 @@ /// \brief write relevant information about primary electrons. /// \author daiki.sekihata@cern.ch -#include -#include -#include -#include -#include +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "CCDB/BasicCCDBManager.h" +#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/Core/TableHelper.h" -#include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Math/Vector4D.h" + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::soa; @@ -332,11 +334,12 @@ struct filterDielectronEvent { pt_recalc, eta_recalc, phi_recalc, dcaXY, dcaZ, track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(), track.tpcChi2NCl(), track.tpcInnerParam(), - track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), - track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.itsClusterSizes(), 0, 0, 0, 0, 0, + track.tpcSignal(), track.tpcNSigmaEl(), /*track.tpcNSigmaMu(),*/ track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), + track.beta(), track.tofNSigmaEl(), /*track.tofNSigmaMu(),*/ track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.itsClusterSizes(), + // 0, 0, 0, 0, 0, track.itsChi2NCl(), track.tofChi2(), track.detectorMap(), - track_par_cov_recalc.getX(), track_par_cov_recalc.getAlpha(), track_par_cov_recalc.getY(), track_par_cov_recalc.getZ(), track_par_cov_recalc.getSnp(), track_par_cov_recalc.getTgl(), isAssociatedToMPC); + track_par_cov_recalc.getX(), track_par_cov_recalc.getAlpha(), track_par_cov_recalc.getY(), track_par_cov_recalc.getZ(), track_par_cov_recalc.getSnp(), track_par_cov_recalc.getTgl(), isAssociatedToMPC, -1); emprimaryelectronscov( track_par_cov_recalc.getSigmaY2(), diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx index 96bd1fec6e5..14196b13137 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx @@ -54,7 +54,7 @@ using MyTracks = soa::Join; using MyTrack = MyTracks::iterator; -using MyTracksMC = soa::Join; +using MyTracksMC = soa::Join; using MyTrackMC = MyTracksMC::iterator; struct skimmerPrimaryElectron { @@ -158,6 +158,7 @@ struct skimmerPrimaryElectron { fRegistry.add("Track/hChi2ITS", "chi2/number of ITS clusters", kTH1F, {{100, 0, 10}}, false); fRegistry.add("Track/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); fRegistry.add("Track/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/hTPCdEdxMC", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); fRegistry.add("Track/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); @@ -435,7 +436,7 @@ struct skimmerPrimaryElectron { return minTPCNsigmaEl < track.tpcNSigmaEl() && track.tpcNSigmaEl() < maxTPCNsigmaEl && std::fabs(track.tofNSigmaEl()) < maxTOFNsigmaEl; } - template + template void fillTrackTable(TCollision const& collision, TTrack const& track) { if (std::find(stored_trackIds.begin(), stored_trackIds.end(), std::pair{collision.globalIndex(), track.globalIndex()}) == stored_trackIds.end()) { @@ -455,16 +456,21 @@ struct skimmerPrimaryElectron { o2::math_utils::bringTo02Pi(phi_recalc); bool isAssociatedToMPC = collision.globalIndex() == track.collisionId(); + float tpcSignalMC = -1; + if constexpr (isMC) { + tpcSignalMC = track.mcTunedTPCSignal(); + } emprimaryelectrons(collision.globalIndex(), track.globalIndex(), track.sign(), pt_recalc, eta_recalc, phi_recalc, dcaXY, dcaZ, track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(), track.tpcChi2NCl(), track.tpcInnerParam(), - track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), - track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.itsClusterSizes(), track.itsNSigmaEl(), track.itsNSigmaMu(), track.itsNSigmaPi(), track.itsNSigmaKa(), track.itsNSigmaPr(), + track.tpcSignal(), track.tpcNSigmaEl(), /*track.tpcNSigmaMu(),*/ track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), + track.beta(), track.tofNSigmaEl(), /*track.tofNSigmaMu(),*/ track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.itsClusterSizes(), + // track.itsNSigmaEl(), track.itsNSigmaMu(), track.itsNSigmaPi(), track.itsNSigmaKa(), track.itsNSigmaPr(), track.itsChi2NCl(), track.tofChi2(), track.detectorMap(), - track_par_cov_recalc.getX(), track_par_cov_recalc.getAlpha(), track_par_cov_recalc.getY(), track_par_cov_recalc.getZ(), track_par_cov_recalc.getSnp(), track_par_cov_recalc.getTgl(), isAssociatedToMPC); + track_par_cov_recalc.getX(), track_par_cov_recalc.getAlpha(), track_par_cov_recalc.getY(), track_par_cov_recalc.getZ(), track_par_cov_recalc.getSnp(), track_par_cov_recalc.getTgl(), isAssociatedToMPC, tpcSignalMC); emprimaryelectronscov( track_par_cov_recalc.getSigmaY2(), @@ -532,6 +538,7 @@ struct skimmerPrimaryElectron { fRegistry.fill(HIST("Track/hChi2TOF"), track.tofChi2()); fRegistry.fill(HIST("Track/hITSClusterMap"), track.itsClusterMap()); fRegistry.fill(HIST("Track/hTPCdEdx"), track.tpcInnerParam(), track.tpcSignal()); + fRegistry.fill(HIST("Track/hTPCdEdxMC"), track.tpcInnerParam(), tpcSignalMC); fRegistry.fill(HIST("Track/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); fRegistry.fill(HIST("Track/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); @@ -583,7 +590,7 @@ struct skimmerPrimaryElectron { if (!checkTrack(collision, track) || !isElectron(collision, track)) { continue; } - fillTrackTable(collision, track); + fillTrackTable(collision, track); } } // end of collision loop @@ -614,7 +621,7 @@ struct skimmerPrimaryElectron { if (!checkTrack(collision, track) || !isElectron(collision, track)) { continue; } - fillTrackTable(collision, track); + fillTrackTable(collision, track); } } // end of collision loop @@ -645,7 +652,7 @@ struct skimmerPrimaryElectron { if (!checkTrack(collision, track) || !isElectron(collision, track)) { continue; } - fillTrackTable(collision, track); + fillTrackTable(collision, track); } } // end of collision loop @@ -679,7 +686,7 @@ struct skimmerPrimaryElectron { if (!checkTrack(collision, track) || !isElectron(collision, track)) { continue; } - fillTrackTable(collision, track); + fillTrackTable(collision, track); } } // end of collision loop @@ -714,7 +721,7 @@ struct skimmerPrimaryElectron { if (!checkTrack(collision, track) || !isElectron(collision, track)) { continue; } - fillTrackTable(collision, track); + fillTrackTable(collision, track); } } // end of collision loop @@ -747,7 +754,7 @@ struct skimmerPrimaryElectron { if (!checkTrack(collision, track) || !isElectron(collision, track)) { continue; } - fillTrackTable(collision, track); + fillTrackTable(collision, track); } } // end of collision loop diff --git a/PWGEM/Dilepton/TableProducer/skimmerSecondaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerSecondaryElectron.cxx index 837fd99b3d4..15b99dc7349 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerSecondaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerSecondaryElectron.cxx @@ -12,28 +12,30 @@ /// \brief write relevant information about primary electrons. /// \author daiki.sekihata@cern.ch -#include -#include -#include -#include -#include -#include +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "CCDB/BasicCCDBManager.h" #include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include "Math/Vector4D.h" + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::soa; @@ -261,11 +263,12 @@ struct skimmerSecondaryElectron { pt_recalc, eta_recalc, phi_recalc, dcaXY, dcaZ, track.tpcNClsFindable(), track.tpcNClsFindableMinusFound(), track.tpcNClsFindableMinusCrossedRows(), track.tpcNClsShared(), track.tpcChi2NCl(), track.tpcInnerParam(), - track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), - track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.itsClusterSizes(), 0, 0, 0, 0, 0, + track.tpcSignal(), track.tpcNSigmaEl(), /*track.tpcNSigmaMu(),*/ track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), + track.beta(), track.tofNSigmaEl(), /*track.tofNSigmaMu(),*/ track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.itsClusterSizes(), + // 0, 0, 0, 0, 0, track.itsChi2NCl(), track.tofChi2(), track.detectorMap(), - track_par_cov_recalc.getX(), track_par_cov_recalc.getAlpha(), track_par_cov_recalc.getY(), track_par_cov_recalc.getZ(), track_par_cov_recalc.getSnp(), track_par_cov_recalc.getTgl(), isAssociatedToMPC); + track_par_cov_recalc.getX(), track_par_cov_recalc.getAlpha(), track_par_cov_recalc.getY(), track_par_cov_recalc.getZ(), track_par_cov_recalc.getSnp(), track_par_cov_recalc.getTgl(), isAssociatedToMPC, -1); emprimaryelectronscov( track_par_cov_recalc.getSigmaY2(), diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx index 7643f79a984..1874e953269 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -14,33 +14,37 @@ // This code will create data table for inputs to machine learning for electrons. // Please write to: daiki.sekihata@cern.ch -#include -#include -#include -#include -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/trackUtilities.h" +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + #include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsBase/GeometryManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" #include "DCAFitter/DCAFitterN.h" -#include "CCDB/BasicCCDBManager.h" -#include "PWGEM/Dilepton/Utils/MCUtilities.h" -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Math/Vector4D.h" + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -96,8 +100,8 @@ DECLARE_SOA_TABLE(MyTracks, "AOD", "MYTRACK", //! track::DcaXY, track::DcaZ, mytrack::DCAresXY, mytrack::DCAresZ, track::CZY, track::TPCNClsFindable, mytrack::TPCNClsFound, mytrack::TPCNClsCrossedRows, track::TPCChi2NCl, track::TPCInnerParam, - track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaMu, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, - pidtofbeta::Beta, pidtof::TOFNSigmaEl, pidtof::TOFNSigmaMu, pidtof::TOFNSigmaPi, pidtof::TOFNSigmaKa, pidtof::TOFNSigmaPr, + track::TPCSignal, pidtpc::TPCNSigmaEl, /*pidtpc::TPCNSigmaMu,*/ pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, + pidtofbeta::Beta, pidtof::TOFNSigmaEl, /*pidtof::TOFNSigmaMu,*/ pidtof::TOFNSigmaPi, pidtof::TOFNSigmaKa, pidtof::TOFNSigmaPr, track::TOFChi2, track::ITSChi2NCl, track::ITSClusterSizes, mytrack::MCVx, mytrack::MCVy, mytrack::MCVz, mcparticle::PdgCode, mytrack::IsPhysicalPrimary, mytrack::MotherIds, mytrack::MotherPdgCodes); @@ -584,8 +588,8 @@ struct TreeCreatorElectronML { track.sign(), track.pt(), track.eta(), track.phi(), track.tgl(), track.dcaXY(), track.dcaZ(), sqrt(track.cYY()), sqrt(track.cZZ()), track.cZY(), track.tpcNClsFindable(), track.tpcNClsFound(), track.tpcNClsCrossedRows(), track.tpcChi2NCl(), track.tpcInnerParam(), - track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), - track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), + track.tpcSignal(), track.tpcNSigmaEl(), /*track.tpcNSigmaMu(),*/ track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), + track.beta(), track.tofNSigmaEl(), /*track.tofNSigmaMu(),*/ track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), track.tofChi2(), track.itsChi2NCl(), track.itsClusterSizes(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.pdgCode(), mctrack.isPhysicalPrimary(), mothers_id, mothers_pdg); diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx index a42c7c805d4..fba1c3787df 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx @@ -65,7 +65,7 @@ using MyTrack = MyTracks::iterator; struct TreeCreatorElectronMLDDA { SliceCache cache; - Produces emprimarytracks; // flat table containing collision + track information + Produces emprimarytracks; // flat table containing collision + track information // Basic checks HistogramRegistry registry{ @@ -590,8 +590,8 @@ struct TreeCreatorElectronMLDDA { mVtx.setPos({collision.posX(), collision.posY(), collision.posZ()}); mVtx.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ()); o2::base::Propagator::Instance()->propagateToDCABxByBz(mVtx, trackParCov, 2.f, matCorr, &mDcaInfoCov); - float dcaXY = mDcaInfoCov.getY(); - float dcaZ = mDcaInfoCov.getZ(); + // float dcaXY = mDcaInfoCov.getY(); + // float dcaZ = mDcaInfoCov.getZ(); if (tracktype == static_cast(o2::aod::pwgem::dilepton::ml::Track_Type::kPrimary)) { if (dist01(engine) > downscaling_electron_primary && trackParCov.getP() < max_p_for_downscaling_electron_primary) { @@ -619,13 +619,12 @@ struct TreeCreatorElectronMLDDA { if (std::find(stored_trackIds.begin(), stored_trackIds.end(), track.globalIndex()) == stored_trackIds.end()) { emprimarytracks(collision.numContrib(), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), - trackParCov.getPt(), trackParCov.getEta(), trackParCov.getPhi() > 0.f ? trackParCov.getPhi() : trackParCov.getPhi() + 2 * M_PI, trackParCov.getTgl(), track.sign(), - dcaXY, dcaZ, trackParCov.getSigmaY2(), trackParCov.getSigmaZ2(), trackParCov.getSigmaZY(), + trackParCov.getP(), trackParCov.getTgl(), track.sign(), track.tpcNClsFindable(), track.tpcNClsFound(), track.tpcNClsCrossedRows(), track.tpcChi2NCl(), track.tpcInnerParam(), track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(), track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), - track.itsClusterSizes(), track.itsChi2NCl(), track.tofChi2(), track.detectorMap(), pidlabel, tracktype, isForValidation); + track.itsClusterSizes(), track.itsChi2NCl(), track.tofChi2(), track.detectorMap(), pidlabel, isForValidation); stored_trackIds.emplace_back(track.globalIndex()); } } @@ -990,7 +989,7 @@ struct MLTrackQC { }, }; - void processQC(aod::EMMLPrimaryTracks const& tracks) + void processQC(aod::EMTracksForMLPID const& tracks) { for (const auto& track : tracks) { registry.fill(HIST("hTPCdEdx_P_All"), track.p(), track.tpcSignal()); @@ -1025,7 +1024,7 @@ struct MLTrackQC { } PROCESS_SWITCH(MLTrackQC, processQC, "process QC for single track level", false); - void processDummy(aod::EMMLPrimaryTracks const&) {} + void processDummy(aod::EMTracksForMLPID const&) {} PROCESS_SWITCH(MLTrackQC, processDummy, "process dummy", true); }; diff --git a/PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt b/PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt index 503c3aee2ff..7e02c208968 100644 --- a/PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt +++ b/PWGEM/Dilepton/Tasks/Converters/CMakeLists.txt @@ -20,3 +20,8 @@ o2physics_add_dpl_workflow(electron-converter2 PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(electron-converter3 + SOURCES electronConverter3.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + diff --git a/PWGEM/Dilepton/Tasks/Converters/electronConverter3.cxx b/PWGEM/Dilepton/Tasks/Converters/electronConverter3.cxx new file mode 100644 index 00000000000..f4101ab2a51 --- /dev/null +++ b/PWGEM/Dilepton/Tasks/Converters/electronConverter3.cxx @@ -0,0 +1,85 @@ +// 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. +// +// ======================== +// +// This code runs loop over ULS ee pars for virtual photon QC. +// Please write to: daiki.sekihata@cern.ch + +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" + +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::aod; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; + +struct electronConverter3 { + Produces track_003; + + void process(aod::EMPrimaryElectrons_002 const& tracks) + { + for (auto& track : tracks) { + track_003(track.collisionId(), + track.trackId(), + track.sign(), + track.pt(), + track.eta(), + track.phi(), + track.dcaXY(), + track.dcaZ(), + track.tpcNClsFindable(), + track.tpcNClsFindableMinusFound(), + track.tpcNClsFindableMinusCrossedRows(), + track.tpcNClsShared(), + track.tpcChi2NCl(), + track.tpcInnerParam(), + track.tpcSignal(), + track.tpcNSigmaEl(), + // track.tpcNSigmaMu(), + track.tpcNSigmaPi(), + track.tpcNSigmaKa(), + track.tpcNSigmaPr(), + track.beta(), + track.tofNSigmaEl(), + // track.tofNSigmaMu(), + track.tofNSigmaPi(), + track.tofNSigmaKa(), + track.tofNSigmaPr(), + track.itsClusterSizes(), + // track.itsNSigmaEl(), + // track.itsNSigmaMu(), + // track.itsNSigmaPi(), + // track.itsNSigmaKa(), + // track.itsNSigmaPr(), + track.itsChi2NCl(), + track.tofChi2(), + track.detectorMap(), + track.x(), + track.alpha(), + track.y(), + track.z(), + track.snp(), + track.tgl(), + track.isAssociatedToMPC(), + -1); + } // end of track loop + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"electron-converter3"})}; +} diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index 45a00ae9889..75a92e03c9a 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -133,8 +133,8 @@ struct prefilterDielectron { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; @@ -292,7 +292,7 @@ struct prefilterDielectron { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); diff --git a/PWGEM/Dilepton/Tasks/vpPairQC.cxx b/PWGEM/Dilepton/Tasks/vpPairQC.cxx index bb597751be4..098403d7ea4 100644 --- a/PWGEM/Dilepton/Tasks/vpPairQC.cxx +++ b/PWGEM/Dilepton/Tasks/vpPairQC.cxx @@ -130,8 +130,8 @@ struct vpPairQC { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTOFif), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -0.0, "min. TPC n sigma for kaon exclusion"}; @@ -257,12 +257,12 @@ struct vpPairQC { fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);chi2", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {160, 0, 16}}, false); fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); @@ -335,7 +335,7 @@ struct vpPairQC { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); @@ -445,12 +445,12 @@ struct vpPairQC { fRegistry.fill(HIST("Track/positive/hTOFbeta"), track.p(), track.beta()); fRegistry.fill(HIST("Track/positive/hMeanClusterSizeITS"), track.p(), track.meanClusterSizeITS() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/positive/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/positive/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + // fRegistry.fill(HIST("Track/positive/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/positive/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + // fRegistry.fill(HIST("Track/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); @@ -482,12 +482,12 @@ struct vpPairQC { fRegistry.fill(HIST("Track/negative/hTOFbeta"), track.p(), track.beta()); fRegistry.fill(HIST("Track/negative/hMeanClusterSizeITS"), track.p(), track.meanClusterSizeITS() * std::cos(std::atan(track.tgl()))); fRegistry.fill(HIST("Track/negative/hTPCNsigmaEl"), track.tpcInnerParam(), track.tpcNSigmaEl()); - fRegistry.fill(HIST("Track/negative/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); + // fRegistry.fill(HIST("Track/negative/hTPCNsigmaMu"), track.tpcInnerParam(), track.tpcNSigmaMu()); fRegistry.fill(HIST("Track/negative/hTPCNsigmaPi"), track.tpcInnerParam(), track.tpcNSigmaPi()); fRegistry.fill(HIST("Track/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa()); fRegistry.fill(HIST("Track/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl()); - fRegistry.fill(HIST("Track/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); + // fRegistry.fill(HIST("Track/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa()); fRegistry.fill(HIST("Track/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr()); diff --git a/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx b/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx index 0fa6fb85b75..9cc2c6cb77f 100644 --- a/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/vpPairQCMC.cxx @@ -130,8 +130,8 @@ struct vpPairQCMC { Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTOFif), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5]"}; Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -0.0, "min. TPC n sigma for kaon exclusion"}; @@ -341,7 +341,7 @@ struct vpPairQCMC { // for eID fDielectronCut.SetPIDScheme(dielectroncuts.cfg_pid_scheme); fDielectronCut.SetTPCNsigmaElRange(dielectroncuts.cfg_min_TPCNsigmaEl, dielectroncuts.cfg_max_TPCNsigmaEl); - fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); + // fDielectronCut.SetTPCNsigmaMuRange(dielectroncuts.cfg_min_TPCNsigmaMu, dielectroncuts.cfg_max_TPCNsigmaMu); fDielectronCut.SetTPCNsigmaPiRange(dielectroncuts.cfg_min_TPCNsigmaPi, dielectroncuts.cfg_max_TPCNsigmaPi); fDielectronCut.SetTPCNsigmaKaRange(dielectroncuts.cfg_min_TPCNsigmaKa, dielectroncuts.cfg_max_TPCNsigmaKa); fDielectronCut.SetTPCNsigmaPrRange(dielectroncuts.cfg_min_TPCNsigmaPr, dielectroncuts.cfg_max_TPCNsigmaPr); diff --git a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h index 3db865a69e4..2ed0b02fe3c 100644 --- a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h +++ b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h @@ -117,18 +117,18 @@ enum class InputFeaturesDielectronSingleTrack : uint8_t { reldiffp, tpcSignal, tpcNSigmaEl, - tpcNSigmaMu, + // tpcNSigmaMu, tpcNSigmaPi, tpcNSigmaKa, tpcNSigmaPr, beta, tofNSigmaEl, - tofNSigmaMu, + // tofNSigmaMu, tofNSigmaPi, tofNSigmaKa, tofNSigmaPr, tpctofNSigmaEl, - tpctofNSigmaMu, + // tpctofNSigmaMu, tpctofNSigmaPi, tpctofNSigmaKa, tpctofNSigmaPr, @@ -239,18 +239,18 @@ class MlResponseDielectronSingleTrack : public MlResponse CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_RELDIFF(reldiffp, p, tpcInnerParam); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcSignal); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcNSigmaEl); - CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcNSigmaMu); + // CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcNSigmaMu); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcNSigmaPi); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcNSigmaKa); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tpcNSigmaPr); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(beta); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tofNSigmaEl); - CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tofNSigmaMu); + // CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tofNSigmaMu); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tofNSigmaPi); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tofNSigmaKa); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK(tofNSigmaPr); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_TPCTOF(tpctofNSigmaEl, tpcNSigmaEl, tofNSigmaEl, hasTOF); - CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_TPCTOF(tpctofNSigmaMu, tpcNSigmaMu, tofNSigmaMu, hasTOF); + // CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_TPCTOF(tpctofNSigmaMu, tpcNSigmaMu, tofNSigmaMu, hasTOF); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_TPCTOF(tpctofNSigmaPi, tpcNSigmaPi, tofNSigmaPi, hasTOF); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_TPCTOF(tpctofNSigmaKa, tpcNSigmaKa, tofNSigmaKa, hasTOF); CHECK_AND_FILL_DIELECTRON_SINGLE_TRACK_TPCTOF(tpctofNSigmaPr, tpcNSigmaPr, tofNSigmaPr, hasTOF); @@ -387,18 +387,18 @@ class MlResponseDielectronSingleTrack : public MlResponse FILL_MAP_DIELECTRON_SINGLE_TRACK(reldiffp), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcSignal), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcNSigmaEl), - FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcNSigmaMu), + // FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcNSigmaMu), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcNSigmaPi), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcNSigmaKa), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpcNSigmaPr), FILL_MAP_DIELECTRON_SINGLE_TRACK(beta), FILL_MAP_DIELECTRON_SINGLE_TRACK(tofNSigmaEl), - FILL_MAP_DIELECTRON_SINGLE_TRACK(tofNSigmaMu), + // FILL_MAP_DIELECTRON_SINGLE_TRACK(tofNSigmaMu), FILL_MAP_DIELECTRON_SINGLE_TRACK(tofNSigmaPi), FILL_MAP_DIELECTRON_SINGLE_TRACK(tofNSigmaKa), FILL_MAP_DIELECTRON_SINGLE_TRACK(tofNSigmaPr), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpctofNSigmaEl), - FILL_MAP_DIELECTRON_SINGLE_TRACK(tpctofNSigmaMu), + // FILL_MAP_DIELECTRON_SINGLE_TRACK(tpctofNSigmaMu), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpctofNSigmaPi), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpctofNSigmaKa), FILL_MAP_DIELECTRON_SINGLE_TRACK(tpctofNSigmaPr), diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index a1010e76435..2b37f91f7a2 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -15,14 +15,18 @@ #ifndef PWGEM_DILEPTON_UTILS_PAIRUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_PAIRUTILITIES_H_ -#include -#include +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" + +#include "ReconstructionDataFormats/TrackFwd.h" + +#include "Math/GenVector/Boost.h" #include "Math/SMatrix.h" #include "Math/Vector3D.h" #include "Math/Vector4D.h" -#include "Math/GenVector/Boost.h" -#include "Common/Core/RecoDecay.h" -#include "ReconstructionDataFormats/TrackFwd.h" + +#include +#include //_______________________________________________________________________ namespace o2::aod::pwgem::dilepton::utils::pairutil From 3635c6498d2bdace50d00174e8a1640422271621 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Thu, 3 Jul 2025 14:35:07 +0200 Subject: [PATCH 16/29] =?UTF-8?q?[PWGHF]=20=CE=A3c0,++:=20Remove=20duplica?= =?UTF-8?q?ted=20consuming=20of=20McParticles.=20(#11855)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mattia Faggin --- .../candidateCreatorSigmac0plusplus.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx index e66702055d8..9a59c28cf9c 100644 --- a/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx +++ b/PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx @@ -417,7 +417,7 @@ struct HfCandidateSigmac0plusplusMc { using BCsInfo = soa::Join; using LambdacMc = soa::Join; - using McParticlesLcGenMatch = soa::Join; + using McParticlesLcGenMatch = soa::Join; // including response of particle matching to MC from candidate-creator-3-prong using McCollisionsNoCents = soa::Join; PresliceUnsorted colPerMcCollision = aod::mccollisionlabel::mcCollisionId; @@ -466,9 +466,9 @@ struct HfCandidateSigmac0plusplusMc { /// @brief process function for MC matching of Σc0,++ → Λc+(→pK-π+) π- reconstructed candidates and counting of generated ones /// @param candidatesSigmac reconstructed Σc0,++ candidates /// @param mcParticles table of generated particles - void processMc(aod::McParticles const& mcParticles, + void processMc(McParticlesLcGenMatch const& mcParticles, aod::TracksWMc const& tracks, - LambdacMc const& candsLc, McParticlesLcGenMatch const& mcParticlesLcGenMatch, + LambdacMc const& candsLc, McCollisionsNoCents const& collInfos, aod::McCollisions const&, BCsInfo const&) @@ -576,7 +576,7 @@ struct HfCandidateSigmac0plusplusMc { } /// end loop over reconstructed Σc0,++ candidates /// Match generated Σc0,++ candidates - for (const auto& particle : mcParticlesLcGenMatch) { + for (const auto& particle : mcParticles) { flag = 0; origin = 0; std::vector idxBhadMothers{}; @@ -602,7 +602,7 @@ struct HfCandidateSigmac0plusplusMc { /// → here we check level 1. first, and then levels 2. and 3. are inherited by the Λc+ → pK-π+ MC matching in candidateCreator3Prong.cxx /// look for Σc0,++(2455) - if (RecoDecay::isMatchedMCGen(mcParticlesLcGenMatch, particle, Pdg::kSigmaC0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaC0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { // generated Σc0(2455) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ @@ -615,7 +615,7 @@ struct HfCandidateSigmac0plusplusMc { break; } } - } else if (RecoDecay::isMatchedMCGen(mcParticlesLcGenMatch, particle, Pdg::kSigmaCPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { // generated Σc++(2455) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ @@ -632,7 +632,7 @@ struct HfCandidateSigmac0plusplusMc { /// look for Σc0,++(2520) if (flag == 0) { - if (RecoDecay::isMatchedMCGen(mcParticlesLcGenMatch, particle, Pdg::kSigmaCStar0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { + if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCStar0, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiMinus)}, true, &sign, 1)) { // generated Σc0(2520) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ @@ -645,7 +645,7 @@ struct HfCandidateSigmac0plusplusMc { break; } } - } else if (RecoDecay::isMatchedMCGen(mcParticlesLcGenMatch, particle, Pdg::kSigmaCStarPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kSigmaCStarPlusPlus, std::array{static_cast(Pdg::kLambdaCPlus), static_cast(kPiPlus)}, true, &sign, 1)) { // generated Σc++(2520) for (const auto& daughter : particle.daughters_as()) { // look for Λc+ daughter decaying in pK-π+ @@ -663,7 +663,7 @@ struct HfCandidateSigmac0plusplusMc { /// check the origin (prompt vs. non-prompt) if (flag != 0) { - origin = RecoDecay::getCharmHadronOrigin(mcParticlesLcGenMatch, particle, false, &idxBhadMothers); + origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); } /// fill the table with results of generation level MC matching if (origin == RecoDecay::OriginType::NonPrompt) { From cec4bc879e91e9d89b241e9354ce04238bc2548d Mon Sep 17 00:00:00 2001 From: Jesper Gumprecht <113693781+jesgum@users.noreply.github.com> Date: Thu, 3 Jul 2025 15:46:44 +0200 Subject: [PATCH 17/29] [Common] Add time dependency study to centrality task (#11896) --- Common/Tasks/centralityStudy.cxx | 54 ++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 7df3fa4ffc5..6e97af9e8a2 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -13,14 +13,18 @@ // Run 3 Pb-Pb centrality selections in 2023 data. It is compatible with // derived data. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "Common/DataModel/Multiplicity.h" + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/GRPECSObject.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" + #include "TH1F.h" #include "TH2F.h" @@ -32,6 +36,7 @@ using BCsWithRun3Matchings = soa::Join ccdb; // Configurables Configurable do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"}; @@ -39,6 +44,7 @@ struct centralityStudy { Configurable doOccupancyStudyVsRawValues2d{"doOccupancyStudyVsRawValues2d", true, "0 - no, 1 - yes"}; Configurable doOccupancyStudyVsCentrality3d{"doOccupancyStudyVsCentrality3d", false, "0 - no, 1 - yes"}; Configurable doOccupancyStudyVsRawValues3d{"doOccupancyStudyVsRawValues3d", false, "0 - no, 1 - yes"}; + Configurable doTimeStudies{"doTimeStudies", false, "0 - no, 1 - yes"}; Configurable doNGlobalTracksVsRawSignals{"doNGlobalTracksVsRawSignals", true, "0 - no, 1 - yes"}; Configurable applySel8{"applySel8", true, "0 - no, 1 - yes"}; Configurable applyVtxZ{"applyVtxZ", true, "0 - no, 1 - yes"}; @@ -113,10 +119,10 @@ struct centralityStudy { ConfigurableAxis axisCentrality{"axisCentrality", {100, 0, 100}, "FT0C percentile"}; ConfigurableAxis axisPVChi2{"axisPVChi2", {300, 0, 30}, "FT0C percentile"}; ConfigurableAxis axisDeltaTime{"axisDeltaTime", {300, 0, 300}, "#Delta time"}; + ConfigurableAxis axisDeltaTimestamp{"axisDeltaTimestamp", {1440, 0, 24}, "#Delta timestamp - sor (hours)"}; // For profile Z ConfigurableAxis axisPVz{"axisPVz", {400, -20.0f, +20.0f}, "PVz (cm)"}; - ConfigurableAxis axisZN{"axisZN", {1100, -50.0f, +500.0f}, "ZN"}; void init(InitContext&) @@ -227,6 +233,21 @@ struct centralityStudy { histos.add("hFT0COccupancyVsNGlobalTracksVsCentrality", "hFT0COccupancyVsNGlobalTracksVsCentrality", kTH3F, {axisFT0COccupancy, axisMultGlobalTracks, axisCentrality}); } } + + if (doTimeStudies) { + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + + histos.add("hFT0AvsTime", "hFT0AvsTime", kTH2F, {axisDeltaTimestamp, axisMultFT0A}); + histos.add("hFT0CvsTime", "hFT0CvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0C}}); + histos.add("hFT0MvsTime", "hFT0MvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0M}}); + histos.add("hFV0AvsTime", "hFV0AvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFV0A}}); + histos.add("hMFTTracksvsTime", "hMFTTracksvsTime", kTH2F, {{axisDeltaTimestamp, axisMultMFTTracks}}); + histos.add("hNGlobalVsTime", "hNGlobalVsTime", kTH2F, {{axisDeltaTimestamp, axisMultGlobalTracks}}); + histos.add("hNTPVContributorsvsTime", "hNTPVContributorsvsTime", kTH2F, {{axisDeltaTimestamp, axisMultPVContributors}}); + } } template @@ -403,19 +424,34 @@ struct centralityStudy { histos.fill(HIST("hFT0COccupancyVsNGlobalTracksVsCentrality"), collision.ft0cOccupancyInTimeRange(), collision.multNTracksGlobal(), collision.centFT0C()); } } + + if (doTimeStudies && collision.has_multBC()) { + auto multbc = collision.template multBC_as(); + uint64_t bcTimestamp = multbc.timestamp(); + o2::parameters::GRPECSObject* grpo = ccdb->getForTimeStamp("GLO/Config/GRPECS", bcTimestamp); + uint64_t startOfRunTimestamp = grpo->getTimeStart(); + float hoursAfterStartOfRun = static_cast(bcTimestamp - startOfRunTimestamp) / 3600000.0; + histos.fill(HIST("hFT0AvsTime"), hoursAfterStartOfRun, collision.multFT0A()); + histos.fill(HIST("hFT0CvsTime"), hoursAfterStartOfRun, collision.multFT0C()); + histos.fill(HIST("hFT0MvsTime"), hoursAfterStartOfRun, collision.multFT0M()); + histos.fill(HIST("hFV0AvsTime"), hoursAfterStartOfRun, collision.multFV0A()); + histos.fill(HIST("hMFTTracksvsTime"), hoursAfterStartOfRun, collision.mftNtracks()); + histos.fill(HIST("hNGlobalVsTime"), hoursAfterStartOfRun, collision.multNTracksGlobal()); + histos.fill(HIST("hNTPVContributorsvsTime"), hoursAfterStartOfRun, collision.multPVTotalContributors()); + } } - void processCollisions(soa::Join::iterator const& collision) + void processCollisions(soa::Join::iterator const& collision, aod::MultBCs const&) { genericProcessCollision(collision); } - void processCollisionsWithCentrality(soa::Join::iterator const& collision) + void processCollisionsWithCentrality(soa::Join::iterator const& collision, aod::MultBCs const&) { genericProcessCollision(collision); } - void processCollisionsWithCentralityWithNeighbours(soa::Join::iterator const& collision) + void processCollisionsWithCentralityWithNeighbours(soa::Join::iterator const& collision, aod::MultBCs const&) { genericProcessCollision(collision); } From 78e4af0eb66fe3cf4d52e205a4092c8bcc980edd Mon Sep 17 00:00:00 2001 From: Marvin Hemmer <53471402+mhemmer-cern@users.noreply.github.com> Date: Thu, 3 Jul 2025 15:50:36 +0200 Subject: [PATCH 18/29] [PWGJE,EMCAL-670] Add option to use Run2 alignment (#11892) --- PWGJE/TableProducer/emcalCorrectionTask.cxx | 22 ++++----------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index e7d14189114..8b114289992 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -112,6 +112,7 @@ struct EmcalCorrectionTask { Configurable applyCellTimeCorrection{"applyCellTimeCorrection", true, "apply a correction to the cell time for data and MC: Shift both average cell times to 0 and smear MC time distribution to fit data better. For MC requires isMC to be true"}; Configurable trackMinPt{"trackMinPt", 0.3, "Minimum pT for tracks to perform track matching, to reduce computing time. Tracks below a certain pT will be loopers anyway."}; Configurable fillQA{"fillQA", false, "Switch to turn on QA histograms."}; + Configurable useCCDBAlignment{"useCCDBAlignment", false, "EXPERTS ONLY! Switch to use the alignment object stored in CCDB instead of using the default alignment from the global geometry object."}; // Require EMCAL cells (CALO type 1) Filter emccellfilter = aod::calo::caloType == selectedCellType; @@ -166,6 +167,9 @@ struct EmcalCorrectionTask { if (!geometry) { LOG(error) << "Failure accessing geometry"; } + if (useCCDBAlignment.value) { + geometry->SetMisalMatrixFromCcdb(); + } // read all the cluster definitions specified in the options if (clusterDefinitions->length()) { @@ -350,12 +354,6 @@ struct EmcalCorrectionTask { fillQAHistogram(cellsBC); - // TODO: Helpful for now, but should be removed. - LOG(debug) << "Converted EMCAL cells"; - for (const auto& cell : cellsBC) { - LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); - } - LOG(debug) << "Converted cells. Contains: " << cellsBC.size() << ". Originally " << cellsInBC.size() << ". About to run clusterizer."; // this is a test // Run the clusterizers @@ -482,12 +480,6 @@ struct EmcalCorrectionTask { fillQAHistogram(cellsBC); - // TODO: Helpful for now, but should be removed. - LOG(debug) << "Converted EMCAL cells"; - for (const auto& cell : cellsBC) { - LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); - } - LOG(debug) << "Converted cells. Contains: " << cellsBC.size() << ". Originally " << cellsInBC.size() << ". About to run clusterizer."; // this is a test // Run the clusterizers @@ -597,12 +589,6 @@ struct EmcalCorrectionTask { fillQAHistogram(cellsBC); - // TODO: Helpful for now, but should be removed. - LOG(debug) << "Converted EMCAL cells"; - for (const auto& cell : cellsBC) { - LOG(debug) << cell.getTower() << ": E: " << cell.getEnergy() << ", time: " << cell.getTimeStamp() << ", type: " << cell.getType(); - } - LOG(debug) << "Converted cells. Contains: " << cellsBC.size() << ". Originally " << cellsInBC.size() << ". About to run clusterizer."; // this is a test From 02aa365cd9341b90f24f750bb7031d5a01b1a7f3 Mon Sep 17 00:00:00 2001 From: Nicolas Strangmann <77485327+nstrangm@users.noreply.github.com> Date: Thu, 3 Jul 2025 16:52:25 +0200 Subject: [PATCH 19/29] [PWGEM/PhotonMeson] Add workaround for kTVXinEMC issues in data to BC wise GG task (#11899) Co-authored-by: Nicolas Strangmann --- PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx index 33f3928076d..d02f33ea009 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx @@ -42,7 +42,8 @@ using SelectedMCClusters = soa::Filtered cfgRequirekTVXinEMC{"cfgRequirekTVXinEMC", true, "Reconstruct mesonss only in kTVXinEMC triggered BCs"}; + Configurable cfgRequirekTVXinEMC{"cfgRequirekTVXinEMC", true, "Reconstruct mesons only in kTVXinEMC triggered BCs"}; + Configurable cfgRequireEMCCell{"cfgRequireEMCCell", true, "Reconstruct mesons only in BCs containing at least one EMCal cell (workaround for kTVXinEMC trigger)"}; Configurable cfgSelectOnlyUniqueAmbiguous{"cfgSelectOnlyUniqueAmbiguous", 0, "0: all clusters, 1: only unique clusters, 2: only ambiguous clusters"}; Configurable cfgClusterDefinition{"cfgClusterDefinition", 13, "Clusterizer to be selected, e.g. 13 for kV3MostSplitLowSeed"}; @@ -289,6 +290,8 @@ struct EmcalBcWiseGammaGamma { { if (cfgRequirekTVXinEMC && !bc.haskTVXinEMC()) return false; + if (cfgRequireEMCCell && !bc.hasEMCCell()) + return false; if (cfgSelectOnlyUniqueAmbiguous == 1 && collisions.size() != 1) return false; if (cfgSelectOnlyUniqueAmbiguous == 2 && collisions.size() == 1) From 87be5da87be8bcef56dccf64b5d960e7f1b7545d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Thu, 3 Jul 2025 17:09:09 +0200 Subject: [PATCH 20/29] [PWGCF,PWGHF,PWGJE] Propagate new MC flags to 2-prongs (#11782) --- .../femtoUniverseProducerTask.cxx | 54 +++-- PWGCF/TableProducer/filter2Prong.cxx | 3 +- PWGHF/Core/DecayChannels.h | 7 +- PWGHF/D2H/Tasks/taskCharmPolarisation.cxx | 6 +- PWGHF/D2H/Tasks/taskD0.cxx | 13 +- PWGHF/D2H/Tasks/taskLcToK0sP.cxx | 8 - PWGHF/D2H/Tasks/taskSigmac.cxx | 2 +- PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx | 25 +- .../correlatorD0D0barBarrelFullPid.cxx | 25 +- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 27 +-- .../TableProducer/correlatorDMesonPairs.cxx | 21 +- .../TableProducer/correlatorLcScHadrons.cxx | 5 +- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 5 +- PWGHF/HFC/Tasks/taskFlow.cxx | 2 +- .../TableProducer/candidateCreator2Prong.cxx | 83 +++---- .../TableProducer/candidateCreator3Prong.cxx | 217 ++++++++--------- PWGHF/TableProducer/candidateCreatorMcGen.cxx | 8 +- .../derivedDataCreatorD0ToKPi.cxx | 23 +- PWGHF/TableProducer/treeCreatorD0ToKPi.cxx | 27 ++- PWGHF/TableProducer/treeCreatorDsToKKPi.cxx | 2 - PWGHF/Tasks/taskCharmHadImpactPar.cxx | 2 +- PWGHF/Tasks/taskMcValidation.cxx | 2 +- PWGHF/Tasks/taskSelOptimisation.cxx | 4 +- PWGHF/Utils/utilsMcGen.h | 220 +++++++++--------- PWGHF/Utils/utilsMcMatching.h | 209 +++++++++-------- PWGJE/Core/JetHFUtilities.h | 4 +- PWGJE/Tasks/hfFragmentationFunction.cxx | 12 +- 27 files changed, 523 insertions(+), 493 deletions(-) diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index acd339fef4c..e337ecf7f7e 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -17,45 +17,49 @@ /// \author Pritam Chakraborty, WUT Warsaw, pritam.chakraborty@cern.ch /// \author Shirajum Monira, WUT Warsaw, shirajum.monira@cern.ch -#include -#include -#include -#include -#include -#include +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h" +#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" +#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" +#include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "CommonConstants/PhysicsConstants.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/Core/trackUtilities.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" + +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPMagField.h" #include "DataFormatsParameters/GRPObject.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseCollisionSelection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseV0Selection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseCascadeSelection.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniversePhiSelection.h" -#include "PWGCF/FemtoUniverse/Core/femtoUtils.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Core/HfHelper.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" -#include "Math/Vector4D.h" -#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "ReconstructionDataFormats/Track.h" -#include "TMath.h" +#include + +#include "Math/Vector4D.h" #include "TLorentzVector.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include "TMath.h" +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::analysis::femto_universe; @@ -786,7 +790,7 @@ struct FemtoUniverseProducerTask { template void fillMCParticleD0(ParticleType const& hfCand) { - if (std::abs(hfCand.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // get corresponding MC particle and its info int pdgCode = 0; int hfCandOrigin = 99; @@ -1807,7 +1811,7 @@ struct FemtoUniverseProducerTask { auto mcD0origin = aod::femtouniverseparticle::ParticleType::kMCTruthTrack; float ptGenB = -1; - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(particle.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { if (ConfD0Selection.yD0D0barCandGenMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassD0)) > ConfD0Selection.yD0D0barCandGenMax) { continue; } diff --git a/PWGCF/TableProducer/filter2Prong.cxx b/PWGCF/TableProducer/filter2Prong.cxx index 2ee72e9b923..e757e4bce61 100644 --- a/PWGCF/TableProducer/filter2Prong.cxx +++ b/PWGCF/TableProducer/filter2Prong.cxx @@ -12,6 +12,7 @@ /// \author Jasper Parkkila #include "PWGCF/DataModel/CorrelationsDerived.h" +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -147,7 +148,7 @@ struct Filter2Prong { // The main filter outputs the primary MC particles. Here we just resolve the daughter indices that are needed for the efficiency matching. for (const auto& r : cfmcparticles) { const auto& mcParticle = r.mcParticle_as(); - if ((mcParticle.flagMcMatchGen() & (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) == 0 || mcParticle.daughtersIds().size() != 2) { + if ((std::abs(mcParticle.flagMcMatchGen()) != o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || mcParticle.daughtersIds().size() != 2) { output2ProngMcParts(-1, -1, aod::cf2prongtrack::Generic2Prong); continue; } diff --git a/PWGHF/Core/DecayChannels.h b/PWGHF/Core/DecayChannels.h index 4b5abd12735..2516abc4796 100644 --- a/PWGHF/Core/DecayChannels.h +++ b/PWGHF/Core/DecayChannels.h @@ -40,8 +40,11 @@ enum DecayChannelMain : int8_t { D0ToPiPi = 3, // π+ π− D0ToPiPiPi0 = 4, // π+ π− π0 D0ToKK = 5, // K+ K− + // J/ψ + JpsiToEE = 6, // e+ e− + JpsiToMuMu = 7, // μ+ μ− // - NChannelsMain = D0ToKK // last channel + NChannelsMain = JpsiToMuMu // last channel }; /// @brief 2-prong candidates: resonant channels enum DecayChannelResonant : int8_t { @@ -119,7 +122,7 @@ enum DecayChannelResonant : int8_t { DstarToDplusToRho0Pi = 22, // ρ0 π+ DstarToDplusToF2_1270Pi = 23, // f2(1270) π+ // Λc+ - LcToPKstar0 = 24, // p K*0(892) + LcToPKstar0 = 24, // p anti-K*0(892) LcToDeltaplusplusK = 25, // Δ++ K− LcToL1520Pi = 26, // Λ(1520) π+ // Ξc+ diff --git a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx index 895a73cf419..86cdbdef317 100644 --- a/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx +++ b/PWGHF/D2H/Tasks/taskCharmPolarisation.cxx @@ -48,8 +48,6 @@ #include #include -#include - #include #include #include @@ -2082,8 +2080,8 @@ struct HfTaskCharmPolarisation { int8_t charge = -99; bool partRecoDstar{false}; if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) { - partRecoDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0); - bool signalDstar = TESTBIT(std::abs(mcParticle.flagMcMatchGen()), hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && TESTBIT(std::abs(mcParticle.flagMcMatchGenD0()), hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + partRecoDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0); + bool signalDstar = (std::abs(mcParticle.flagMcMatchGen()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) && (std::abs(mcParticle.flagMcMatchGenD0()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); if (!signalDstar && (!activatePartRecoDstar || !partRecoDstar)) { // this particle is not signal and not partially reconstructed signal, skip return; diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index b40c546650e..30bc3787e24 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -16,6 +16,7 @@ /// \author Vít Kučera , CERN #include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -569,7 +570,7 @@ struct HfTaskD0 { } auto trackPos = candidate.template prong0_as(); // positive daughter auto trackNeg = candidate.template prong1_as(); // negative daughter - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // Get the corresponding MC particle. auto indexMother = RecoDecay::getMother(mcParticles, trackPos.template mcParticle_as>(), o2::constants::physics::Pdg::kD0, true); auto particleMother = mcParticles.rawIteratorAt(indexMother); @@ -663,7 +664,7 @@ struct HfTaskD0 { int minTpcCrossedRowsOfProngs = std::min(trackPos.tpcNClsCrossedRows(), trackNeg.tpcNClsCrossedRows()); if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hMassSigBkgD0"), massD0, ptCandidate, rapidityCandidate); - if (candidate.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hPtProng0Sig"), ptProng0, rapidityCandidate); registry.fill(HIST("hPtProng1Sig"), ptProng1, rapidityCandidate); registry.fill(HIST("hDecLengthSig"), declengthCandidate, rapidityCandidate); @@ -727,7 +728,7 @@ struct HfTaskD0 { registry.fill(HIST("hCPABkg"), cpaCandidate, rapidityCandidate); registry.fill(HIST("hCPAxyBkg"), cpaxyCandidate, rapidityCandidate); registry.fill(HIST("hMassBkgD0"), massD0, ptCandidate, rapidityCandidate); - if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassReflBkgD0"), massD0, ptCandidate, rapidityCandidate); if constexpr (applyMl) { if (storeCentrality && storeOccupancy) { @@ -759,7 +760,7 @@ struct HfTaskD0 { } if (candidate.isSelD0bar() >= selectionFlagD0bar) { registry.fill(HIST("hMassSigBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); - if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassSigD0bar"), massD0bar, ptCandidate, rapidityCandidate); if constexpr (applyMl) { if (storeCentrality && storeOccupancy) { @@ -788,7 +789,7 @@ struct HfTaskD0 { } } else { registry.fill(HIST("hMassBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); - if (candidate.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassReflBkgD0bar"), massD0bar, ptCandidate, rapidityCandidate); if constexpr (applyMl) { if (storeCentrality && storeOccupancy) { @@ -821,7 +822,7 @@ struct HfTaskD0 { } // MC gen. for (const auto& particle : mcParticles) { - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(particle.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { if (yCandGenMax >= 0. && std::abs(RecoDecay::y(particle.pVector(), o2::constants::physics::MassD0)) > yCandGenMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskLcToK0sP.cxx b/PWGHF/D2H/Tasks/taskLcToK0sP.cxx index 088c88c2629..f107452344a 100644 --- a/PWGHF/D2H/Tasks/taskLcToK0sP.cxx +++ b/PWGHF/D2H/Tasks/taskLcToK0sP.cxx @@ -266,17 +266,9 @@ struct HfTaskLcToK0sP { TracksWPid const&) { for (const auto& candidate : candidates) { - /* - // no such selection for LcK0sp for now - it is the only cascade - if (!(candidate.hfflag() & 1 << D0ToPiK)) { - continue; - } - */ - if (etaCandMax >= 0. && std::abs(candidate.eta()) > etaCandMax) { continue; } - if (yCandRecoMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandRecoMax) { continue; } diff --git a/PWGHF/D2H/Tasks/taskSigmac.cxx b/PWGHF/D2H/Tasks/taskSigmac.cxx index b9f50240bd9..b14d0640c88 100644 --- a/PWGHF/D2H/Tasks/taskSigmac.cxx +++ b/PWGHF/D2H/Tasks/taskSigmac.cxx @@ -1070,7 +1070,7 @@ struct HfTaskSigmac { double decLengthLc(candidateLc.decayLength()), decLengthXYLc(candidateLc.decayLengthXY()); double cpaLc(candidateLc.cpa()), cpaXYLc(candidateLc.cpaXY()); int origin = candSc.originMcRec(); - auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π± + auto channel = candidateLc.flagMcDecayChanRec(); /// 0: direct; 1: Λc± → p± K*; 2: Λc± → Δ(1232)±± K∓; 3: Λc± → Λ(1520) π±; FIXME: DecayChannelResonant /// candidate Λc+ → pK-π+ (and charge conjugate) within the range of M(pK-π+) chosen in the Σc0,++ builder if ((TESTBIT(isCandPKPiPiKP, o2::aod::hf_cand_sigmac::Decays::PKPi)) && std::abs(candidateLc.template prong0_as().mcParticle().pdgCode()) == kProton) { diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx index a59e95bd7e0..6a1c0a7a808 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0bar.cxx @@ -14,6 +14,7 @@ /// /// \author Fabio Colamaria , INFN Bari +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -306,7 +307,7 @@ struct HfCorrelatorD0D0bar { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } - if (std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate1.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // fill per-candidate distributions from D0/D0bar true candidates registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); @@ -317,19 +318,19 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); } // fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0 - if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 + if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0 + if (candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // also matched as D0 registry.fill(HIST("hMassD0MCRecSig"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + } else if (candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassD0MCRecRefl"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); } else { registry.fill(HIST("hMassD0MCRecBkg"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); } } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar - if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // also matched as D0bar registry.fill(HIST("hMassD0barMCRecSig"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + } else if (candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassD0barMCRecRefl"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); } else { registry.fill(HIST("hMassD0barMCRecBkg"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); @@ -341,8 +342,8 @@ struct HfCorrelatorD0D0bar { if (candidate1.isSelD0() < selectionFlagD0) { // discard candidates not selected as D0 in outer loop continue; } - flagD0Signal = candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0Reflection = candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0Signal = candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) + flagD0Reflection = candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) for (const auto& candidate2 : selectedD0CandidatesGroupedMC) { if (!(candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // check decay channel flag for candidate2 continue; @@ -350,8 +351,8 @@ struct HfCorrelatorD0D0bar { if (candidate2.isSelD0bar() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop continue; } - flagD0barSignal = candidate2.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) - flagD0barReflection = candidate2.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) + flagD0barSignal = candidate2.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) + flagD0barReflection = candidate2.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) if (yCandMax >= 0. && std::abs(hfHelper.yD0(candidate2)) > yCandMax) { continue; } @@ -455,7 +456,7 @@ struct HfCorrelatorD0D0bar { // fill pairs vs etaCut plot bool rightDecayChannels = false; - if ((std::abs(particle1.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) && (std::abs(particle2.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if ((std::abs(particle1.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) && (std::abs(particle2.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) { rightDecayChannels = true; } do { diff --git a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx index c51912e5e40..8fa93dc0d63 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0D0barBarrelFullPid.cxx @@ -14,6 +14,7 @@ /// /// \author Fabio Colamaria , INFN Bari +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -307,7 +308,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { efficiencyWeight = 1. / efficiencyD->at(o2::analysis::findBin(binsPt, candidate1.pt())); } - if (std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate1.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // fill per-candidate distributions from D0/D0bar true candidates registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); @@ -318,19 +319,19 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0barTofPlusRichPid() + (candidate1.isSelD0TofPlusRichPid() * 2)); } // fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate1.isSelD0TofPlusRichPid() >= selectionFlagD0) { // only reco as D0 - if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 + if (candidate1.isSelD0TofPlusRichPid() >= selectionFlagD0) { // only reco as D0 + if (candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // also matched as D0 registry.fill(HIST("hMassD0MCRecSig"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + } else if (candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassD0MCRecRefl"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); } else { registry.fill(HIST("hMassD0MCRecBkg"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); } } - if (candidate1.isSelD0barTofPlusRichPid() >= selectionFlagD0bar) { // only reco as D0bar - if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar + if (candidate1.isSelD0barTofPlusRichPid() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // also matched as D0bar registry.fill(HIST("hMassD0barMCRecSig"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + } else if (candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassD0barMCRecRefl"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); } else { registry.fill(HIST("hMassD0barMCRecBkg"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); @@ -342,8 +343,8 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (candidate1.isSelD0TofPlusRichPid() < selectionFlagD0) { // discard candidates not selected as D0 in outer loop continue; } - flagD0Signal = candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0Reflection = candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0Signal = candidate1.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) + flagD0Reflection = candidate1.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) for (const auto& candidate2 : selectedD0candidatesGroupedMC) { if (!(candidate2.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // check decay channel flag for candidate2 continue; @@ -351,8 +352,8 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (candidate2.isSelD0barTofPlusRichPid() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop continue; } - flagD0barSignal = candidate2.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) - flagD0barReflection = candidate2.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) + flagD0barSignal = candidate2.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) + flagD0barReflection = candidate2.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) if (yCandMax >= 0. && std::abs(hfHelper.yD0(candidate2)) > yCandMax) { continue; } @@ -456,7 +457,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { // fill pairs vs etaCut plot bool rightDecayChannels = false; - if ((std::abs(particle1.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) && (std::abs(particle2.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if ((std::abs(particle1.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) && (std::abs(particle2.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK)) { rightDecayChannels = true; } do { diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 30df8b9a57e..98a3e1ece81 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -15,6 +15,7 @@ /// \author Samrangy Sadhu , INFN Bari /// \author Swapnesh Santosh Khade , IIT Indore +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -557,7 +558,7 @@ struct HfCorrelatorD0Hadrons { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(binsPtEfficiencyD, candidate.pt())); } - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // fill per-candidate distributions from D0/D0bar true candidates registry.fill(HIST("hPtCandRec"), candidate.pt()); registry.fill(HIST("hPtProng0Rec"), candidate.ptProng0()); @@ -568,8 +569,8 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hSelectionStatusRec"), candidate.isSelD0bar() + (candidate.isSelD0() * 2)); } // fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate.isSelD0() >= selectionFlagD0) { // only reco as D0 - if (candidate.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 + if (candidate.isSelD0() >= selectionFlagD0) { // only reco as D0 + if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // also matched as D0 registry.fill(HIST("hMassD0RecSig"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); if (isD0Prompt) { registry.fill(HIST("hPtCandRecSigPrompt"), candidate.pt()); @@ -578,7 +579,7 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hPtCandRecSigNonPrompt"), candidate.pt()); registry.fill(HIST("hPtVsMultiplicityRecNonPrompt"), candidate.pt(), collision.multFT0M()); } - } else if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + } else if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassD0RecRef"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); } else { registry.fill(HIST("hMassD0RecBg"), hfHelper.invMassD0ToPiK(candidate), candidate.pt(), efficiencyWeight); @@ -587,8 +588,8 @@ struct HfCorrelatorD0Hadrons { outputMlD0[iclass] = candidate.mlProbD0()[classMl->at(iclass)]; } } - if (candidate.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar - if (candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar + if (candidate.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // also matched as D0bar registry.fill(HIST("hMassD0barRecSig"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); if (isD0Prompt) { registry.fill(HIST("hPtCandRecSigPrompt"), candidate.pt()); @@ -597,7 +598,7 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hPtCandRecSigNonPrompt"), candidate.pt()); registry.fill(HIST("hPtVsMultiplicityRecNonPrompt"), candidate.pt(), collision.multFT0M()); } - } else if (candidate.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + } else if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMassD0barRecRef"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); } else { registry.fill(HIST("hMassD0barRecBg"), hfHelper.invMassD0barToKPi(candidate), candidate.pt(), efficiencyWeight); @@ -615,8 +616,8 @@ struct HfCorrelatorD0Hadrons { // ============== D-h correlation dedicated section ==================================== - flagD0 = candidate.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate matched to D0 (particle) - flagD0bar = candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0 = candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Signal 'true' if candidate matched to D0 (particle) + flagD0bar = candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Reflection 'true' if candidate, selected as D0 (particle), is matched to D0bar (antiparticle) // ========== track loop starts here ======================== @@ -740,7 +741,7 @@ struct HfCorrelatorD0Hadrons { if (std::abs(particleTrigg.pdgCode()) != Pdg::kD0) { continue; } - if (std::abs(particleTrigg.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(particleTrigg.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { double yD = RecoDecay::y(particleTrigg.pVector(), MassD0); if (yCandMax >= 0. && std::abs(yD) > yCandMax) { continue; @@ -972,8 +973,8 @@ struct HfCorrelatorD0Hadrons { } } - flagD0 = candidate.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate matched to D0 (particle) - flagD0bar = candidate.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0 = candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Signal 'true' if candidate matched to D0 (particle) + flagD0bar = candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; // flagD0Reflection 'true' if candidate, selected as D0 (particle), is matched to D0bar (antiparticle) int signalStatus = 0; if (flagD0 && (candidate.isSelD0() >= selectionFlagD0)) { @@ -1050,7 +1051,7 @@ struct HfCorrelatorD0Hadrons { if (std::abs(particleTrigg.pdgCode()) != Pdg::kD0) { continue; } - if (std::abs(particleTrigg.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(particleTrigg.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { double yD = RecoDecay::y(particleTrigg.pVector(), MassD0); if (std::abs(yD) >= yCandMax || particleTrigg.pt() <= ptCandMin || std::abs(particleAssoc.eta()) >= etaTrackMax || particleAssoc.pt() <= ptTrackMin) { continue; diff --git a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx index 8885893e696..8616569468c 100644 --- a/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDMesonPairs.cxx @@ -14,6 +14,7 @@ /// /// \author Andrea Tavira García , IJCLab Orsay +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/HfMlResponseD0ToKPi.h" #include "PWGHF/Core/SelectorCuts.h" @@ -326,10 +327,10 @@ struct HfCorrelatorDMesonPairs { SETBIT(candidateType, SelectedDbar); } if constexpr (isMcRec) { - if (candidate.flagMcMatchRec() == 1 << o2::aod::hf_cand_2prong::DecayType::D0ToPiK) { // matched as D0 + if (candidate.flagMcMatchRec() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // matched as D0 SETBIT(candidateType, TrueD); } - if (candidate.flagMcMatchRec() == -(1 << o2::aod::hf_cand_2prong::DecayType::D0ToPiK)) { // matched as D0bar + if (candidate.flagMcMatchRec() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { // matched as D0bar SETBIT(candidateType, TrueDbar); } } @@ -532,18 +533,18 @@ struct HfCorrelatorDMesonPairs { { // Fill hMatchingMcRec - Cand 1 registry.fill(HIST("hMatchingMcRec"), 1); - if (matchedRec1 == 1) { + if (matchedRec1 == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcRec"), 2); - } else if (matchedRec1 == -1) { + } else if (matchedRec1 == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcRec"), 3); } else if (matchedRec1 == 0) { registry.fill(HIST("hMatchingMcRec"), 4); } // Fill hMatchingMcRec - Cand 2 registry.fill(HIST("hMatchingMcRec"), 5); - if (matchedRec2 == 1) { + if (matchedRec2 == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcRec"), 6); - } else if (matchedRec2 == -1) { + } else if (matchedRec2 == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcRec"), 7); } else if (matchedRec2 == 0) { registry.fill(HIST("hMatchingMcRec"), 8); @@ -1057,18 +1058,18 @@ struct HfCorrelatorDMesonPairs { // Fill hMatchingMcGen - Cand 1 registry.fill(HIST("hMatchingMcGen"), 1); - if (matchedGen1 == 1) { + if (matchedGen1 == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcGen"), 2); - } else if (matchedGen1 == -1) { + } else if (matchedGen1 == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcGen"), 3); } else if (matchedGen1 == 0) { registry.fill(HIST("hMatchingMcGen"), 4); } // Fill hMatchingMcRec - Cand 2 registry.fill(HIST("hMatchingMcGen"), 5); - if (matchedGen2 == 1) { + if (matchedGen2 == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcGen"), 6); - } else if (matchedGen2 == -1) { + } else if (matchedGen2 == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { registry.fill(HIST("hMatchingMcGen"), 7); } else if (matchedGen2 == 0) { registry.fill(HIST("hMatchingMcGen"), 8); diff --git a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx index db357dcc51a..98a53d7ab1b 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcScHadrons.cxx @@ -16,6 +16,7 @@ /// \author Zhen Zhang /// \author Ravindra Singh +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -642,7 +643,7 @@ struct HfCorrelatorLcScHadrons { auto trackPos2 = candidate.template prong2_as(); chargeCand = trackPos1.sign(); if constexpr (isMcRec) { - isSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); + isSignal = std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; if (calTrkEff && countCand == 1 && (isSignal || !calEffEventWithCand)) { calculateTrkEff(trackPos1, trackPos2, *mcParticles); } @@ -849,7 +850,7 @@ struct HfCorrelatorLcScHadrons { auto trackPos1 = candidate.template prong0_as(); chargeCand = trackPos1.sign(); if constexpr (isMcRec) { - isSignal = TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_3prong::DecayType::LcToPKPi); + isSignal = std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; } } diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index 94a4ab37270..44fa0e0635b 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -16,6 +16,7 @@ /// \author Samrangy Sadhu , INFN Bari /// \author Swapnesh Santosh Khade , IIT Indore +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" @@ -804,7 +805,7 @@ struct HfTaskCorrelationD0Hadrons { auto mcCollision = mcParticle.template mcCollision_as>(); multiplicity = mcCollision.multMCFT0A() + mcCollision.multMCFT0C(); // multFT0M = multFt0A + multFT0C hCandidates->Fill(kCandidateStepMcGenAll, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); - if (std::abs(mcParticle.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(mcParticle.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { hCandidates->Fill(kCandidateStepMcGenD0ToPiKPi, mcParticle.pt(), multiplicity, mcParticle.originMcGen()); auto yD0 = RecoDecay::y(mcParticle.pVector(), o2::constants::physics::MassD0); if (std::abs(yD0) <= yCandGenMax) { @@ -856,7 +857,7 @@ struct HfTaskCorrelationD0Hadrons { continue; } multiplicity = collision.multFT0M(); - if (std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { hCandidates->Fill(kCandidateStepMcReco, candidate.pt(), multiplicity, candidate.originMcRec()); if (std::abs(hfHelper.yD0(candidate)) <= yCandMax) { hCandidates->Fill(kCandidateStepMcRecoInAcceptance, candidate.pt(), multiplicity, candidate.originMcRec()); diff --git a/PWGHF/HFC/Tasks/taskFlow.cxx b/PWGHF/HFC/Tasks/taskFlow.cxx index 2e4ed8d210b..6f6870c49fc 100644 --- a/PWGHF/HFC/Tasks/taskFlow.cxx +++ b/PWGHF/HFC/Tasks/taskFlow.cxx @@ -797,7 +797,7 @@ struct HfTaskFlow { auto etaCandidate = mcCandidate.eta(); if constexpr (std::is_same_v) { // For now, that means we do D0 - if (std::abs(mcCandidate.flagMcMatchGen()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(mcCandidate.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { if (etaCandidateMax >= 0. && std::abs(etaCandidate) > etaCandidateMax) { return false; diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 700804d4ea5..7216731a7dd 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -18,6 +18,7 @@ #ifndef HomogeneousField #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) +#include "PWGHF/Core/DecayChannels.h" #endif #include "PWGHF/Core/CentralityEstimation.h" @@ -817,7 +818,7 @@ struct HfCandidateCreator2ProngExpressions { Configurable rejectBackground{"rejectBackground", true, "Reject particles from background events"}; Configurable matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"}; Configurable matchInteractionsWithMaterial{"matchInteractionsWithMaterial", false, "Match also candidates with tracks that interact with material"}; - Configurable matchCorrelatedBackgrounds{"matchCorrelatedBackgrounds", false, "Match correlated background candidates"}; + Configurable matchCorrelatedBackground{"matchCorrelatedBackground", false, "Match correlated background candidates"}; HfEventSelectionMc hfEvSelMc; // mc event selection and monitoring @@ -864,8 +865,8 @@ struct HfCandidateCreator2ProngExpressions { int indexRec = -1; int8_t sign = 0; - int8_t flag = 0; - int8_t channel = 0; + int8_t flagChannelMain = 0; + int8_t flagChannelResonant = 0; int8_t origin = 0; int8_t nKinkedTracks = 0; int8_t nInteractionsWithMaterial = 0; @@ -874,9 +875,9 @@ struct HfCandidateCreator2ProngExpressions { // Match reconstructed candidates. // Spawned table can be used directly for (const auto& candidate : *rowCandidateProng2) { - flag = 0; + flagChannelMain = 0; + flagChannelResonant = 0; origin = 0; - channel = 0; auto arrayDaughters = std::array{candidate.prong0_as(), candidate.prong1_as()}; // Check whether the particle is from background events. If so, reject it. @@ -892,66 +893,66 @@ struct HfCandidateCreator2ProngExpressions { } } if (fromBkg) { - rowMcMatchRec(flag, origin, channel, -1.f, 0, 0, 0); + rowMcMatchRec(flagChannelMain, origin, flagChannelResonant, -1.f, 0, 0, 0); continue; } } std::vector idxBhadMothers{}; - if (matchCorrelatedBackgrounds) { + if (matchCorrelatedBackground) { indexRec = -1; // Index of the matched reconstructed candidate constexpr int FinalStateDepth = 2; constexpr int ResoDepth = 1; // D0(bar) → π+ K−, π+ K− π0, π+ π−, π+ π− π0, K+ K− - for (const auto& [chn, finalState] : hf_cand_2prong::daughtersD0Main) { - std::array finalStateParts2Prong = std::array{finalState[0], finalState[1]}; - if (finalState.size() == 3) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays) + for (const auto& [channelMain, finalState] : daughtersD0Main) { + std::array arrPdgDaughtersMain2Prongs = std::array{finalState[0], finalState[1]}; + if (finalState.size() == 3) { // o2-linter: disable=magic-number (partially reconstructed 3-prong decays) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth); } if (indexRec > -1) { auto motherParticle = mcParticles.rawIteratorAt(indexRec); - std::array finalStateParts2ProngAll = std::array{finalState[0], finalState[1], finalState[2]}; - changeFinalStatePdgSign(motherParticle.pdgCode(), +kPi0, finalStateParts2ProngAll); - if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, Pdg::kD0, finalStateParts2ProngAll, true, &sign, FinalStateDepth)) { - indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one does not match the reconstructed one + std::array arrPdgDaughtersMain3Prongs = std::array{finalState[0], finalState[1], finalState[2]}; + flipPdgSign(motherParticle.pdgCode(), +kPi0, arrPdgDaughtersMain3Prongs); + if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, Pdg::kD0, arrPdgDaughtersMain3Prongs, true, &sign, FinalStateDepth)) { + indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one } } - } else if (finalState.size() == 2) { // o2-linter: disable=magic-number (Fully Reco 2-prong decays) + } else if (finalState.size() == 2) { // o2-linter: disable=magic-number (fully reconstructed 2-prong decays) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, finalStateParts2Prong, true, &sign, FinalStateDepth); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, FinalStateDepth); } } else { LOG(fatal) << "Final state size not supported: " << finalState.size(); - continue; + return; } if (indexRec > -1) { - flag = sign * (1 << chn); + flagChannelMain = sign * channelMain; // Flag the resonant decay channel std::vector arrResoDaughIndex = {}; RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndex, std::array{0}, ResoDepth); - std::array arrPDGDaugh = {}; + std::array arrPdgDaughters = {}; if (arrResoDaughIndex.size() == NDaughtersResonant) { for (auto iProng = 0u; iProng < arrResoDaughIndex.size(); ++iProng) { auto daughI = mcParticles.rawIteratorAt(arrResoDaughIndex[iProng]); - arrPDGDaugh[iProng] = daughI.pdgCode(); + arrPdgDaughters[iProng] = daughI.pdgCode(); } - channel = flagResonantDecay(Pdg::kD0, arrPDGDaugh); + flagChannelResonant = getDecayChannelResonant(Pdg::kD0, arrPdgDaughters); } break; } @@ -968,44 +969,44 @@ struct HfCandidateCreator2ProngExpressions { indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); } if (indexRec > -1) { - flag = sign * (1 << DecayType::D0ToPiK); + flagChannelMain = sign * DecayChannelMain::D0ToPiK; } // J/ψ → e+ e− - if (flag == 0) { + if (flagChannelMain == 0) { if (matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true, &sign, 1, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, +kPositron}, true, &sign, 1, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kElectron, +kPositron}, true); } if (indexRec > -1) { - flag = 1 << DecayType::JpsiToEE; + flagChannelMain = DecayChannelMain::JpsiToEE; } } // J/ψ → μ+ μ− - if (flag == 0) { + if (flagChannelMain == 0) { if (matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true, &sign, 1, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonMinus, +kMuonPlus}, true, &sign, 1, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kJPsi, std::array{+kMuonMinus, +kMuonPlus}, true); } if (indexRec > -1) { - flag = 1 << DecayType::JpsiToMuMu; + flagChannelMain = DecayChannelMain::JpsiToMuMu; } } } // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { + if (flagChannelMain != 0) { auto particle = mcParticles.rawIteratorAt(indexRec); origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); - rowMcMatchRec(flag, origin, channel, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial); + rowMcMatchRec(flagChannelMain, origin, flagChannelResonant, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial); } else { - rowMcMatchRec(flag, origin, channel, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); + rowMcMatchRec(flagChannelMain, origin, flagChannelResonant, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); } } @@ -1036,7 +1037,7 @@ struct HfCandidateCreator2ProngExpressions { } continue; } - hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds); + hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackground); } } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 017752f248d..a9f3f1af19e 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -149,7 +149,7 @@ struct HfCandidateCreator3Prong { using TracksWCovExtraPidPiKaPr = soa::Join; // filter candidates - Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi))) != static_cast(0)) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi))) != static_cast(0)) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) != static_cast(0)) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::XicToPKPi))) != static_cast(0)); + Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DplusToPiKPi))) != static_cast(0)) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::DsToKKPi))) != static_cast(0)) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::LcToPKPi))) != static_cast(0)) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast(BIT(DecayType::XicToPKPi))) != static_cast(0)); std::shared_ptr hCandidates; HistogramRegistry registry{"registry"}; @@ -974,8 +974,8 @@ struct HfCandidateCreator3ProngExpressions { Configurable rejectBackground{"rejectBackground", true, "Reject particles from background events"}; Configurable matchKinkedDecayTopology{"matchKinkedDecayTopology", false, "Match also candidates with tracks that decay with kinked topology"}; Configurable matchInteractionsWithMaterial{"matchInteractionsWithMaterial", false, "Match also candidates with tracks that interact with material"}; - Configurable matchCorrelatedBackgrounds{"matchCorrelatedBackgrounds", false, "Match correlated background candidates"}; - Configurable> mothersCorrBkgsPdgs{"mothersCorrBkgsPdgs", {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus}, "PDG codes of the mother particles of correlated background candidates"}; + Configurable matchCorrelatedBackground{"matchCorrelatedBackground", false, "Match correlated background candidates"}; + Configurable> pdgMothersCorrelBkg{"pdgMothersCorrelBkg", {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus}, "PDG codes of the mother particles of correlated background candidates"}; constexpr static std::size_t NDaughtersResonant{2u}; @@ -1024,28 +1024,27 @@ struct HfCandidateCreator3ProngExpressions { int indexRec = -1; int8_t sign = 0; - int8_t flag = 0; + int8_t flagChannelMain = 0; + int8_t flagChannelResonant = 0; int8_t origin = 0; int8_t swapping = 0; - int8_t channel = 0; int8_t nKinkedTracks = 0; int8_t nInteractionsWithMaterial = 0; - constexpr std::size_t NDaughtersResonant{2u}; std::vector arrDaughIndex; - std::array arrPDGDaugh; - std::array arrPDGResonant1 = {kProton, 313}; // Λc± → p± K* - std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ - std::array arrPDGResonant3 = {102134, kPiPlus}; // Λc± → Λ(1520) π± - std::array arrPDGResonantDPhiPi = {333, kPiPlus}; // Ds± → Phi π± and D± → Phi π± - std::array arrPDGResonantDKstarK = {313, kKPlus}; // Ds± → K*(892)0bar K± and D± → K*(892)0bar K± + std::array arrPdgDaugResonant; + const std::array arrPdgDaugResonantLcToPKstar0{daughtersLcResonant.at(DecayChannelResonant::LcToPKstar0)}; // Λc± → p± K* + const std::array arrPdgDaugResonantLcToDeltaplusplusK{daughtersLcResonant.at(DecayChannelResonant::LcToDeltaplusplusK)}; // Λc± → Δ(1232)±± K∓ + const std::array arrPdgDaugResonantLcToL1520Pi{daughtersLcResonant.at(DecayChannelResonant::LcToL1520Pi)}; // Λc± → Λ(1520) π± + const std::array arrPdgDaugResonantDToPhiPi{daughtersDsResonant.at(DecayChannelResonant::DsToPhiPi)}; // Ds± → φ π± and D± → φ π± + const std::array arrPdgDaugResonantDToKstar0K{daughtersDsResonant.at(DecayChannelResonant::DsToKstar0K)}; // Ds± → anti-K*(892)0 K± and D± → anti-K*(892)0 K± // Match reconstructed candidates. // Spawned table can be used directly for (const auto& candidate : *rowCandidateProng3) { - flag = 0; + flagChannelMain = 0; + flagChannelResonant = 0; origin = 0; swapping = 0; - channel = 0; indexRec = -1; arrDaughIndex.clear(); std::vector idxBhadMothers{}; @@ -1064,90 +1063,90 @@ struct HfCandidateCreator3ProngExpressions { } } if (fromBkg) { - rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, 0, 0); + rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, -1.f, 0, 0, 0); continue; } } - if (matchCorrelatedBackgrounds) { + if (matchCorrelatedBackground) { indexRec = -1; // Index of the matched reconstructed candidate - constexpr int MaxDepth = 2; // Depth for final state matching - constexpr int ResoMaxDepth = 1; // Depth for resonant decay matching + constexpr int DepthMainMax = 2; // Depth for final state matching + constexpr int DepthResoMax = 1; // Depth for resonant decay matching - for (const auto& pdg : mothersCorrBkgsPdgs.value) { - int depth = MaxDepth; - if (pdg == Pdg::kDStar) { - depth = MaxDepth + 1; // D0 resonant decays are active + for (const auto& pdgMother : pdgMothersCorrelBkg.value) { + int depthMainMax = DepthMainMax; + if (pdgMother == Pdg::kDStar) { + depthMainMax = DepthMainMax + 1; // D0 resonant decays are active } - auto finalStates = getDecayChannelMain(pdg); - for (const auto& [chn, finalState] : finalStates) { - std::array finalStateParts3Prong = std::array{finalState[0], finalState[1], finalState[2]}; - if (finalState.size() > 3) { // o2-linter: disable=magic-number (Partly Reco decays with 4 or 5 final state particles) + auto finalStates = getDecayChannelsMain(pdgMother); + for (const auto& [channelMain, finalState] : finalStates) { + std::array arrPdgDaughtersMain3Prongs = std::array{finalState[0], finalState[1], finalState[2]}; + if (finalState.size() > 3) { // o2-linter: disable=magic-number (partially reconstructed decays with 4 or 5 final state particles) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax); } if (indexRec > -1) { auto motherParticle = mcParticles.rawIteratorAt(indexRec); if (finalState.size() == 4) { // o2-linter: disable=magic-number (Check if the final state has 4 particles) - std::array finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], finalState[3]}; - changeFinalStatePdgSign(motherParticle.pdgCode(), +kPi0, finalStateParts3ProngAll); - if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, true, &sign, depth)) { + std::array arrPdgDaughtersMain4Prongs = std::array{finalState[0], finalState[1], finalState[2], finalState[3]}; + flipPdgSign(motherParticle.pdgCode(), +kPi0, arrPdgDaughtersMain4Prongs); + if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdgMother, arrPdgDaughtersMain4Prongs, true, &sign, depthMainMax)) { indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one is not matched } } else if (finalState.size() == 5) { // o2-linter: disable=magic-number (Check if the final state has 5 particles) - std::array finalStateParts3ProngAll = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]}; - changeFinalStatePdgSign(motherParticle.pdgCode(), +kPi0, finalStateParts3ProngAll); - if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdg, finalStateParts3ProngAll, true, &sign, depth)) { + std::array arrPdgDaughtersMain5Prongs = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]}; + flipPdgSign(motherParticle.pdgCode(), +kPi0, arrPdgDaughtersMain5Prongs); + if (!RecoDecay::isMatchedMCGen(mcParticles, motherParticle, pdgMother, arrPdgDaughtersMain5Prongs, true, &sign, depthMainMax)) { indexRec = -1; // Reset indexRec if the generated decay does not match the reconstructed one is not matched } } } - } else if (finalState.size() == 3) { // o2-linter: disable=magic-number(Fully Reco 3-prong decays) + } else if (finalState.size() == 3) { // o2-linter: disable=magic-number(fully reconstructed 3-prong decays) if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdg, finalStateParts3Prong, true, &sign, depth); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax); } } else { LOG(fatal) << "Final state size not supported: " << finalState.size(); - continue; // Skip unsupported final states + return; } if (indexRec > -1) { - flag = sign * chn; + flagChannelMain = sign * channelMain; // Flag the resonant decay channel std::vector arrResoDaughIndex = {}; - if (pdg == Pdg::kDStar) { - std::vector arrResoDaughIndexDStar = {}; - RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndexDStar, std::array{0}, ResoMaxDepth); - for (size_t iDaug = 0; iDaug < arrResoDaughIndexDStar.size(); iDaug++) { - auto daughDstar = mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]); + if (pdgMother == Pdg::kDStar) { + std::vector arrResoDaughIndexDstar = {}; + RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndexDstar, std::array{0}, DepthResoMax); + for (size_t iDaug = 0; iDaug < arrResoDaughIndexDstar.size(); iDaug++) { + auto daughDstar = mcParticles.rawIteratorAt(arrResoDaughIndexDstar[iDaug]); if (std::abs(daughDstar.pdgCode()) == Pdg::kD0 || std::abs(daughDstar.pdgCode()) == Pdg::kDPlus) { - RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, ResoMaxDepth); + RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, DepthResoMax); break; } } } else { - RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndex, std::array{0}, ResoMaxDepth); + RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrResoDaughIndex, std::array{0}, DepthResoMax); } - std::array arrPDGDaugh = {}; + std::array arrPdgDaughters = {}; if (arrResoDaughIndex.size() == NDaughtersResonant) { for (auto iProng = 0u; iProng < NDaughtersResonant; ++iProng) { auto daughI = mcParticles.rawIteratorAt(arrResoDaughIndex[iProng]); - arrPDGDaugh[iProng] = daughI.pdgCode(); + arrPdgDaughters[iProng] = daughI.pdgCode(); } - channel = flagResonantDecay(pdg, arrPDGDaugh); + flagChannelResonant = getDecayChannelResonant(pdgMother, arrPdgDaughters); } break; // Exit loop if a match is found } @@ -1158,143 +1157,149 @@ struct HfCandidateCreator3ProngExpressions { } } else { // D± → π± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { + auto arrPdgDaughtersDplusToPiKPi{std::array{+kPiPlus, -kKPlus, +kPiPlus}}; if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDplusToPiKPi, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDplusToPiKPi, true, &sign, 2, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDplusToPiKPi, true, &sign, 2, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDplusToPiKPi, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannelMain::DplusToPiKPi; + flagChannelMain = sign * DecayChannelMain::DplusToPiKPi; } } // Ds± → K± K∓ π± and D± → K± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { + auto arrPdgDaughtersDToPiKK{std::array{+kKPlus, -kKPlus, +kPiPlus}}; bool isDplus = false; if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, arrPdgDaughtersDToPiKK, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, arrPdgDaughtersDToPiKK, true, &sign, 2, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, arrPdgDaughtersDToPiKK, true, &sign, 2, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, arrPdgDaughtersDToPiKK, true, &sign, 2); } if (indexRec == -1) { isDplus = true; if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDToPiKK, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDToPiKK, true, &sign, 2, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDToPiKK, true, &sign, 2, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, arrPdgDaughtersDToPiKK, true, &sign, 2); } } if (indexRec > -1) { - flag = sign * (isDplus ? DecayChannelMain::DplusToPiKK : DecayChannelMain::DsToPiKK); + flagChannelMain = sign * (isDplus ? DecayChannelMain::DplusToPiKK : DecayChannelMain::DsToPiKK); if (arrayDaughters[0].has_mcParticle()) { - swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); + swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == NDaughtersResonant) { for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); - arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); + arrPdgDaugResonant[iProng] = std::abs(daughI.pdgCode()); } - if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? DecayChannelResonant::DplusToPhiPi : DecayChannelResonant::DsToPhiPi; - } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? DecayChannelResonant::DplusToKstar0K : DecayChannelResonant::DsToKstar0K; + if ((arrPdgDaugResonant[0] == arrPdgDaugResonantDToPhiPi[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToPhiPi[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantDToPhiPi[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToPhiPi[0])) { + flagChannelResonant = isDplus ? DecayChannelResonant::DplusToPhiPi : DecayChannelResonant::DsToPhiPi; + } else if ((arrPdgDaugResonant[0] == arrPdgDaugResonantDToKstar0K[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToKstar0K[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantDToKstar0K[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToKstar0K[0])) { + flagChannelResonant = isDplus ? DecayChannelResonant::DplusToKstar0K : DecayChannelResonant::DsToKstar0K; } } } } - // D* → D0π → Kππ - if (flag == 0) { + // D* → D0 π → K π π + if (flagChannelMain == 0) { + auto arrPdgDaughtersDstarToPiKPi{std::array{+kPiPlus, +kPiPlus, -kKPlus}}; if (matchKinkedDecayTopology) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, arrPdgDaughtersDstarToPiKPi, true, &sign, 2, &nKinkedTracks); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDStar, arrPdgDaughtersDstarToPiKPi, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannelMain::DstarToPiKPi; - channel = 1; + flagChannelMain = sign * DecayChannelMain::DstarToPiKPi; + flagChannelResonant = 0; } } // Λc± → p± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { + auto arrPdgDaughtersLcToPKPi{std::array{+kProton, -kKPlus, +kPiPlus}}; if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, arrPdgDaughtersLcToPKPi, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, arrPdgDaughtersLcToPKPi, true, &sign, 2, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, arrPdgDaughtersLcToPKPi, true, &sign, 2, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kLambdaCPlus, arrPdgDaughtersLcToPKPi, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannelMain::LcToPKPi; + flagChannelMain = sign * DecayChannelMain::LcToPKPi; // Flagging the different Λc± → p± K∓ π± decay channels if (arrayDaughters[0].has_mcParticle()) { - swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); + swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } RecoDecay::getDaughters(mcParticles.rawIteratorAt(indexRec), &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == NDaughtersResonant) { for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); - arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); + arrPdgDaugResonant[iProng] = std::abs(daughI.pdgCode()); } - if ((arrPDGDaugh[0] == arrPDGResonant1[0] && arrPDGDaugh[1] == arrPDGResonant1[1]) || (arrPDGDaugh[0] == arrPDGResonant1[1] && arrPDGDaugh[1] == arrPDGResonant1[0])) { - channel = 1; - } else if ((arrPDGDaugh[0] == arrPDGResonant2[0] && arrPDGDaugh[1] == arrPDGResonant2[1]) || (arrPDGDaugh[0] == arrPDGResonant2[1] && arrPDGDaugh[1] == arrPDGResonant2[0])) { - channel = 2; - } else if ((arrPDGDaugh[0] == arrPDGResonant3[0] && arrPDGDaugh[1] == arrPDGResonant3[1]) || (arrPDGDaugh[0] == arrPDGResonant3[1] && arrPDGDaugh[1] == arrPDGResonant3[0])) { - channel = 3; + if ((arrPdgDaugResonant[0] == arrPdgDaugResonantLcToPKstar0[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToPKstar0[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantLcToPKstar0[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToPKstar0[0])) { + flagChannelResonant = DecayChannelResonant::LcToPKstar0; + } else if ((arrPdgDaugResonant[0] == arrPdgDaugResonantLcToDeltaplusplusK[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToDeltaplusplusK[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantLcToDeltaplusplusK[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToDeltaplusplusK[0])) { + flagChannelResonant = DecayChannelResonant::LcToDeltaplusplusK; + } else if ((arrPdgDaugResonant[0] == arrPdgDaugResonantLcToL1520Pi[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToL1520Pi[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantLcToL1520Pi[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToL1520Pi[0])) { + flagChannelResonant = DecayChannelResonant::LcToL1520Pi; } } } } // Ξc± → p± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { + auto arrPdgDaughtersXicToPKPi{std::array{+kProton, -kKPlus, +kPiPlus}}; if (matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, arrPdgDaughtersXicToPKPi, true, &sign, 2, &nKinkedTracks, &nInteractionsWithMaterial); } else if (matchKinkedDecayTopology && !matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, &nKinkedTracks); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, arrPdgDaughtersXicToPKPi, true, &sign, 2, &nKinkedTracks); } else if (!matchKinkedDecayTopology && matchInteractionsWithMaterial) { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2, nullptr, &nInteractionsWithMaterial); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, arrPdgDaughtersXicToPKPi, true, &sign, 2, nullptr, &nInteractionsWithMaterial); } else { - indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2); + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kXiCPlus, arrPdgDaughtersXicToPKPi, true, &sign, 2); } if (indexRec > -1) { - flag = sign * DecayChannelMain::XicToPKPi; + flagChannelMain = sign * DecayChannelMain::XicToPKPi; + flagChannelResonant = 0; // TODO if (arrayDaughters[0].has_mcParticle()) { - swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); + swapping = static_cast(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); } } } } // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { + if (flagChannelMain != 0) { auto particle = mcParticles.rawIteratorAt(indexRec); origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); } if (origin == RecoDecay::OriginType::NonPrompt) { auto bHadMother = mcParticles.rawIteratorAt(idxBhadMothers[0]); - rowMcMatchRec(flag, origin, swapping, channel, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial); + rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, bHadMother.pt(), bHadMother.pdgCode(), nKinkedTracks, nInteractionsWithMaterial); } else { - rowMcMatchRec(flag, origin, swapping, channel, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); + rowMcMatchRec(flagChannelMain, origin, swapping, flagChannelResonant, -1.f, 0, nKinkedTracks, nInteractionsWithMaterial); } } @@ -1325,7 +1330,7 @@ struct HfCandidateCreator3ProngExpressions { } continue; } - hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackgrounds ? mothersCorrBkgsPdgs : std::vector{}); + hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen, rejectBackground, matchCorrelatedBackground ? pdgMothersCorrelBkg : std::vector{}); } } diff --git a/PWGHF/TableProducer/candidateCreatorMcGen.cxx b/PWGHF/TableProducer/candidateCreatorMcGen.cxx index 52d947c7828..1c923a5b6e3 100644 --- a/PWGHF/TableProducer/candidateCreatorMcGen.cxx +++ b/PWGHF/TableProducer/candidateCreatorMcGen.cxx @@ -41,8 +41,8 @@ struct HfCandidateCreatorMcGen { Produces rowMcMatchGenB0; Configurable fill2Prong{"fill2Prong", false, "fill table for 2 prong candidates"}; Configurable fill3Prong{"fill3Prong", false, "fill table for 3 prong candidates"}; - Configurable matchCorrelatedBackgrounds{"matchCorrelatedBackgrounds", false, "Match correlated background candidates"}; - Configurable> mothersCorrBkgsPdgs{"mothersCorrBkgsPdgs", {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus}, "PDG codes of the mother particles of correlated background candidates"}; + Configurable matchCorrelatedBackground{"matchCorrelatedBackground", false, "Match correlated background candidates"}; + Configurable> pdgMothersCorrelBkg{"pdgMothersCorrelBkg", {Pdg::kDPlus, Pdg::kDS, Pdg::kDStar, Pdg::kLambdaCPlus, Pdg::kXiCPlus}, "PDG codes of the mother particles of correlated background candidates"}; Configurable fillBplus{"fillBplus", false, "fill table for for B+ candidates"}; Configurable fillB0{"fillB0", false, "fill table for B0 candidates"}; Configurable rejectBackground2Prong{"rejectBackground2Prong", false, "Reject particles from PbPb background for 2 prong candidates"}; @@ -57,10 +57,10 @@ struct HfCandidateCreatorMcGen { for (const auto& mcCollision : mcCollisions) { const auto mcParticlesPerMcColl = mcParticles.sliceBy(mcParticlesPerMcCollision, mcCollision.globalIndex()); if (fill2Prong) { - hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen2Prong, rejectBackground2Prong, matchCorrelatedBackgrounds); + hf_mc_gen::fillMcMatchGen2Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen2Prong, rejectBackground2Prong, matchCorrelatedBackground); } if (fill3Prong) { - hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen3Prong, rejectBackground3Prong, matchCorrelatedBackgrounds ? mothersCorrBkgsPdgs : std::vector{}); + hf_mc_gen::fillMcMatchGen3Prong(mcParticles, mcParticlesPerMcColl, rowMcMatchGen3Prong, rejectBackground3Prong, matchCorrelatedBackground ? pdgMothersCorrelBkg : std::vector{}); } } if (fillBplus) { diff --git a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx index 98d2346c49b..194b50eb2c0 100644 --- a/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorD0ToKPi.cxx @@ -15,6 +15,7 @@ /// /// \author Vít Kučera , Inha University +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -105,7 +106,7 @@ struct HfDerivedDataCreatorD0ToKPi { using TypeMcCollisions = soa::Join; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_2prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Filter filterMcGenMatching = nabs(aod::hf_cand_2prong::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); Preslice candidatesPerCollision = aod::hf_cand::collisionId; Preslice candidatesKfPerCollision = aod::hf_cand::collisionId; @@ -127,14 +128,14 @@ struct HfDerivedDataCreatorD0ToKPi { Partition candidatesMcMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; Partition candidatesMcKfMlAll = aod::hf_sel_candidate_d0::isSelD0 >= 0; // partitions for signal and background - Partition candidatesMcSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcKfSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcKfBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcMlSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcMlBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcKfMlSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition candidatesMcKfMlBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition candidatesMcSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcKfSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcKfBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcMlSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcMlBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcKfMlSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition candidatesMcKfMlBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); void init(InitContext const&) { @@ -284,7 +285,7 @@ struct HfDerivedDataCreatorD0ToKPi { flagMcRec = candidate.flagMcMatchRec(); origin = candidate.originMcRec(); if constexpr (onlyBkg) { - if (TESTBIT(std::abs(flagMcRec), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if (std::abs(flagMcRec) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { continue; } if (downSampleBkgFactor < 1.) { @@ -295,7 +296,7 @@ struct HfDerivedDataCreatorD0ToKPi { } } if constexpr (onlySig) { - if (!TESTBIT(std::abs(flagMcRec), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + if (std::abs(flagMcRec) != o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { continue; } } diff --git a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx index 781a5b89ded..bda20c52903 100644 --- a/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorD0ToKPi.cxx @@ -17,6 +17,7 @@ /// \author Nicolo' Jacazio , CERN /// \author Andrea Tavira García , IJCLab +#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" @@ -33,8 +34,6 @@ #include #include -#include - #include #include #include @@ -257,17 +256,17 @@ struct HfTreeCreatorD0ToKPi { using MatchedGenCandidatesMc = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_d0::isSelD0 >= 1 || aod::hf_sel_candidate_d0::isSelD0bar >= 1; - Filter filterMcGenMatching = nabs(aod::hf_cand_2prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && (nabs(aod::hf_cand_2prong::flagMcMatchGen) != 0)); + Filter filterMcGenMatching = nabs(aod::hf_cand_2prong::flagMcMatchGen) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && (nabs(aod::hf_cand_2prong::flagMcMatchGen) != 0)); - Partition reconstructedCandSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); - Partition reconstructedCandBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition reconstructedCandSigKF = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); - Partition reconstructedCandBkgKF = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition reconstructedCandSig = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); + Partition reconstructedCandBkg = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition reconstructedCandSigKF = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); + Partition reconstructedCandBkgKF = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); - Partition reconstructedCandSigMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); - Partition reconstructedCandBkgMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); - Partition reconstructedCandSigKFMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); - Partition reconstructedCandBkgKFMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK)); + Partition reconstructedCandSigMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); + Partition reconstructedCandBkgMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); + Partition reconstructedCandSigKFMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) == static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && nabs(aod::hf_cand_2prong::flagMcMatchRec) != 0); + Partition reconstructedCandBkgKFMl = nabs(aod::hf_cand_2prong::flagMcMatchRec) != static_cast(o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK); void init(InitContext const&) { @@ -526,7 +525,7 @@ struct HfTreeCreatorD0ToKPi { } for (const auto& candidate : candidates) { if constexpr (onlyBkg) { - if (TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { + if ((std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { continue; } if (downSampleBkgFactor < 1.) { @@ -537,7 +536,7 @@ struct HfTreeCreatorD0ToKPi { } } if constexpr (onlySig) { - if (!(TESTBIT(std::abs(candidate.flagMcMatchRec()), aod::hf_cand_2prong::DecayType::D0ToPiK)) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { + if ((std::abs(candidate.flagMcMatchRec()) != o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && (candidate.flagMcMatchRec() != 0))) { continue; } } @@ -565,7 +564,7 @@ struct HfTreeCreatorD0ToKPi { // Filling particle properties rowCandidateFullParticles.reserve(mcParticles.size()); for (const auto& particle : mcParticles) { - if (TESTBIT(std::abs(particle.flagMcMatchGen()), aod::hf_cand_2prong::DecayType::D0ToPiK) || (fillCorrBkgs && particle.flagMcMatchGen() != 0)) { + if ((std::abs(particle.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (fillCorrBkgs && particle.flagMcMatchGen() != 0)) { rowCandidateFullParticles( particle.mcCollisionId(), particle.pt(), diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index ca3ed4db61a..bfbd0b38ea3 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -284,8 +284,6 @@ struct HfTreeCreatorDsToKKPi { using CollisionsWithFT0M = soa::Join; using CollisionsWithNTracksPV = soa::Join; - int offsetDplusDecayChannel = aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi - aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; // Offset between Dplus and Ds to use the same decay channel. See aod::hf_cand_3prong::DecayChannelDToKKPi - Filter filterSelectCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK) && diff --git a/PWGHF/Tasks/taskCharmHadImpactPar.cxx b/PWGHF/Tasks/taskCharmHadImpactPar.cxx index a20c49c922b..3000d5bf8c5 100644 --- a/PWGHF/Tasks/taskCharmHadImpactPar.cxx +++ b/PWGHF/Tasks/taskCharmHadImpactPar.cxx @@ -195,7 +195,7 @@ struct HfTaskCharmHadImpactPar { if (candidate.isSelD0()) { // D0 -> Kpi if constexpr (doMc) { if (fillOnlySignal) { - if (std::abs(candidate.flagMcMatchRec()) != 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchRec()) != o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { return; } } diff --git a/PWGHF/Tasks/taskMcValidation.cxx b/PWGHF/Tasks/taskMcValidation.cxx index 5feaf4f186b..97b57f150bc 100644 --- a/PWGHF/Tasks/taskMcValidation.cxx +++ b/PWGHF/Tasks/taskMcValidation.cxx @@ -1098,7 +1098,7 @@ struct HfTaskMcValidationRec { continue; } int whichHad = -1; - if (isD0Sel && TESTBIT(std::abs(cand2Prong.flagMcMatchRec()), hf_cand_2prong::DecayType::D0ToPiK)) { + if (isD0Sel && std::abs(cand2Prong.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { whichHad = DzeroToKPi; } int whichOrigin; diff --git a/PWGHF/Tasks/taskSelOptimisation.cxx b/PWGHF/Tasks/taskSelOptimisation.cxx index d796a0c67b4..c91f5d55819 100644 --- a/PWGHF/Tasks/taskSelOptimisation.cxx +++ b/PWGHF/Tasks/taskSelOptimisation.cxx @@ -287,7 +287,7 @@ struct HfSelOptimisation { bool isPrompt = false, isNonPrompt = false, isBkg = false; for (int iDecay{0}; iDecay < n2Prong; ++iDecay) { if (TESTBIT(cand2Prong.hfflag(), iDecay)) { - if (std::abs(cand2Prong.flagMcMatchRec()) == BIT(iDecay)) { + if (std::abs(cand2Prong.flagMcMatchRec()) == BIT(iDecay)) { // FIXME: Migrate to DecayChannelMain if (cand2Prong.originMcRec() == RecoDecay::OriginType::Prompt) { isPrompt = true; switch (iDecay) { @@ -343,7 +343,7 @@ struct HfSelOptimisation { bool isPrompt = false, isNonPrompt = false, isBkg = false; for (int iDecay{0}; iDecay < n3Prong; ++iDecay) { if (TESTBIT(cand3Prong.hfflag(), iDecay)) { - if (std::abs(cand3Prong.flagMcMatchRec()) == BIT(iDecay)) { + if (std::abs(cand3Prong.flagMcMatchRec()) == BIT(iDecay)) { // FIXME: Migrate to DecayChannelMain if (cand3Prong.originMcRec() == RecoDecay::OriginType::Prompt) { isPrompt = true; switch (iDecay) { diff --git a/PWGHF/Utils/utilsMcGen.h b/PWGHF/Utils/utilsMcGen.h index 7c68e158925..a3a81119a39 100644 --- a/PWGHF/Utils/utilsMcGen.h +++ b/PWGHF/Utils/utilsMcGen.h @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file utilsMcGen.h -/// \brief utility functions for HF Mc gen. workflows +/// \brief utility functions for HF MC gen. workflows /// /// \author Nima Zardoshti, nima.zardoshti@cern.ch, CERN @@ -39,53 +39,56 @@ namespace hf_mc_gen { template -void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, bool matchCorrelatedBackgrounds) +void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, bool matchCorrelatedBackground) { using namespace o2::constants::physics; + using namespace o2::hf_decay::hf_cand_2prong; + constexpr std::size_t NDaughtersResonant{2u}; // Match generated particles. for (const auto& particle : mcParticlesPerMcColl) { - int8_t flag = 0; + int8_t flagChannelMain = 0; + int8_t flagChannelResonant = 0; int8_t origin = 0; - int8_t channel = 0; int8_t sign = 0; std::vector idxBhadMothers{}; // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { - rowMcMatchGen(flag, origin, channel, -1); + rowMcMatchGen(flagChannelMain, origin, flagChannelResonant, -1); continue; } - if (matchCorrelatedBackgrounds) { - constexpr int MaxDepth = 2; // Depth for final state matching - constexpr int ResoMaxDepth = 1; // Depth for resonant decay matching + if (matchCorrelatedBackground) { + constexpr int DepthMainMax = 2; // Depth for final state matching + constexpr int DepthResoMax = 1; // Depth for resonant decay matching bool matched = false; - for (const auto& [chn, finalState] : o2::hf_decay::hf_cand_2prong::daughtersD0Main) { - if (finalState.size() == 3) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays) - std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2]}; - o2::hf_decay::changeFinalStatePdgSign(particle.pdgCode(), +kPi0, finalStateParts); - matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, finalStateParts, true, &sign, MaxDepth); - } else if (finalState.size() == 2) { // o2-linter: disable=magic-number (Fully Reco 2-prong decays) - std::array finalStateParts = std::array{finalState[0], finalState[1]}; - matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, finalStateParts, true, &sign, MaxDepth); + // TODO: J/ψ + for (const auto& [channelMain, finalState] : daughtersD0Main) { + if (finalState.size() == 3) { // o2-linter: disable=magic-number (partially reconstructed 3-prong decays) + std::array arrPdgDaughtersMain3Prongs = std::array{finalState[0], finalState[1], finalState[2]}; + o2::hf_decay::flipPdgSign(particle.pdgCode(), +kPi0, arrPdgDaughtersMain3Prongs); + matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, arrPdgDaughtersMain3Prongs, true, &sign, DepthMainMax); + } else if (finalState.size() == 2) { // o2-linter: disable=magic-number (fully reconstructed 2-prong decays) + std::array arrPdgDaughtersMain2Prongs = std::array{finalState[0], finalState[1]}; + matched = RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, arrPdgDaughtersMain2Prongs, true, &sign, DepthMainMax); } else { - LOG(info) << "Final state size not supported: " << finalState.size(); - continue; + LOG(fatal) << "Final state size not supported: " << finalState.size(); + return; } if (matched) { - flag = sign * (1 << chn); + flagChannelMain = sign * channelMain; // Flag the resonant decay channel std::vector arrResoDaughIndex = {}; - RecoDecay::getDaughters(particle, &arrResoDaughIndex, std::array{0}, ResoMaxDepth); - std::array arrPDGDaugh = {}; + RecoDecay::getDaughters(particle, &arrResoDaughIndex, std::array{0}, DepthResoMax); + std::array arrPdgDaughters = {}; if (arrResoDaughIndex.size() == NDaughtersResonant) { for (auto iProng = 0u; iProng < arrResoDaughIndex.size(); ++iProng) { auto daughI = mcParticles.rawIteratorAt(arrResoDaughIndex[iProng]); - arrPDGDaugh[iProng] = daughI.pdgCode(); + arrPdgDaughters[iProng] = daughI.pdgCode(); } - channel = o2::hf_decay::flagResonantDecay(Pdg::kD0, arrPDGDaugh); + flagChannelResonant = o2::hf_decay::getDecayChannelResonant(Pdg::kD0, arrPdgDaughters); } break; } @@ -93,121 +96,124 @@ void fillMcMatchGen2Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V } else { // D0(bar) → π± K∓ if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) { - flag = sign * (1 << o2::aod::hf_cand_2prong::DecayType::D0ToPiK); + flagChannelMain = sign * DecayChannelMain::D0ToPiK; } // J/ψ → e+ e− - if (flag == 0) { + if (flagChannelMain == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kElectron, -kElectron}, true)) { - flag = 1 << o2::aod::hf_cand_2prong::DecayType::JpsiToEE; + flagChannelMain = DecayChannelMain::JpsiToEE; } } // J/ψ → μ+ μ− - if (flag == 0) { + if (flagChannelMain == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true)) { - flag = 1 << o2::aod::hf_cand_2prong::DecayType::JpsiToMuMu; + flagChannelMain = DecayChannelMain::JpsiToMuMu; } } } // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { + if (flagChannelMain != 0) { origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); } if (origin == RecoDecay::OriginType::NonPrompt) { - rowMcMatchGen(flag, origin, channel, idxBhadMothers[0]); + rowMcMatchGen(flagChannelMain, origin, flagChannelResonant, idxBhadMothers[0]); } else { - rowMcMatchGen(flag, origin, channel, -1); + rowMcMatchGen(flagChannelMain, origin, flagChannelResonant, -1); } } } template -void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, std::vector const& corrBkgMothersPdgs = {}) +void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V& rowMcMatchGen, bool rejectBackground, std::vector const& pdgMothersCorrelBkg = {}) { using namespace o2::constants::physics; + using namespace o2::hf_decay::hf_cand_3prong; + constexpr std::size_t NDaughtersResonant{2u}; // Match generated particles. for (const auto& particle : mcParticlesPerMcColl) { - int8_t flag = 0; + int8_t flagChannelMain = 0; + int8_t flagChannelResonant = 0; int8_t origin = 0; - int8_t channel = 0; int8_t sign = 0; std::vector arrDaughIndex; std::vector idxBhadMothers{}; - std::array arrPDGDaugh; - std::array arrPDGResonant1 = {kProton, Pdg::kK0Star892}; // Λc± → p± K* - std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ - std::array arrPDGResonant3 = {102134, kPiPlus}; // Λc± → Λ(1520) π± - std::array arrPDGResonantDPhiPi = {Pdg::kPhi, kPiPlus}; // Ds± → Phi π± and D± → Phi π± - std::array arrPDGResonantDKstarK = {Pdg::kK0Star892, kKPlus}; // Ds± → K*(892)0bar K± and D± → K*(892)0bar K± + std::array arrPdgDaugResonant; + const std::array arrPdgDaugResonantLcToPKstar0{daughtersLcResonant.at(DecayChannelResonant::LcToPKstar0)}; // Λc± → p± K* + const std::array arrPdgDaugResonantLcToDeltaplusplusK{daughtersLcResonant.at(DecayChannelResonant::LcToDeltaplusplusK)}; // Λc± → Δ(1232)±± K∓ + const std::array arrPdgDaugResonantLcToL1520Pi{daughtersLcResonant.at(DecayChannelResonant::LcToL1520Pi)}; // Λc± → Λ(1520) π± + const std::array arrPdgDaugResonantDToPhiPi{daughtersDsResonant.at(DecayChannelResonant::DsToPhiPi)}; // Ds± → φ π± and D± → φ π± + const std::array arrPdgDaugResonantDToKstar0K{daughtersDsResonant.at(DecayChannelResonant::DsToKstar0K)}; // Ds± → anti-K*(892)0 K± and D± → anti-K*(892)0 K± + // Reject particles from background events if (particle.fromBackgroundEvent() && rejectBackground) { - rowMcMatchGen(flag, origin, channel, -1); + rowMcMatchGen(flagChannelMain, origin, flagChannelResonant, -1); continue; } - if (corrBkgMothersPdgs.size() > 0) { - for (const auto& motherPdgCode : corrBkgMothersPdgs) { - if (std::abs(particle.pdgCode()) != motherPdgCode) { + if (pdgMothersCorrelBkg.size() > 0) { + for (const auto& pdgMother : pdgMothersCorrelBkg) { + if (std::abs(particle.pdgCode()) != pdgMother) { continue; // Skip if the particle PDG code does not match the mother PDG code } - auto finalStates = o2::hf_decay::hf_cand_3prong::getDecayChannelMain(motherPdgCode); - constexpr int MaxDepth = 2; // Depth for final state matching - constexpr int ResoMaxDepth = 1; // Depth for resonant decay matching + auto finalStates = getDecayChannelsMain(pdgMother); + constexpr int DepthMainMax = 2; // Depth for final state matching + constexpr int DepthResoMax = 1; // Depth for resonant decay matching - int maxDepth = MaxDepth; + int depthMainMax = DepthMainMax; bool matched = false; - if (motherPdgCode == Pdg::kDStar) { - maxDepth = MaxDepth + 1; // D0 resonant decays are switched on + if (pdgMother == Pdg::kDStar) { + depthMainMax = DepthMainMax + 1; // D0 resonant decays are switched on } std::vector arrAllDaughtersIndex; - for (const auto& [chn, finalState] : finalStates) { - if (finalState.size() == 5) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays from 5-prong decays) - std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]}; - o2::hf_decay::changeFinalStatePdgSign(particle.pdgCode(), +kPi0, finalStateParts); - RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth); - matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, -1); - } else if (finalState.size() == 4) { // o2-linter: disable=magic-number (Partly Reco 3-prong decays from 4-prong decays) - std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2], finalState[3]}; - o2::hf_decay::changeFinalStatePdgSign(particle.pdgCode(), +kPi0, finalStateParts); - RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth); - matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, -1); - } else if (finalState.size() == 3) { // o2-linter: disable=magic-number (Fully Reco 3-prong decays) - std::array finalStateParts = std::array{finalState[0], finalState[1], finalState[2]}; - RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, finalStateParts, maxDepth); - matched = RecoDecay::isMatchedMCGen(mcParticles, particle, motherPdgCode, finalStateParts, true, &sign, maxDepth); + for (const auto& [channelMain, finalState] : finalStates) { + if (finalState.size() == 5) { // o2-linter: disable=magic-number (partially reconstructed 3-prong decays from 5-prong decays) + std::array arrPdgDaughtersMain5Prongs = std::array{finalState[0], finalState[1], finalState[2], finalState[3], finalState[4]}; + o2::hf_decay::flipPdgSign(particle.pdgCode(), +kPi0, arrPdgDaughtersMain5Prongs); + RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, arrPdgDaughtersMain5Prongs, depthMainMax); + matched = RecoDecay::isMatchedMCGen(mcParticles, particle, pdgMother, arrPdgDaughtersMain5Prongs, true, &sign, -1); + } else if (finalState.size() == 4) { // o2-linter: disable=magic-number (partially reconstructed 3-prong decays from 4-prong decays) + std::array arrPdgDaughtersMain4Prongs = std::array{finalState[0], finalState[1], finalState[2], finalState[3]}; + o2::hf_decay::flipPdgSign(particle.pdgCode(), +kPi0, arrPdgDaughtersMain4Prongs); + RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, arrPdgDaughtersMain4Prongs, depthMainMax); + matched = RecoDecay::isMatchedMCGen(mcParticles, particle, pdgMother, arrPdgDaughtersMain4Prongs, true, &sign, -1); + } else if (finalState.size() == 3) { // o2-linter: disable=magic-number (fully reconstructed 3-prong decays) + std::array arrPdgDaughtersMain3Prongs = std::array{finalState[0], finalState[1], finalState[2]}; + RecoDecay::getDaughters(particle, &arrAllDaughtersIndex, arrPdgDaughtersMain3Prongs, depthMainMax); + matched = RecoDecay::isMatchedMCGen(mcParticles, particle, pdgMother, arrPdgDaughtersMain3Prongs, true, &sign, depthMainMax); } else { - LOG(info) << "Final state size not supported: " << finalState.size(); - continue; + LOG(fatal) << "Final state size not supported: " << finalState.size(); + return; } if (matched) { - flag = sign * chn; + flagChannelMain = sign * channelMain; // Flag the resonant decay channel std::vector arrResoDaughIndex = {}; - if (std::abs(motherPdgCode) == Pdg::kDStar) { + if (std::abs(pdgMother) == Pdg::kDStar) { std::vector arrResoDaughIndexDStar = {}; - RecoDecay::getDaughters(particle, &arrResoDaughIndexDStar, std::array{0}, ResoMaxDepth); - for (size_t iDaug = 0; iDaug < arrResoDaughIndexDStar.size(); iDaug++) { + RecoDecay::getDaughters(particle, &arrResoDaughIndexDStar, std::array{0}, DepthResoMax); + for (std::size_t iDaug = 0; iDaug < arrResoDaughIndexDStar.size(); iDaug++) { auto daughDstar = mcParticles.rawIteratorAt(arrResoDaughIndexDStar[iDaug]); if (std::abs(daughDstar.pdgCode()) == Pdg::kD0 || std::abs(daughDstar.pdgCode()) == Pdg::kDPlus) { - RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, ResoMaxDepth); + RecoDecay::getDaughters(daughDstar, &arrResoDaughIndex, std::array{0}, DepthResoMax); break; } } } else { - RecoDecay::getDaughters(particle, &arrResoDaughIndex, std::array{0}, ResoMaxDepth); + RecoDecay::getDaughters(particle, &arrResoDaughIndex, std::array{0}, DepthResoMax); } - std::array arrPDGDaugh = {}; + std::array arrPdgDaughters = {}; if (arrResoDaughIndex.size() == NDaughtersResonant) { for (auto iProng = 0u; iProng < NDaughtersResonant; ++iProng) { auto daughI = mcParticles.rawIteratorAt(arrResoDaughIndex[iProng]); - arrPDGDaugh[iProng] = daughI.pdgCode(); + arrPdgDaughters[iProng] = daughI.pdgCode(); } - channel = o2::hf_decay::flagResonantDecay(motherPdgCode, arrPDGDaugh); + flagChannelResonant = o2::hf_decay::getDecayChannelResonant(pdgMother, arrPdgDaughters); } break; // Exit loop if a match is found } @@ -219,87 +225,87 @@ void fillMcMatchGen3Prong(T const& mcParticles, U const& mcParticlesPerMcColl, V } else { // D± → π± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi; + flagChannelMain = sign * DecayChannelMain::DplusToPiKPi; } } // Ds± → K± K∓ π± and D± → K± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { bool isDplus = false; if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DsToPiKK; + flagChannelMain = sign * DecayChannelMain::DsToPiKK; } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± // TODO: move to different and explicit flags - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKK; + flagChannelMain = sign * DecayChannelMain::DplusToPiKK; isDplus = true; } - if (flag != 0) { + if (flagChannelMain != 0) { RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == NDaughtersResonant) { - for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { - auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); - arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); + for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { + auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); + arrPdgDaugResonant[iProng] = std::abs(daughI.pdgCode()); } - if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { - channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToPhiPi : o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToPhiPi; - } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { - channel = isDplus ? o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DplusToKstar0K : o2::hf_decay::hf_cand_3prong::DecayChannelResonant::DsToKstar0K; + if ((arrPdgDaugResonant[0] == arrPdgDaugResonantDToPhiPi[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToPhiPi[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantDToPhiPi[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToPhiPi[0])) { + flagChannelResonant = isDplus ? DecayChannelResonant::DplusToPhiPi : DecayChannelResonant::DsToPhiPi; + } else if ((arrPdgDaugResonant[0] == arrPdgDaugResonantDToKstar0K[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToKstar0K[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantDToKstar0K[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantDToKstar0K[0])) { + flagChannelResonant = isDplus ? DecayChannelResonant::DplusToKstar0K : DecayChannelResonant::DsToKstar0K; } } } } // D*± → D0(bar) π± - if (flag == 0) { + if (flagChannelMain == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::DstarToPiKPi; + flagChannelMain = sign * DecayChannelMain::DstarToPiKPi; } } // Λc± → p± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi; + flagChannelMain = sign * DecayChannelMain::LcToPKPi; // Flagging the different Λc± → p± K∓ π± decay channels RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == NDaughtersResonant) { - for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { - auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); - arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); + for (auto iProng = 0u; iProng < arrDaughIndex.size(); ++iProng) { + auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); + arrPdgDaugResonant[iProng] = std::abs(daughI.pdgCode()); } - if ((arrPDGDaugh[0] == arrPDGResonant1[0] && arrPDGDaugh[1] == arrPDGResonant1[1]) || (arrPDGDaugh[0] == arrPDGResonant1[1] && arrPDGDaugh[1] == arrPDGResonant1[0])) { - channel = 1; - } else if ((arrPDGDaugh[0] == arrPDGResonant2[0] && arrPDGDaugh[1] == arrPDGResonant2[1]) || (arrPDGDaugh[0] == arrPDGResonant2[1] && arrPDGDaugh[1] == arrPDGResonant2[0])) { - channel = 2; - } else if ((arrPDGDaugh[0] == arrPDGResonant3[0] && arrPDGDaugh[1] == arrPDGResonant3[1]) || (arrPDGDaugh[0] == arrPDGResonant3[1] && arrPDGDaugh[1] == arrPDGResonant3[0])) { - channel = 3; + if ((arrPdgDaugResonant[0] == arrPdgDaugResonantLcToPKstar0[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToPKstar0[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantLcToPKstar0[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToPKstar0[0])) { + flagChannelResonant = DecayChannelResonant::LcToPKstar0; + } else if ((arrPdgDaugResonant[0] == arrPdgDaugResonantLcToDeltaplusplusK[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToDeltaplusplusK[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantLcToDeltaplusplusK[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToDeltaplusplusK[0])) { + flagChannelResonant = DecayChannelResonant::LcToDeltaplusplusK; + } else if ((arrPdgDaugResonant[0] == arrPdgDaugResonantLcToL1520Pi[0] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToL1520Pi[1]) || (arrPdgDaugResonant[0] == arrPdgDaugResonantLcToL1520Pi[1] && arrPdgDaugResonant[1] == arrPdgDaugResonantLcToL1520Pi[0])) { + flagChannelResonant = DecayChannelResonant::LcToL1520Pi; } } } } // Ξc± → p± K∓ π± - if (flag == 0) { + if (flagChannelMain == 0) { if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kXiCPlus, std::array{+kProton, -kKPlus, +kPiPlus}, true, &sign, 2)) { - flag = sign * o2::hf_decay::hf_cand_3prong::DecayChannelMain::XicToPKPi; + flagChannelMain = sign * DecayChannelMain::XicToPKPi; } } } // Check whether the particle is non-prompt (from a b quark). - if (flag != 0) { + if (flagChannelMain != 0) { origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); } if (origin == RecoDecay::OriginType::NonPrompt) { - rowMcMatchGen(flag, origin, channel, idxBhadMothers[0]); + rowMcMatchGen(flagChannelMain, origin, flagChannelResonant, idxBhadMothers[0]); } else { - rowMcMatchGen(flag, origin, channel, -1); + rowMcMatchGen(flagChannelMain, origin, flagChannelResonant, -1); } } } diff --git a/PWGHF/Utils/utilsMcMatching.h b/PWGHF/Utils/utilsMcMatching.h index 7718fe6ff39..31f9396e021 100644 --- a/PWGHF/Utils/utilsMcMatching.h +++ b/PWGHF/Utils/utilsMcMatching.h @@ -35,115 +35,128 @@ namespace o2::hf_decay namespace hf_cand_2prong { +// D0 + static const std::unordered_map> daughtersD0Main{ - {DecayChannelMain::D0ToPiK, {+kKMinus, +kPiPlus}}, - {DecayChannelMain::D0ToPiKPi0, {+kKMinus, +kPiPlus, +kPi0}}, - {DecayChannelMain::D0ToPiPi, {+kPiMinus, +kPiPlus}}, - {DecayChannelMain::D0ToPiPiPi0, {+kPiMinus, +kPiPlus, +kPi0}}, - {DecayChannelMain::D0ToKK, {+kKMinus, +kKPlus}}, + {DecayChannelMain::D0ToPiK, {+PDG_t::kKMinus, +PDG_t::kPiPlus}}, + {DecayChannelMain::D0ToPiKPi0, {+PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::D0ToPiPi, {+PDG_t::kPiMinus, +PDG_t::kPiPlus}}, + {DecayChannelMain::D0ToPiPiPi0, {+PDG_t::kPiMinus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::D0ToKK, {+PDG_t::kKMinus, +PDG_t::kKPlus}}, }; static const std::unordered_map> daughtersD0Resonant{ - {DecayChannelResonant::D0ToRhoplusPi, {+kRho770Plus, +kPiMinus}}, - {DecayChannelResonant::D0ToRhoplusK, {+kRho770Plus, +kKMinus}}, - {DecayChannelResonant::D0ToKstar0Pi0, {-o2::constants::physics::kK0Star892, +kPi0}}, - {DecayChannelResonant::D0ToKstarPi, {-o2::constants::physics::kKPlusStar892, +kPiPlus}}, + {DecayChannelResonant::D0ToRhoplusPi, {+PDG_t::kRho770Plus, +PDG_t::kPiMinus}}, + {DecayChannelResonant::D0ToRhoplusK, {+PDG_t::kRho770Plus, +PDG_t::kKMinus}}, + {DecayChannelResonant::D0ToKstar0Pi0, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kPi0}}, + {DecayChannelResonant::D0ToKstarPi, {-o2::constants::physics::Pdg::kKPlusStar892, +PDG_t::kPiPlus}}, }; +// J/ψ + +static const std::unordered_map> daughtersJpsiMain{ + {DecayChannelMain::JpsiToEE, {+PDG_t::kElectron, +PDG_t::kPositron}}, + {DecayChannelMain::JpsiToMuMu, {+PDG_t::kMuonMinus, +PDG_t::kMuonPlus}}, +}; } // namespace hf_cand_2prong namespace hf_cand_3prong { // D± + static const std::unordered_map> daughtersDplusMain{ - {DecayChannelMain::DplusToPiKPi, {+kKMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DplusToPiKK, {+kKMinus, +kKPlus, +kPiPlus}}, - {DecayChannelMain::DplusToPiKPiPi0, {+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DplusToPiPiPi, {+kPiMinus, +kPiPlus, +kPiPlus}}, + {DecayChannelMain::DplusToPiKPi, {+PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DplusToPiKK, {+PDG_t::kKMinus, +PDG_t::kKPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DplusToPiKPiPi0, {+PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::DplusToPiPiPi, {+PDG_t::kPiMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus}}, }; static const std::unordered_map> daughtersDplusResonant{ - {DecayChannelResonant::DplusToPhiPi, {+o2::constants::physics::kPhi, +kPiPlus}}, - {DecayChannelResonant::DplusToKstar0K, {-o2::constants::physics::kK0Star892, +kKPlus}}, - {DecayChannelResonant::DplusToKstar1430_0K, {-10311, +kKPlus}}, - {DecayChannelResonant::DplusToRho0Pi, {+kRho770_0, +kPiPlus}}, - {DecayChannelResonant::DplusToF2_1270Pi, {+225, +kPiPlus}}, + {DecayChannelResonant::DplusToPhiPi, {+o2::constants::physics::Pdg::kPhi, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DplusToKstar0K, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kKPlus}}, + {DecayChannelResonant::DplusToKstar1430_0K, {-10311, +PDG_t::kKPlus}}, + {DecayChannelResonant::DplusToRho0Pi, {+PDG_t::kRho770_0, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DplusToF2_1270Pi, {+225, +PDG_t::kPiPlus}}, }; // Ds± + static const std::unordered_map> daughtersDsMain{ - {DecayChannelMain::DsToPiKK, {+kKMinus, +kKPlus, +kPiPlus}}, - {DecayChannelMain::DsToPiKKPi0, {+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DsToPiPiK, {+kKPlus, +kPiPlus, +kPiMinus}}, - {DecayChannelMain::DsToPiPiPi, {+kPiMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DsToPiPiPiPi0, {+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, + {DecayChannelMain::DsToPiKK, {+PDG_t::kKMinus, +PDG_t::kKPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DsToPiKKPi0, {+PDG_t::kKMinus, +PDG_t::kKPlus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::DsToPiPiK, {+PDG_t::kKPlus, +PDG_t::kPiPlus, +PDG_t::kPiMinus}}, + {DecayChannelMain::DsToPiPiPi, {+PDG_t::kPiMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DsToPiPiPiPi0, {+PDG_t::kPiMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, }; static const std::unordered_map> daughtersDsResonant{ - {DecayChannelResonant::DsToPhiPi, {+o2::constants::physics::kPhi, +kPiPlus}}, - {DecayChannelResonant::DsToPhiRhoplus, {+o2::constants::physics::kPhi, +kRho770Plus}}, - {DecayChannelResonant::DsToKstar0K, {-o2::constants::physics::kK0Star892, +kKPlus}}, - {DecayChannelResonant::DsToKstar0Pi, {+o2::constants::physics::kK0Star892, +kPiPlus}}, - {DecayChannelResonant::DsToRho0Pi, {+kRho770_0, +kPiPlus}}, - {DecayChannelResonant::DsToRho0K, {+kRho770_0, +kKPlus}}, - {DecayChannelResonant::DsToF2_1270Pi, {225, +kPiPlus}}, - {DecayChannelResonant::DsToF0_1370K, {10221, +kKPlus}}, - {DecayChannelResonant::DsToEtaPi, {221, +kPiPlus}}, + {DecayChannelResonant::DsToPhiPi, {+o2::constants::physics::Pdg::kPhi, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DsToPhiRhoplus, {+o2::constants::physics::Pdg::kPhi, +PDG_t::kRho770Plus}}, + {DecayChannelResonant::DsToKstar0K, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kKPlus}}, + {DecayChannelResonant::DsToKstar0Pi, {+o2::constants::physics::Pdg::kK0Star892, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DsToRho0Pi, {+PDG_t::kRho770_0, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DsToRho0K, {+PDG_t::kRho770_0, +PDG_t::kKPlus}}, + {DecayChannelResonant::DsToF2_1270Pi, {225, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DsToF0_1370K, {10221, +PDG_t::kKPlus}}, + {DecayChannelResonant::DsToEtaPi, {221, +PDG_t::kPiPlus}}, }; -// Dstar +// D*+ + static const std::unordered_map> daughtersDstarMain{ - {DecayChannelMain::DstarToPiKPi, {+kKMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DstarToPiKPiPi0, {+kKMinus, +kPiPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DstarToPiKPiPi0Pi0, {+kKMinus, +kPiPlus, +kPiPlus, +kPi0, +kPi0}}, - {DecayChannelMain::DstarToPiKK, {+kKMinus, +kKPlus, +kPiPlus}}, - {DecayChannelMain::DstarToPiKKPi0, {+kKMinus, +kKPlus, +kPiPlus, +kPi0}}, - {DecayChannelMain::DstarToPiPiPi, {+kPiMinus, +kPiPlus, +kPiPlus}}, - {DecayChannelMain::DstarToPiPiPiPi0, {+kPiMinus, +kPiPlus, +kPiPlus, +kPi0}}, + {DecayChannelMain::DstarToPiKPi, {+PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DstarToPiKPiPi0, {+PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::DstarToPiKPiPi0Pi0, {+PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus, +PDG_t::kPi0, +PDG_t::kPi0}}, + {DecayChannelMain::DstarToPiKK, {+PDG_t::kKMinus, +PDG_t::kKPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DstarToPiKKPi0, {+PDG_t::kKMinus, +PDG_t::kKPlus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::DstarToPiPiPi, {+PDG_t::kPiMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus}}, + {DecayChannelMain::DstarToPiPiPiPi0, {+PDG_t::kPiMinus, +PDG_t::kPiPlus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, }; static const std::unordered_map> daughtersDstarResonant{ - {DecayChannelResonant::DstarToD0ToRhoplusPi, {+kRho770Plus, +kPiMinus}}, - {DecayChannelResonant::DstarToD0ToRhoplusK, {+kRho770Plus, +kKMinus}}, - {DecayChannelResonant::DstarToD0ToKstar0Pi0, {-o2::constants::physics::kK0Star892, +kPi0}}, - {DecayChannelResonant::DstarToD0ToKstarPi, {-o2::constants::physics::kKPlusStar892, +kPiPlus}}, - {DecayChannelResonant::DstarToDplusToPhiPi, {+o2::constants::physics::kPhi, +kPiPlus}}, - {DecayChannelResonant::DstarToDplusToKstar0K, {-o2::constants::physics::kK0Star892, +kKPlus}}, - {DecayChannelResonant::DstarToDplusToKstar1430_0K, {-10311, +kKPlus}}, - {DecayChannelResonant::DstarToDplusToRho0Pi, {+kRho770_0, +kPiPlus}}, - {DecayChannelResonant::DstarToDplusToF2_1270Pi, {+225, +kPiPlus}}, + {DecayChannelResonant::DstarToD0ToRhoplusPi, {+PDG_t::kRho770Plus, +PDG_t::kPiMinus}}, + {DecayChannelResonant::DstarToD0ToRhoplusK, {+PDG_t::kRho770Plus, +PDG_t::kKMinus}}, + {DecayChannelResonant::DstarToD0ToKstar0Pi0, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kPi0}}, + {DecayChannelResonant::DstarToD0ToKstarPi, {-o2::constants::physics::Pdg::kKPlusStar892, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DstarToDplusToPhiPi, {+o2::constants::physics::Pdg::kPhi, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DstarToDplusToKstar0K, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kKPlus}}, + {DecayChannelResonant::DstarToDplusToKstar1430_0K, {-10311, +PDG_t::kKPlus}}, + {DecayChannelResonant::DstarToDplusToRho0Pi, {+PDG_t::kRho770_0, +PDG_t::kPiPlus}}, + {DecayChannelResonant::DstarToDplusToF2_1270Pi, {+225, +PDG_t::kPiPlus}}, }; -// Lc +// Λc+ + static const std::unordered_map> daughtersLcMain{ - {DecayChannelMain::LcToPKPi, {+kProton, +kKMinus, +kPiPlus}}, - {DecayChannelMain::LcToPKPiPi0, {+kProton, +kKMinus, +kPiPlus, +kPi0}}, - {DecayChannelMain::LcToPPiPi, {+kProton, +kPiMinus, +kPiPlus}}, - {DecayChannelMain::LcToPKK, {+kProton, +kKMinus, +kKPlus}}}; + {DecayChannelMain::LcToPKPi, {+PDG_t::kProton, +PDG_t::kKMinus, +PDG_t::kPiPlus}}, + {DecayChannelMain::LcToPKPiPi0, {+PDG_t::kProton, +PDG_t::kKMinus, +PDG_t::kPiPlus, +PDG_t::kPi0}}, + {DecayChannelMain::LcToPPiPi, {+PDG_t::kProton, +PDG_t::kPiMinus, +PDG_t::kPiPlus}}, + {DecayChannelMain::LcToPKK, {+PDG_t::kProton, +PDG_t::kKMinus, +PDG_t::kKPlus}}}; static const std::unordered_map> daughtersLcResonant{ - {DecayChannelResonant::LcToPKstar0, {-o2::constants::physics::kK0Star892, +kProton}}, - {DecayChannelResonant::LcToDeltaplusplusK, {+2224, +kKMinus}}, - {DecayChannelResonant::LcToL1520Pi, {+102134, +kPiPlus}}, + {DecayChannelResonant::LcToPKstar0, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kProton}}, + {DecayChannelResonant::LcToDeltaplusplusK, {+2224, +PDG_t::kKMinus}}, + {DecayChannelResonant::LcToL1520Pi, {+102134, +PDG_t::kPiPlus}}, }; -// Xic +// Ξc+ + static const std::unordered_map> daughtersXicMain{ - {DecayChannelMain::XicToPKPi, {+kProton, +kKMinus, +kPiPlus}}, - {DecayChannelMain::XicToPKK, {+kProton, +kKMinus, +kKPlus}}, - {DecayChannelMain::XicToSPiPi, {+kSigmaPlus, +kPiMinus, +kPiPlus}}, + {DecayChannelMain::XicToPKPi, {+PDG_t::kProton, +PDG_t::kKMinus, +PDG_t::kPiPlus}}, + {DecayChannelMain::XicToPKK, {+PDG_t::kProton, +PDG_t::kKMinus, +PDG_t::kKPlus}}, + {DecayChannelMain::XicToSPiPi, {+PDG_t::kSigmaPlus, +PDG_t::kPiMinus, +PDG_t::kPiPlus}}, }; static const std::unordered_map> daughtersXicResonant{ - {DecayChannelResonant::XicToPKstar0, {-o2::constants::physics::kK0Star892, +kProton}}, - {DecayChannelResonant::XicToPPhi, {+kProton, +o2::constants::physics::kPhi}}, + {DecayChannelResonant::XicToPKstar0, {-o2::constants::physics::Pdg::kK0Star892, +PDG_t::kProton}}, + {DecayChannelResonant::XicToPPhi, {+PDG_t::kProton, +o2::constants::physics::Pdg::kPhi}}, }; /// Returns a map of the possible final states for a specific 3-prong particle specie /// \param pdgMother PDG code of the mother particle /// \return a map of final states with their corresponding PDG codes -inline std::unordered_map> getDecayChannelMain(int pdgMother) +inline std::unordered_map> getDecayChannelsMain(int pdgMother) { switch (pdgMother) { case o2::constants::physics::Pdg::kDPlus: @@ -169,7 +182,7 @@ inline std::unordered_map> getDecayChan /// \param arrPdgExpected array of the expected PDG codes /// \return true if the arrays are equal, false otherwise template -inline bool checkDecayChannel(std::array const& arrPdgTested, std::array arrPdgExpected) +inline bool areSamePdgArrays(std::array const& arrPdgTested, std::array arrPdgExpected) { for (std::size_t i = 0; i < N; i++) { bool foundPdg = false; @@ -187,59 +200,59 @@ inline bool checkDecayChannel(std::array const& arrPdgTested, std::array return true; } -/// Flag the resonant decays +/// Flag the resonant decay channel /// \tparam N size of the array of daughter PDG codes -/// \param motherPdg PDG code of the mother particle -/// \param arrDaughPdgs array of daughter PDG codes -/// \return the flag for the matched resonant decay channel +/// \param pdgMother PDG code of the mother particle +/// \param arrPdgDaughters array of daughter PDG codes +/// \return the channel for the matched resonant decay channel template -inline int8_t flagResonantDecay(const int motherPdg, std::array const& arrDaughPdgs) +inline int8_t getDecayChannelResonant(const int pdgMother, std::array const& arrPdgDaughters) { - switch (motherPdg) { + switch (pdgMother) { case o2::constants::physics::Pdg::kD0: - for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_2prong::daughtersD0Resonant) { - if (o2::hf_decay::checkDecayChannel(arrDaughPdgs, pdgCodes)) { - return flag; + for (const auto& [channelResonant, arrPdgDaughtersResonant] : hf_cand_2prong::daughtersD0Resonant) { + if (areSamePdgArrays(arrPdgDaughters, arrPdgDaughtersResonant)) { + return channelResonant; } } break; case o2::constants::physics::Pdg::kDPlus: - for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::daughtersDplusResonant) { - if (o2::hf_decay::checkDecayChannel(arrDaughPdgs, pdgCodes)) { - return flag; + for (const auto& [channelResonant, arrPdgDaughtersResonant] : hf_cand_3prong::daughtersDplusResonant) { + if (areSamePdgArrays(arrPdgDaughters, arrPdgDaughtersResonant)) { + return channelResonant; } } break; case o2::constants::physics::Pdg::kDS: - for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::daughtersDsResonant) { - if (o2::hf_decay::checkDecayChannel(arrDaughPdgs, pdgCodes)) { - return flag; + for (const auto& [channelResonant, arrPdgDaughtersResonant] : hf_cand_3prong::daughtersDsResonant) { + if (areSamePdgArrays(arrPdgDaughters, arrPdgDaughtersResonant)) { + return channelResonant; } } break; case o2::constants::physics::Pdg::kDStar: - for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::daughtersDstarResonant) { - if (o2::hf_decay::checkDecayChannel(arrDaughPdgs, pdgCodes)) { - return flag; + for (const auto& [channelResonant, arrPdgDaughtersResonant] : hf_cand_3prong::daughtersDstarResonant) { + if (areSamePdgArrays(arrPdgDaughters, arrPdgDaughtersResonant)) { + return channelResonant; } } break; case o2::constants::physics::Pdg::kLambdaCPlus: - for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::daughtersLcResonant) { - if (o2::hf_decay::checkDecayChannel(arrDaughPdgs, pdgCodes)) { - return flag; + for (const auto& [channelResonant, arrPdgDaughtersResonant] : hf_cand_3prong::daughtersLcResonant) { + if (areSamePdgArrays(arrPdgDaughters, arrPdgDaughtersResonant)) { + return channelResonant; } } break; case o2::constants::physics::Pdg::kXiCPlus: - for (const auto& [flag, pdgCodes] : o2::hf_decay::hf_cand_3prong::daughtersXicResonant) { - if (o2::hf_decay::checkDecayChannel(arrDaughPdgs, pdgCodes)) { - return flag; + for (const auto& [channelResonant, arrPdgDaughtersResonant] : hf_cand_3prong::daughtersXicResonant) { + if (areSamePdgArrays(arrPdgDaughters, arrPdgDaughtersResonant)) { + return channelResonant; } } break; default: - LOG(fatal) << "Unknown PDG code for 3-prong final states: " << motherPdg; + LOG(fatal) << "Unknown PDG code for 3-prong final states: " << pdgMother; return -1; } return 0; @@ -248,18 +261,18 @@ inline int8_t flagResonantDecay(const int motherPdg, std::array const& a /// Flip the sign of a specific PDG code in an array /// of PDG codes associated to an antiparticle. /// \tparam N size of the array of PDG codes -/// \param motherPdgCode PDG code of the mother particle -/// \param partPdgCode PDG code to be flipped -/// \param arrFinalStatePdgs array of PDG codes to be modified +/// \param pdgMother PDG code of the mother particle +/// \param pdgToFlip PDG code to be flipped +/// \param arrPdg array of PDG codes to be modified template -inline void changeFinalStatePdgSign(const int motherPdgCode, const int partPdgCode, std::array& arrFinalStatePdgs) +inline void flipPdgSign(const int pdgMother, const int pdgToFlip, std::array& arrPdg) { - if (motherPdgCode >= 0) { + if (pdgMother >= 0) { return; } - for (auto& part : arrFinalStatePdgs) { // o2-linter: disable=const-ref-in-for-loop (arrFinalStatePdgs entries are modified) - if (part == partPdgCode) { - part = -part; + for (auto& pdg : arrPdg) { // o2-linter: disable=const-ref-in-for-loop (arrPdg entries are modified) + if (pdg == pdgToFlip) { + pdg = -pdg; } } } diff --git a/PWGJE/Core/JetHFUtilities.h b/PWGJE/Core/JetHFUtilities.h index 30d0f0da938..f8c95507757 100644 --- a/PWGJE/Core/JetHFUtilities.h +++ b/PWGJE/Core/JetHFUtilities.h @@ -263,7 +263,7 @@ template constexpr bool isMatchedHFCandidate(T const& candidate) { if constexpr (isD0Candidate()) { - if (std::abs(candidate.flagMcMatchRec()) == 1 << o2::aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { return true; } else { return false; @@ -287,7 +287,7 @@ constexpr bool isMatchedHFCandidate(T const& candidate) return false; } } else if constexpr (isD0McCandidate()) { - if (std::abs(candidate.flagMcMatchGen()) == 1 << o2::aod::hf_cand_2prong::DecayType::D0ToPiK) { + if (std::abs(candidate.flagMcMatchGen()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { return true; } else { return false; diff --git a/PWGJE/Tasks/hfFragmentationFunction.cxx b/PWGJE/Tasks/hfFragmentationFunction.cxx index dcfdaf90360..b3790cda8cd 100644 --- a/PWGJE/Tasks/hfFragmentationFunction.cxx +++ b/PWGJE/Tasks/hfFragmentationFunction.cxx @@ -16,13 +16,15 @@ /// /// The task store data relevant to the calculation of hadronization observables radial /// profile and/or jet momentum fraction for charmed hadrons -#include "JetDerivedDataUtilities.h" -#include "RecoDecay.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +// +#include "PWGHF/Core/DecayChannels.h" + +#include "Common/Core/RecoDecay.h" #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" @@ -325,7 +327,7 @@ struct HfFragmentationFunction { // reflection information for storage: D0 = +1, D0bar = -1, neither = 0 int matchedFrom = 0; - int decayChannel = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; + int decayChannel = o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; int selectedAs = 0; if (mcdd0cand.flagMcMatchRec() == decayChannel) { // matched to D0 on truth level @@ -416,7 +418,7 @@ struct HfFragmentationFunction { // reflection information for storage: D0 = +1, D0bar = -1, neither = 0 int matchedFrom = 0; - int decayChannel = 1 << aod::hf_cand_2prong::DecayType::D0ToPiK; + int decayChannel = o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK; int selectedAs = 0; if (mcdd0cand.flagMcMatchRec() == decayChannel) { // matched to D0 on truth level From 904db63c0b255e286221651d4396558a3e37ae47 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Fri, 4 Jul 2025 00:29:04 +0900 Subject: [PATCH 21/29] [PWGLF] Prevent fall-through in switch-case Added missing `break` statements to avoid implicit fall-through warnings. --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index eac70aa392d..0d489209e93 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -187,12 +187,15 @@ struct f0980analysis { case 0: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; + break; case 1: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) return false; + break; case 2: if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) return false; + break; case 3: if (track.hasTOF()) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) @@ -201,6 +204,7 @@ struct f0980analysis { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) return false; } + break; } return true; } From 9c262af83b5c199fd802ebb2cb47ae61896ebe0c Mon Sep 17 00:00:00 2001 From: Yunseul Date: Mon, 30 Jun 2025 17:43:39 +0900 Subject: [PATCH 22/29] [PWGLF] Add the PID option for using TOF Apply TPC and TOF cuts for PID, depending on the availability of TOF. --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 29 +++++++++++++----------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 01b059a7f29..63b8956ef2c 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -14,7 +14,6 @@ #include #include #include "TVector2.h" -#include #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" @@ -47,8 +46,6 @@ struct f0980analysis { "Maximum transverse DCA"}; Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, "Maximum longitudinal DCA"}; - Configurable cfgMaxTPC{"cfgMaxTPC", 5.0, "Maximum TPC PID with TOF"}; - Configurable cfgMaxTOF{"cfgMaxTOF", 3.0, "Maximum TOF PID with TPC"}; Configurable cfgMinRap{"cfgMinRap", -0.5, "Minimum rapidity for pair"}; Configurable cfgMaxRap{"cfgMaxRap", 0.5, "Maximum rapidity for pair"}; Configurable cfgFindRT{"cfgFindRT", false, "boolean for RT analysis"}; @@ -80,7 +77,8 @@ struct f0980analysis { // PID Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF - Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 3.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC + Configurable cMaxTPCnSigmaPionWoTOF{"cMaxTPCnSigmaPionWoTOF", 2.0, "TPC nSigma cut without TOF for Pion"}; Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; Configurable SelectType{"SelectType", 0, "PID selection type"}; @@ -199,6 +197,15 @@ struct f0980analysis { if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) return false; } + if (SelectType == 3) { + if (track.hasTOF()) { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) + return false; + } else if (!track.hasTOF()) { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) + return false; + } + } return true; } @@ -227,17 +234,14 @@ struct f0980analysis { TLorentzVector Pion1, Pion2, Reco; for (auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { - if (trk1.index() == trk2.index()) { - if (!SelTrack(trk1)) - continue; - histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); - histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); - histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); - continue; - } if (!SelTrack(trk1) || !SelTrack(trk2)) continue; + // TPC, TOF Nsigma distributions + histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); + histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); + histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); + if (!SelPion(trk1) || !SelPion(trk2)) continue; @@ -305,7 +309,6 @@ struct f0980analysis { void processMCTrue(aod::ResoMCParents& resoParents) { - for (auto& part : resoParents) { // loop over all pre-filtered MC particles if (abs(part.pdgCode()) != 9010221) continue; From e944e5416ff0198e3ee2b3d842f63e9300e72905 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Mon, 30 Jun 2025 22:28:26 +0900 Subject: [PATCH 23/29] [PWGLF] Apply clang-format Reformatted code with clang-format. --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 63b8956ef2c..2f6d32aa9a6 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -11,19 +11,22 @@ /// \author Junlee Kim (jikim1290@gmail.com) -#include -#include -#include "TVector2.h" +#include "PWGLF/DataModel/LFResonanceTables.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" + +#include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" -#include "PWGLF/DataModel/LFResonanceTables.h" -#include "CommonConstants/PhysicsConstants.h" +#include + +#include "TVector2.h" +#include +#include using namespace o2; using namespace o2::framework; From 1c4650fdca8a320e7114c43746d19633289383f1 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Mon, 30 Jun 2025 23:24:15 +0900 Subject: [PATCH 24/29] [PWGLF] Apply O2 linter --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 37 ++++++++++-------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 2f6d32aa9a6..2015f63eb97 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -17,6 +17,7 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" +#include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" @@ -25,14 +26,8 @@ #include #include "TVector2.h" -#include -#include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::constants::physics; +#include struct f0980analysis { SliceCache cache; @@ -98,9 +93,9 @@ struct f0980analysis { AxisSpec PIDqaAxis = {120, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0., 2.0 * constants::math::PI}; - AxisSpec EPAxis = {10, 0, constants::math::PI}; - AxisSpec EPqaAxis = {200, -constants::math::PI, constants::math::PI}; + AxisSpec phiqaAxis = {72, 0., 2.0 * o2::constants::math::PI}; + AxisSpec EPAxis = {10, 0, o2::constants::math::PI}; + AxisSpec EPqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec EPresAxis = {200, -2, 2}; if (cfgFindRT) { @@ -144,11 +139,11 @@ struct f0980analysis { int RTIndex(double pairphi, double lhphi) { double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi)); - if (dphi < constants::math::PI / 3.0) + if (dphi < o2::constants::math::PI / 3.0) return 0; - if (dphi < 2.0 * constants::math::PI / 3.0 && dphi > constants::math::PI / 3.0) + if (dphi < 2.0 * o2::constants::math::PI / 3.0 && dphi > o2::constants::math::PI / 3.0) return 1; - if (dphi > 2.0 * constants::math::PI / 3.0) + if (dphi > 2.0 * o2::constants::math::PI / 3.0) return 2; return -1; @@ -234,7 +229,7 @@ struct f0980analysis { histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC()); histos.fill(HIST("QA/LTpt"), LHpt, collision.cent(), LHphi); - TLorentzVector Pion1, Pion2, Reco; + ROOT::Math::LorentzVector> Pion1, Pion2, Reco; for (auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { @@ -256,8 +251,8 @@ struct f0980analysis { continue; relPhi = TVector2::Phi_0_2pi(Reco.Phi() - collision.evtPl()); - if (relPhi > constants::math::PI) { - relPhi -= constants::math::PI; + if (relPhi > o2::constants::math::PI) { + relPhi -= o2::constants::math::PI; } if (trk1.sign() * trk2.sign() < 0) { @@ -268,11 +263,11 @@ struct f0980analysis { histos.fill(HIST("hInvMass_f0980_US_EPA"), Reco.M(), Reco.Pt(), collision.cent(), relPhi); if constexpr (IsMC) { - if (abs(trk1.pdgCode()) != 211 || abs(trk2.pdgCode()) != 211) + if (std::abs(trk1.pdgCode()) != 211 || std::abs(trk2.pdgCode()) != 211) continue; if (trk1.motherId() != trk2.motherId()) continue; - if (abs(trk1.motherPDG()) != 9010221) + if (std::abs(trk1.motherPDG()) != 9010221) continue; histos.fill(HIST("MCL/hpT_f0980_REC"), Reco.M(), Reco.Pt(), collision.cent()); @@ -313,7 +308,7 @@ struct f0980analysis { void processMCTrue(aod::ResoMCParents& resoParents) { for (auto& part : resoParents) { // loop over all pre-filtered MC particles - if (abs(part.pdgCode()) != 9010221) + if (std::abs(part.pdgCode()) != 9010221) continue; if (!part.producedByGenerator()) continue; @@ -321,8 +316,8 @@ struct f0980analysis { continue; } bool pass = false; - if ((abs(part.daughterPDG1()) == 211 && - abs(part.daughterPDG2()) == 211)) { + if ((std::abs(part.daughterPDG1()) == 211 && + std::abs(part.daughterPDG2()) == 211)) { pass = true; } if (!pass) // If we have both decay products From c3b8b0b92aee1486aae0c0af124dfed3f1430543 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Tue, 1 Jul 2025 00:34:02 +0900 Subject: [PATCH 25/29] [PWGLF] O2 linter --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 149 +++++++++++++---------- 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 2015f63eb97..340ae17b7a1 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -8,8 +8,11 @@ // 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. - -/// \author Junlee Kim (jikim1290@gmail.com) +/// +/// \file f0980analysis.cxx +/// \brief f0(980) analysis in pp 13.6 TeV +/// \author Yunseul Bae (ybae@cern.ch), Junlee Kim (jikim1290@gmail.com) +/// \since 30/06/2025 #include "PWGLF/DataModel/LFResonanceTables.h" @@ -29,6 +32,8 @@ #include +using namespace o2::constants::physics; + struct f0980analysis { SliceCache cache; HistogramRegistry histos{ @@ -78,7 +83,7 @@ struct f0980analysis { Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC Configurable cMaxTPCnSigmaPionWoTOF{"cMaxTPCnSigmaPionWoTOF", 2.0, "TPC nSigma cut without TOF for Pion"}; Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; - Configurable SelectType{"SelectType", 0, "PID selection type"}; + Configurable selectType{"SelectType", 0, "PID selection type"}; // Axis ConfigurableAxis massAxis{"massAxis", {400, 0.2, 2.2}, "Invariant mass axis"}; @@ -88,41 +93,41 @@ struct f0980analysis { { std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; - AxisSpec RTAxis = {3, 0, 3}; - AxisSpec LptAxis = {lptBinning}; // Minimum leading hadron pT selection + AxisSpec rtAxis = {3, 0, 3}; + AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection - AxisSpec PIDqaAxis = {120, -6, 6}; + AxisSpec pidQaAxis = {120, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0., 2.0 * o2::constants::math::PI}; - AxisSpec EPAxis = {10, 0, o2::constants::math::PI}; - AxisSpec EPqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; - AxisSpec EPresAxis = {200, -2, 2}; + AxisSpec phiqaAxis = {72, 0, o2::constants::math::TWOPI}; + AxisSpec epAxis = {10, 0, o2::constants::math::PI}; + AxisSpec epQaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; + AxisSpec epResAxis = {200, -2, 2}; if (cfgFindRT) { histos.add("hInvMass_f0980_US", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSpp", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSmm", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, RTAxis, LptAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); } histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, EPAxis}}); + {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); - histos.add("QA/hEPResAB", "", {HistType::kTH2F, {centAxis, EPresAxis}}); - histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, EPresAxis}}); - histos.add("QA/hEPResBC", "", {HistType::kTH2F, {centAxis, EPresAxis}}); + histos.add("QA/hEPResAB", "", {HistType::kTH2F, {centAxis, epResAxis}}); + histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, epResAxis}}); + histos.add("QA/hEPResBC", "", {HistType::kTH2F, {centAxis, epResAxis}}); - histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, PIDqaAxis}}); - histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, PIDqaAxis}}); - histos.add("QA/TPC_TOF", "", {HistType::kTH2F, {PIDqaAxis, PIDqaAxis}}); + histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); + histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); + histos.add("QA/TPC_TOF", "", {HistType::kTH2F, {pidQaAxis, pidQaAxis}}); histos.add("QA/LTpt", "", {HistType::kTH3F, {pTqaAxis, centAxis, phiqaAxis}}); - histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, EPqaAxis}}); + histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epQaAxis}}); if (doprocessMCLight) { histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, @@ -136,21 +141,26 @@ struct f0980analysis { double massPi = MassPionCharged; - int RTIndex(double pairphi, double lhphi) + constexpr float OneThird = 1.0f / 3.0f; + constexpr float PIthird = o2::constants::math::PI * OneThird; + constexpr float TWOPIthird = o2::constants::math::TWOPI * OneThird; + + int rtIndex(double pairphi, double lhPhi) { - double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi)); - if (dphi < o2::constants::math::PI / 3.0) + double dphi = std::fabs(TVector2::Phi_mpi_pi(lhPhi - pairphi)); + + if (dphi < PIthird) return 0; - if (dphi < 2.0 * o2::constants::math::PI / 3.0 && dphi > o2::constants::math::PI / 3.0) + if (dphi < TWOPIthird && dphi > PIthird) return 1; - if (dphi > 2.0 * o2::constants::math::PI / 3.0) + if (dphi > TWOPIthird) return 2; return -1; } template - bool SelTrack(const TrackType track) + bool selTrack(const TrackType track) { if (std::abs(track.pt()) < cfgMinPt) return false; @@ -181,21 +191,26 @@ struct f0980analysis { } template - bool SelPion(const TrackType track) + bool selPion(const TrackType track) { - if (SelectType == 0) { + constexpr int TPCorTOF = 0; + constexpr int TPCOnly = 1; + constexpr int Combined = 2; + constexpr int Run2Like = 3; + + if (selectType == TPCorTOF) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; } - if (SelectType == 1) { + if (selectType == TPConly) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) return false; } - if (SelectType == 2) { + if (selectType == Combined) { if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) return false; } - if (SelectType == 3) { + if (selectType == Run2Like) { if (track.hasTOF()) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; @@ -211,14 +226,14 @@ struct f0980analysis { void fillHistograms(const CollisionType& collision, const TracksType& dTracks) { - double LHpt = 0.; - double LHphi = 0.; + double lhPt = 0.; + double lhPhi = 0.; double relPhi = 0.; if (cfgFindRT) { - for (auto& trk : dTracks) { - if (trk.pt() > LHpt) { - LHpt = trk.pt(); - LHphi = trk.phi(); + for (const auto& trk : dTracks) { + if (trk.pt() > lhPt) { + lhPt = trk.pt(); + lhPhi = trk.phi(); } } } @@ -227,64 +242,64 @@ struct f0980analysis { histos.fill(HIST("QA/hEPResAB"), collision.cent(), collision.evtPlResAB()); histos.fill(HIST("QA/hEPResAC"), collision.cent(), collision.evtPlResBC()); histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC()); - histos.fill(HIST("QA/LTpt"), LHpt, collision.cent(), LHphi); + histos.fill(HIST("QA/LTpt"), lhPt, collision.cent(), lhPhi); - ROOT::Math::LorentzVector> Pion1, Pion2, Reco; - for (auto& [trk1, trk2] : + ROOT::Math::LorentzVector> pion1, pion2, reco; + for (const auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { - if (!SelTrack(trk1) || !SelTrack(trk2)) + if (!selTrack(trk1) || !selTrack(trk2)) continue; // TPC, TOF Nsigma distributions histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); - if (!SelPion(trk1) || !SelPion(trk2)) + if (!selPion(trk1) || !selPion(trk2)) continue; - Pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPi); - Pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); - Reco = Pion1 + Pion2; + pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPi); + pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + reco = pion1 + pion2; - if (Reco.Rapidity() > cfgMaxRap || Reco.Rapidity() < cfgMinRap) + if (reco.Rapidity() > cfgMaxRap || reco.Rapidity() < cfgMinRap) continue; - relPhi = TVector2::Phi_0_2pi(Reco.Phi() - collision.evtPl()); + relPhi = TVector2::Phi_0_2pi(reco.Phi() - collision.evtPl()); if (relPhi > o2::constants::math::PI) { relPhi -= o2::constants::math::PI; } if (trk1.sign() * trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_US"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + histos.fill(HIST("hInvMass_f0980_US"), reco.M(), reco.Pt(), + collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); } - histos.fill(HIST("hInvMass_f0980_US_EPA"), Reco.M(), Reco.Pt(), + histos.fill(HIST("hInvMass_f0980_US_EPA"), reco.M(), reco.Pt(), collision.cent(), relPhi); if constexpr (IsMC) { - if (std::abs(trk1.pdgCode()) != 211 || std::abs(trk2.pdgCode()) != 211) + if (std::abs(trk1.pdgCode()) != Pdg::PiPlus || std::abs(trk2.pdgCode()) != Pdg::PiPlus) continue; if (trk1.motherId() != trk2.motherId()) continue; - if (std::abs(trk1.motherPDG()) != 9010221) + if (std::abs(trk1.motherPDG()) != Pdg::f0_980) // 9010221 continue; - histos.fill(HIST("MCL/hpT_f0980_REC"), Reco.M(), Reco.Pt(), + histos.fill(HIST("MCL/hpT_f0980_REC"), reco.M(), reco.Pt(), collision.cent()); } } else if (trk1.sign() > 0 && trk2.sign() > 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSpp"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + histos.fill(HIST("hInvMass_f0980_LSpp"), reco.M(), reco.Pt(), + collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); } - histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), Reco.M(), Reco.Pt(), + histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), reco.M(), reco.Pt(), collision.cent(), relPhi); } else if (trk1.sign() < 0 && trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSmm"), Reco.M(), Reco.Pt(), - collision.cent(), RTIndex(Reco.Phi(), LHphi), LHpt); + histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), + collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); } - histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), Reco.M(), Reco.Pt(), + histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relPhi); } } @@ -305,10 +320,10 @@ struct f0980analysis { } PROCESS_SWITCH(f0980analysis, processMCLight, "Process Event for MC", false); - void processMCTrue(aod::ResoMCParents& resoParents) + void processMCTrue(const aod::ResoMCParents& resoParents) { - for (auto& part : resoParents) { // loop over all pre-filtered MC particles - if (std::abs(part.pdgCode()) != 9010221) + for (const auto& part : resoParents) { // loop over all pre-filtered MC particles + if (std::abs(part.pdgCode()) != Pdg::f0_980) continue; if (!part.producedByGenerator()) continue; @@ -316,8 +331,8 @@ struct f0980analysis { continue; } bool pass = false; - if ((std::abs(part.daughterPDG1()) == 211 && - std::abs(part.daughterPDG2()) == 211)) { + if ((std::abs(part.daughterPDG1()) == Pdg::PiPlus && + std::abs(part.daughterPDG2()) == Pdg::PiPlus)) { pass = true; } if (!pass) // If we have both decay products From 220ea6cc3696a4a0d0dfc973a1dfa11efa1bcc48 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Thu, 3 Jul 2025 15:38:54 +0900 Subject: [PATCH 26/29] [PWGLF] *Debug* and Change PID select type with "switch" - Reorganised overall - Fixed build error --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 287 ++++++++++------------- 1 file changed, 126 insertions(+), 161 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index 340ae17b7a1..f3a3257b615 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -12,128 +12,114 @@ /// \file f0980analysis.cxx /// \brief f0(980) analysis in pp 13.6 TeV /// \author Yunseul Bae (ybae@cern.ch), Junlee Kim (jikim1290@gmail.com) -/// \since 30/06/2025 +/// \since 01/07/2024 #include "PWGLF/DataModel/LFResonanceTables.h" - #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" - #include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" +#include "Framework/AnalysisHelpers.h" #include "Framework/runDataProcessing.h" #include - #include "TVector2.h" - +#include "Math/LorentzVector.h" +#include "Math/Vector4D.h" +#include #include +using namespace o2; using namespace o2::constants::physics; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod; +using namespace o2::soa; struct f0980analysis { SliceCache cache; - HistogramRegistry histos{ - "histos", - {}, - OutputObjHandlingPolicy::AnalysisObject}; - - Configurable cfgMinPt{"cfgMinPt", 0.15, - "Minimum transverse momentum for charged track"}; - Configurable cfgMaxEta{"cfgMaxEta", 0.8, - "Maximum pseudorapidiy for charged track"}; - Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.5, - "Maximum transverse DCA"}; - Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, - "Maximum longitudinal DCA"}; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Event selections + Configurable cfgMinpT{"cfgMinpT", 0.15, "Minimum transverse momentum for charged track"}; + Configurable cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"}; + Configurable cfgMaxDCArToPVcut{"cfgMaxDCArToPVcut", 0.5, "Maximum transverse DCA"}; + Configurable cfgMaxDCAzToPVcut{"cfgMaxDCAzToPVcut", 2.0, "Maximum longitudinal DCA"}; Configurable cfgMinRap{"cfgMinRap", -0.5, "Minimum rapidity for pair"}; Configurable cfgMaxRap{"cfgMaxRap", 0.5, "Maximum rapidity for pair"}; Configurable cfgFindRT{"cfgFindRT", false, "boolean for RT analysis"}; - // Track selection - Configurable cfgPrimaryTrack{ - "cfgPrimaryTrack", true, - "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgGlobalWoDCATrack{ - "cfgGlobalWoDCATrack", true, - "Global track selection without DCA"}; // kQualityTracks (kTrackType | - // kTPCNCls | kTPCCrossedRows | - // kTPCCrossedRowsOverNCls | - // kTPCChi2NDF | kTPCRefit | - // kITSNCls | kITSChi2NDF | - // kITSRefit | kITSHits) | - // kInAcceptanceTracks (kPtRange | - // kEtaRange) - Configurable cfgPVContributor{ - "cfgPVContributor", true, - "PV contributor track selection"}; // PV Contriuibutor - Configurable cfgGlobalTrack{ - "cfgGlobalTrack", false, - "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; + // Track selections + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | + // kTPCNCls | kTPCCrossedRows | + // kTPCCrossedRowsOverNCls | + // kTPCChi2NDF | kTPCRefit | + // kITSNCls | kITSChi2NDF | + // kITSRefit | kITSHits) | + // kInAcceptanceTracks (kPtRange | + // kEtaRange) + Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 0, "Number of TPC cluster"}; - // PID - Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; // TOF - Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; // TPC + // PID + Configurable cMaxTOFnSigmaPion{"cMaxTOFnSigmaPion", 3.0, "TOF nSigma cut for Pion"}; + Configurable cMaxTPCnSigmaPion{"cMaxTPCnSigmaPion", 5.0, "TPC nSigma cut for Pion"}; Configurable cMaxTPCnSigmaPionWoTOF{"cMaxTPCnSigmaPionWoTOF", 2.0, "TPC nSigma cut without TOF for Pion"}; Configurable nsigmaCutCombinedPion{"nsigmaCutCombinedPion", -999, "Combined nSigma cut for Pion"}; Configurable selectType{"SelectType", 0, "PID selection type"}; - // Axis + // Axis ConfigurableAxis massAxis{"massAxis", {400, 0.2, 2.2}, "Invariant mass axis"}; - ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"}; - ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 95.0, 100.0, 105.0, 110.0}, "Centrality Binning"}; - void init(o2::framework::InitContext&) - { - std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; + ConfigurableAxis pTAxis{"pTAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"}; + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 95.0, 100.0, 105.0, 110.0}, "Centrality Binning"}; + void init (o2::framework::InitContext&) { + std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; + AxisSpec rtAxis = {3, 0, 3}; - AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection + AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection - AxisSpec pidQaAxis = {120, -6, 6}; + AxisSpec pidqaAxis = {60, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0, o2::constants::math::TWOPI}; - AxisSpec epAxis = {10, 0, o2::constants::math::PI}; - AxisSpec epQaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; + AxisSpec phiqaAxis = {72, 0, o2::constants::math::TwoPI}; // Azimuthal angle axis + + AxisSpec epAxis = {10, 0, o2::constants::math::PI}; // Event Plane + AxisSpec epqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec epResAxis = {200, -2, 2}; if (cfgFindRT) { - histos.add("hInvMass_f0980_US", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); - histos.add("hInvMass_f0980_LSpp", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); - histos.add("hInvMass_f0980_LSmm", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, rtAxis, lptAxis}}); + histos.add("hInvMass_f0980_US", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); + histos.add("hInvMass_f0980_LSpp", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); + histos.add("hInvMass_f0980_LSmm", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); + } + else { + histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); + histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); + histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); } - histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); - histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); - histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", - {HistType::kTHnSparseF, {massAxis, ptAxis, centAxis, epAxis}}); + histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epqaAxis}}); histos.add("QA/hEPResAB", "", {HistType::kTH2F, {centAxis, epResAxis}}); - histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, epResAxis}}); histos.add("QA/hEPResBC", "", {HistType::kTH2F, {centAxis, epResAxis}}); - - histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); - histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, pidQaAxis}}); - histos.add("QA/TPC_TOF", "", {HistType::kTH2F, {pidQaAxis, pidQaAxis}}); + histos.add("QA/hEPResAC", "", {HistType::kTH2F, {centAxis, epResAxis}}); histos.add("QA/LTpt", "", {HistType::kTH3F, {pTqaAxis, centAxis, phiqaAxis}}); - histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epQaAxis}}); + + histos.add("QA/Nsigma_TPC", "", {HistType::kTH2F, {pTqaAxis, pidqaAxis}}); + histos.add("QA/Nsigma_TOF", "", {HistType::kTH2F, {pTqaAxis, pidqaAxis}}); + histos.add("QA/Nsigma_TPC_TOF", "", {HistType::kTH2F, {pidqaAxis, pidqaAxis}}); if (doprocessMCLight) { - histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, - {pTqaAxis}); - histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", - HistType::kTH3F, {massAxis, pTqaAxis, centAxis}); + histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F,{pTqaAxis}); + histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", HistType::kTH3F, {massAxis, pTqaAxis, centAxis}); } histos.print(); @@ -141,13 +127,13 @@ struct f0980analysis { double massPi = MassPionCharged; - constexpr float OneThird = 1.0f / 3.0f; - constexpr float PIthird = o2::constants::math::PI * OneThird; - constexpr float TWOPIthird = o2::constants::math::TWOPI * OneThird; + static constexpr float OneThird = 1.0f / 3.0f; + static constexpr float PIthird = o2::constants::math::PI * OneThird; + static constexpr float TWOPIthird = o2::constants::math::TwoPI * OneThird; - int rtIndex(double pairphi, double lhPhi) + int rtIndex(double pairphi, double lhphi) { - double dphi = std::fabs(TVector2::Phi_mpi_pi(lhPhi - pairphi)); + double dphi = std::fabs(TVector2::Phi_mpi_pi(lhphi - pairphi)); if (dphi < PIthird) return 0; @@ -160,9 +146,8 @@ struct f0980analysis { } template - bool selTrack(const TrackType track) - { - if (std::abs(track.pt()) < cfgMinPt) + bool selTrack (const TrackType track) { + if (std::abs(track.pt()) < cfgMinpT) return false; if (std::fabs(track.eta()) > cfgMaxEta) return false; @@ -172,158 +157,138 @@ struct f0980analysis { return false; if (track.tpcNClsFound() < cfgTPCcluster) return false; - if (cfgHasTOF && !track.hasTOF()) + if (cfgPrimaryTrack && !track.isPrimaryTrack()) return false; - if (cfgUseITSRefit && !track.passedITSRefit()) + if (cfgGlobalTrack && !track.isGlobalTrack()) return false; - if (cfgUseTPCRefit && !track.passedTPCRefit()) + if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) return false; if (cfgPVContributor && !track.isPVContributor()) return false; - if (cfgPrimaryTrack && !track.isPrimaryTrack()) + if (cfgUseITSRefit && !track.passedITSRefit()) return false; - if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + if (cfgUseTPCRefit && !track.passedTPCRefit()) return false; - if (cfgGlobalTrack && !track.isGlobalTrack()) + if (cfgHasTOF && !track.hasTOF()) return false; return true; } template - bool selPion(const TrackType track) - { - constexpr int TPCorTOF = 0; - constexpr int TPCOnly = 1; - constexpr int Combined = 2; - constexpr int Run2Like = 3; - - if (selectType == TPCorTOF) { - if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) - return false; - } - if (selectType == TPConly) { - if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) - return false; - } - if (selectType == Combined) { - if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) - return false; - } - if (selectType == Run2Like) { - if (track.hasTOF()) { + bool selPion (const TrackType track) { + switch (selectType) { + case 0: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; - } else if (!track.hasTOF()) { - if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) + case 1: + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) return false; - } + case 2: + if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) + return false; + case 3: + if (track.hasTOF()) { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) + return false; + } + else { + if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) + return false; + } } return true; } template - void fillHistograms(const CollisionType& collision, - const TracksType& dTracks) - { - double lhPt = 0.; - double lhPhi = 0.; - double relPhi = 0.; + void fillHistograms(const CollisionType& collision, const TracksType& dTracks) { + double lhpT = 0.; + double lhphi = 0.; + double relphi = 0.; if (cfgFindRT) { for (const auto& trk : dTracks) { - if (trk.pt() > lhPt) { - lhPt = trk.pt(); - lhPhi = trk.phi(); + if (trk.pt() > lhpT) { + lhpT = trk.pt(); + lhphi = trk.phi(); } } } - histos.fill(HIST("QA/EPhist"), collision.cent(), collision.evtPl()); histos.fill(HIST("QA/hEPResAB"), collision.cent(), collision.evtPlResAB()); - histos.fill(HIST("QA/hEPResAC"), collision.cent(), collision.evtPlResBC()); - histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResAC()); - histos.fill(HIST("QA/LTpt"), lhPt, collision.cent(), lhPhi); + histos.fill(HIST("QA/hEPResBC"), collision.cent(), collision.evtPlResBC()); + histos.fill(HIST("QA/hEPResAC"), collision.cent(), collision.evtPlResAC()); + histos.fill(HIST("QA/LTpt"), lhpT, collision.cent(), lhphi); - ROOT::Math::LorentzVector> pion1, pion2, reco; - for (const auto& [trk1, trk2] : - combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { + ROOT::Math::LorentzVector> pion1, pion2, reco; + for (const auto& [trk1, trk2] : combinations(CombinationsStrictlyUpperIndexPolicy(dTracks, dTracks))) { if (!selTrack(trk1) || !selTrack(trk2)) continue; - // TPC, TOF Nsigma distributions histos.fill(HIST("QA/Nsigma_TPC"), trk1.pt(), trk1.tpcNSigmaPi()); histos.fill(HIST("QA/Nsigma_TOF"), trk1.pt(), trk1.tofNSigmaPi()); - histos.fill(HIST("QA/TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); + histos.fill(HIST("QA/Nsigma_TPC_TOF"), trk1.tpcNSigmaPi(), trk1.tofNSigmaPi()); if (!selPion(trk1) || !selPion(trk2)) continue; - pion1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massPi); - pion2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); + pion1 = ROOT::Math::PxPyPzMVector(trk1.px(), trk1.py(), trk1.pz(), massPi); + pion2 = ROOT::Math::PxPyPzMVector(trk2.px(), trk2.py(), trk2.pz(), massPi); reco = pion1 + pion2; - if (reco.Rapidity() > cfgMaxRap || reco.Rapidity() < cfgMinRap) continue; - relPhi = TVector2::Phi_0_2pi(reco.Phi() - collision.evtPl()); - if (relPhi > o2::constants::math::PI) { - relPhi -= o2::constants::math::PI; + relphi = TVector2::Phi_0_2pi(reco.Phi() - collision.evtPl()); + if (relphi > o2::constants::math::PI) { + relphi -= o2::constants::math::PI; } if (trk1.sign() * trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_US"), reco.M(), reco.Pt(), - collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); + histos.fill(HIST("hInvMass_f0980_US"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_US_EPA"), reco.M(), reco.Pt(), - collision.cent(), relPhi); + histos.fill(HIST("hInvMass_f0980_US_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); if constexpr (IsMC) { - if (std::abs(trk1.pdgCode()) != Pdg::PiPlus || std::abs(trk2.pdgCode()) != Pdg::PiPlus) + if (std::abs(trk1.pdgCode()) != kPiPlus || std::abs(trk2.pdgCode()) != kPiPlus) continue; if (trk1.motherId() != trk2.motherId()) continue; - if (std::abs(trk1.motherPDG()) != Pdg::f0_980) // 9010221 + if (std::abs(trk1.motherPDG()) != 9010221) continue; - histos.fill(HIST("MCL/hpT_f0980_REC"), reco.M(), reco.Pt(), - collision.cent()); + histos.fill(HIST("MCL/hpT_f0980_REC"), reco.M(), reco.Pt(), collision.cent()); } } else if (trk1.sign() > 0 && trk2.sign() > 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSpp"), reco.M(), reco.Pt(), - collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); + histos.fill(HIST("hInvMass_f0980_LSpp"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), reco.M(), reco.Pt(), - collision.cent(), relPhi); + histos.fill(HIST("hInvMass_f0980_LSpp_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); } else if (trk1.sign() < 0 && trk2.sign() < 0) { if (cfgFindRT) { - histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), - collision.cent(), rtIndex(reco.Phi(), lhPhi), lhPt); + histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), - collision.cent(), relPhi); + histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); } } } - void processData(soa::Join::iterator const& collision, - aod::ResoTracks const& resotracks) + void processData(o2::soa::Join::iterator const& collision, + o2::aod::ResoTracks const& resotracks) { fillHistograms(collision, resotracks); } PROCESS_SWITCH(f0980analysis, processData, "Process Event for data", true); void processMCLight( - soa::Join::iterator const& collision, - soa::Join const& resotracks) + o2::soa::Join::iterator const& collision, + o2::soa::Join const& resotracks) { fillHistograms(collision, resotracks); } PROCESS_SWITCH(f0980analysis, processMCLight, "Process Event for MC", false); - void processMCTrue(const aod::ResoMCParents& resoParents) + void processMCTrue(const o2::aod::ResoMCParents& resoParents) { for (const auto& part : resoParents) { // loop over all pre-filtered MC particles - if (std::abs(part.pdgCode()) != Pdg::f0_980) + if (std::abs(part.pdgCode()) != 9010221) continue; if (!part.producedByGenerator()) continue; @@ -331,8 +296,8 @@ struct f0980analysis { continue; } bool pass = false; - if ((std::abs(part.daughterPDG1()) == Pdg::PiPlus && - std::abs(part.daughterPDG2()) == Pdg::PiPlus)) { + if ((std::abs(part.daughterPDG1()) == kPiPlus && + std::abs(part.daughterPDG2()) == kPiPlus)) { pass = true; } if (!pass) // If we have both decay products From f820baff104e6ece41cc957d1fd7da4c747844db Mon Sep 17 00:00:00 2001 From: Yunseul Date: Thu, 3 Jul 2025 16:07:34 +0900 Subject: [PATCH 27/29] [PWGLF] Apply clang-format --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 60 +++++++++++++----------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index f3a3257b615..f92d58f7577 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -15,21 +15,25 @@ /// \since 01/07/2024 #include "PWGLF/DataModel/LFResonanceTables.h" + #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" + #include "CommonConstants/MathConstants.h" #include "CommonConstants/PhysicsConstants.h" #include "DataFormatsParameters/GRPObject.h" #include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" #include "Framework/AnalysisHelpers.h" +#include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include -#include "TVector2.h" + #include "Math/LorentzVector.h" #include "Math/Vector4D.h" +#include "TVector2.h" #include + #include using namespace o2; @@ -42,7 +46,7 @@ using namespace o2::soa; struct f0980analysis { SliceCache cache; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - + // Event selections Configurable cfgMinpT{"cfgMinpT", 0.15, "Minimum transverse momentum for charged track"}; Configurable cfgMaxEta{"cfgMaxEta", 0.8, "Maximum pseudorapidiy for charged track"}; @@ -53,16 +57,16 @@ struct f0980analysis { Configurable cfgFindRT{"cfgFindRT", false, "boolean for RT analysis"}; // Track selections - Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | - // kTPCNCls | kTPCCrossedRows | - // kTPCCrossedRowsOverNCls | - // kTPCChi2NDF | kTPCRefit | - // kITSNCls | kITSChi2NDF | - // kITSRefit | kITSHits) | - // kInAcceptanceTracks (kPtRange | - // kEtaRange) + // kTPCNCls | kTPCCrossedRows | + // kTPCCrossedRowsOverNCls | + // kTPCChi2NDF | kTPCRefit | + // kITSNCls | kITSChi2NDF | + // kITSRefit | kITSHits) | + // kInAcceptanceTracks (kPtRange | + // kEtaRange) Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; @@ -81,17 +85,18 @@ struct f0980analysis { ConfigurableAxis pTAxis{"pTAxis", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 10.0, 13.0, 20.0}, "Transverse momentum Binning"}; ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 95.0, 100.0, 105.0, 110.0}, "Centrality Binning"}; - void init (o2::framework::InitContext&) { + void init(o2::framework::InitContext&) + { std::vector lptBinning = {0, 5.0, 13.0, 20.0, 50.0, 1000.0}; - + AxisSpec rtAxis = {3, 0, 3}; - AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection + AxisSpec lptAxis = {lptBinning}; // Minimum leading hadron pT selection AxisSpec pidqaAxis = {60, -6, 6}; AxisSpec pTqaAxis = {200, 0, 20}; - AxisSpec phiqaAxis = {72, 0, o2::constants::math::TwoPI}; // Azimuthal angle axis + AxisSpec phiqaAxis = {72, 0, o2::constants::math::TwoPI}; // Azimuthal angle axis - AxisSpec epAxis = {10, 0, o2::constants::math::PI}; // Event Plane + AxisSpec epAxis = {10, 0, o2::constants::math::PI}; // Event Plane AxisSpec epqaAxis = {200, -o2::constants::math::PI, o2::constants::math::PI}; AxisSpec epResAxis = {200, -2, 2}; @@ -99,11 +104,10 @@ struct f0980analysis { histos.add("hInvMass_f0980_US", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSpp", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); histos.add("hInvMass_f0980_LSmm", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, rtAxis, lptAxis}}); - } - else { + } else { histos.add("hInvMass_f0980_US_EPA", "unlike invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); histos.add("hInvMass_f0980_LSpp_EPA", "++ invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); - histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); + histos.add("hInvMass_f0980_LSmm_EPA", "-- invariant mass", {HistType::kTHnSparseF, {massAxis, pTAxis, centAxis, epAxis}}); } histos.add("QA/EPhist", "", {HistType::kTH2F, {centAxis, epqaAxis}}); @@ -118,7 +122,7 @@ struct f0980analysis { histos.add("QA/Nsigma_TPC_TOF", "", {HistType::kTH2F, {pidqaAxis, pidqaAxis}}); if (doprocessMCLight) { - histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F,{pTqaAxis}); + histos.add("MCL/hpT_f0980_GEN", "generated f0 signals", HistType::kTH1F, {pTqaAxis}); histos.add("MCL/hpT_f0980_REC", "reconstructed f0 signals", HistType::kTH3F, {massAxis, pTqaAxis, centAxis}); } @@ -146,7 +150,8 @@ struct f0980analysis { } template - bool selTrack (const TrackType track) { + bool selTrack(const TrackType track) + { if (std::abs(track.pt()) < cfgMinpT) return false; if (std::fabs(track.eta()) > cfgMaxEta) @@ -176,7 +181,8 @@ struct f0980analysis { } template - bool selPion (const TrackType track) { + bool selPion(const TrackType track) + { switch (selectType) { case 0: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) @@ -191,8 +197,7 @@ struct f0980analysis { if (track.hasTOF()) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; - } - else { + } else { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) return false; } @@ -201,7 +206,8 @@ struct f0980analysis { } template - void fillHistograms(const CollisionType& collision, const TracksType& dTracks) { + void fillHistograms(const CollisionType& collision, const TracksType& dTracks) + { double lhpT = 0.; double lhphi = 0.; double relphi = 0.; @@ -265,7 +271,7 @@ struct f0980analysis { if (cfgFindRT) { histos.fill(HIST("hInvMass_f0980_LSmm"), reco.M(), reco.Pt(), collision.cent(), rtIndex(reco.Phi(), lhphi), lhpT); } - histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); + histos.fill(HIST("hInvMass_f0980_LSmm_EPA"), reco.M(), reco.Pt(), collision.cent(), relphi); } } } From f89f1821e4bf839062bf4993e78ce39fceadc1b4 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Thu, 3 Jul 2025 16:11:52 +0900 Subject: [PATCH 28/29] [PWGLF] Apply clang-format --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index f92d58f7577..eac70aa392d 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -60,13 +60,13 @@ struct f0980analysis { Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | - // kTPCNCls | kTPCCrossedRows | - // kTPCCrossedRowsOverNCls | - // kTPCChi2NDF | kTPCRefit | - // kITSNCls | kITSChi2NDF | - // kITSRefit | kITSHits) | - // kInAcceptanceTracks (kPtRange | - // kEtaRange) + // kTPCNCls | kTPCCrossedRows | + // kTPCCrossedRowsOverNCls | + // kTPCChi2NDF | kTPCRefit | + // kITSNCls | kITSChi2NDF | + // kITSRefit | kITSHits) | + // kInAcceptanceTracks (kPtRange | + // kEtaRange) Configurable cfgPVContributor{"cfgPVContributor", true, "PV contributor track selection"}; Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; From acb2be8143175efd000fd0fc329217223c3aae13 Mon Sep 17 00:00:00 2001 From: Yunseul Date: Fri, 4 Jul 2025 00:29:04 +0900 Subject: [PATCH 29/29] [PWGLF] Prevent fall-through in switch-case Added missing `break` statements to avoid implicit fall-through warnings. --- PWGLF/Tasks/Resonances/f0980analysis.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGLF/Tasks/Resonances/f0980analysis.cxx b/PWGLF/Tasks/Resonances/f0980analysis.cxx index eac70aa392d..0d489209e93 100644 --- a/PWGLF/Tasks/Resonances/f0980analysis.cxx +++ b/PWGLF/Tasks/Resonances/f0980analysis.cxx @@ -187,12 +187,15 @@ struct f0980analysis { case 0: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) return false; + break; case 1: if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion) return false; + break; case 2: if (track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi() >= nsigmaCutCombinedPion * nsigmaCutCombinedPion) return false; + break; case 3: if (track.hasTOF()) { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPion || std::fabs(track.tofNSigmaPi()) >= cMaxTOFnSigmaPion) @@ -201,6 +204,7 @@ struct f0980analysis { if (std::fabs(track.tpcNSigmaPi()) >= cMaxTPCnSigmaPionWoTOF) return false; } + break; } return true; }