diff --git a/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h b/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h index 57621f8695f02..63f3ac543d404 100644 --- a/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h +++ b/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h @@ -16,11 +16,20 @@ namespace o2::aod { namespace hf_selcandidate_d0 { -DECLARE_SOA_COLUMN(IsSelD0, isSelD0, int); //! -DECLARE_SOA_COLUMN(IsSelD0bar, isSelD0bar, int); //! +DECLARE_SOA_COLUMN(IsSelD0, isSelD0, int); //! +DECLARE_SOA_COLUMN(IsSelD0bar, isSelD0bar, int); //! +DECLARE_SOA_COLUMN(IsRecoHFFlag, isRecoHFFlag, int); //! +DECLARE_SOA_COLUMN(IsRecoTopol, isRecoTopol, int); //! +DECLARE_SOA_COLUMN(IsRecoCand, isRecoCand, int); //! +DECLARE_SOA_COLUMN(IsRecoPID, isRecoPID, int); } // namespace hf_selcandidate_d0 DECLARE_SOA_TABLE(HFSelD0Candidate, "AOD", "HFSELD0CAND", //! - hf_selcandidate_d0::IsSelD0, hf_selcandidate_d0::IsSelD0bar); + hf_selcandidate_d0::IsSelD0, + hf_selcandidate_d0::IsSelD0bar, + hf_selcandidate_d0::IsRecoHFFlag, + hf_selcandidate_d0::IsRecoTopol, + hf_selcandidate_d0::IsRecoCand, + hf_selcandidate_d0::IsRecoPID); namespace hf_selcandidate_dplus { diff --git a/Analysis/Tasks/PWGHF/HFD0CandidateSelector.cxx b/Analysis/Tasks/PWGHF/HFD0CandidateSelector.cxx index fb7a002a1b3f9..9b44478366e4f 100644 --- a/Analysis/Tasks/PWGHF/HFD0CandidateSelector.cxx +++ b/Analysis/Tasks/PWGHF/HFD0CandidateSelector.cxx @@ -181,11 +181,16 @@ struct HFD0CandidateSelector { // final selection flag: 0 - rejected, 1 - accepted int statusD0 = 0; int statusD0bar = 0; + int statusHFFlag = 0; + int statusTopol = 0; + int statusCand = 0; + int statusPID = 0; if (!(candidate.hfflag() & 1 << DecayType::D0ToPiK)) { - hfSelD0Candidate(statusD0, statusD0bar); + hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); continue; } + statusHFFlag = 1; auto trackPos = candidate.index0_as(); // positive daughter auto trackNeg = candidate.index1_as(); // negative daughter @@ -199,9 +204,10 @@ struct HFD0CandidateSelector { // conjugate-independent topological selection if (!selectionTopol(candidate)) { - hfSelD0Candidate(statusD0, statusD0bar); + hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); continue; } + statusTopol = 1; // implement filter bit 4 cut - should be done before this task at the track selection level // need to add special cuts (additional cuts on decay length and d0 norm) @@ -212,9 +218,10 @@ struct HFD0CandidateSelector { bool topolD0bar = selectionTopolConjugate(candidate, trackNeg, trackPos); if (!topolD0 && !topolD0bar) { - hfSelD0Candidate(statusD0, statusD0bar); + hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); continue; } + statusCand = 1; // track-level PID selection int pidTrackPosKaon = selectorKaon.getStatusTrackPIDAll(trackPos); @@ -246,7 +253,7 @@ struct HFD0CandidateSelector { } if (pidD0 == 0 && pidD0bar == 0) { - hfSelD0Candidate(statusD0, statusD0bar); + hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); continue; } @@ -256,8 +263,8 @@ struct HFD0CandidateSelector { if ((pidD0bar == -1 || pidD0bar == 1) && topolD0bar) { statusD0bar = 1; // identified as D0bar } - - hfSelD0Candidate(statusD0, statusD0bar); + statusPID = 1; + hfSelD0Candidate(statusD0, statusD0bar, statusHFFlag, statusTopol, statusCand, statusPID); } } }; diff --git a/Analysis/Tasks/PWGHF/taskD0.cxx b/Analysis/Tasks/PWGHF/taskD0.cxx index 6cb7aa047680f..fd251ceca78d6 100644 --- a/Analysis/Tasks/PWGHF/taskD0.cxx +++ b/Analysis/Tasks/PWGHF/taskD0.cxx @@ -123,13 +123,33 @@ struct TaskD0MC { {"hCPARecBg", "2-prong candidates (unmatched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, {"hEtaRecSig", "2-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, {"hEtaRecBg", "2-prong candidates (unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; + {"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, + {"hPtvsYRecSig_RecoPID", "2-prong candidates (RecoPID - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigPrompt_RecoPID", "2-prong candidates (RecoPID - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigNonPrompt_RecoPID", "2-prong candidates (RecoPID - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSig_RecoCand", "2-prong candidates (RecoCand - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigPrompt_RecoCand", "2-prong candidates (RecoCand - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigNonPrompt_RecoCand", "2-prong candidates (RecoCand - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSig_RecoTopol", "2-prong candidates (RecoTopol - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigPrompt_RecoTopol", "2-prong candidates (RecoTopol - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigNonPrompt_RecoTopol", "2-prong candidates (RecoTopol - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSig_RecoHFFlag", "2-prong candidates (RecoHFFlag - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigPrompt_RecoHFFlag", "2-prong candidates (RecoHFFlag - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYRecSigNonPrompt_RecoHFFlag", "2-prong candidates (RecoHFFlag - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYGen", "2-prong candidates (matched);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYGenPrompt", "2-prong candidates (matched, prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}, + {"hPtvsYGenNonPrompt", "2-prong candidates (matched, non-prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{100, 0., 10.}, {100, -2., 2.}}}}}}; Configurable d_selectionFlagD0{"d_selectionFlagD0", 1, "Selection Flag for D0"}; Configurable d_selectionFlagD0bar{"d_selectionFlagD0bar", 1, "Selection Flag for D0bar"}; + Configurable d_selectionHFFlag{"d_selectionHFFlag", 1, "Selection Flag for HF flagged candidates"}; + Configurable d_selectionTopol{"d_selectionTopol", 1, "Selection Flag for topologically selected candidates"}; + Configurable d_selectionCand{"d_selectionCand", 1, "Selection Flag for conj. topol. selected candidates"}; + Configurable d_selectionPID{"d_selectionPID", 1, "Selection Flag for reco PID candidates"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= d_selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= d_selectionFlagD0bar); + Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isRecoHFFlag >= d_selectionHFFlag); + //Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= d_selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= d_selectionFlagD0bar); void process(soa::Filtered> const& candidates, soa::Join const& particlesMC, aod::BigTracksMC const& tracks) @@ -149,11 +169,49 @@ struct TaskD0MC { auto particleMother = particlesMC.iteratorAt(indexMother); registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT auto ptRec = candidate.pt(); + auto yRec = YD0(candidate); registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT + if (candidate.isRecoHFFlag() >= d_selectionHFFlag) { + registry.fill(HIST("hPtvsYRecSig_RecoHFFlag"), ptRec, yRec); + } + if (candidate.isRecoTopol() >= d_selectionTopol) { + registry.fill(HIST("hPtvsYRecSig_RecoTopol"), ptRec, yRec); + } + if (candidate.isRecoCand() >= d_selectionCand) { + registry.fill(HIST("hPtvsYRecSig_RecoCand"), ptRec, yRec); + } + if (candidate.isRecoPID() >= d_selectionPID) { + registry.fill(HIST("hPtvsYRecSig_RecoPID"), ptRec, yRec); + } + if (candidate.originMCRec() == OriginType::Prompt) { registry.fill(HIST("hPtRecSigPrompt"), ptRec); // rec. level pT, prompt + if (candidate.isRecoHFFlag() >= d_selectionHFFlag) { + registry.fill(HIST("hPtvsYRecSigPrompt_RecoHFFlag"), ptRec, yRec); + } + if (candidate.isRecoTopol() >= d_selectionTopol) { + registry.fill(HIST("hPtvsYRecSigPrompt_RecoTopol"), ptRec, yRec); + } + if (candidate.isRecoCand() >= d_selectionCand) { + registry.fill(HIST("hPtvsYRecSigPrompt_RecoCand"), ptRec, yRec); + } + if (candidate.isRecoPID() >= d_selectionPID) { + registry.fill(HIST("hPtvsYRecSigPrompt_RecoPID"), ptRec, yRec); + } } else { registry.fill(HIST("hPtRecSigNonPrompt"), ptRec); // rec. level pT, non-prompt + if (candidate.isRecoHFFlag() >= d_selectionHFFlag) { + registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoHFFlag"), ptRec, yRec); + } + if (candidate.isRecoTopol() >= d_selectionTopol) { + registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoTopol"), ptRec, yRec); + } + if (candidate.isRecoCand() >= d_selectionCand) { + registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoCand"), ptRec, yRec); + } + if (candidate.isRecoPID() >= d_selectionPID) { + registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoPID"), ptRec, yRec); + } } registry.fill(HIST("hCPARecSig"), candidate.cpa()); registry.fill(HIST("hEtaRecSig"), candidate.eta()); @@ -171,11 +229,15 @@ struct TaskD0MC { continue; } auto ptGen = particle.pt(); + auto yGen = RecoDecay::Y(array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode())); registry.fill(HIST("hPtGen"), ptGen); + registry.fill(HIST("hPtvsYGen"), ptGen, yGen); if (particle.originMCGen() == OriginType::Prompt) { registry.fill(HIST("hPtGenPrompt"), ptGen); + registry.fill(HIST("hPtvsYGenPrompt"), ptGen, yGen); } else { registry.fill(HIST("hPtGenNonPrompt"), ptGen); + registry.fill(HIST("hPtvsYGenNonPrompt"), ptGen, yGen); } registry.fill(HIST("hEtaGen"), particle.eta()); }