From d3cd2d60289229411118ae14cf25ed2a74dee837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Sat, 5 Dec 2020 22:18:48 +0100 Subject: [PATCH 1/3] Fix tabs. --- Analysis/Core/CMakeLists.txt | 4 ++-- Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Analysis/Core/CMakeLists.txt b/Analysis/Core/CMakeLists.txt index f8e732ee91b70..5a7ab7707b2ab 100644 --- a/Analysis/Core/CMakeLists.txt +++ b/Analysis/Core/CMakeLists.txt @@ -12,7 +12,7 @@ o2_add_library(AnalysisCore SOURCES src/CorrelationContainer.cxx src/TrackSelection.cxx src/TriggerAliases.cxx - src/HFConfigurables.cxx + src/HFConfigurables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel) o2_target_root_dictionary(AnalysisCore @@ -21,7 +21,7 @@ o2_target_root_dictionary(AnalysisCore include/AnalysisCore/TrackSelectionDefaults.h include/AnalysisCore/TriggerAliases.h include/AnalysisCore/MC.h - include/AnalysisCore/HFConfigurables.h + include/AnalysisCore/HFConfigurables.h LINKDEF src/AnalysisCoreLinkDef.h) if(FastJet_FOUND) diff --git a/Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx b/Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx index 7cbf629fcf51a..9b9d03967fd98 100644 --- a/Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx +++ b/Analysis/Tasks/PWGHF/HFTrackIndexSkimsCreator.cxx @@ -207,7 +207,7 @@ struct HFTrackIndexSkimsCreator { /* if (nCollsMax > -1){ if (nColls == nCollMax){ - return; + return; //can be added to run over limited collisions per file - for tesing purposes } nColls++; From 767f5982016beb72759edac4e8f74b5961a38cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 15 Jan 2021 20:15:49 +0100 Subject: [PATCH 2/3] RecoDecay: getMother: Enforce matching type of the MC particle. --- Analysis/Core/include/AnalysisCore/RecoDecay.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Analysis/Core/include/AnalysisCore/RecoDecay.h b/Analysis/Core/include/AnalysisCore/RecoDecay.h index fb4997040c214..fc6db5219a791 100644 --- a/Analysis/Core/include/AnalysisCore/RecoDecay.h +++ b/Analysis/Core/include/AnalysisCore/RecoDecay.h @@ -513,8 +513,8 @@ class RecoDecay /// \param acceptAntiParticles switch to accept the antiparticle of the expected mother /// \param sign antiparticle indicator of the found mother w.r.t. PDGMother; 1 if particle, -1 if antiparticle, 0 if mother not found /// \return index of the mother particle if found, -1 otherwise - template - static int getMother(const T& particlesMC, const U& particle, int PDGMother, bool acceptAntiParticles = false, int8_t* sign = nullptr) + template + static int getMother(const T& particlesMC, const typename T::iterator& particle, int PDGMother, bool acceptAntiParticles = false, int8_t* sign = nullptr) { int8_t sgn = 0; // 1 if the expected mother is particle, -1 if antiparticle (w.r.t. PDGMother) int indexMother = -1; // index of the final matched mother, if found From 270f0fce680cc363c0edcf246b663d0a078f2b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 15 Jan 2021 20:47:06 +0100 Subject: [PATCH 3/3] PWGHF: MC D0: Add gen. level pT of matched candidates. --- Analysis/Tasks/PWGHF/taskD0.cxx | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/Analysis/Tasks/PWGHF/taskD0.cxx b/Analysis/Tasks/PWGHF/taskD0.cxx index 54ae5fcb5afa6..97d91effdb232 100644 --- a/Analysis/Tasks/PWGHF/taskD0.cxx +++ b/Analysis/Tasks/PWGHF/taskD0.cxx @@ -99,14 +99,15 @@ struct TaskD0 { struct TaskD0MC { HistogramRegistry registry{ "registry", - {{"hPtRecSig", "2-prong candidates (rec. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, - {"hPtRecBg", "2-prong candidates (rec. unmatched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, - {"hPtGen", "2-prong candidates (gen. matched);#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, - {"hCPARecSig", "2-prong candidates (rec. matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"hCPARecBg", "2-prong candidates (rec. unmatched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"hEtaRecSig", "2-prong candidates (rec. matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"hEtaRecBg", "2-prong candidates (rec. unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"hEtaGen", "2-prong candidates (gen. matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; + {{"hPtRecSig", "2-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, + {"hPtRecBg", "2-prong candidates (unmatched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, + {"hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, + {"hPtGenSig", "2-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, + {"hCPARecSig", "2-prong candidates (matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, + {"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.}}}}}}; Configurable d_selectionFlagD0{"d_selectionFlagD0", 1, "Selection Flag for D0"}; Configurable d_selectionFlagD0bar{"d_selectionFlagD0bar", 1, "Selection Flag for D0bar"}; @@ -115,7 +116,7 @@ struct TaskD0MC { 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) + soa::Join const& particlesMC, aod::BigTracksMC const& tracks) { // MC rec. //Printf("MC Candidates: %d", candidates.size()); @@ -125,7 +126,11 @@ struct TaskD0MC { continue; } if (std::abs(candidate.flagMCMatchRec()) == D0ToPiK) { - registry.fill(HIST("hPtRecSig"), candidate.pt()); + // Get the corresponding MC particle. + auto indexMother = RecoDecay::getMother(particlesMC, candidate.index0_as().label_as>(), 421, true); + auto particleMother = particlesMC.iteratorAt(indexMother); + registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT + registry.fill(HIST("hPtRecSig"), candidate.pt()); // rec. level pT registry.fill(HIST("hCPARecSig"), candidate.cpa()); registry.fill(HIST("hEtaRecSig"), candidate.eta()); } else {