diff --git a/PWGHF/Core/SelectorCuts.h b/PWGHF/Core/SelectorCuts.h index f0a9ad9034e..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 = 11; +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 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 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", "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 d12c5d799d2..3d5688a6db1 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::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"); + 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(); diff --git a/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx b/PWGHF/TableProducer/candidateSelectorXicToXiPiPi.cxx index bb0bbf04c78..c4087a93e75 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)"}; @@ -101,7 +101,8 @@ struct HfCandidateSelectorXicToXiPiPi { Mass, Rapidity, Eta, - EtaDaughters, + EtaPionFromXicPlus, + EtaXiDaughters, PtPionFromXicPlus, Chi2SV, MinDecayLength, @@ -140,36 +141,109 @@ 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"; + std::string labels[NSelectionCriteria]; + labels[All] = "All"; + labels[Pt] = "#it{p}_{T}"; + labels[Mass] = "#Delta M"; + labels[Rapidity] = "y"; + labels[Eta] = "#eta"; + 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}^{#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::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::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()); + } + } + if (fillQAHistograms) { 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()); - } + // 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) { - 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()); - } + // 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}}}); } } @@ -226,11 +300,13 @@ struct HfCandidateSelectorXicToXiPiPi { { // Successful reconstruction SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoTotal); // RecoTotal = 0 --> statusXicToXiPiPi += 1 - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), All); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), All); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), All); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), All); + } + } else { registry.fill(HIST("hSelCandidates"), All); } @@ -241,6 +317,72 @@ struct HfCandidateSelectorXicToXiPiPi { auto trackV0PosDau = hfCandXic.template posTrack_as(); auto trackV0NegDau = hfCandXic.template negTrack_as(); + if (fillQAHistograms) { + 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()); + } + } + //////////////////////////////////////////////// // Kinematic and topological selection // //////////////////////////////////////////////// @@ -251,22 +393,27 @@ struct HfCandidateSelectorXicToXiPiPi { if (pTBin == -1) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Pt); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Pt); - } else if (fillHistogram && !isMc) { + 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 (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Mass); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Mass); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Mass); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Mass); + } + } else { registry.fill(HIST("hSelCandidates"), Mass); } @@ -274,11 +421,13 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.y(o2::constants::physics::MassXiCPlus)) > cuts->get(pTBin, "y")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Rapidity); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Rapidity); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Rapidity); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Rapidity); + } + } else { registry.fill(HIST("hSelCandidates"), Rapidity); } @@ -286,35 +435,55 @@ struct HfCandidateSelectorXicToXiPiPi { if (std::abs(hfCandXic.eta()) > cuts->get(pTBin, "eta")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Eta); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Eta); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Eta); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Eta); + } + } else { 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"), EtaPionFromXicPlus); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), EtaPionFromXicPlus); + } + } else { + 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 (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), EtaDaughters); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), EtaDaughters); - } else if (fillHistogram && !isMc) { - registry.fill(HIST("hSelCandidates"), EtaDaughters); + 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 - 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) { - registry.fill(HIST("hSelCandidatesRecSig"), PtPionFromXicPlus); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), PtPionFromXicPlus); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), PtPionFromXicPlus); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), PtPionFromXicPlus); + } + } else { registry.fill(HIST("hSelCandidates"), PtPionFromXicPlus); } @@ -322,11 +491,13 @@ struct HfCandidateSelectorXicToXiPiPi { if (hfCandXic.chi2PCA() > cuts->get(pTBin, "chi2SV")) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), Chi2SV); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), Chi2SV); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), Chi2SV); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), Chi2SV); + } + } else { registry.fill(HIST("hSelCandidates"), Chi2SV); } @@ -334,11 +505,13 @@ 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) { - registry.fill(HIST("hSelCandidatesRecSig"), MinDecayLength); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), MinDecayLength); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), MinDecayLength); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), MinDecayLength); + } + } else { registry.fill(HIST("hSelCandidates"), MinDecayLength); } @@ -346,11 +519,13 @@ 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) { - registry.fill(HIST("hSelCandidatesRecSig"), MaxInvMassXiPiPairs); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), MaxInvMassXiPiPairs); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), MaxInvMassXiPiPairs); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), MaxInvMassXiPiPairs); + } + } else { registry.fill(HIST("hSelCandidates"), MaxInvMassXiPiPairs); } @@ -367,11 +542,13 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackV0NegDau, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityXiDaughters); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityXiDaughters); + } + } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityXiDaughters); } @@ -380,11 +557,13 @@ struct HfCandidateSelectorXicToXiPiPi { !isSelectedTrackTpcQuality(trackPi1, nClustersTpcMin, nTpcCrossedRowsMin, tpcCrossedRowsOverFindableClustersRatioMin, tpcChi2PerClusterMax)) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), TpcTrackQualityPiFromCharm); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), TpcTrackQualityPiFromCharm); + } + } else { registry.fill(HIST("hSelCandidates"), TpcTrackQualityPiFromCharm); } @@ -393,26 +572,30 @@ struct HfCandidateSelectorXicToXiPiPi { (!isSelectedTrackItsQuality(trackPi0, nClustersItsMin, itsChi2PerClusterMax) || trackPi1.itsNClsInnerBarrel() < nClustersItsInnBarrMin)) { return false; } - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), ItsTrackQualityPiFromCharm); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), ItsTrackQualityPiFromCharm); + } + } 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) { - 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) { + } else { + 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); @@ -457,18 +640,22 @@ struct HfCandidateSelectorXicToXiPiPi { // Successful PID selection SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoPID); // RecoPID = 3 --> statusXicToXiPiPi += 8 - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); - } else if (fillHistogram && !isMc) { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + } + } else { registry.fill(HIST("hSelCandidates"), PidSelected); } - } else if (fillHistogram) { - if (isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); - } else if (isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + } else { + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), PidSelected); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), PidSelected); + } } else { registry.fill(HIST("hSelCandidates"), PidSelected); } @@ -499,12 +686,14 @@ struct HfCandidateSelectorXicToXiPiPi { } // Successful ML selection - SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl); // RecoPID = 4 --> statusXicToXiPiPi += 16 - if (fillHistogram && isMc && isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); - } else if (fillHistogram && isMc && !isMatchedSignal) { - registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); - } else if (fillHistogram && !isMc) { + SETBIT(statusXicToXiPiPi, hf_sel_candidate_xic::XicToXiPiPiSelectionStep::RecoMl); // RecoML = 4 --> statusXicToXiPiPi += 16 + if constexpr (isMc) { + if (isMatchedSignal) { + registry.fill(HIST("hSelCandidatesRecSig"), BdtSelected); + } else { + registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); + } + } else { registry.fill(HIST("hSelCandidates"), BdtSelected); } } @@ -530,7 +719,7 @@ struct HfCandidateSelectorXicToXiPiPi { // ML selection if (applyMl) { isBdtSelected(hfCandXic, statusXicToXiPiPi); - } else if (fillHistogram) { + } else { registry.fill(HIST("hSelCandidates"), BdtSelected); } @@ -565,9 +754,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 { registry.fill(HIST("hSelCandidatesRecBkg"), BdtSelected); }