From 18c7f77190d4bc6e560db2fae36bfb3535dd9f5e Mon Sep 17 00:00:00 2001 From: Stefano Trogolo Date: Fri, 13 Aug 2021 10:55:15 +0200 Subject: [PATCH 1/5] Modification of D0 task for step-by-step efficiency --- .../HFCandidateSelectionTables.h | 13 +++++- .../Tasks/PWGHF/HFD0CandidateSelector.cxx | 19 +++++--- Analysis/Tasks/PWGHF/taskD0.cxx | 44 +++++++++++++++++-- 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h b/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h index 57621f8695f02..b81ad60329210 100644 --- a/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h +++ b/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h @@ -18,10 +18,19 @@ namespace hf_selcandidate_d0 { 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 { DECLARE_SOA_COLUMN(IsSelDplusToPiKPi, isSelDplusToPiKPi, int); //! 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..4c6686346848b 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,25 @@ 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 +205,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()); } From da68aab7cc69f40a83cc8c485878791f88fb6564 Mon Sep 17 00:00:00 2001 From: Stefano Trogolo Date: Fri, 13 Aug 2021 14:15:12 +0200 Subject: [PATCH 2/5] Fixing clang format in HFCandidateSelectionTables --- .../AnalysisDataModel/HFCandidateSelectionTables.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h b/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h index b81ad60329210..63f3ac543d404 100644 --- a/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h +++ b/Analysis/DataModel/include/AnalysisDataModel/HFCandidateSelectionTables.h @@ -16,21 +16,21 @@ 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(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::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 { DECLARE_SOA_COLUMN(IsSelDplusToPiKPi, isSelDplusToPiKPi, int); //! From a8612982694e47cee04acb7cbbb4cb6859eca537 Mon Sep 17 00:00:00 2001 From: Stefano Trogolo Date: Fri, 13 Aug 2021 14:32:20 +0200 Subject: [PATCH 3/5] Fixing clang format in taskD0 --- Analysis/Tasks/PWGHF/taskD0.cxx | 68 +++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/Analysis/Tasks/PWGHF/taskD0.cxx b/Analysis/Tasks/PWGHF/taskD0.cxx index 4c6686346848b..305a37f2cd880 100644 --- a/Analysis/Tasks/PWGHF/taskD0.cxx +++ b/Analysis/Tasks/PWGHF/taskD0.cxx @@ -124,21 +124,21 @@ struct TaskD0MC { {"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.}}}}, - {"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.}}}}}}; + {"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"}; @@ -147,7 +147,7 @@ struct TaskD0MC { 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::isRecoHFFlag >= d_selectionHFFlag); //Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= d_selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= d_selectionFlagD0bar); @@ -171,23 +171,35 @@ struct TaskD0MC { 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.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); + 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); + 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()); From 0098dd2a768f9bf9189aaa730e61579809f2cbde Mon Sep 17 00:00:00 2001 From: Stefano Trogolo Date: Mon, 16 Aug 2021 12:31:08 +0200 Subject: [PATCH 4/5] Add braces to if-statements to fix build format error --- Analysis/Tasks/PWGHF/taskD0.cxx | 36 ++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Analysis/Tasks/PWGHF/taskD0.cxx b/Analysis/Tasks/PWGHF/taskD0.cxx index 305a37f2cd880..9f5bcbd30de21 100644 --- a/Analysis/Tasks/PWGHF/taskD0.cxx +++ b/Analysis/Tasks/PWGHF/taskD0.cxx @@ -171,35 +171,47 @@ struct TaskD0MC { auto ptRec = candidate.pt(); auto yRec = YD0(candidate); registry.fill(HIST("hPtRecSig"), ptRec); // rec. level pT - if (candidate.isRecoHFFlag() >= d_selectionHFFlag) + if (candidate.isRecoHFFlag() >= d_selectionHFFlag) { registry.fill(HIST("hPtvsYRecSig_RecoHFFlag"), ptRec, yRec); - if (candidate.isRecoTopol() >= d_selectionTopol) + } + if (candidate.isRecoTopol() >= d_selectionTopol) { registry.fill(HIST("hPtvsYRecSig_RecoTopol"), ptRec, yRec); - if (candidate.isRecoCand() >= d_selectionCand) + } + if (candidate.isRecoCand() >= d_selectionCand) { registry.fill(HIST("hPtvsYRecSig_RecoCand"), ptRec, yRec); - if (candidate.isRecoPID() >= d_selectionPID) + } + 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) + if (candidate.isRecoHFFlag() >= d_selectionHFFlag) { registry.fill(HIST("hPtvsYRecSigPrompt_RecoHFFlag"), ptRec, yRec); - if (candidate.isRecoTopol() >= d_selectionTopol) + } + if (candidate.isRecoTopol() >= d_selectionTopol) { registry.fill(HIST("hPtvsYRecSigPrompt_RecoTopol"), ptRec, yRec); - if (candidate.isRecoCand() >= d_selectionCand) + } + if (candidate.isRecoCand() >= d_selectionCand) { registry.fill(HIST("hPtvsYRecSigPrompt_RecoCand"), ptRec, yRec); - if (candidate.isRecoPID() >= d_selectionPID) + } + 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) + if (candidate.isRecoHFFlag() >= d_selectionHFFlag) { registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoHFFlag"), ptRec, yRec); - if (candidate.isRecoTopol() >= d_selectionTopol) + } + if (candidate.isRecoTopol() >= d_selectionTopol) { registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoTopol"), ptRec, yRec); - if (candidate.isRecoCand() >= d_selectionCand) + } + if (candidate.isRecoCand() >= d_selectionCand) { registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoCand"), ptRec, yRec); - if (candidate.isRecoPID() >= d_selectionPID) + } + if (candidate.isRecoPID() >= d_selectionPID) { registry.fill(HIST("hPtvsYRecSigNonPrompt_RecoPID"), ptRec, yRec); + } } registry.fill(HIST("hCPARecSig"), candidate.cpa()); registry.fill(HIST("hEtaRecSig"), candidate.eta()); From 90381c10f54be3285314d1b2a7346442dc800882 Mon Sep 17 00:00:00 2001 From: Stefano Trogolo Date: Mon, 16 Aug 2021 13:21:41 +0200 Subject: [PATCH 5/5] Fixing clang format --- Analysis/Tasks/PWGHF/taskD0.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Analysis/Tasks/PWGHF/taskD0.cxx b/Analysis/Tasks/PWGHF/taskD0.cxx index 9f5bcbd30de21..fd251ceca78d6 100644 --- a/Analysis/Tasks/PWGHF/taskD0.cxx +++ b/Analysis/Tasks/PWGHF/taskD0.cxx @@ -173,45 +173,45 @@ struct TaskD0MC { 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());