From bb13a7584520c9e13a331df621f1f711c4a5f0ca Mon Sep 17 00:00:00 2001 From: pstahlhu Date: Tue, 8 Jul 2025 16:07:52 +0200 Subject: [PATCH 1/4] Add QA histograms and sum pion pT cut --- PWGHF/Core/SelectorCuts.h | 32 +-- .../candidateSelectorXicToXiPiPi.cxx | 210 +++++++++++------- 2 files changed, 143 insertions(+), 99 deletions(-) diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index f0a9ad9034e..fe8120ad1f6 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -788,7 +788,7 @@ static const std::vector labelsCutVar = {"m", "pT p", "pT K", "pT P namespace hf_cuts_xic_to_xi_pi_pi { static constexpr int NBinsPt = 13; -static constexpr int NCutVars = 11; +static constexpr int NCutVars = 12; // default values for the pT bin edges (can be used to configure histogram axis) // offset by 1 from the bin numbers in cuts array constexpr double BinsPt[NBinsPt + 1] = { @@ -808,20 +808,20 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.}; auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; -// default values for the cuts m Y Eta EtaDau ptPi0 ptPi1 chi2SV dL dLXY invMass Xi-Pi pairs -constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 0 < pT < 1 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 1 < pT < 2 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 2 < pT < 3 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 3 < pT < 4 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 4 < pT < 5 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 5 < pT < 6 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 6 < pT < 7 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 7 < pT < 8 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 8 < pT < 9 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 9 < pT < 10 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 10 < pT < 11 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}, /* 11 < pT < 12 */ - {0.4, 0.8, 0.8, 0.8, 0.4, 0.4, 100, 0.0, 0.0, 2.4, 2.4}}; /* 12 < pT < 20 */ +// default values for the cuts m Y Eta EtaDau pT Pi0 Pi1 Sum chi2SV dL dLXY invMass Xi-Pi pairs +constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 0 < pT < 1 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 1 < pT < 2 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 2 < pT < 3 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 3 < pT < 4 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 4 < pT < 5 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 5 < pT < 6 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 6 < pT < 7 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 7 < pT < 8 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 8 < pT < 9 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 9 < pT < 10 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 10 < pT < 11 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 11 < pT < 12 */ + {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}}; /* 12 < pT < 20 */ // row labels static const std::vector labelsPt = { @@ -840,7 +840,7 @@ static const std::vector labelsPt = { "pT bin 12"}; // column labels -static const std::vector labelsCutVar = {"m", "y", "eta", "eta Daughters", "pT Pi0", "pT Pi1", "chi2SV", "min decay length", "min decay length XY", "max inv mass Xi-Pi0", "max inv mass Xi-Pi1"}; +static const std::vector labelsCutVar = {"m", "y", "eta", "eta Daughters", "pT Pi0", "pT Pi1", "pT Pi0 + Pi1", "chi2SV", "min decay length", "min decay length XY", "max inv mass Xi-Pi0", "max inv mass Xi-Pi1"}; } // namespace hf_cuts_xic_to_xi_pi_pi namespace hf_cuts_xicc_to_p_k_pi_pi diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index bb0bbf04c78..767f4ebea45 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -54,7 +54,7 @@ struct HfCandidateSelectorXicToXiPiPi { Configurable> binsPt{"binsPt", std::vector{hf_cuts_xic_to_xi_pi_pi::vecBinsPt}, "pT bin limits"}; Configurable> cuts{"cuts", {hf_cuts_xic_to_xi_pi_pi::Cuts[0], hf_cuts_xic_to_xi_pi_pi::NBinsPt, hf_cuts_xic_to_xi_pi_pi::NCutVars, hf_cuts_xic_to_xi_pi_pi::labelsPt, hf_cuts_xic_to_xi_pi_pi::labelsCutVar}, "Xicplus candidate selection per pT bin"}; - Configurable fillHistogram{"fillHistogram", false, "Flag to filling of counter histogram"}; + Configurable fillQAHistograms{"fillQAHistograms", false, "Switch to enable filling of QA histograms"}; // Enable PID Configurable usePid{"usePid", true, "Switch for PID selection at track level"}; Configurable useTpcPidOnly{"useTpcPidOnly", false, "Switch to use TPC PID only instead of TPC OR TOF)"}; @@ -140,39 +140,60 @@ struct HfCandidateSelectorXicToXiPiPi { selectorProton.setRangeNSigmaTofCondTpc(-nSigmaTofCombinedMax, nSigmaTofCombinedMax); } - if (fillHistogram) { - std::string labels[NSelectionCriteria]; - labels[All] = "All"; - labels[Pt] = "#it{p}_{T}"; - labels[Mass] = "#Delta M"; - labels[Rapidity] = "y"; - labels[Eta] = "#eta"; - labels[EtaDaughters] = "#eta final state daughters"; - labels[PtPionFromXicPlus] = "#it{p}_{T} (#pi #leftarrow #Xi_{c}^{+})"; - labels[Chi2SV] = "#chi^{2}_{SV}"; - labels[MinDecayLength] = "Decay length"; - labels[MaxInvMassXiPiPairs] = "M_{#Xi #pi}"; - labels[TpcTrackQualityXiDaughters] = "TPC track quality selection on #Xi daughters"; - labels[TpcTrackQualityPiFromCharm] = "TPC track quality selection on #pi #leftarrow #Xi_{c}^{+}"; - labels[ItsTrackQualityPiFromCharm] = "ITS track quality selection on #pi #leftarrow #Xi_{c}^{+}"; - labels[PidSelected] = "PID selection"; - labels[BdtSelected] = "BDT selection"; - - if (doprocessData) { - registry.add("hSelCandidates", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); - for (int iBin = 0; iBin < NSelectionCriteria; ++iBin) { - registry.get(HIST("hSelCandidates"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); - } - } else if (doprocessMc) { - registry.add("hSelCandidatesRecSig", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); - registry.add("hSelCandidatesRecBkg", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); - for (int iBin = 0; iBin < NSelectionCriteria; ++iBin) { - registry.get(HIST("hSelCandidatesRecSig"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); - registry.get(HIST("hSelCandidatesRecBkg"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); - } + std::string labels[NSelectionCriteria]; + labels[All] = "All"; + labels[Pt] = "#it{p}_{T}"; + labels[Mass] = "#Delta M"; + labels[Rapidity] = "y"; + labels[Eta] = "#eta"; + labels[EtaDaughters] = "#eta final state daughters"; + labels[PtPionFromXicPlus] = "#it{p}_{T} (#pi #leftarrow #Xi_{c}^{+})"; + labels[Chi2SV] = "#chi^{2}_{SV}"; + labels[MinDecayLength] = "Decay length"; + labels[MaxInvMassXiPiPairs] = "M_{#Xi #pi}"; + labels[TpcTrackQualityXiDaughters] = "TPC track quality selection on #Xi daughters"; + labels[TpcTrackQualityPiFromCharm] = "TPC track quality selection on #pi #leftarrow #Xi_{c}^{+}"; + labels[ItsTrackQualityPiFromCharm] = "ITS track quality selection on #pi #leftarrow #Xi_{c}^{+}"; + labels[PidSelected] = "PID selection"; + labels[BdtSelected] = "BDT selection"; + + if (doprocessData) { + registry.add("hSelCandidates", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); + for (int iBin = 0; iBin < NSelectionCriteria; ++iBin) { + registry.get(HIST("hSelCandidates"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + } + } else if (doprocessMc) { + registry.add("hSelCandidatesRecSig", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); + registry.add("hSelCandidatesRecBkg", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); + for (int iBin = 0; iBin < NSelectionCriteria; ++iBin) { + registry.get(HIST("hSelCandidatesRecSig"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); + registry.get(HIST("hSelCandidatesRecBkg"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } } + if (fillQAHistograms) { + // eta of all final state daughters + registry.add("hEtaPi0FromXic", ";#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaPi1FromXic", ";#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaBachelorPion", ";#eta (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0PosDau", ";;#eta (V0 pos. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0NegDau", ";;#eta (V0 neg. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + // pions from XicPlus + registry.add("hNClustersTpcPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersItsPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsInnBarrPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + registry.add("hNClustersItsInnBarrPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + // Xi daughters + registry.add("hNClustersTpcBachelorPion", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0PosDau", ";#it{N}_{clusters}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0NegDau", ";#it{N}_{clusters}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcBachelorPion", ";#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0PosDau", ";#it{N}_{rows}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0NegDau", ";#it{N}_{rows}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + } + if (applyMl) { hfMlResponse.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); if (loadModelsFromCCDB) { @@ -226,11 +247,11 @@ struct HfCandidateSelectorXicToXiPiPi { { // Successful reconstruction SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTotal); // RecoTotal = 0 --> statusXicToXiPiPi += 1 - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), All); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), All); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), All); } @@ -241,6 +262,29 @@ struct HfCandidateSelectorXicToXiPiPi { auto trackV0PosDau = hfCandXic.template posTrack_as(); auto trackV0NegDau = hfCandXic.template negTrack_as(); + if (fillQAHistograms) { + // eta of all final state daughters + registry.fill(HIST("hEtaPi0FromXic"), trackPi0.eta()); + registry.fill(HIST("hEtaPi1FromXic"), trackPi1.eta()); + registry.fill(HIST("hEtaBachelorPion"), trackPiFromXi.eta()); + registry.fill(HIST("hEtaV0PosDau"), trackV0PosDau.eta()); + registry.fill(HIST("hEtaV0NegDau"), trackV0NegDau.eta()); + // pions from XicPlus + registry.fill(HIST("hNClustersTpcPi0FromXic"), trackPi0.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcPi1FromXic"), trackPi1.tpcNClsFound()); + registry.fill(HIST("hNClustersItsPi0FromXic"), trackPi0.itsNCls()); + registry.fill(HIST("hNClustersItsPi1FromXic"), trackPi1.itsNCls()); + registry.fill(HIST("hNClustersItsInnBarrPi0FromXic"), trackPi0.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersItsInnBarrPi1FromXic"), trackPi1.itsNClsInnerBarrel()); + // Xi daughters + registry.fill(HIST("hNClustersTpcBachelorPion"), trackPiFromXi.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0PosDau"), trackV0PosDau.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0NegDau"), trackV0NegDau.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcBachelorPion"), trackPiFromXi.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0PosDau"), trackV0PosDau.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0NegDau"), trackV0NegDau.tpcNClsCrossedRows()); + } + //////////////////////////////////////////////// // Kinematic and topological selection // //////////////////////////////////////////////// @@ -251,22 +295,22 @@ struct HfCandidateSelectorXicToXiPiPi { if (pTBin == -1) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Pt); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), Pt); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), Pt); } // check whether candidate mass is within a defined mass window if (std::abs(hfCandXic.invMassXicPlus() - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Mass); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), Mass); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), Mass); } @@ -274,11 +318,11 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.y(o2::constants::physics::MassXiCPlus)) > cuts->get(pTBin, "y")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Rapidity); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), Rapidity); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), Rapidity); } @@ -286,11 +330,11 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.eta()) > cuts->get(pTBin, "eta")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Eta); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), Eta); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), Eta); } @@ -298,23 +342,23 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(trackPi0.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackPi1.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackPiFromXi.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackV0PosDau.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackV0NegDau.eta()) > cuts->get(pTBin, "eta Daughters")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), EtaDaughters); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), EtaDaughters); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), EtaDaughters); } // cut on pion pT - if (hfCandXic.ptProng1() < cuts->get(pTBin, "pT Pi0") || hfCandXic.ptProng2() < cuts->get(pTBin, "pT Pi1")) { + if (hfCandXic.ptProng1() < cuts->get(pTBin, "pT Pi0") || hfCandXic.ptProng2() < cuts->get(pTBin, "pT Pi1") || (hfCandXic.ptProng1() + hfCandXic.ptProng2()) < cuts->get(pTBin, "pT Pi0 + Pi1")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PtPionFromXicPlus); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), PtPionFromXicPlus); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), PtPionFromXicPlus); } @@ -322,11 +366,11 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.chi2PCA() > cuts->get(pTBin, "chi2SV")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), Chi2SV); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), Chi2SV); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), Chi2SV); } @@ -334,11 +378,11 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.decayLength() < cuts->get(pTBin, "min decay length") || hfCandXic.decayLengthXY() < cuts->get(pTBin, "min decay length XY")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), MinDecayLength); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), MinDecayLength); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), MinDecayLength); } @@ -346,11 +390,11 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.invMassXiPi0() > cuts->get(pTBin, "max inv mass Xi-Pi0") || hfCandXic.invMassXiPi1() > cuts->get(pTBin, "max inv mass Xi-Pi1")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), MaxInvMassXiPiPairs); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), MaxInvMassXiPiPairs); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), MaxInvMassXiPiPairs); } @@ -367,11 +411,11 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackV0NegDau, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityXiDaughters); } @@ -380,11 +424,11 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackPi1, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityPiFromCharm); } @@ -393,17 +437,17 @@ struct HfCandidateSelectorXicToXiPiPi { (!isSelectedTrackItsQuality(trackPi0, nClustersItsMin, itsChi2PerClusterMax) || trackPi1.itsNClsInnerBarrel() < nClustersItsInnBarrMin)) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), ItsTrackQualityPiFromCharm); } // Successful track quality selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTrackQuality); // RecoTrackQuality = 2 --> statusXicToXiPiPi += 4 - } else if (fillHistogram) { + } else { if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); @@ -457,14 +501,14 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful PID selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoPID); // RecoPID = 3 --> statusXicToXiPiPi += 8 - if (fillHistogram && isMc && isMatchedSignal) { + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), PidSelected); } - } else if (fillHistogram) { + } else { if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); } else if (isMc && !isMatchedSignal) { @@ -499,12 +543,12 @@ struct HfCandidateSelectorXicToXiPiPi { } // Successful ML selection - SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl); // RecoPID = 4 --> statusXicToXiPiPi += 16 - if (fillHistogram && isMc && isMatchedSignal) { + SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl); // RecoML = 4 --> statusXicToXiPiPi += 16 + if (isMc && isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); - } else if (fillHistogram && isMc && !isMatchedSignal) { + } else if (isMc && !isMatchedSignal) { registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); - } else if (fillHistogram && !isMc) { + } else { registry.fill(HIST("hSelCandidates"), BdtSelected); } } @@ -530,7 +574,7 @@ struct HfCandidateSelectorXicToXiPiPi { // ML selection if (applyMl) { isBdtSelected(hfCandXic, statusXicToXiPiPi); - } else if (fillHistogram) { + } else { registry.fill(HIST("hSelCandidates"), BdtSelected); } @@ -565,9 +609,9 @@ struct HfCandidateSelectorXicToXiPiPi { // ML selection if (applyMl) { isBdtSelected(hfCandXic, statusXicToXiPiPi, isMatchedCandidate); - } else if (fillHistogram && isMatchedCandidate) { + } else if (isMatchedCandidate) { registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); - } else if (fillHistogram && !isMatchedCandidate) { + } else if (!isMatchedCandidate) { registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); } From 089dc7589baf6fc7ef09392405d07df0db6244f2 Mon Sep 17 00:00:00 2001 From: pstahlhu Date: Tue, 8 Jul 2025 16:09:54 +0200 Subject: [PATCH 2/4] Make only histogram filling for phys. var. configurable --- .../candidateCreatorXicToXiPiPi.cxx | 51 +++++++------------ 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index d12c5d799d2..7f998d0b817 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -143,17 +143,16 @@ struct HfCandidateCreatorXicToXiPiPi { } // add histograms to registry + registry.add("hVertexerType", "Use DCAFitter or KFParticle;;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); + registry.get(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::DCAFitter, "DCAFitter"); + registry.get(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::KfParticle, "KFParticle"); + registry.add("hCandCounter", "hCandCounter", {HistType::kTH1F, {{4, -0.5, 3.5}}}); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + TotalSkimmedTriplets, "total"); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + SelEvent, "Event selected"); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + CascPreSel, "Cascade preselection"); + registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + VertexFit, "Successful vertex fit"); + // physical variables if (fillHistograms) { - // counter - registry.add("hVertexerType", "Use DCAFitter or KFParticle;;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); - registry.get(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::DCAFitter, "DCAFitter"); - registry.get(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::KfParticle, "KFParticle"); - registry.add("hCandCounter", "hCandCounter", {HistType::kTH1F, {{4, -0.5, 3.5}}}); - registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + TotalSkimmedTriplets, "total"); - registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + SelEvent, "Event selected"); - registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + CascPreSel, "Cascade preselection"); - registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + VertexFit, "Successful vertex fit"); - // physical variables registry.add("hMass3", "3-prong candidates;inv. mass (#Xi #pi #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1D, {{500, 2.3, 2.7}}}); registry.add("hCovPVXX", "3-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, 0., 1.e-4}}}); registry.add("hCovSVXX", "3-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1D, {{100, 0., 0.2}}}); @@ -205,9 +204,7 @@ struct HfCandidateCreatorXicToXiPiPi { { // loop over triplets of track indices for (const auto& rowTrackIndexXicPlus : rowsTrackIndexXicPlus) { - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), TotalSkimmedTriplets); - } + registry.fill(HIST("hCandCounter"), TotalSkimmedTriplets); // check if the event is selected auto collision = rowTrackIndexXicPlus.collision_as(); @@ -217,9 +214,7 @@ struct HfCandidateCreatorXicToXiPiPi { /// at least one event selection not satisfied --> reject the candidate continue; } - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), SelEvent); - } + registry.fill(HIST("hCandCounter"), SelEvent); // Retrieve skimmed cascade and pion tracks auto cascAodElement = rowTrackIndexXicPlus.cascade_as(); @@ -239,9 +234,7 @@ struct HfCandidateCreatorXicToXiPiPi { continue; } } - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), CascPreSel); - } + registry.fill(HIST("hCandCounter"), CascPreSel); //----------------------Set the magnetic field from ccdb--------------------------------------- /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, @@ -294,9 +287,7 @@ struct HfCandidateCreatorXicToXiPiPi { LOG(info) << "Run time error found: " << error.what() << ". DCAFitterN cannot work, skipping the candidate."; continue; } - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), VertexFit); - } + registry.fill(HIST("hCandCounter"), VertexFit); //----------------------------calculate physical properties----------------------- // Charge of charm baryon @@ -446,9 +437,7 @@ struct HfCandidateCreatorXicToXiPiPi { { // loop over triplets of track indices for (const auto& rowTrackIndexXicPlus : rowsTrackIndexXicPlus) { - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), TotalSkimmedTriplets); - } + registry.fill(HIST("hCandCounter"), TotalSkimmedTriplets); // check if the event is selected auto collision = rowTrackIndexXicPlus.collision_as(); @@ -458,9 +447,7 @@ struct HfCandidateCreatorXicToXiPiPi { /// at least one event selection not satisfied --> reject the candidate continue; } - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), SelEvent); - } + registry.fill(HIST("hCandCounter"), SelEvent); // Retrieve skimmed cascade and pion tracks auto cascAodElement = rowTrackIndexXicPlus.cascade_as(); @@ -480,9 +467,7 @@ struct HfCandidateCreatorXicToXiPiPi { continue; } } - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), CascPreSel); - } + registry.fill(HIST("hCandCounter"), CascPreSel); //----------------------Set the magnetic field from ccdb----------------------------- /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, @@ -539,9 +524,7 @@ struct HfCandidateCreatorXicToXiPiPi { LOG(debug) << "Failed to construct XicPlus : " << e.what(); continue; } - if (fillHistograms) { - registry.fill(HIST("hCandCounter"), VertexFit); - } + registry.fill(HIST("hCandCounter"), VertexFit); // get chi2 values float chi2GeoXicPlus = kfXicPlus.GetChi2() / kfXicPlus.GetNDF(); From 18681b87f65122d2f3fea7197d593a0c3143de40 Mon Sep 17 00:00:00 2001 From: pstahlhu Date: Wed, 9 Jul 2025 16:50:53 +0200 Subject: [PATCH 3/4] Split QA histograms for Sig/Bkg and use constexpr for isMC --- .../candidateSelectorXicToXiPiPi.cxx | 357 ++++++++++++------ 1 file changed, 243 insertions(+), 114 deletions(-) diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index 767f4ebea45..389b53dbf99 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -172,26 +172,77 @@ struct HfCandidateSelectorXicToXiPiPi { } if (fillQAHistograms) { - // eta of all final state daughters - registry.add("hEtaPi0FromXic", ";#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); - registry.add("hEtaPi1FromXic", ";#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); - registry.add("hEtaBachelorPion", ";#eta (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); - registry.add("hEtaV0PosDau", ";;#eta (V0 pos. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); - registry.add("hEtaV0NegDau", ";;#eta (V0 neg. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); - // pions from XicPlus - registry.add("hNClustersTpcPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNClustersTpcPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNClustersItsPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); - registry.add("hNClustersItsPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); - registry.add("hNClustersItsInnBarrPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); - registry.add("hNClustersItsInnBarrPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); - // Xi daughters - registry.add("hNClustersTpcBachelorPion", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNClustersTpcV0PosDau", ";#it{N}_{clusters}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNClustersTpcV0NegDau", ";#it{N}_{clusters}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNCrossedRowsTpcBachelorPion", ";#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNCrossedRowsTpcV0PosDau", ";#it{N}_{rows}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); - registry.add("hNCrossedRowsTpcV0NegDau", ";#it{N}_{rows}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + if (doprocessData) { + // eta of all final state daughters + registry.add("hEtaPi0FromXic", ";#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaPi1FromXic", ";#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaBachelorPion", ";#eta (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0PosDau", ";;#eta (V0 pos. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0NegDau", ";;#eta (V0 neg. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + // pions from XicPlus + registry.add("hNClustersTpcPi0FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcPi1FromXic", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcPi0FromXic", ";#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcPi1FromXic", ";#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersItsPi0FromXic", ";#it{N}_{clusters}^{ITS} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsPi1FromXic", ";#it{N}_{clusters}^{ITS} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsInnBarrPi0FromXic", ";#it{N}_{clusters}^{ITS-IB} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + registry.add("hNClustersItsInnBarrPi1FromXic", ";#it{N}_{clusters}^{ITS-IB} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + // Xi daughters + registry.add("hNClustersTpcBachelorPion", ";#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0PosDau", ";#it{N}_{clusters}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0NegDau", ";#it{N}_{clusters}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcBachelorPion", ";#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0PosDau", ";#it{N}_{rows}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0NegDau", ";#it{N}_{rows}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + } else if (doprocessMc) { + // Reconstructed signal + // eta of all final state daughters + registry.add("hEtaPi0FromXicRecSig", "Reconstructed signal;#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaPi1FromXicRecSig", "Reconstructed signal;#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaBachelorPionRecSig", "Reconstructed signal;#eta (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0PosDauRecSig", "Reconstructed signal;#eta (V0 pos. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0NegDauRecSig", "Reconstructed signal;#eta (V0 neg. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + // pions from XicPlus + registry.add("hNClustersTpcPi0FromXicRecSig", "Reconstructed signal;#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcPi1FromXicRecSig", "Reconstructed signal;#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcPi0FromXicRecSig", "Reconstructed signal;#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcPi1FromXicRecSig", "Reconstructed signal;#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersItsPi0FromXicRecSig", "Reconstructed signal;#it{N}_{clusters}^{ITS} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsPi1FromXicRecSig", "Reconstructed signal;#it{N}_{clusters}^{ITS} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsInnBarrPi0FromXicRecSig", "Reconstructed signal;#it{N}_{clusters}^{ITS-IB} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + registry.add("hNClustersItsInnBarrPi1FromXicRecSig", "Reconstructed signal;#it{N}_{clusters}^{ITS-IB} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + // Xi daughters + registry.add("hNClustersTpcBachelorPionRecSig", "Reconstructed signal;#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0PosDauRecSig", "Reconstructed signal;#it{N}_{clusters}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0NegDauRecSig", "Reconstructed signal;#it{N}_{clusters}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcBachelorPionRecSig", "Reconstructed signal;#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0PosDauRecSig", "Reconstructed signal;#it{N}_{rows}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0NegDauRecSig", "Reconstructed signal;#it{N}_{rows}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + // Reconstructed background + // eta of all final state daughters + registry.add("hEtaPi0FromXicRecBkg", "Reconstructed background;#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaPi1FromXicRecBkg", "Reconstructed background;#eta (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaBachelorPionRecBkg", "Reconstructed background;#eta (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0PosDauRecBkg", "Reconstructed background;#eta (V0 pos. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + registry.add("hEtaV0NegDauRecBkg", "Reconstructed background;#eta (V0 neg. dau.);entries", {HistType::kTH1F, {{150, -1.5f, +1.5f}}}); + // pions from XicPlus + registry.add("hNClustersTpcPi0FromXicRecBkg", "Reconstructed background;#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcPi1FromXicRecBkg", "Reconstructed background;#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcPi0FromXicRecBkg", "Reconstructed background;#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcPi1FromXicRecBkg", "Reconstructed background;#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersItsPi0FromXicRecBkg", "Reconstructed background;#it{N}_{clusters}^{ITS} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsPi1FromXicRecBkg", "Reconstructed background;#it{N}_{clusters}^{ITS} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{7, 0.5, 7.5}}}); + registry.add("hNClustersItsInnBarrPi0FromXicRecBkg", "Reconstructed background;#it{N}_{clusters}^{ITS-IB} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + registry.add("hNClustersItsInnBarrPi1FromXicRecBkg", "Reconstructed background;#it{N}_{clusters}^{ITS-IB} (#pi #leftarrow #Xi_{c}^{#plus});entries", {HistType::kTH1F, {{3, 0.5, 3.5}}}); + // Xi daughters + registry.add("hNClustersTpcBachelorPionRecBkg", "Reconstructed background;#it{N}_{clusters}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0PosDauRecBkg", "Reconstructed background;#it{N}_{clusters}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNClustersTpcV0NegDauRecBkg", "Reconstructed background;#it{N}_{clusters}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcBachelorPionRecBkg", "Reconstructed background;#it{N}_{rows}^{TPC} (#pi #leftarrow #Xi);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0PosDauRecBkg", "Reconstructed background;#it{N}_{rows}^{TPC} (V0 pos. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + registry.add("hNCrossedRowsTpcV0NegDauRecBkg", "Reconstructed background;#it{N}_{rows}^{TPC} (V0 neg. dau.);entries", {HistType::kTH1F, {{103, 49.5, 152.5}}}); + } } if (applyMl) { @@ -247,10 +298,12 @@ struct HfCandidateSelectorXicToXiPiPi { { // Successful reconstruction SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTotal); // RecoTotal = 0 --> statusXicToXiPiPi += 1 - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), All); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), All); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), All); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), All); + } } else { registry.fill(HIST("hSelCandidates"), All); } @@ -263,26 +316,69 @@ struct HfCandidateSelectorXicToXiPiPi { auto trackV0NegDau = hfCandXic.template negTrack_as(); if (fillQAHistograms) { - // eta of all final state daughters - registry.fill(HIST("hEtaPi0FromXic"), trackPi0.eta()); - registry.fill(HIST("hEtaPi1FromXic"), trackPi1.eta()); - registry.fill(HIST("hEtaBachelorPion"), trackPiFromXi.eta()); - registry.fill(HIST("hEtaV0PosDau"), trackV0PosDau.eta()); - registry.fill(HIST("hEtaV0NegDau"), trackV0NegDau.eta()); - // pions from XicPlus - registry.fill(HIST("hNClustersTpcPi0FromXic"), trackPi0.tpcNClsFound()); - registry.fill(HIST("hNClustersTpcPi1FromXic"), trackPi1.tpcNClsFound()); - registry.fill(HIST("hNClustersItsPi0FromXic"), trackPi0.itsNCls()); - registry.fill(HIST("hNClustersItsPi1FromXic"), trackPi1.itsNCls()); - registry.fill(HIST("hNClustersItsInnBarrPi0FromXic"), trackPi0.itsNClsInnerBarrel()); - registry.fill(HIST("hNClustersItsInnBarrPi1FromXic"), trackPi1.itsNClsInnerBarrel()); - // Xi daughters - registry.fill(HIST("hNClustersTpcBachelorPion"), trackPiFromXi.tpcNClsFound()); - registry.fill(HIST("hNClustersTpcV0PosDau"), trackV0PosDau.tpcNClsFound()); - registry.fill(HIST("hNClustersTpcV0NegDau"), trackV0NegDau.tpcNClsFound()); - registry.fill(HIST("hNCrossedRowsTpcBachelorPion"), trackPiFromXi.tpcNClsCrossedRows()); - registry.fill(HIST("hNCrossedRowsTpcV0PosDau"), trackV0PosDau.tpcNClsCrossedRows()); - registry.fill(HIST("hNCrossedRowsTpcV0NegDau"), trackV0NegDau.tpcNClsCrossedRows()); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hEtaPi0FromXicRecSig"), trackPi0.eta()); + registry.fill(HIST("hEtaPi1FromXicRecSig"), trackPi1.eta()); + registry.fill(HIST("hEtaBachelorPionRecSig"), trackPiFromXi.eta()); + registry.fill(HIST("hEtaV0PosDauRecSig"), trackV0PosDau.eta()); + registry.fill(HIST("hEtaV0NegDauRecSig"), trackV0NegDau.eta()); + registry.fill(HIST("hNClustersTpcPi0FromXicRecSig"), trackPi0.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcPi1FromXicRecSig"), trackPi1.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcPi0FromXicRecSig"), trackPi0.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcPi1FromXicRecSig"), trackPi1.tpcNClsCrossedRows()); + registry.fill(HIST("hNClustersItsPi0FromXicRecSig"), trackPi0.itsNCls()); + registry.fill(HIST("hNClustersItsPi1FromXicRecSig"), trackPi1.itsNCls()); + registry.fill(HIST("hNClustersItsInnBarrPi0FromXicRecSig"), trackPi0.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersItsInnBarrPi1FromXicRecSig"), trackPi1.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersTpcBachelorPionRecSig"), trackPiFromXi.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0PosDauRecSig"), trackV0PosDau.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0NegDauRecSig"), trackV0NegDau.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcBachelorPionRecSig"), trackPiFromXi.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0PosDauRecSig"), trackV0PosDau.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0NegDauRecSig"), trackV0NegDau.tpcNClsCrossedRows()); + } else { + registry.fill(HIST("hEtaPi0FromXicRecBkg"), trackPi0.eta()); + registry.fill(HIST("hEtaPi1FromXicRecBkg"), trackPi1.eta()); + registry.fill(HIST("hEtaBachelorPionRecBkg"), trackPiFromXi.eta()); + registry.fill(HIST("hEtaV0PosDauRecBkg"), trackV0PosDau.eta()); + registry.fill(HIST("hEtaV0NegDauRecBkg"), trackV0NegDau.eta()); + registry.fill(HIST("hNClustersTpcPi0FromXicRecBkg"), trackPi0.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcPi1FromXicRecBkg"), trackPi1.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcPi0FromXicRecBkg"), trackPi0.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcPi1FromXicRecBkg"), trackPi1.tpcNClsCrossedRows()); + registry.fill(HIST("hNClustersItsPi0FromXicRecBkg"), trackPi0.itsNCls()); + registry.fill(HIST("hNClustersItsPi1FromXicRecBkg"), trackPi1.itsNCls()); + registry.fill(HIST("hNClustersItsInnBarrPi0FromXicRecBkg"), trackPi0.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersItsInnBarrPi1FromXicRecBkg"), trackPi1.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersTpcBachelorPionRecBkg"), trackPiFromXi.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0PosDauRecBkg"), trackV0PosDau.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0NegDauRecBkg"), trackV0NegDau.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcBachelorPionRecBkg"), trackPiFromXi.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0PosDauRecBkg"), trackV0PosDau.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0NegDauRecBkg"), trackV0NegDau.tpcNClsCrossedRows()); + } + } else { + registry.fill(HIST("hEtaPi0FromXic"), trackPi0.eta()); + registry.fill(HIST("hEtaPi1FromXic"), trackPi1.eta()); + registry.fill(HIST("hEtaBachelorPion"), trackPiFromXi.eta()); + registry.fill(HIST("hEtaV0PosDau"), trackV0PosDau.eta()); + registry.fill(HIST("hEtaV0NegDau"), trackV0NegDau.eta()); + registry.fill(HIST("hNClustersTpcPi0FromXic"), trackPi0.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcPi1FromXic"), trackPi1.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcPi0FromXic"), trackPi0.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcPi1FromXic"), trackPi1.tpcNClsCrossedRows()); + registry.fill(HIST("hNClustersItsPi0FromXic"), trackPi0.itsNCls()); + registry.fill(HIST("hNClustersItsPi1FromXic"), trackPi1.itsNCls()); + registry.fill(HIST("hNClustersItsInnBarrPi0FromXic"), trackPi0.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersItsInnBarrPi1FromXic"), trackPi1.itsNClsInnerBarrel()); + registry.fill(HIST("hNClustersTpcBachelorPion"), trackPiFromXi.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0PosDau"), trackV0PosDau.tpcNClsFound()); + registry.fill(HIST("hNClustersTpcV0NegDau"), trackV0NegDau.tpcNClsFound()); + registry.fill(HIST("hNCrossedRowsTpcBachelorPion"), trackPiFromXi.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0PosDau"), trackV0PosDau.tpcNClsCrossedRows()); + registry.fill(HIST("hNCrossedRowsTpcV0NegDau"), trackV0NegDau.tpcNClsCrossedRows()); + } } //////////////////////////////////////////////// @@ -295,21 +391,26 @@ struct HfCandidateSelectorXicToXiPiPi { if (pTBin == -1) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Pt); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Pt); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Pt); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Pt); + } } else { registry.fill(HIST("hSelCandidates"), Pt); } + // check whether candidate mass is within a defined mass window if (std::abs(hfCandXic.invMassXicPlus() - o2::constants::physics::MassXiCPlus) > cuts->get(pTBin, "m")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Mass); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Mass); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Mass); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Mass); + } } else { registry.fill(HIST("hSelCandidates"), Mass); } @@ -318,10 +419,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.y(o2::constants::physics::MassXiCPlus)) > cuts->get(pTBin, "y")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Rapidity); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Rapidity); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Rapidity); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Rapidity); + } } else { registry.fill(HIST("hSelCandidates"), Rapidity); } @@ -330,10 +433,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.eta()) > cuts->get(pTBin, "eta")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Eta); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Eta); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Eta); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Eta); + } } else { registry.fill(HIST("hSelCandidates"), Eta); } @@ -342,10 +447,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(trackPi0.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackPi1.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackPiFromXi.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackV0PosDau.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackV0NegDau.eta()) > cuts->get(pTBin, "eta Daughters")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), EtaDaughters); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), EtaDaughters); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), EtaDaughters); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), EtaDaughters); + } } else { registry.fill(HIST("hSelCandidates"), EtaDaughters); } @@ -354,10 +461,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.ptProng1() < cuts->get(pTBin, "pT Pi0") || hfCandXic.ptProng2() < cuts->get(pTBin, "pT Pi1") || (hfCandXic.ptProng1() + hfCandXic.ptProng2()) < cuts->get(pTBin, "pT Pi0 + Pi1")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), PtPionFromXicPlus); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), PtPionFromXicPlus); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), PtPionFromXicPlus); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), PtPionFromXicPlus); + } } else { registry.fill(HIST("hSelCandidates"), PtPionFromXicPlus); } @@ -366,10 +475,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.chi2PCA() > cuts->get(pTBin, "chi2SV")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Chi2SV); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Chi2SV); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Chi2SV); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Chi2SV); + } } else { registry.fill(HIST("hSelCandidates"), Chi2SV); } @@ -378,10 +489,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.decayLength() < cuts->get(pTBin, "min decay length") || hfCandXic.decayLengthXY() < cuts->get(pTBin, "min decay length XY")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), MinDecayLength); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), MinDecayLength); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), MinDecayLength); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), MinDecayLength); + } } else { registry.fill(HIST("hSelCandidates"), MinDecayLength); } @@ -390,10 +503,12 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.invMassXiPi0() > cuts->get(pTBin, "max inv mass Xi-Pi0") || hfCandXic.invMassXiPi1() > cuts->get(pTBin, "max inv mass Xi-Pi1")) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), MaxInvMassXiPiPairs); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), MaxInvMassXiPiPairs); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), MaxInvMassXiPiPairs); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), MaxInvMassXiPiPairs); + } } else { registry.fill(HIST("hSelCandidates"), MaxInvMassXiPiPairs); } @@ -411,10 +526,12 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackV0NegDau, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); + } } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityXiDaughters); } @@ -424,10 +541,12 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackPi1, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); + } } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityPiFromCharm); } @@ -437,10 +556,12 @@ struct HfCandidateSelectorXicToXiPiPi { (!isSelectedTrackItsQuality(trackPi0, nClustersItsMin, itsChi2PerClusterMax) || trackPi1.itsNClsInnerBarrel() < nClustersItsInnBarrMin)) { return false; } - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); + } } else { registry.fill(HIST("hSelCandidates"), ItsTrackQualityPiFromCharm); } @@ -448,15 +569,17 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful track quality selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTrackQuality); // RecoTrackQuality = 2 --> statusXicToXiPiPi += 4 } else { - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); - registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); - registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); - registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); - registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); - } else if (!isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); + registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); + registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); + registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); + registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); + } + } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityXiDaughters); registry.fill(HIST("hSelCandidates"), TpcTrackQualityPiFromCharm); registry.fill(HIST("hSelCandidates"), ItsTrackQualityPiFromCharm); @@ -501,18 +624,22 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful PID selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoPID); // RecoPID = 3 --> statusXicToXiPiPi += 8 - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + } } else { registry.fill(HIST("hSelCandidates"), PidSelected); } } else { - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + } } else { registry.fill(HIST("hSelCandidates"), PidSelected); } @@ -544,10 +671,12 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful ML selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl); // RecoML = 4 --> statusXicToXiPiPi += 16 - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); + } } else { registry.fill(HIST("hSelCandidates"), BdtSelected); } @@ -611,7 +740,7 @@ struct HfCandidateSelectorXicToXiPiPi { isBdtSelected(hfCandXic, statusXicToXiPiPi, isMatchedCandidate); } else if (isMatchedCandidate) { registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); - } else if (!isMatchedCandidate) { + } else { registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); } From ce385586c1b08ac0bbd658585aff141f0363e33f Mon Sep 17 00:00:00 2001 From: pstahlhu Date: Thu, 10 Jul 2025 14:09:43 +0200 Subject: [PATCH 4/4] Introduce separate eta cuts and change to TH1D for counter histograms --- PWGHF/Core/SelectorCuts.h | 32 +++++++------- .../candidateCreatorXicToXiPiPi.cxx | 2 +- .../candidateSelectorXicToXiPiPi.cxx | 42 +++++++++++++------ 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index fe8120ad1f6..18727201d56 100644 --- a/PWGHF/Core/SelectorCuts.h +++ b/PWGHF/Core/SelectorCuts.h @@ -788,7 +788,7 @@ static const std::vector labelsCutVar = {"m", "pT p", "pT K", "pT P namespace hf_cuts_xic_to_xi_pi_pi { static constexpr int NBinsPt = 13; -static constexpr int NCutVars = 12; +static constexpr int NCutVars = 13; // default values for the pT bin edges (can be used to configure histogram axis) // offset by 1 from the bin numbers in cuts array constexpr double BinsPt[NBinsPt + 1] = { @@ -808,20 +808,20 @@ constexpr double BinsPt[NBinsPt + 1] = { 20.}; auto vecBinsPt = std::vector{BinsPt, BinsPt + NBinsPt + 1}; -// default values for the cuts m Y Eta EtaDau pT Pi0 Pi1 Sum chi2SV dL dLXY invMass Xi-Pi pairs -constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 0 < pT < 1 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 1 < pT < 2 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 2 < pT < 3 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 3 < pT < 4 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 4 < pT < 5 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 5 < pT < 6 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 6 < pT < 7 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 7 < pT < 8 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 8 < pT < 9 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 9 < pT < 10 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 10 < pT < 11 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 11 < pT < 12 */ - {0.4, 0.8, 0.8, 0.8, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}}; /* 12 < pT < 20 */ +// default values for the cuts m Y Eta EtaPi EtaXi pT Pi0 Pi1 Sum chi2SV dL dLXY invMass Xi-Pi pairs +constexpr double Cuts[NBinsPt][NCutVars] = {{0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 0 < pT < 1 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 1 < pT < 2 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 2 < pT < 3 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 3 < pT < 4 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 4 < pT < 5 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 5 < pT < 6 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 6 < pT < 7 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 7 < pT < 8 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 8 < pT < 9 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 9 < pT < 10 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 10 < pT < 11 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}, /* 11 < pT < 12 */ + {0.4, 0.8, 0.8, 0.8, 1.0, 0.1, 0.1, 0.2, 100, 0.0, 0.0, 2.4, 2.4}}; /* 12 < pT < 20 */ // row labels static const std::vector labelsPt = { @@ -840,7 +840,7 @@ static const std::vector labelsPt = { "pT bin 12"}; // column labels -static const std::vector labelsCutVar = {"m", "y", "eta", "eta Daughters", "pT Pi0", "pT Pi1", "pT Pi0 + Pi1", "chi2SV", "min decay length", "min decay length XY", "max inv mass Xi-Pi0", "max inv mass Xi-Pi1"}; +static const std::vector labelsCutVar = {"m", "y", "eta", "eta Pi from XicPlus", "eta Xi Daughters", "pT Pi0", "pT Pi1", "pT Pi0 + Pi1", "chi2SV", "min decay length", "min decay length XY", "max inv mass Xi-Pi0", "max inv mass Xi-Pi1"}; } // namespace hf_cuts_xic_to_xi_pi_pi namespace hf_cuts_xicc_to_p_k_pi_pi diff --git a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx index 7f998d0b817..3d5688a6db1 100644 --- a/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx @@ -146,7 +146,7 @@ struct HfCandidateCreatorXicToXiPiPi { registry.add("hVertexerType", "Use DCAFitter or KFParticle;;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}); registry.get(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::DCAFitter, "DCAFitter"); registry.get(HIST("hVertexerType"))->GetXaxis()->SetBinLabel(1 + aod::hf_cand::VertexerType::KfParticle, "KFParticle"); - registry.add("hCandCounter", "hCandCounter", {HistType::kTH1F, {{4, -0.5, 3.5}}}); + registry.add("hCandCounter", "hCandCounter", {HistType::kTH1D, {{4, -0.5, 3.5}}}); registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + TotalSkimmedTriplets, "total"); registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + SelEvent, "Event selected"); registry.get(HIST("hCandCounter"))->GetXaxis()->SetBinLabel(1 + CascPreSel, "Cascade preselection"); diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index 389b53dbf99..c4087a93e75 100644 --- a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx @@ -101,7 +101,8 @@ struct HfCandidateSelectorXicToXiPiPi { Mass, Rapidity, Eta, - EtaDaughters, + EtaPionFromXicPlus, + EtaXiDaughters, PtPionFromXicPlus, Chi2SV, MinDecayLength, @@ -146,25 +147,26 @@ struct HfCandidateSelectorXicToXiPiPi { labels[Mass] = "#Delta M"; labels[Rapidity] = "y"; labels[Eta] = "#eta"; - labels[EtaDaughters] = "#eta final state daughters"; - labels[PtPionFromXicPlus] = "#it{p}_{T} (#pi #leftarrow #Xi_{c}^{+})"; + labels[EtaPionFromXicPlus] = "#eta (#pi #leftarrow #Xi_{c}^{#plus})"; + labels[EtaXiDaughters] = "#eta (#Xi daughters)"; + labels[PtPionFromXicPlus] = "#it{p}_{T} (#pi #leftarrow #Xi_{c}^{#plus})"; labels[Chi2SV] = "#chi^{2}_{SV}"; labels[MinDecayLength] = "Decay length"; labels[MaxInvMassXiPiPairs] = "M_{#Xi #pi}"; labels[TpcTrackQualityXiDaughters] = "TPC track quality selection on #Xi daughters"; - labels[TpcTrackQualityPiFromCharm] = "TPC track quality selection on #pi #leftarrow #Xi_{c}^{+}"; - labels[ItsTrackQualityPiFromCharm] = "ITS track quality selection on #pi #leftarrow #Xi_{c}^{+}"; + labels[TpcTrackQualityPiFromCharm] = "TPC track quality selection on #pi #leftarrow #Xi_{c}^{#plus}"; + labels[ItsTrackQualityPiFromCharm] = "ITS track quality selection on #pi #leftarrow #Xi_{c}^{#plus}"; labels[PidSelected] = "PID selection"; labels[BdtSelected] = "BDT selection"; if (doprocessData) { - registry.add("hSelCandidates", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); + registry.add("hSelCandidates", ";;entries", {HistType::kTH1D, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); for (int iBin = 0; iBin < NSelectionCriteria; ++iBin) { registry.get(HIST("hSelCandidates"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); } } else if (doprocessMc) { - registry.add("hSelCandidatesRecSig", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); - registry.add("hSelCandidatesRecBkg", ";;entries", {HistType::kTH1F, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); + registry.add("hSelCandidatesRecSig", ";;entries", {HistType::kTH1D, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); + registry.add("hSelCandidatesRecBkg", ";;entries", {HistType::kTH1D, {{NSelectionCriteria, -0.5f, +NSelectionCriteria - 0.5f}}}); for (int iBin = 0; iBin < NSelectionCriteria; ++iBin) { registry.get(HIST("hSelCandidatesRecSig"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); registry.get(HIST("hSelCandidatesRecBkg"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin].data()); @@ -443,18 +445,32 @@ struct HfCandidateSelectorXicToXiPiPi { registry.fill(HIST("hSelCandidates"), Eta); } - // cut on pseudorapidity of final state daughters - if (std::abs(trackPi0.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackPi1.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackPiFromXi.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackV0PosDau.eta()) > cuts->get(pTBin, "eta Daughters") || std::abs(trackV0NegDau.eta()) > cuts->get(pTBin, "eta Daughters")) { + // cut on pseudorapidity of pions from XicPlus + if (std::abs(trackPi0.eta()) > cuts->get(pTBin, "eta Pi from XicPlus") || std::abs(trackPi1.eta()) > cuts->get(pTBin, "eta Pi from XicPlus")) { return false; } if constexpr (isMc) { if (isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), EtaDaughters); + registry.fill(HIST("hSelCandidatesRecSig"), EtaPionFromXicPlus); } else { - registry.fill(HIST("hSelCandidatesRecBkg"), EtaDaughters); + registry.fill(HIST("hSelCandidatesRecBkg"), EtaPionFromXicPlus); } } else { - registry.fill(HIST("hSelCandidates"), EtaDaughters); + registry.fill(HIST("hSelCandidates"), EtaPionFromXicPlus); + } + + // cut on pseudorapidity of Xi daughters + if (std::abs(trackPiFromXi.eta()) > cuts->get(pTBin, "eta Xi Daughters") || std::abs(trackV0PosDau.eta()) > cuts->get(pTBin, "eta Xi Daughters") || std::abs(trackV0NegDau.eta()) > cuts->get(pTBin, "eta Xi Daughters")) { + return false; + } + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), EtaXiDaughters); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), EtaXiDaughters); + } + } else { + registry.fill(HIST("hSelCandidates"), EtaXiDaughters); } // cut on pion pT