From 44d5041d2c742d4b17844b27913f0af4e69a0d57 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Sun, 27 Jul 2025 20:14:55 +0900 Subject: [PATCH 01/16] [PWGLF] Applied the formatting of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 33 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 83f233d5112..dc70ae02010 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -34,7 +34,6 @@ #include #include -#include "TRandom.h" #include #include #include @@ -102,9 +101,9 @@ struct kstarInOO { Configurable cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"}; // Mixing - ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis cfg_bins_MixMult{"cfg_bins_MixMult", {VARIABLE_WIDTH, 0.0f, 1.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f}, "Mixing bins - z-vertex"}; - Configurable cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 5, "Number of mixed events per event"}; + ConfigurableAxis cfg_bins_MixMult{"cfg_bins_Cent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"}; + Configurable cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 10, "Number of mixed events per event"}; // Pair Configurable cfg_MinvNBins{"cfg_MinvNBins", 300, "Number of bins for Minv axis"}; @@ -112,6 +111,7 @@ struct kstarInOO { Configurable cfg_MinvMax{"cfg_MinvMax", 1.20, "Maximum Minv value"}; // Histogram + Configurable cfg_Event_CutQA{"cfg_Event_CutsQA", false, "Enable Event QA Hists"}; Configurable cfg_Track_CutQA{"cfg_Track_CutQA", false, "Enable Track QA Hists"}; // std::vector eventSelectionBits; @@ -125,6 +125,11 @@ struct kstarInOO { const AxisSpec PIDAxis = {120, -6, 6}; const AxisSpec MinvAxis = {cfg_MinvNBins, cfg_MinvMin, cfg_MinvMax}; + if (cfg_Event_CutQA) { + OOhistos.add("hPosZ_BC", "PosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); + OOhistos.add("hPosZ_AC", "PosZ_AC", kTH1F, {{100, 0.0, 15.0}}); + } + if (cfg_Track_CutQA) { OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); @@ -165,8 +170,8 @@ struct kstarInOO { // For Mixed Event using BinningType = ColumnBinningPolicy; - Partition Kaon_MC = (!cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig)); - Partition Pion_MC = (!cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig)); + Partition Kaon_MC = nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig; + Partition Pion_MC = nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig; double massKa = o2::constants::physics::MassKPlus; double massPi = o2::constants::physics::MassPiMinus; @@ -181,17 +186,16 @@ struct kstarInOO { { if (!event.sel8()) return false; - + if (std::abs(event.posZ()) > cfg_Event_VtxCut) + return false; if (!event.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) return false; if (!event.selection_bit(aod::evsel::kNoSameBunchPileup)) return false; - if (!event.selection_bit(aod::evsel::kNoTimeFrameBorder)) return false; if (!event.selection_bit(aod::evsel::kNoITSROFrameBorder)) return false; - if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard)) return false; @@ -335,9 +339,11 @@ struct kstarInOO { if (!trackPIDKaon(trk1) || !trackPIDPion(trk2)) return {-1.0, -1.0}; - if (trk1.globalIndex() == trk2.globalIndex()) - return {-1.0, -1.0}; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not neede. + if (trk1.globalIndex() == trk2.globalIndex()) { + // std::cout<<"This happens"< cfg_Event_VtxCut) - return; - bool INELgt0 = false; for (const auto& track : tracks) { if (std::fabs(track.eta()) < cfg_Track_MaxEta) { @@ -385,7 +388,6 @@ struct kstarInOO { return; OOhistos.fill(HIST("nEvents_MC"), 1.5); - TrackSlicing_MC(collision, tracks, collision, tracks, false); } // processSameEvents_MC @@ -410,7 +412,6 @@ struct kstarInOO { std::cout << "Processed Mixed Events: " << nEvents_MC_Mix << std::endl; } } - auto goodEv1 = eventSelection(collision1); auto goodEv2 = eventSelection(collision2); OOhistos.fill(HIST("nEvents_MC_Mix"), 0.5); From b596edf6f51dd37b5eb4e3b138849f71bdd3e182 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 13:27:38 +0900 Subject: [PATCH 02/16] [PWGLF] Added the TOF condition of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 70 ++++++++++++++++++---------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index dc70ae02010..d0f54945654 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -76,7 +75,6 @@ struct kstarInOO { // Track Selection // General - Configurable cfg_Track_Selections{"cfg_Track_Selections", "globalTracks", "set track selections"}; Configurable cfg_Track_MinPt{"cfg_Track_MinPt", 0.15, "set track min pT"}; Configurable cfg_Track_MaxEta{"cfg_Track_MaxEta", 0.9, "set track max Eta"}; Configurable cfg_Track_MaxDCArToPVcut{"cfg_Track_MaxDCArToPVcut", 0.5, "Track DCAr cut to PV Maximum"}; @@ -126,23 +124,27 @@ struct kstarInOO { const AxisSpec MinvAxis = {cfg_MinvNBins, cfg_MinvMin, cfg_MinvMax}; if (cfg_Event_CutQA) { - OOhistos.add("hPosZ_BC", "PosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); - OOhistos.add("hPosZ_AC", "PosZ_AC", kTH1F, {{100, 0.0, 15.0}}); + OOhistos.add("hPosZ_BC", "hPosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); + OOhistos.add("hPosZ_AC", "hPosZ_AC", kTH1F, {{100, 0.0, 15.0}}); } if (cfg_Track_CutQA) { - OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); - OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); - OOhistos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}}); - OOhistos.add("h_eta", "h_eta", kTH1F, {axisEta}); - OOhistos.add("h_phi", "h_phi", kTH1F, {axisPhi}); + // OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); + // OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); + // OOhistos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}}); + // OOhistos.add("h_eta", "h_eta", kTH1F, {axisEta}); + // OOhistos.add("h_phi", "h_phi", kTH1F, {axisPhi}); OOhistos.add("QA_nSigma_pion_TPC", "QA_nSigma_pion_TPC", {HistType::kTH2F, {PtAxis, PIDAxis}}); OOhistos.add("QA_nSigma_pion_TOF", "QA_nSigma_pion_TOF", {HistType::kTH2F, {PtAxis, PIDAxis}}); OOhistos.add("QA_pion_TPC_TOF", "QA_pion_TPC_TOF", {HistType::kTH2F, {PIDAxis, PIDAxis}}); - OOhistos.add("QA_nSigma_kaon_TPC", "QA_nSigma_kaon_TPC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_nSigma_kaon_TOF", "QA_nSigma_kaon_TOF", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_kaon_TPC_TOF", "QA_kaon_TPC_TOF", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + OOhistos.add("QA_nSigma_kaon_TPC_BC", "QA_nSigma_kaon_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + OOhistos.add("QA_nSigma_kaon_TOF_BC", "QA_nSigma_kaon_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + OOhistos.add("QA_kaon_TPC_TOF_BC", "QA_kaon_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + + OOhistos.add("QA_nSigma_kaon_TPC_AC", "QA_nSigma_kaon_TPC_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + OOhistos.add("QA_nSigma_kaon_TOF_AC", "QA_nSigma_kaon_TOF_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + OOhistos.add("QA_kaon_TPC_TOF_AC", "QA_kaon_TPC_TOF_AC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); } // MC histos @@ -170,8 +172,8 @@ struct kstarInOO { // For Mixed Event using BinningType = ColumnBinningPolicy; - Partition Kaon_MC = nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig; - Partition Pion_MC = nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig; + Partition Kaon_MC = !cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig); + Partition Pion_MC = !cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig); double massKa = o2::constants::physics::MassKPlus; double massPi = o2::constants::physics::MassPiMinus; @@ -184,6 +186,9 @@ struct kstarInOO { template bool eventSelection(const EventType event) { + if (cfg_Event_CutQA) + OOhistos.fill(HIST("hPosZ_BC"), event.posZ()); + if (!event.sel8()) return false; if (std::abs(event.posZ()) > cfg_Event_VtxCut) @@ -199,6 +204,9 @@ struct kstarInOO { if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard)) return false; + if (cfg_Event_CutQA) + OOhistos.fill(HIST("hPosZ_AC"), event.posZ()); + return true; }; @@ -250,25 +258,31 @@ struct kstarInOO { bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC if (cfg_Track_CutQA) { - OOhistos.fill(HIST("QA_nSigma_kaon_TPC"), candidate.pt(), candidate.tpcNSigmaKa()); - OOhistos.fill(HIST("QA_nSigma_kaon_TOF"), candidate.pt(), candidate.tofNSigmaKa()); - OOhistos.fill(HIST("QA_kaon_TPC_TOF"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); + OOhistos.fill(HIST("QA_nSigma_kaon_TPC_BC"), candidate.pt(), candidate.tpcNSigmaKa()); + OOhistos.fill(HIST("QA_nSigma_kaon_TOF_BC"), candidate.pt(), candidate.tofNSigmaKa()); + OOhistos.fill(HIST("QA_kaon_TPC_TOF_BC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); } if (std::abs(candidate.tpcNSigmaKa()) < cfg_Track_TPCPID_nSig) tpcPIDPassed = true; // TOF if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaKa()) < cfg_Track_TOFPID_nSig) - tofPIDPassed = true; - else + if (std::abs(candidate.tofNSigmaKa()) < cfg_Track_TOFPID_nSig) { tofPIDPassed = true; + } + } else { + tofPIDPassed = true; } // TPC & TOF - if (tpcPIDPassed && tofPIDPassed) + if (tpcPIDPassed && tofPIDPassed) { + if (cfg_Track_CutQA) { + OOhistos.fill(HIST("QA_nSigma_kaon_TPC_AC"), candidate.pt(), candidate.tpcNSigmaKa()); + OOhistos.fill(HIST("QA_nSigma_kaon_TOF_AC"), candidate.pt(), candidate.tofNSigmaKa()); + OOhistos.fill(HIST("QA_kaon_TPC_TOF_AC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); + } return true; - + } return false; } @@ -308,6 +322,12 @@ struct kstarInOO { auto centrality = collision1.centFT0C(); for (auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + if (!trackSelection(trk1) || !trackSelection(trk2)) + continue; + if (!trackPIDKaon(trk1) || !trackPIDPion(trk2)) + continue; + auto [KstarPt, Minv] = minvReconstruction(trk1, trk2); if (Minv < 0) continue; @@ -336,14 +356,14 @@ struct kstarInOO { if (!trackSelection(trk1) || !trackSelection(trk2)) return {-1.0, -1.0}; + if (!trackPIDKaon(trk1) || !trackPIDPion(trk2)) return {-1.0, -1.0}; if (trk1.globalIndex() == trk2.globalIndex()) { - // std::cout<<"This happens"< Date: Tue, 5 Aug 2025 17:27:32 +0900 Subject: [PATCH 03/16] [PWGLF] Fixed about MegaLinter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index d0f54945654..506e44cfc60 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -41,6 +41,7 @@ #include +#include #include #include #include From ca544bf797d0242b69f0789b1c66581a1a25f38e Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 17:31:08 +0900 Subject: [PATCH 04/16] [PWGLF] Fixed about MegaLinter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 506e44cfc60..fdbb407a6ca 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -41,12 +41,12 @@ #include -#include #include #include #include #include #include +#include #include #include #include From 4d684f606a5086df1a9734367a5112946a1b965f Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 18:27:38 +0900 Subject: [PATCH 05/16] [PWGLF] Fixed about O2Linter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 120 +++++++++++++-------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index fdbb407a6ca..b9fbec66052 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -69,49 +69,49 @@ struct kstarInOO { //================================== // Event Selection - Configurable cfg_Event_Selections{"cfg_Event_Selections", "sel8", "choose event selection"}; - Configurable cfg_Event_VtxCut{"cfg_Event_VtxCut", 10.0, "V_z cut selection"}; + Configurable cfgEventSelections{"cfgEventSelections", "sel8", "choose event selection"}; + Configurable cfgEventVtxCut{"cfgEventVtxCut", 10.0, "V_z cut selection"}; - ConfigurableAxis cfg_CentAxis{"cfg_CentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; // Track Selection // General - Configurable cfg_Track_MinPt{"cfg_Track_MinPt", 0.15, "set track min pT"}; - Configurable cfg_Track_MaxEta{"cfg_Track_MaxEta", 0.9, "set track max Eta"}; - Configurable cfg_Track_MaxDCArToPVcut{"cfg_Track_MaxDCArToPVcut", 0.5, "Track DCAr cut to PV Maximum"}; - Configurable cfg_Track_MaxDCAzToPVcut{"cfg_Track_MaxDCAzToPVcut", 2.0, "Track DCAz cut to PV Maximum"}; - Configurable cfg_Track_PrimaryTrack{"cfg_Track_PrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfg_Track_ConnectedToPV{"cfg_Track_ConnectedToPV", true, "PV contributor track selection"}; // PV Contriuibutor - Configurable cfg_Track_GlobalWoDCATrack{"cfg_Track_GlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) + Configurable cfgTrackMinPt{"cfgTrackMinPt", 0.15, "set track min pT"}; + Configurable cfgTrackMaxEta{"cfgTrackMaxEta", 0.9, "set track max Eta"}; + Configurable cfgTrackMaxDCArToPVcut{"cfgTrackMaxDCArToPVcut", 0.5, "Track DCAr cut to PV Maximum"}; + Configurable cfgTrackMaxDCAzToPVcut{"cfgTrackMaxDCAzToPVcut", 2.0, "Track DCAz cut to PV Maximum"}; + Configurable cfgTrackPrimaryTrack{"cfgTrackPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgTrackConnectedToPV{"cfgTrackConnectedToPV", true, "PV contributor track selection"}; // PV Contriuibutor + Configurable cfgTrackGlobalWoDCATrack{"cfgTrackGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) // TPC - Configurable cfg_Track_nFindableTPCClusters{"cfg_Track_FindableTPCClusters", 50, "nFindable TPC Clusters"}; - Configurable cfg_Track_nTPCCrossedRows{"cfg_Track_TPCCrossedRows", 70, "nCrossed TPC Rows"}; - Configurable cfg_Track_nRowsOverFindable{"cfg_Track_RowsOverFindable", 1.2, "nRowsOverFindable TPC CLusters"}; - Configurable cfg_Track_nTPCChi2{"cfg_Track_TPCChi2", 4.0, "nTPC Chi2 per Cluster"}; + Configurable cfgTracknFindableTPCClusters{"cfgTrackFindableTPCClusters", 50, "nFindable TPC Clusters"}; + Configurable cfgTracknTPCCrossedRows{"cfgTrackTPCCrossedRows", 70, "nCrossed TPC Rows"}; + Configurable cfgTracknRowsOverFindable{"cfgTrackRowsOverFindable", 1.2, "nRowsOverFindable TPC CLusters"}; + Configurable cfgTracknTPCChi2{"cfgTrackTPCChi2", 4.0, "nTPC Chi2 per Cluster"}; - // ITS - Configurable cfg_Track_nITSChi2{"cfg_Track_ITSChi2", 36.0, "nITS Chi2 per Cluster"}; + // IT + Configurable cfgTracknITSChi2{"cfgTrackITSChi2", 36.0, "nITS Chi2 per Cluster"}; // PID - Configurable cfg_Track_TPCPID{"cfg_Track_TPCPID", true, "Enables TPC PID"}; - Configurable cfg_Track_TOFPID{"cfg_Track_TOFPID", true, "Enables TOF PID"}; - Configurable cfg_Track_TPCPID_nSig{"cfg_Track_TPCPID_nSig", 4.0, "nTPC PID sigma"}; - Configurable cfg_Track_TOFPID_nSig{"cfg_Track_TOFPID_nSig", 4.0, "nTOF PID sigma"}; + Configurable cfgTrackTPCPID{"cfgTrackTPCPID", true, "Enables TPC PID"}; + Configurable cfgTrackTOFPID{"cfgTrackTOFPID", true, "Enables TOF PID"}; + Configurable cfgTrackTPCPIDnSig{"cfgTrackTPCPIDnSig", 4.0, "nTPC PID sigma"}; + Configurable cfgTrackTOFPID_nSig{"cfgTrackTOFPIDnSig", 4.0, "nTOF PID sigma"}; Configurable cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"}; // Mixing - ConfigurableAxis cfg_bins_MixMult{"cfg_bins_Cent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; - ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"}; - Configurable cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 10, "Number of mixed events per event"}; + ConfigurableAxis cfgBinsMixMult{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfgBinsMixVtx{"cfgBinsMixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"}; + Configurable cfgMixNMixedEvents{"cfgMixNMixedEvents", 10, "Number of mixed events per event"}; // Pair - Configurable cfg_MinvNBins{"cfg_MinvNBins", 300, "Number of bins for Minv axis"}; - Configurable cfg_MinvMin{"cfg_MinvMin", 0.60, "Minimum Minv value"}; - Configurable cfg_MinvMax{"cfg_MinvMax", 1.20, "Maximum Minv value"}; + Configurable cfgMinvNBins{"cfgMinvNBins", 300, "Number of bins for Minv axis"}; + Configurable cfgMinvMin{"cfgMinvMin", 0.60, "Minimum Minv value"}; + Configurable cfgMinvMax{"cfgMinvMax", 1.20, "Maximum Minv value"}; // Histogram - Configurable cfg_Event_CutQA{"cfg_Event_CutsQA", false, "Enable Event QA Hists"}; - Configurable cfg_Track_CutQA{"cfg_Track_CutQA", false, "Enable Track QA Hists"}; + Configurable cfgEventCutQA{"cfgEventCutsQA", false, "Enable Event QA Hists"}; + Configurable cfgTrackCutQA{"cfgTrackCutQA", false, "Enable Track QA Hists"}; // std::vector eventSelectionBits; @@ -122,14 +122,14 @@ struct kstarInOO { const AxisSpec axisPhi{200, -1, +7, "#phi"}; const AxisSpec PtAxis = {200, 0, 20.0}; const AxisSpec PIDAxis = {120, -6, 6}; - const AxisSpec MinvAxis = {cfg_MinvNBins, cfg_MinvMin, cfg_MinvMax}; + const AxisSpec MinvAxis = {cfgMinvNBins, cfgMinvMin, cfgMinvMax}; - if (cfg_Event_CutQA) { + if (cfgEventCutQA) { OOhistos.add("hPosZ_BC", "hPosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); OOhistos.add("hPosZ_AC", "hPosZ_AC", kTH1F, {{100, 0.0, 15.0}}); } - if (cfg_Track_CutQA) { + if (cfgTrackCutQA) { // OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); // OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); // OOhistos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}}); @@ -149,10 +149,10 @@ struct kstarInOO { } // MC histos - OOhistos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfg_CentAxis, PtAxis, MinvAxis}); - OOhistos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfg_CentAxis, PtAxis, MinvAxis}); - OOhistos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfg_CentAxis, PtAxis, MinvAxis}); - OOhistos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfg_CentAxis, PtAxis, MinvAxis}); + OOhistos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + OOhistos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + OOhistos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + OOhistos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); // OOhistos.add("hMC_pt_Pion", "hMC_pt_Pion", kTH1F, {PtAxis}); // OOhistos.add("hMC_pt_Kaon", "hMC_pt_Kaon", kTH1F, {PtAxis}); @@ -173,8 +173,8 @@ struct kstarInOO { // For Mixed Event using BinningType = ColumnBinningPolicy; - Partition Kaon_MC = !cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig); - Partition Pion_MC = !cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig); + Partition Kaon_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); + Partition Pion_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); double massKa = o2::constants::physics::MassKPlus; double massPi = o2::constants::physics::MassPiMinus; @@ -192,7 +192,7 @@ struct kstarInOO { if (!event.sel8()) return false; - if (std::abs(event.posZ()) > cfg_Event_VtxCut) + if (std::abs(event.posZ()) > cfgEventVtxCut) return false; if (!event.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) return false; @@ -205,7 +205,7 @@ struct kstarInOO { if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard)) return false; - if (cfg_Event_CutQA) + if (cfgEventCutQA) OOhistos.fill(HIST("hPosZ_AC"), event.posZ()); return true; @@ -214,40 +214,40 @@ struct kstarInOO { template bool trackSelection(const TracksType track) { - if (track.pt() < cfg_Track_MinPt) + if (track.pt() < cfgTrackMinPt) return false; - if (std::abs(track.eta()) > cfg_Track_MaxEta) + if (std::abs(track.eta()) > cfgTrackMaxEta) return false; - if (std::abs(track.dcaXY()) > cfg_Track_MaxDCArToPVcut) + if (std::abs(track.dcaXY()) > cfgTrackMaxDCArToPVcut) return false; - if (std::abs(track.dcaZ()) > cfg_Track_MaxDCAzToPVcut) + if (std::abs(track.dcaZ()) > cfgTrackMaxDCAzToPVcut) return false; - if (cfg_Track_PrimaryTrack && !track.isPrimaryTrack()) + if (cfgTrackPrimaryTrack && !track.isPrimaryTrack()) return false; - if (cfg_Track_GlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + if (cfgTrackGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) return false; - if (track.tpcNClsFindable() < cfg_Track_nFindableTPCClusters) + if (track.tpcNClsFindable() < cfgTracknFindableTPCClusters) return false; - if (track.tpcNClsCrossedRows() < cfg_Track_nTPCCrossedRows) + if (track.tpcNClsCrossedRows() < cfgTracknTPCCrossedRows) return false; - if (track.tpcCrossedRowsOverFindableCls() > cfg_Track_nRowsOverFindable) + if (track.tpcCrossedRowsOverFindableCls() > cfgTracknRowsOverFindable) return false; - if (track.tpcChi2NCl() > cfg_Track_nTPCChi2) + if (track.tpcChi2NCl() > cfgTracknTPCChi2) return false; - if (track.itsChi2NCl() > cfg_Track_nITSChi2) + if (track.itsChi2NCl() > cfgTracknITSChi2) return false; - if (cfg_Track_ConnectedToPV && !track.isPVContributor()) + if (cfgTrackConnectedToPV && !track.isPVContributor()) return false; return true; @@ -263,12 +263,12 @@ struct kstarInOO { OOhistos.fill(HIST("QA_nSigma_kaon_TOF_BC"), candidate.pt(), candidate.tofNSigmaKa()); OOhistos.fill(HIST("QA_kaon_TPC_TOF_BC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); } - if (std::abs(candidate.tpcNSigmaKa()) < cfg_Track_TPCPID_nSig) + if (std::abs(candidate.tpcNSigmaKa()) < cfgTrackTPCPIDnSig) tpcPIDPassed = true; // TOF if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaKa()) < cfg_Track_TOFPID_nSig) { + if (std::abs(candidate.tofNSigmaKa()) < cfgTrackTOFPID_nSig) { tofPIDPassed = true; } } else { @@ -277,7 +277,7 @@ struct kstarInOO { // TPC & TOF if (tpcPIDPassed && tofPIDPassed) { - if (cfg_Track_CutQA) { + if (cfgTrackCutQA) { OOhistos.fill(HIST("QA_nSigma_kaon_TPC_AC"), candidate.pt(), candidate.tpcNSigmaKa()); OOhistos.fill(HIST("QA_nSigma_kaon_TOF_AC"), candidate.pt(), candidate.tofNSigmaKa()); OOhistos.fill(HIST("QA_kaon_TPC_TOF_AC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); @@ -298,11 +298,11 @@ struct kstarInOO { OOhistos.fill(HIST("QA_pion_TPC_TOF"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); } - if (std::abs(candidate.tpcNSigmaPi()) < cfg_Track_TPCPID_nSig) + if (std::abs(candidate.tpcNSigmaPi()) < cfgTrackTPCPIDnSig) tpcPIDPassed = true; if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cfg_Track_TOFPID_nSig) + if (std::abs(candidate.tofNSigmaPi()) < cfgTrackTOFPIDnSig) tofPIDPassed = true; else tofPIDPassed = true; @@ -369,7 +369,7 @@ struct kstarInOO { lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi); lResonance = lDecayDaughter1 + lDecayDaughter2; - if (std::abs(lResonance.Eta()) > cfg_Track_MaxEta) + if (std::abs(lResonance.Eta()) > cfgTrackMaxEta) return {-1.0, -1.0}; return {lResonance.Pt(), lResonance.M()}; @@ -400,7 +400,7 @@ struct kstarInOO { bool INELgt0 = false; for (const auto& track : tracks) { - if (std::fabs(track.eta()) < cfg_Track_MaxEta) { + if (std::fabs(track.eta()) < cfgTrackMaxEta) { INELgt0 = true; break; } @@ -424,8 +424,8 @@ struct kstarInOO { void processMixedEvent_MC(EventCandidates const& collisions, TrackCandidates_MC const& tracks, aod::McParticles const&) { auto tracksTuple = std::make_tuple(tracks); - BinningType colBinning{{cfg_bins_MixVtx, cfg_bins_MixMult}, true}; // true is for 'ignore overflows' (true by default) - SameKindPair pairs{colBinning, cfg_Mix_NMixedEvents, -1, collisions, tracksTuple, &cache}; + BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true}; // true is for 'ignore overflows' (true by default) + SameKindPair pairs{colBinning, cfgMixNMixedEvents, -1, collisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { if (cDebugLevel > 0) { nEvents_MC_Mix++; From 50e8ae824bfc9806a4379a5c3fef8fb7035086d0 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 18:33:19 +0900 Subject: [PATCH 06/16] [PWGLF] Fixed about O2Linter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 98 ++++++++++++++-------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index b9fbec66052..f1bfbc6645b 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -41,12 +41,12 @@ #include +#include #include #include #include #include #include -#include #include #include #include @@ -60,7 +60,7 @@ using namespace o2::framework::expressions; struct kstarInOO { SliceCache cache; Preslice perCollision = aod::track::collisionId; - HistogramRegistry OOhistos{"OOhistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; //================================== //|| @@ -125,42 +125,42 @@ struct kstarInOO { const AxisSpec MinvAxis = {cfgMinvNBins, cfgMinvMin, cfgMinvMax}; if (cfgEventCutQA) { - OOhistos.add("hPosZ_BC", "hPosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); - OOhistos.add("hPosZ_AC", "hPosZ_AC", kTH1F, {{100, 0.0, 15.0}}); + histos.add("hPosZ_BC", "hPosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); + histos.add("hPosZ_AC", "hPosZ_AC", kTH1F, {{100, 0.0, 15.0}}); } if (cfgTrackCutQA) { - // OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); - // OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); - // OOhistos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}}); - // OOhistos.add("h_eta", "h_eta", kTH1F, {axisEta}); - // OOhistos.add("h_phi", "h_phi", kTH1F, {axisPhi}); - - OOhistos.add("QA_nSigma_pion_TPC", "QA_nSigma_pion_TPC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_nSigma_pion_TOF", "QA_nSigma_pion_TOF", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_pion_TPC_TOF", "QA_pion_TPC_TOF", {HistType::kTH2F, {PIDAxis, PIDAxis}}); - OOhistos.add("QA_nSigma_kaon_TPC_BC", "QA_nSigma_kaon_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_nSigma_kaon_TOF_BC", "QA_nSigma_kaon_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_kaon_TPC_TOF_BC", "QA_kaon_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); - - OOhistos.add("QA_nSigma_kaon_TPC_AC", "QA_nSigma_kaon_TPC_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_nSigma_kaon_TOF_AC", "QA_nSigma_kaon_TOF_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - OOhistos.add("QA_kaon_TPC_TOF_AC", "QA_kaon_TPC_TOF_AC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + // histos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); + // histos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); + // histos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}}); + // histos.add("h_eta", "h_eta", kTH1F, {axisEta}); + // histos.add("h_phi", "h_phi", kTH1F, {axisPhi}); + + histos.add("QA_nSigma_pion_TPC", "QA_nSigma_pion_TPC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_nSigma_pion_TOF", "QA_nSigma_pion_TOF", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_pion_TPC_TOF", "QA_pion_TPC_TOF", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_kaon_TPC_BC", "QA_nSigma_kaon_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_nSigma_kaon_TOF_BC", "QA_nSigma_kaon_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_kaon_TPC_TOF_BC", "QA_kaon_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + + histos.add("QA_nSigma_kaon_TPC_AC", "QA_nSigma_kaon_TPC_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_nSigma_kaon_TOF_AC", "QA_nSigma_kaon_TOF_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_kaon_TPC_TOF_AC", "QA_kaon_TPC_TOF_AC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); } // MC histos - OOhistos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - OOhistos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - OOhistos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - OOhistos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + histos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + histos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + histos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); + histos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - // OOhistos.add("hMC_pt_Pion", "hMC_pt_Pion", kTH1F, {PtAxis}); - // OOhistos.add("hMC_pt_Kaon", "hMC_pt_Kaon", kTH1F, {PtAxis}); - // OOhistos.add("hMC_pt_Proton", "hMC_pt_Proton", kTH1F, {PtAxis}); + // histos.add("hMC_pt_Pion", "hMC_pt_Pion", kTH1F, {PtAxis}); + // histos.add("hMC_pt_Kaon", "hMC_pt_Kaon", kTH1F, {PtAxis}); + // histos.add("hMC_pt_Proton", "hMC_pt_Proton", kTH1F, {PtAxis}); // Event Histograms - OOhistos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}}); - OOhistos.add("nEvents_MC_Mix", "nEvents_MC_Mix", kTH1F, {{4, 0.0, 4.0}}); + histos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}}); + histos.add("nEvents_MC_Mix", "nEvents_MC_Mix", kTH1F, {{4, 0.0, 4.0}}); } // end of init @@ -188,7 +188,7 @@ struct kstarInOO { bool eventSelection(const EventType event) { if (cfg_Event_CutQA) - OOhistos.fill(HIST("hPosZ_BC"), event.posZ()); + histos.fill(HIST("hPosZ_BC"), event.posZ()); if (!event.sel8()) return false; @@ -206,7 +206,7 @@ struct kstarInOO { return false; if (cfgEventCutQA) - OOhistos.fill(HIST("hPosZ_AC"), event.posZ()); + histos.fill(HIST("hPosZ_AC"), event.posZ()); return true; }; @@ -259,9 +259,9 @@ struct kstarInOO { bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC if (cfg_Track_CutQA) { - OOhistos.fill(HIST("QA_nSigma_kaon_TPC_BC"), candidate.pt(), candidate.tpcNSigmaKa()); - OOhistos.fill(HIST("QA_nSigma_kaon_TOF_BC"), candidate.pt(), candidate.tofNSigmaKa()); - OOhistos.fill(HIST("QA_kaon_TPC_TOF_BC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); + histos.fill(HIST("QA_nSigma_kaon_TPC_BC"), candidate.pt(), candidate.tpcNSigmaKa()); + histos.fill(HIST("QA_nSigma_kaon_TOF_BC"), candidate.pt(), candidate.tofNSigmaKa()); + histos.fill(HIST("QA_kaon_TPC_TOF_BC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); } if (std::abs(candidate.tpcNSigmaKa()) < cfgTrackTPCPIDnSig) tpcPIDPassed = true; @@ -278,9 +278,9 @@ struct kstarInOO { // TPC & TOF if (tpcPIDPassed && tofPIDPassed) { if (cfgTrackCutQA) { - OOhistos.fill(HIST("QA_nSigma_kaon_TPC_AC"), candidate.pt(), candidate.tpcNSigmaKa()); - OOhistos.fill(HIST("QA_nSigma_kaon_TOF_AC"), candidate.pt(), candidate.tofNSigmaKa()); - OOhistos.fill(HIST("QA_kaon_TPC_TOF_AC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); + histos.fill(HIST("QA_nSigma_kaon_TPC_AC"), candidate.pt(), candidate.tpcNSigmaKa()); + histos.fill(HIST("QA_nSigma_kaon_TOF_AC"), candidate.pt(), candidate.tofNSigmaKa()); + histos.fill(HIST("QA_kaon_TPC_TOF_AC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); } return true; } @@ -293,9 +293,9 @@ struct kstarInOO { bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC if (cfg_Track_CutQA) { - OOhistos.fill(HIST("QA_nSigma_pion_TPC"), candidate.pt(), candidate.tpcNSigmaPi()); - OOhistos.fill(HIST("QA_nSigma_pion_TOF"), candidate.pt(), candidate.tofNSigmaPi()); - OOhistos.fill(HIST("QA_pion_TPC_TOF"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); + histos.fill(HIST("QA_nSigma_pion_TPC"), candidate.pt(), candidate.tpcNSigmaPi()); + histos.fill(HIST("QA_nSigma_pion_TOF"), candidate.pt(), candidate.tofNSigmaPi()); + histos.fill(HIST("QA_pion_TPC_TOF"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); } if (std::abs(candidate.tpcNSigmaPi()) < cfgTrackTPCPIDnSig) @@ -336,15 +336,15 @@ struct kstarInOO { double conjugate = trk1.sign() * trk2.sign(); if (!IsMix) { if (conjugate < 0) { - OOhistos.fill(HIST("hMC_USS"), centrality, KstarPt, Minv); + histos.fill(HIST("hMC_USS"), centrality, KstarPt, Minv); } else if (conjugate > 0) { - OOhistos.fill(HIST("hMC_LSS"), centrality, KstarPt, Minv); + histos.fill(HIST("hMC_LSS"), centrality, KstarPt, Minv); } } else { if (conjugate < 0) { - OOhistos.fill(HIST("hMC_USS_Mix"), centrality, KstarPt, Minv); + histos.fill(HIST("hMC_USS_Mix"), centrality, KstarPt, Minv); } else if (conjugate > 0) { - OOhistos.fill(HIST("hMC_LSS_Mix"), centrality, KstarPt, Minv); + histos.fill(HIST("hMC_LSS_Mix"), centrality, KstarPt, Minv); } } } @@ -387,14 +387,14 @@ struct kstarInOO { if (cDebugLevel > 0) { nEvents_MC++; if ((nEvents_MC + 1) % 10000 == 0) { - double histmem = OOhistos.getSize(); + double histmem = histos.getSize(); std::cout << histmem << std::endl; std::cout << "process_SameEvent_MC: " << nEvents_MC << std::endl; } } auto goodEv = eventSelection(collision); - OOhistos.fill(HIST("nEvents_MC"), 0.5); + histos.fill(HIST("nEvents_MC"), 0.5); if (!goodEv) return; @@ -408,7 +408,7 @@ struct kstarInOO { if (!INELgt0) return; - OOhistos.fill(HIST("nEvents_MC"), 1.5); + histos.fill(HIST("nEvents_MC"), 1.5); TrackSlicing_MC(collision, tracks, collision, tracks, false); } // processSameEvents_MC @@ -435,12 +435,12 @@ struct kstarInOO { } auto goodEv1 = eventSelection(collision1); auto goodEv2 = eventSelection(collision2); - OOhistos.fill(HIST("nEvents_MC_Mix"), 0.5); + histos.fill(HIST("nEvents_MC_Mix"), 0.5); if (!goodEv1 || !goodEv2) continue; - OOhistos.fill(HIST("nEvents_MC_Mix"), 1.5); + histos.fill(HIST("nEvents_MC_Mix"), 1.5); TrackSlicing_MC(collision1, tracks1, collision2, tracks2, true); } // mixing From cd9206b414061a708ebc91e2a2d8fa4f731e609c Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 18:46:29 +0900 Subject: [PATCH 07/16] [PWGLF] Fixed about O2Linter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index f1bfbc6645b..2795875ee20 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -167,14 +167,14 @@ struct kstarInOO { using EventCandidates = soa::Join; //, aod::CentFT0Ms, aod::CentFT0As using TrackCandidates = soa::Join; - using TrackCandidates_MC = soa::Join; // For Mixed Event using BinningType = ColumnBinningPolicy; - Partition Kaon_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); - Partition Pion_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); + Partition Kaon_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); + Partition Pion_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); double massKa = o2::constants::physics::MassKPlus; double massPi = o2::constants::physics::MassPiMinus; @@ -381,15 +381,15 @@ struct kstarInOO { //| //======================================================= - int nEvents_MC = 0; - void processSameEvent_MC(EventCandidates::iterator const& collision, TrackCandidates_MC const& tracks, aod::McParticles const&) + int nEventsMC = 0; + void processSameEventMC(EventCandidates::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&) { if (cDebugLevel > 0) { - nEvents_MC++; - if ((nEvents_MC + 1) % 10000 == 0) { + nEventsMC++; + if ((nEventsMC + 1) % 10000 == 0) { double histmem = histos.getSize(); std::cout << histmem << std::endl; - std::cout << "process_SameEvent_MC: " << nEvents_MC << std::endl; + std::cout << "process_SameEvent_MC: " << nEventsMC << std::endl; } } @@ -412,7 +412,7 @@ struct kstarInOO { TrackSlicing_MC(collision, tracks, collision, tracks, false); } // processSameEvents_MC - PROCESS_SWITCH(kstarInOO, processSameEvent_MC, "process Same Event MC", true); + PROCESS_SWITCH(kstarInOO, processSameEventMC, "process Same Event MC", true); //======================================================= //| @@ -420,17 +420,17 @@ struct kstarInOO { //| //======================================================= - int nEvents_MC_Mix = 0; - void processMixedEvent_MC(EventCandidates const& collisions, TrackCandidates_MC const& tracks, aod::McParticles const&) + int nEventsMCMix = 0; + void processMixedEventMC(EventCandidates const& collisions, TrackCandidatesMC const& tracks, aod::McParticles const&) { auto tracksTuple = std::make_tuple(tracks); BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true}; // true is for 'ignore overflows' (true by default) - SameKindPair pairs{colBinning, cfgMixNMixedEvents, -1, collisions, tracksTuple, &cache}; + SameKindPair pairs{colBinning, cfgMixNMixedEvents, -1, collisions, tracksTuple, &cache}; for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { if (cDebugLevel > 0) { - nEvents_MC_Mix++; - if ((nEvents_MC_Mix + 1) % 10000 == 0) { - std::cout << "Processed Mixed Events: " << nEvents_MC_Mix << std::endl; + nEventsMCMix++; + if ((nEventsMCMix + 1) % 10000 == 0) { + std::cout << "Processed Mixed Events: " << nEventsMCMix << std::endl; } } auto goodEv1 = eventSelection(collision1); @@ -445,7 +445,7 @@ struct kstarInOO { TrackSlicing_MC(collision1, tracks1, collision2, tracks2, true); } // mixing } // processMixedEvent_MC - PROCESS_SWITCH(kstarInOO, processMixedEvent_MC, "process Mixed Event MC", false); + PROCESS_SWITCH(kstarInOO, processMixedEventMC, "process Mixed Event MC", false); void processEventsDummy(EventCandidates::iterator const&, TrackCandidates const&) { From 38ceefc5056479bbf424eacecbd95e58826540f2 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 19:23:13 +0900 Subject: [PATCH 08/16] [PWGLF] Fixed about O2Linter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 2795875ee20..1dddf03ee89 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -41,12 +41,12 @@ #include -#include #include #include #include #include #include +#include #include #include #include @@ -69,7 +69,6 @@ struct kstarInOO { //================================== // Event Selection - Configurable cfgEventSelections{"cfgEventSelections", "sel8", "choose event selection"}; Configurable cfgEventVtxCut{"cfgEventVtxCut", 10.0, "V_z cut selection"}; ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; @@ -96,7 +95,7 @@ struct kstarInOO { Configurable cfgTrackTPCPID{"cfgTrackTPCPID", true, "Enables TPC PID"}; Configurable cfgTrackTOFPID{"cfgTrackTOFPID", true, "Enables TOF PID"}; Configurable cfgTrackTPCPIDnSig{"cfgTrackTPCPIDnSig", 4.0, "nTPC PID sigma"}; - Configurable cfgTrackTOFPID_nSig{"cfgTrackTOFPIDnSig", 4.0, "nTOF PID sigma"}; + Configurable cfgTrackTOFPIDnSig{"cfgTrackTOFPIDnSig", 4.0, "nTOF PID sigma"}; Configurable cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"}; // Mixing @@ -168,7 +167,7 @@ struct kstarInOO { using TrackCandidates = soa::Join; using TrackCandidatesMC = soa::Join; + aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi>; // For Mixed Event using BinningType = ColumnBinningPolicy; @@ -187,7 +186,7 @@ struct kstarInOO { template bool eventSelection(const EventType event) { - if (cfg_Event_CutQA) + if (cfgEventCutQA) histos.fill(HIST("hPosZ_BC"), event.posZ()); if (!event.sel8()) @@ -258,7 +257,7 @@ struct kstarInOO { { bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC - if (cfg_Track_CutQA) { + if (cfgTrackCutQA) { histos.fill(HIST("QA_nSigma_kaon_TPC_BC"), candidate.pt(), candidate.tpcNSigmaKa()); histos.fill(HIST("QA_nSigma_kaon_TOF_BC"), candidate.pt(), candidate.tofNSigmaKa()); histos.fill(HIST("QA_kaon_TPC_TOF_BC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); @@ -268,7 +267,7 @@ struct kstarInOO { // TOF if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaKa()) < cfgTrackTOFPID_nSig) { + if (std::abs(candidate.tofNSigmaKa()) < cfgTrackTOFPIDnSig) { tofPIDPassed = true; } } else { @@ -292,7 +291,7 @@ struct kstarInOO { { bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC - if (cfg_Track_CutQA) { + if (cfgTrackCutQA) { histos.fill(HIST("QA_nSigma_pion_TPC"), candidate.pt(), candidate.tpcNSigmaPi()); histos.fill(HIST("QA_nSigma_pion_TOF"), candidate.pt(), candidate.tofNSigmaPi()); histos.fill(HIST("QA_pion_TPC_TOF"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); From fa26206c4781ff593d91d9f0e0fe4900494acefb Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 19:28:10 +0900 Subject: [PATCH 09/16] [PWGLF] Fixed about O2Linter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/CMakeLists.txt | 4 ++-- PWGLF/Tasks/Resonances/kstarInOO.cxx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index a1fea7646a2..b2f78d88669 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -229,7 +229,7 @@ o2physics_add_dpl_workflow(double-resonance-scan PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(kstar-in-oo +o2physics_add_dpl_workflow(kstarinoo SOURCES kstarInOO.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) @@ -237,4 +237,4 @@ o2physics_add_dpl_workflow(kstar-in-oo o2physics_add_dpl_workflow(phioo SOURCES phiOO.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) \ No newline at end of file + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 1dddf03ee89..9e33cacc1c9 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -41,12 +41,12 @@ #include +#include #include #include #include #include #include -#include #include #include #include @@ -167,7 +167,7 @@ struct kstarInOO { using TrackCandidates = soa::Join; using TrackCandidatesMC = soa::Join; + aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi>; // For Mixed Event using BinningType = ColumnBinningPolicy; @@ -321,7 +321,7 @@ struct kstarInOO { auto tracks2 = Pion_MC->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); auto centrality = collision1.centFT0C(); - for (auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + for (const auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!trackSelection(trk1) || !trackSelection(trk2)) continue; From 0ae4bada511dd1754594a1388cd10361d2a9fae7 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 5 Aug 2025 19:30:28 +0900 Subject: [PATCH 10/16] [PWGLF] Fixed about O2Linter issue of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 9e33cacc1c9..37aac31fd91 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -41,12 +41,12 @@ #include -#include #include #include #include #include #include +#include #include #include #include @@ -167,7 +167,7 @@ struct kstarInOO { using TrackCandidates = soa::Join; using TrackCandidatesMC = soa::Join; + aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPi, aod::pidTOFFullPi>; // For Mixed Event using BinningType = ColumnBinningPolicy; From 9f42c341c3187996b74722b7d296b116a296cdc6 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Wed, 6 Aug 2025 14:23:27 +0900 Subject: [PATCH 11/16] [PWGLF] Fixed about pion in TPC selection of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 37aac31fd91..b89aa40367a 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -135,9 +135,14 @@ struct kstarInOO { // histos.add("h_eta", "h_eta", kTH1F, {axisEta}); // histos.add("h_phi", "h_phi", kTH1F, {axisPhi}); - histos.add("QA_nSigma_pion_TPC", "QA_nSigma_pion_TPC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_nSigma_pion_TOF", "QA_nSigma_pion_TOF", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_pion_TPC_TOF", "QA_pion_TPC_TOF", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_pion_TPC_BC", "QA_nSigma_pion_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_nSigma_pion_TOF_BC", "QA_nSigma_pion_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_pion_TPC_TOF_BC", "QA_pion_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + + histos.add("QA_nSigma_pion_TPC_AC", "QA_nSigma_pion_TPC_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_nSigma_pion_TOF_AC", "QA_nSigma_pion_TOF_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); + histos.add("QA_pion_TPC_TOF_AC", "QA_pion_TPC_TOF_AC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_kaon_TPC_BC", "QA_nSigma_kaon_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); histos.add("QA_nSigma_kaon_TOF_BC", "QA_nSigma_kaon_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); histos.add("QA_kaon_TPC_TOF_BC", "QA_kaon_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); @@ -292,25 +297,30 @@ struct kstarInOO { bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC if (cfgTrackCutQA) { - histos.fill(HIST("QA_nSigma_pion_TPC"), candidate.pt(), candidate.tpcNSigmaPi()); - histos.fill(HIST("QA_nSigma_pion_TOF"), candidate.pt(), candidate.tofNSigmaPi()); - histos.fill(HIST("QA_pion_TPC_TOF"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); + histos.fill(HIST("QA_nSigma_pion_TPC_BC"), candidate.pt(), candidate.tpcNSigmaPi()); + histos.fill(HIST("QA_nSigma_pion_TOF_BC"), candidate.pt(), candidate.tofNSigmaPi()); + histos.fill(HIST("QA_pion_TPC_TOF_BC"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); } - if (std::abs(candidate.tpcNSigmaPi()) < cfgTrackTPCPIDnSig) tpcPIDPassed = true; if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cfgTrackTOFPIDnSig) - tofPIDPassed = true; - else + if (std::abs(candidate.tofNSigmaPi()) < cfgTrackTOFPIDnSig) { tofPIDPassed = true; + } + } else { + tofPIDPassed = true; } // TPC & TOF - if (tpcPIDPassed && tofPIDPassed) + if (tpcPIDPassed && tofPIDPassed) { + if (cfgTrackCutQA) { + histos.fill(HIST("QA_nSigma_pion_TPC_AC"), candidate.pt(), candidate.tpcNSigmaPi()); + histos.fill(HIST("QA_nSigma_pion_TOF_AC"), candidate.pt(), candidate.tofNSigmaPi()); + histos.fill(HIST("QA_pion_TPC_TOF_AC"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); + } return true; - + } return false; } From 848343a0246a1b9a3e746132c9357553a039c05e Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Wed, 6 Aug 2025 14:38:31 +0900 Subject: [PATCH 12/16] [PWGLF] Fixed about o2linter errors of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 46 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index b89aa40367a..a182a514e48 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -119,9 +119,9 @@ struct kstarInOO { // HISTOGRAMS const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; const AxisSpec axisPhi{200, -1, +7, "#phi"}; - const AxisSpec PtAxis = {200, 0, 20.0}; - const AxisSpec PIDAxis = {120, -6, 6}; - const AxisSpec MinvAxis = {cfgMinvNBins, cfgMinvMin, cfgMinvMax}; + const AxisSpec ptAxis = {200, 0, 20.0}; + const AxisSpec pidAxis = {120, -6, 6}; + const AxisSpec minvAxis = {cfgMinvNBins, cfgMinvMin, cfgMinvMax}; if (cfgEventCutQA) { histos.add("hPosZ_BC", "hPosZ_Bc", kTH1F, {{100, 0.0, 15.0}}); @@ -135,32 +135,32 @@ struct kstarInOO { // histos.add("h_eta", "h_eta", kTH1F, {axisEta}); // histos.add("h_phi", "h_phi", kTH1F, {axisPhi}); - histos.add("QA_nSigma_pion_TPC_BC", "QA_nSigma_pion_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_nSigma_pion_TOF_BC", "QA_nSigma_pion_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_pion_TPC_TOF_BC", "QA_pion_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_pion_TPC_BC", "QA_nSigma_pion_TPC_BC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_nSigma_pion_TOF_BC", "QA_nSigma_pion_TOF_BC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_pion_TPC_TOF_BC", "QA_pion_TPC_TOF_BC", {HistType::kTH2F, {pidAxis, pidAxis}}); - histos.add("QA_nSigma_pion_TPC_AC", "QA_nSigma_pion_TPC_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_nSigma_pion_TOF_AC", "QA_nSigma_pion_TOF_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_pion_TPC_TOF_AC", "QA_pion_TPC_TOF_AC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_pion_TPC_AC", "QA_nSigma_pion_TPC_AC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_nSigma_pion_TOF_AC", "QA_nSigma_pion_TOF_AC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_pion_TPC_TOF_AC", "QA_pion_TPC_TOF_AC", {HistType::kTH2F, {pidAxis, pidAxis}}); - histos.add("QA_nSigma_kaon_TPC_BC", "QA_nSigma_kaon_TPC_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_nSigma_kaon_TOF_BC", "QA_nSigma_kaon_TOF_BC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_kaon_TPC_TOF_BC", "QA_kaon_TPC_TOF_BC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_kaon_TPC_BC", "QA_nSigma_kaon_TPC_BC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_nSigma_kaon_TOF_BC", "QA_nSigma_kaon_TOF_BC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_kaon_TPC_TOF_BC", "QA_kaon_TPC_TOF_BC", {HistType::kTH2F, {pidAxis, pidAxis}}); - histos.add("QA_nSigma_kaon_TPC_AC", "QA_nSigma_kaon_TPC_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_nSigma_kaon_TOF_AC", "QA_nSigma_kaon_TOF_AC", {HistType::kTH2F, {PtAxis, PIDAxis}}); - histos.add("QA_kaon_TPC_TOF_AC", "QA_kaon_TPC_TOF_AC", {HistType::kTH2F, {PIDAxis, PIDAxis}}); + histos.add("QA_nSigma_kaon_TPC_AC", "QA_nSigma_kaon_TPC_AC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_nSigma_kaon_TOF_AC", "QA_nSigma_kaon_TOF_AC", {HistType::kTH2F, {ptAxis, pidAxis}}); + histos.add("QA_kaon_TPC_TOF_AC", "QA_kaon_TPC_TOF_AC", {HistType::kTH2F, {pidAxis, pidAxis}}); } // MC histos - histos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - histos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - histos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - histos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, PtAxis, MinvAxis}); - - // histos.add("hMC_pt_Pion", "hMC_pt_Pion", kTH1F, {PtAxis}); - // histos.add("hMC_pt_Kaon", "hMC_pt_Kaon", kTH1F, {PtAxis}); - // histos.add("hMC_pt_Proton", "hMC_pt_Proton", kTH1F, {PtAxis}); + histos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + + // histos.add("hMC_pt_Pion", "hMC_pt_Pion", kTH1F, {ptAxis}); + // histos.add("hMC_pt_Kaon", "hMC_pt_Kaon", kTH1F, {ptAxis}); + // histos.add("hMC_pt_Proton", "hMC_pt_Proton", kTH1F, {ptAxis}); // Event Histograms histos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}}); From 9de354d64a0c080172bce2223b551ddd31e6c5ce Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Wed, 6 Aug 2025 14:42:09 +0900 Subject: [PATCH 13/16] [PWGLF] Fixed about o2linter errors of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index a182a514e48..47259ec84ed 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -177,8 +177,8 @@ struct kstarInOO { // For Mixed Event using BinningType = ColumnBinningPolicy; - Partition Kaon_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); - Partition Pion_MC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); + Partition kaonMC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); + Partition pionMC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); double massKa = o2::constants::physics::MassKPlus; double massPi = o2::constants::physics::MassPiMinus; @@ -325,10 +325,10 @@ struct kstarInOO { } template - void TrackSlicing_MC(const CollisionType& collision1, const TracksType&, const CollisionType& collision2, const TracksType&, const bool IsMix) + void TrackSlicingMC(const CollisionType& collision1, const TracksType&, const CollisionType& collision2, const TracksType&, const bool IsMix) { - auto tracks1 = Kaon_MC->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); - auto tracks2 = Pion_MC->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); + auto tracks1 = kaonMC->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); + auto tracks2 = pionMC->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); auto centrality = collision1.centFT0C(); for (const auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { @@ -418,7 +418,7 @@ struct kstarInOO { return; histos.fill(HIST("nEvents_MC"), 1.5); - TrackSlicing_MC(collision, tracks, collision, tracks, false); + TrackSlicingMC(collision, tracks, collision, tracks, false); } // processSameEvents_MC PROCESS_SWITCH(kstarInOO, processSameEventMC, "process Same Event MC", true); @@ -451,7 +451,7 @@ struct kstarInOO { histos.fill(HIST("nEvents_MC_Mix"), 1.5); - TrackSlicing_MC(collision1, tracks1, collision2, tracks2, true); + TrackSlicingMC(collision1, tracks1, collision2, tracks2, true); } // mixing } // processMixedEvent_MC PROCESS_SWITCH(kstarInOO, processMixedEventMC, "process Mixed Event MC", false); From 6644f12067b3a981c117c7ababfe49dfb122050e Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 12 Aug 2025 10:21:09 +0900 Subject: [PATCH 14/16] [PWGLF] Added the data && the MC(Gen) of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 317 +++++++++++++++++++++++---- 1 file changed, 275 insertions(+), 42 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 47259ec84ed..43c94520958 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -70,7 +70,6 @@ struct kstarInOO { // Event Selection Configurable cfgEventVtxCut{"cfgEventVtxCut", 10.0, "V_z cut selection"}; - ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; // Track Selection @@ -88,7 +87,7 @@ struct kstarInOO { Configurable cfgTracknRowsOverFindable{"cfgTrackRowsOverFindable", 1.2, "nRowsOverFindable TPC CLusters"}; Configurable cfgTracknTPCChi2{"cfgTrackTPCChi2", 4.0, "nTPC Chi2 per Cluster"}; - // IT + // ITS Configurable cfgTracknITSChi2{"cfgTrackITSChi2", 36.0, "nITS Chi2 per Cluster"}; // PID @@ -103,6 +102,12 @@ struct kstarInOO { ConfigurableAxis cfgBinsMixVtx{"cfgBinsMixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"}; Configurable cfgMixNMixedEvents{"cfgMixNMixedEvents", 10, "Number of mixed events per event"}; + // MCGen + Configurable cfgForceGenReco{"cfgForceGenReco", false, "Only consider events which are reconstructed (neglect event-loss)"}; + // Configurable cfgForceBR{"cfgForceBR", false, "Only consider K*0->K(pm)pi(mp)"}; + // Configurable cfgForceKaonAcceptence{"cfgForceKaonAcceptence", false, "Only consider K*0's whose daughters decay inside acceptence (no signal loss)"}; + // Configurable cfgForcePionAcceptence{"cfgForcePionAcceptence", false, "Only consider K*0's whose daughters decay inside acceptence (no signal loss)"}; + // Pair Configurable cfgMinvNBins{"cfgMinvNBins", 300, "Number of bins for Minv axis"}; Configurable cfgMinvMin{"cfgMinvMin", 0.60, "Minimum Minv value"}; @@ -111,8 +116,8 @@ struct kstarInOO { // Histogram Configurable cfgEventCutQA{"cfgEventCutsQA", false, "Enable Event QA Hists"}; Configurable cfgTrackCutQA{"cfgTrackCutQA", false, "Enable Track QA Hists"}; - - // std::vector eventSelectionBits; + Configurable cfgDataHistos{"cfgDataHistos", false, "Enable Data Hists"}; + Configurable cfgMcHistos{"cfgMcHistos", false, "Enable MC Hists"}; void init(o2::framework::InitContext&) { @@ -129,9 +134,6 @@ struct kstarInOO { } if (cfgTrackCutQA) { - // histos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}}); - // histos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}}); - // histos.add("h_rawpT_Pion", "h_rawpT_Pion", kTH1F, {{1000, 0.0, 10.0}}); // histos.add("h_eta", "h_eta", kTH1F, {axisEta}); // histos.add("h_phi", "h_phi", kTH1F, {axisPhi}); @@ -152,23 +154,34 @@ struct kstarInOO { histos.add("QA_kaon_TPC_TOF_AC", "QA_kaon_TPC_TOF_AC", {HistType::kTH2F, {pidAxis, pidAxis}}); } - // MC histos - histos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); - histos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); - histos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); - histos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + if (cfgDataHistos) { + histos.add("nEvents", "nEvents", kTH1F, {{4, 0.0, 4.0}}); + histos.add("nEvents_Mix", "nEvents_Mix", kTH1F, {{4, 0.0, 4.0}}); - // histos.add("hMC_pt_Pion", "hMC_pt_Pion", kTH1F, {ptAxis}); - // histos.add("hMC_pt_Kaon", "hMC_pt_Kaon", kTH1F, {ptAxis}); - // histos.add("hMC_pt_Proton", "hMC_pt_Proton", kTH1F, {ptAxis}); + histos.add("hUSS", "hUSS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hLSS", "hLSS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hUSS_Mix", "hUSS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hLSS_Mix", "hLSS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + } - // Event Histograms - histos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}}); - histos.add("nEvents_MC_Mix", "nEvents_MC_Mix", kTH1F, {{4, 0.0, 4.0}}); + if (cfgMcHistos) { + histos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}}); + histos.add("nEvents_MC_Mix", "nEvents_MC_Mix", kTH1F, {{4, 0.0, 4.0}}); + histos.add("nEvents_MC_True", "nEvents_MC_True", kTH1F, {{4, 0.0, 4.0}}); + + histos.add("hMC_USS", "hMC_USS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_LSS", "hMC_LSS", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_USS_Mix", "hMC_USS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_LSS_Mix", "hMC_LSS_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_USS_True", "hMC_USS_True", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); + histos.add("hMC_kstar_True", "hMC_kstar_True", kTHnSparseF, {cfgCentAxis, ptAxis}); + } } // end of init using EventCandidates = soa::Join; //, aod::CentFT0Ms, aod::CentFT0As + using EventCandidatesTrue = aod::McCollisions; + using TrackCandidates = soa::Join; using TrackCandidatesMC = soa::Join; + Partition kaon = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); + Partition pion = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); + Partition kaonMC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfgTrackTPCPIDnSig); Partition pionMC = !cfgTrackTPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfgTrackTPCPIDnSig); @@ -324,6 +340,43 @@ struct kstarInOO { return false; } + template + void TrackSlicing(const CollisionType& collision1, const TracksType&, const CollisionType& collision2, const TracksType&, const bool IsMix) + { + auto tracks1 = kaon->sliceByCached(aod::track::collisionId, collision1.globalIndex(), cache); + auto tracks2 = pion->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache); + auto centrality = collision1.centFT0C(); + + for (const auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + if (!trackSelection(trk1) || !trackSelection(trk2)) + continue; + if (!trackPIDKaon(trk1) || !trackPIDPion(trk2)) + continue; + + auto [KstarPt, Minv] = minvReconstruction(trk1, trk2); + if (Minv < 0) + continue; + + double conjugate = trk1.sign() * trk2.sign(); + if (cfgDataHistos) { + if (!IsMix) { + if (conjugate < 0) { + histos.fill(HIST("hUSS"), centrality, KstarPt, Minv); + } else if (conjugate > 0) { + histos.fill(HIST("hLSS"), centrality, KstarPt, Minv); + } + } else { + if (conjugate < 0) { + histos.fill(HIST("hUSS_Mix"), centrality, KstarPt, Minv); + } else if (conjugate > 0) { + histos.fill(HIST("hLSS_Mix"), centrality, KstarPt, Minv); + } + } + } // cfgDataHistos + } // for + } // TrackSlicing + template void TrackSlicingMC(const CollisionType& collision1, const TracksType&, const CollisionType& collision2, const TracksType&, const bool IsMix) { @@ -343,21 +396,66 @@ struct kstarInOO { continue; double conjugate = trk1.sign() * trk2.sign(); - if (!IsMix) { - if (conjugate < 0) { - histos.fill(HIST("hMC_USS"), centrality, KstarPt, Minv); - } else if (conjugate > 0) { - histos.fill(HIST("hMC_LSS"), centrality, KstarPt, Minv); - } - } else { - if (conjugate < 0) { - histos.fill(HIST("hMC_USS_Mix"), centrality, KstarPt, Minv); - } else if (conjugate > 0) { - histos.fill(HIST("hMC_LSS_Mix"), centrality, KstarPt, Minv); + if (cfgMcHistos) { + if (!IsMix) { + if (conjugate < 0) { + histos.fill(HIST("hMC_USS"), centrality, KstarPt, Minv); + } else if (conjugate > 0) { + histos.fill(HIST("hMC_LSS"), centrality, KstarPt, Minv); + } + } else { + if (conjugate < 0) { + histos.fill(HIST("hMC_USS_Mix"), centrality, KstarPt, Minv); + } else if (conjugate > 0) { + histos.fill(HIST("hMC_LSS_Mix"), centrality, KstarPt, Minv); + } } + } // cfgMcHistos + + //====================== + // Gen MC + if (!trk1.has_mcParticle() || !trk2.has_mcParticle()) + continue; + auto particle1 = trk1.mcParticle(); + auto particle2 = trk2.mcParticle(); + if (std::fabs(particle1.pdgCode()) != 321) + continue; // Not Kaon + if (std::fabs(particle2.pdgCode()) != 211) + continue; // Not Pion + + if (!particle1.has_mothers()) { + continue; } - } - } + if (!particle2.has_mothers()) + continue; + + std::vector mothers1{}; + std::vector mothers1PDG{}; + for (auto& particle1_mom : particle1.template mothers_as()) { + mothers1.push_back(particle1_mom.globalIndex()); + mothers1PDG.push_back(particle1_mom.pdgCode()); + } + + std::vector mothers2{}; + std::vector mothers2PDG{}; + for (auto& particle2_mom : particle2.template mothers_as()) { + mothers2.push_back(particle2_mom.globalIndex()); + mothers2PDG.push_back(particle2_mom.pdgCode()); + } + + if (mothers1PDG[0] != 313) + continue; // mother not K*0 + if (mothers2PDG[0] != 313) + continue; // mothers not K*0 + + if (mothers1[0] != mothers2[0]) + continue; // Kaon and pion not from the same K*0 + + if (cfgMcHistos) { + histos.fill(HIST("hMC_USS_True"), centrality, KstarPt, Minv); + } + } // for + } // TrackSlicingMC template std::pair minvReconstruction(const TracksType& trk1, const TracksType& trk2) @@ -384,6 +482,82 @@ struct kstarInOO { return {lResonance.Pt(), lResonance.M()}; } + //======================================================= + //| + //| DATA STUFF (SE) + //| + //======================================================= + + int nEvents = 0; + void processDataSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks) + { + if (cDebugLevel > 0) { + nEvents++; + if ((nEvents + 1) % 10000 == 0) { + std::cout << "Processed Data Events: " << nEvents << std::endl; + } + } + + auto goodEv = eventSelection(collision); + if (cfgDataHistos) { + histos.fill(HIST("nEvents"), 0.5); + } + if (!goodEv) + return; + + bool INELgt0 = false; + for (const auto& track : tracks) { + if (std::fabs(track.eta()) < cfgTrackMaxEta) { + INELgt0 = true; + break; + } + } + if (!INELgt0) + return; + if (cfgDataHistos) { + histos.fill(HIST("nEvents"), 1.5); + } + TrackSlicing(collision, tracks, collision, tracks, false); + + } // processSameEvents + PROCESS_SWITCH(kstarInOO, processDataSameEvent, "process Data Same Event", false); + + //======================================================= + //| + //| DATA STUFF (ME) + //| + //======================================================= + + int nEventsMix = 0; + void processDataMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks) + { + auto tracksTuple = std::make_tuple(tracks); + BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true}; // true is for 'ignore overflows' (true by default) + SameKindPair pairs{colBinning, cfgMixNMixedEvents, -1, collisions, tracksTuple, &cache}; + for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { + if (cDebugLevel > 0) { + nEventsMix++; + if ((nEventsMix + 1) % 10000 == 0) { + std::cout << "Processed DATA Mixed Events : " << nEventsMix << std::endl; + } + } + auto goodEv1 = eventSelection(collision1); + auto goodEv2 = eventSelection(collision2); + if (cfgDataHistos) { + histos.fill(HIST("nEvents_Mix"), 0.5); + } + + if (!goodEv1 || !goodEv2) + continue; + + if (cfgDataHistos) { + histos.fill(HIST("nEvents_Mix"), 1.5); + } + TrackSlicing(collision1, tracks1, collision2, tracks2, true); + } + } + PROCESS_SWITCH(kstarInOO, processDataMixedEvent, "process DATA Mixed Event", false); + //======================================================= //| //| MC STUFF (SE) @@ -391,19 +565,21 @@ struct kstarInOO { //======================================================= int nEventsMC = 0; - void processSameEventMC(EventCandidates::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&) + void processMCSameEvent(EventCandidates::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&) { if (cDebugLevel > 0) { nEventsMC++; if ((nEventsMC + 1) % 10000 == 0) { double histmem = histos.getSize(); std::cout << histmem << std::endl; - std::cout << "process_SameEvent_MC: " << nEventsMC << std::endl; + std::cout << "process MC Same Event : " << nEventsMC << std::endl; } } auto goodEv = eventSelection(collision); - histos.fill(HIST("nEvents_MC"), 0.5); + if (cfgMcHistos) { + histos.fill(HIST("nEvents_MC"), 0.5); + } if (!goodEv) return; @@ -417,11 +593,13 @@ struct kstarInOO { if (!INELgt0) return; - histos.fill(HIST("nEvents_MC"), 1.5); + if (cfgMcHistos) { + histos.fill(HIST("nEvents_MC"), 1.5); + } TrackSlicingMC(collision, tracks, collision, tracks, false); } // processSameEvents_MC - PROCESS_SWITCH(kstarInOO, processSameEventMC, "process Same Event MC", true); + PROCESS_SWITCH(kstarInOO, processMCSameEvent, "process MC Same Event", false); //======================================================= //| @@ -430,7 +608,7 @@ struct kstarInOO { //======================================================= int nEventsMCMix = 0; - void processMixedEventMC(EventCandidates const& collisions, TrackCandidatesMC const& tracks, aod::McParticles const&) + void processMCMixedEvent(EventCandidates const& collisions, TrackCandidatesMC const& tracks, aod::McParticles const&) { auto tracksTuple = std::make_tuple(tracks); BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true}; // true is for 'ignore overflows' (true by default) @@ -439,22 +617,77 @@ struct kstarInOO { if (cDebugLevel > 0) { nEventsMCMix++; if ((nEventsMCMix + 1) % 10000 == 0) { - std::cout << "Processed Mixed Events: " << nEventsMCMix << std::endl; + std::cout << "Processed MC Mixed Events : " << nEventsMCMix << std::endl; } } auto goodEv1 = eventSelection(collision1); auto goodEv2 = eventSelection(collision2); - histos.fill(HIST("nEvents_MC_Mix"), 0.5); + if (cfgMcHistos) { + histos.fill(HIST("nEvents_MC_Mix"), 0.5); + } if (!goodEv1 || !goodEv2) continue; - histos.fill(HIST("nEvents_MC_Mix"), 1.5); - + if (cfgMcHistos) { + histos.fill(HIST("nEvents_MC_Mix"), 1.5); + } TrackSlicingMC(collision1, tracks1, collision2, tracks2, true); } // mixing } // processMixedEvent_MC - PROCESS_SWITCH(kstarInOO, processMixedEventMC, "process Mixed Event MC", false); + PROCESS_SWITCH(kstarInOO, processMCMixedEvent, "process MC Mixed Event", false); + + //======================================================= + //| + //| GENERATED MC STUFF (TRUE) + //| + //======================================================= + + int nEventsTrue = 0; + void processMCTrue(EventCandidatesTrue::iterator const& collision, soa::SmallGroups> const& recocolls, aod::McParticles const& particles) + { + if (cDebugLevel > 0) { + ++nEventsTrue; + if (nEventsTrue & 10000 == 0) { + std::cout << "Processed MC True Events : " << nEventsTrue << std::endl; + } + } + + if (fabs(collision.posZ()) > cfgEventVtxCut) + return; + + if (recocolls.size() <= 0) { // not reconstructed + if (cfgForceGenReco) { + return; + } + } + + double centrality = -1; + for (auto& recocoll : recocolls) { + centrality = recocoll.centFT0C(); + auto goodEv = eventSelection(recocoll); + + if (cfgMcHistos) { + histos.fill(HIST("nEvents_MC_True"), 0.5); + } + if (!goodEv) + continue; + } // for + + for (auto& particle : particles) { + if (particle.pdgCode() != 313) + continue; // Not K*0 + if (std::fabs(particle.eta()) > cfgTrackMaxEta) + continue; + + if (cfgMcHistos) { + histos.fill(HIST("hMC_kstar_True"), centrality, particle.pt()); + } + + } // loop over particles + + } // processMCTrue + PROCESS_SWITCH(kstarInOO, processMCTrue, "process MC True", false); void processEventsDummy(EventCandidates::iterator const&, TrackCandidates const&) { From 252baa09f21026122f59d152be3bf4d584bfaaea Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Tue, 12 Aug 2025 14:23:27 +0900 Subject: [PATCH 15/16] [PWGLF] Added the data && the MC(Gen) of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 43c94520958..fe057f20025 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -648,7 +648,7 @@ struct kstarInOO { { if (cDebugLevel > 0) { ++nEventsTrue; - if (nEventsTrue & 10000 == 0) { + if ((nEventsTrue & 10000) == 0) { std::cout << "Processed MC True Events : " << nEventsTrue << std::endl; } } From ae4647bfaba9843cac81197c9640881d63db0922 Mon Sep 17 00:00:00 2001 From: jimun_lee Date: Wed, 13 Aug 2025 13:05:13 +0900 Subject: [PATCH 16/16] [PWGLF] Added the condition of globaltrack of KstarInOO.cxx --- PWGLF/Tasks/Resonances/kstarInOO.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index fe057f20025..d17c9e87110 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -80,6 +80,7 @@ struct kstarInOO { Configurable cfgTrackMaxDCAzToPVcut{"cfgTrackMaxDCAzToPVcut", 2.0, "Track DCAz cut to PV Maximum"}; Configurable cfgTrackPrimaryTrack{"cfgTrackPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgTrackConnectedToPV{"cfgTrackConnectedToPV", true, "PV contributor track selection"}; // PV Contriuibutor + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cfgTrackGlobalWoDCATrack{"cfgTrackGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) // TPC Configurable cfgTracknFindableTPCClusters{"cfgTrackFindableTPCClusters", 50, "nFindable TPC Clusters"}; @@ -240,6 +241,9 @@ struct kstarInOO { if (std::abs(track.eta()) > cfgTrackMaxEta) return false; + if (cfgGlobalTrack && !track.isGlobalTrack()) + return false; + if (std::abs(track.dcaXY()) > cfgTrackMaxDCArToPVcut) return false;