From ca2d0bd4b51602e82a61911a55c21c57644afc61 Mon Sep 17 00:00:00 2001 From: Fabio Colamaria Date: Mon, 22 Nov 2021 11:24:45 +0100 Subject: [PATCH 01/16] PWGHF: update of DDbar correlation code (remove obsolete tasks + add process switch) --- PWGHF/Tasks/HFCorrelatorD0D0bar.cxx | 550 ++-------------- .../HFCorrelatorD0D0barBarrelFullPID.cxx | 552 ++-------------- PWGHF/Tasks/HFCorrelatorDplusDminus.cxx | 589 ++---------------- PWGHF/Tasks/taskCorrelationDDbar.cxx | 249 +++----- 4 files changed, 252 insertions(+), 1688 deletions(-) diff --git a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx index 5811de47080..d14fb2d0b47 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HFCorrelatorD0D0bar.cxx +/// \file HfCorrelatorD0D0bar.cxx /// \brief D0-D0bar correlator task - data-like, MC-reco and MC-kine analyses. For ULS and LS pairs /// /// \author Fabio Colamaria , INFN Bari @@ -29,18 +29,6 @@ using namespace o2::aod::hf_correlation_ddbar; using namespace o2::analysis::hf_cuts_d0_topik; using namespace o2::constants::math; -void customize(std::vector& workflowOptions) -{ - ConfigParamSpec optionDoLikeSign{"doLikeSign", VariantType::Bool, false, {"Run Like-Sign analysis."}}; - ConfigParamSpec optionDoMCccbar{"doMCccbar", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCGen{"doMCGen", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCRec{"doMCRec", VariantType::Bool, true, {"Run MC-Rec dedicated tasks."}}; - workflowOptions.push_back(optionDoLikeSign); - workflowOptions.push_back(optionDoMCccbar); - workflowOptions.push_back(optionDoMCGen); - workflowOptions.push_back(optionDoMCRec); -} - #include "Framework/runDataProcessing.h" /// @@ -64,7 +52,6 @@ auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficienc using MCParticlesPlus = soa::Join; -/// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) struct HfCorrelatorD0D0bar { Produces entryD0D0barPair; Produces entryD0D0barRecoInfo; @@ -81,7 +68,23 @@ struct HfCorrelatorD0D0bar { {"hY", "D0,D0bar candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; + {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, + {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, + {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; @@ -98,11 +101,20 @@ struct HfCorrelatorD0D0bar { registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= selectionFlagD0bar); - void process(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) + /// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) + void processData(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) { int nTracks = 0; if (collision.numContrib() > 1) { @@ -205,51 +217,11 @@ struct HfCorrelatorD0D0bar { } //end outer loop } -}; -/// D0-D0bar correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) -struct HfCorrelatorD0D0barMcRec { - - Produces entryD0D0barPair; - Produces entryD0D0barRecoInfo; + PROCESS_SWITCH(HfCorrelatorD0D0bar, processData, "Process data", false); - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; - - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for D0 meson"}; - Configurable flagApplyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; - Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; - Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= selectionFlagD0bar); - - void process(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) + /// D0-D0bar correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) + void processMcRec(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) { int nTracks = 0; if (collision.numContrib() > 1) { @@ -384,34 +356,11 @@ struct HfCorrelatorD0D0barMcRec { } //end outer loop } -}; - -/// D0-D0bar correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) -struct HfCorrelatorD0D0barMcGen { - Produces entryD0D0barPair; + PROCESS_SWITCH(HfCorrelatorD0D0bar, processMcRec, "Process MC Reco mode", true); - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut of D mesons;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) + /// D0-D0bar correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) + void processMcGen(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { int counterD0D0bar = 0; registry.fill(HIST("hMCEvtCount"), 0); @@ -454,6 +403,9 @@ struct HfCorrelatorD0D0barMcGen { particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt()); + entryD0D0barRecoInfo(1.864, + 1.864, + 8); //dummy information double etaCut = 0.; double ptCut = 0.; @@ -487,306 +439,11 @@ struct HfCorrelatorD0D0barMcGen { } //end outer loop registry.fill(HIST("hcountD0D0barPerEvent"), counterD0D0bar); } -}; - -/// D0-D0bar correlation pair builder - LIKE SIGN - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, -/// since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HfCorrelatorD0D0barLs { - - Produces entryD0D0barPair; - Produces entryD0D0barRecoInfo; - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "D0,D0bar candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}}}; - - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= selectionFlagD0bar); - - void process(aod::Collision const& collision, soa::Filtered> const& candidates) - { - for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - if (cutYCandMax >= 0. && std::abs(YD0(candidate1)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { - continue; - } - //fill invariant mass plots and generic info from all D0/D0bar candidates - if (candidate1.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("hMass"), InvMassD0(candidate1), candidate1.pt()); - registry.fill(HIST("hMassD0"), InvMassD0(candidate1), candidate1.pt()); - } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("hMass"), InvMassD0bar(candidate1), candidate1.pt()); - registry.fill(HIST("hMassD0bar"), InvMassD0bar(candidate1), candidate1.pt()); - } - registry.fill(HIST("hPtCand"), candidate1.pt()); - registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); - registry.fill(HIST("hEta"), candidate1.eta()); - registry.fill(HIST("hPhi"), candidate1.phi()); - registry.fill(HIST("hY"), YD0(candidate1)); - registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); - - //D-Dbar correlation dedicated section - //For like-sign, first loop on both D0 and D0bars. First candidate is for sure a D0 and D0bars (checked before, so don't re-check anything on it) - for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - //for the associated, has to have smaller pT, and pass D0sel if trigger passes D0sel, or D0barsel if trigger passes D0barsel - if ((candidate1.isSelD0() >= selectionFlagD0 && candidate2.isSelD0() >= selectionFlagD0) || (candidate1.isSelD0bar() >= selectionFlagD0bar && candidate2.isSelD0bar() >= selectionFlagD0bar)) { - if (cutYCandMax >= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { - continue; - } - //Excluding self-correlations - if (candidate1.mRowIndex == candidate2.mRowIndex) { - continue; - } - entryD0D0barPair(getDeltaPhi(candidate2.phi(), candidate1.phi()), - candidate2.eta() - candidate1.eta(), - candidate1.pt(), - candidate2.pt()); - entryD0D0barRecoInfo(InvMassD0(candidate1), - InvMassD0bar(candidate2), - 0); - } - //note: candidates selected as both D0 and D0bar are used, and considered in both situation (but not auto-correlated): reflections could play a relevant role. - //another, more restrictive, option, could be to consider only candidates selected with a single option (D0 xor D0bar) - } // end inner loop (Dbars) - } //end outer loop - } -}; - -/// D0-D0bar correlation pair builder - LIKE SIGN - for MC reco analysis (data-like but matching to true DO and D0bar) -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, -/// since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HfCorrelatorD0D0barMcRecLs { - - Produces entryD0D0barPair; - Produces entryD0D0barRecoInfo; - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}}}; - - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMassD0MCRec", "D0,D0bar candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRec", "D0,D0bar candidates - MC reco;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= selectionFlagD0bar); - - void process(aod::Collision const& collision, soa::Filtered> const& candidates) - { - //MC reco level - for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - if (cutYCandMax >= 0. && std::abs(YD0(candidate1)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { - continue; - } - if (std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::D0ToPiK) { - //fill invariant mass plots and generic info from all D0/D0bar candidates - if (candidate1.isSelD0() >= selectionFlagD0 && candidate1.flagMCMatchRec() == DecayType::D0ToPiK) { //only reco and matched as D0 - registry.fill(HIST("hMassD0MCRec"), InvMassD0(candidate1)); - } - if (candidate1.isSelD0bar() >= selectionFlagD0bar && candidate1.flagMCMatchRec() == DecayType::D0ToPiK) { //only reco and matched as D0bar - registry.fill(HIST("hMassD0barMCRec"), InvMassD0bar(candidate1)); - } - registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); - registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1MCRec"), candidate1.ptProng1()); - registry.fill(HIST("hEtaMCRec"), candidate1.eta()); - registry.fill(HIST("hPhiMCRec"), candidate1.phi()); - registry.fill(HIST("hYMCRec"), YD0(candidate1)); - registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); - - //D-Dbar correlation dedicated section - //For like-sign, first loop on both D0 and D0bars. First candidate is for sure a D0 and D0bars (looping on filtered) and was already matched, so don't re-check anything on it) - for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - bool conditionLSForD0 = (candidate1.isSelD0() >= selectionFlagD0bar && candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) && (candidate2.isSelD0() >= selectionFlagD0bar && candidate2.flagMCMatchRec() == 1 << DecayType::D0ToPiK); - bool conditionLSForD0bar = (candidate1.isSelD0bar() >= selectionFlagD0bar && candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) && (candidate2.isSelD0bar() >= selectionFlagD0bar && candidate2.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)); - if (conditionLSForD0 || conditionLSForD0bar) { //LS pair (of D0 or of D0bar) + pt2= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { - continue; - } - //Excluding self-correlations - if (candidate1.mRowIndex == candidate2.mRowIndex) { - continue; - } - entryD0D0barPair(getDeltaPhi(candidate2.phi(), candidate1.phi()), - candidate2.eta() - candidate1.eta(), - candidate1.pt(), - candidate2.pt()); - entryD0D0barRecoInfo(InvMassD0(candidate1), - InvMassD0bar(candidate2), - 0); //for LS studies we set a dummy 0 for pairSignalStatus (there are no more the usual 4 possible combinations) - - } //end inner if (MC match) - } // end inner loop (Dbars) - } //end outer if (MC match) - } //end outer loop - } -}; - -/// D0-D0bar correlation pair builder - for MC gen-level analysis, like sign particles -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, -/// since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HfCorrelatorD0D0barMcGenLs { - - Produces entryD0D0barPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) - { - int counterD0D0bar = 0; - registry.fill(HIST("hMCEvtCount"), 0); - //MC gen level - for (auto& particle1 : particlesMC) { - //check if the particle is D0 or D0bar (both can be trigger) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { - continue; - } - double yD = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); - if (cutYCandMax >= 0. && std::abs(yD) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { - continue; - } - - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMCGen"), particle1.eta()); - registry.fill(HIST("hPhiMCGen"), particle1.phi()); - registry.fill(HIST("hYMCGen"), yD); - counterD0D0bar++; - //D-Dbar correlation dedicated section - //if it's D0, search for D0bar and evaluate correlations. - registry.fill(HIST("hcountD0triggersMCGen"), 0, particle1.pt()); //to count trigger D0 (normalisation) - for (auto& particle2 : particlesMC) { - if (std::abs(particle2.pdgCode()) != pdg::Code::kD0) { //check that associated is a D0/D0bar (both are fine) - continue; - } - if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { - continue; - } - if (particle2.pdgCode() == particle1.pdgCode()) { //like-sign condition (both 421 or both -421) and pT_Trig>pT_assoc - //Excluding self-correlations - if (particle1.mRowIndex == particle2.mRowIndex) { - continue; - } - entryD0D0barPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } - } // end inner loop (Dbars) - } //end outer loop - registry.fill(HIST("hcountD0D0barPerEvent"), counterD0D0bar); - } -}; -/// c-cbar correlator table builder - for MC gen-level analysis -struct HfCorrelatorCCbarMcGen { + PROCESS_SWITCH(HfCorrelatorD0D0bar, processMcGen, "Process MC Gen mode", false); - Produces entryccbarPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "c,cbar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "c,cbar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hYMCGen", "c,cbar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "c,cbar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) + /// c-cbar correlator table builder - for MC gen-level analysis + void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); int counterccbar = 0, counterccbarPreEtasel = 0; @@ -836,132 +493,23 @@ struct HfCorrelatorCCbarMcGen { if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } - entryccbarPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } // end inner loop - } //end outer loop - registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); - } -}; - -/// c-cbar correlator table builder - for MC gen-level analysis - Like Sign -struct HfCorrelatorCCbarMcGenLs { - - Produces entryccbarPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "c,cbar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "c,cbar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hYMCGen", "c,cbar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "c,cbar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) - { - registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarPreEtasel = 0; - - //loop over particles at MC gen level - for (auto& particle1 : particlesMC) { - if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles - continue; - } - int partMothPDG = particle1.mother0_as().pdgCode(); - //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it - if (partMothPDG == particle1.pdgCode()) { - continue; - } - counterccbarPreEtasel++; //count c or cbar (before kinematic selection) - double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); - if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { - continue; - } - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMCGen"), particle1.eta()); - registry.fill(HIST("hPhiMCGen"), particle1.phi()); - registry.fill(HIST("hYMCGen"), yC); - counterccbar++; //count if c or cbar don't come from themselves during fragmentation (after kinematic selection) - - //c-cbar correlation dedicated section - registry.fill(HIST("hcountCtriggersMCGen"), 0, particle1.pt()); //to count trigger c quark (for normalisation) - - for (auto& particle2 : particlesMC) { - if (std::abs(particle2.pdgCode()) != PDG_t::kCharm) { //search c or cbar for associated particles - continue; - } - if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { - continue; - } - if (particle2.pdgCode() == particle1.pdgCode()) { - //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it - if (particle2.mother0_as().pdgCode() == particle2.pdgCode()) { - continue; - } - //Excluding self-correlations - if (particle1.mRowIndex == particle2.mRowIndex) { - continue; - } - entryccbarPair(getDeltaPhi(particle2.phi(), particle1.phi()), + entryD0D0barPair(getDeltaPhi(particle2.phi(), particle1.phi()), particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt()); - } // end outer if (check PDG associate) - } // end inner loop - } //end outer loop + entryD0D0barRecoInfo(1.864, + 1.864, + 8); //dummy information + } // end inner loop + } //end outer loop registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); } + + PROCESS_SWITCH(HfCorrelatorD0D0bar, processccbar, "Process ccbar pairs", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{}; - const bool doMCccbar = cfgc.options().get("doMCccbar"); - const bool doMCGen = cfgc.options().get("doMCGen"); - const bool doMCRec = cfgc.options().get("doMCRec"); - const bool doLikeSign = cfgc.options().get("doLikeSign"); - if (!doLikeSign) { //unlike-sign analyses - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCccbar) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - } else { //like-sign analyses - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCccbar) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - } - - return workflow; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-correlator-d0-d0bar"})}; } diff --git a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx index cfad7edd42f..8babb0a66c8 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HFCorrelatorD0D0barBarrelFullPID.cxx +/// \file HfCorrelatorD0D0barBarrelFullPid.cxx /// \brief Temporary D0-D0bar correlator task with full barrel PID implementation - data-like, MC-reco and MC-kine analyses. For ULS and LS pairs /// /// \author Fabio Colamaria , INFN Bari @@ -29,18 +29,6 @@ using namespace o2::aod::hf_correlation_ddbar; using namespace o2::analysis::hf_cuts_d0_topik; using namespace o2::constants::math; -void customize(std::vector& workflowOptions) -{ - ConfigParamSpec optionDoLikeSign{"doLikeSign", VariantType::Bool, false, {"Run Like-Sign analysis."}}; - ConfigParamSpec optionDoMCccbar{"doMCccbar", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCGen{"doMCGen", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCRec{"doMCRec", VariantType::Bool, true, {"Run MC-Rec dedicated tasks."}}; - workflowOptions.push_back(optionDoLikeSign); - workflowOptions.push_back(optionDoMCccbar); - workflowOptions.push_back(optionDoMCGen); - workflowOptions.push_back(optionDoMCRec); -} - #include "Framework/runDataProcessing.h" /// @@ -64,8 +52,7 @@ auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficienc using MCParticlesPlus = soa::Join; -/// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) -struct HFCorrelatorD0D0barBarrelFullPID { +struct HfCorrelatorD0D0barBarrelFullPid { Produces entryD0D0barPair; Produces entryD0D0barRecoInfo; @@ -81,7 +68,23 @@ struct HFCorrelatorD0D0barBarrelFullPID { {"hY", "D0,D0bar candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; + {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, + {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, + {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; @@ -98,11 +101,20 @@ struct HFCorrelatorD0D0barBarrelFullPID { registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0TOFplusRICHPID >= selectionFlagD0 || aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0barTOFplusRICHPID >= selectionFlagD0bar); - void process(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) + /// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) + void processData(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) { int nTracks = 0; if (collision.numContrib() > 1) { @@ -205,51 +217,11 @@ struct HFCorrelatorD0D0barBarrelFullPID { } //end outer loop } -}; -/// D0-D0bar correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) -struct HFCorrelatorD0D0barBarrelFullPIDMcRec { - - Produces entryD0D0barPair; - Produces entryD0D0barRecoInfo; + PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processData, "Process data", false); - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; - - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for D0 meson"}; - Configurable flagApplyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; - Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; - Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0TOFplusRICHPID >= selectionFlagD0 || aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0barTOFplusRICHPID >= selectionFlagD0bar); - - void process(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) + /// D0-D0bar correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) + void processMcRec(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates) { int nTracks = 0; if (collision.numContrib() > 1) { @@ -384,34 +356,11 @@ struct HFCorrelatorD0D0barBarrelFullPIDMcRec { } //end outer loop } -}; - -/// D0-D0bar correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) -struct HFCorrelatorD0D0barBarrelFullPIDMcGen { - Produces entryD0D0barPair; + PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processMcRec, "Process MC Reco mode", true); - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut of D mesons;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) + /// D0-D0bar correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) + void processMcGen(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { int counterD0D0bar = 0; registry.fill(HIST("hMCEvtCount"), 0); @@ -454,6 +403,9 @@ struct HFCorrelatorD0D0barBarrelFullPIDMcGen { particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt()); + entryD0D0barRecoInfo(1.864, + 1.864, + 8); //dummy information double etaCut = 0.; double ptCut = 0.; @@ -487,306 +439,11 @@ struct HFCorrelatorD0D0barBarrelFullPIDMcGen { } //end outer loop registry.fill(HIST("hcountD0D0barPerEvent"), counterD0D0bar); } -}; - -/// D0-D0bar correlation pair builder - LIKE SIGN - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, -/// since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HFCorrelatorD0D0barBarrelFullPIDLs { - - Produces entryD0D0barPair; - Produces entryD0D0barRecoInfo; - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "D0,D0bar candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}}}; - - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0TOFplusRICHPID >= selectionFlagD0 || aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0barTOFplusRICHPID >= selectionFlagD0bar); - - void process(aod::Collision const& collision, soa::Filtered> const& candidates) - { - for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - if (cutYCandMax >= 0. && std::abs(YD0(candidate1)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { - continue; - } - //fill invariant mass plots and generic info from all D0/D0bar candidates - if (candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0) { - registry.fill(HIST("hMass"), InvMassD0(candidate1), candidate1.pt()); - registry.fill(HIST("hMassD0"), InvMassD0(candidate1), candidate1.pt()); - } - if (candidate1.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar) { - registry.fill(HIST("hMass"), InvMassD0bar(candidate1), candidate1.pt()); - registry.fill(HIST("hMassD0bar"), InvMassD0bar(candidate1), candidate1.pt()); - } - registry.fill(HIST("hPtCand"), candidate1.pt()); - registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); - registry.fill(HIST("hEta"), candidate1.eta()); - registry.fill(HIST("hPhi"), candidate1.phi()); - registry.fill(HIST("hY"), YD0(candidate1)); - registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0barTOFplusRICHPID() + (candidate1.isSelD0TOFplusRICHPID() * 2)); - - //D-Dbar correlation dedicated section - //For like-sign, first loop on both D0 and D0bars. First candidate is for sure a D0 and D0bars (checked before, so don't re-check anything on it) - for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - //for the associated, has to have smaller pT, and pass D0sel if trigger passes D0sel, or D0barsel if trigger passes D0barsel - if ((candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0 && candidate2.isSelD0TOFplusRICHPID() >= selectionFlagD0) || (candidate1.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar && candidate2.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar)) { - if (cutYCandMax >= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { - continue; - } - //Excluding self-correlations - if (candidate1.mRowIndex == candidate2.mRowIndex) { - continue; - } - entryD0D0barPair(getDeltaPhi(candidate2.phi(), candidate1.phi()), - candidate2.eta() - candidate1.eta(), - candidate1.pt(), - candidate2.pt()); - entryD0D0barRecoInfo(InvMassD0(candidate1), - InvMassD0bar(candidate2), - 0); - } - //note: candidates selected as both D0 and D0bar are used, and considered in both situation (but not auto-correlated): reflections could play a relevant role. - //another, more restrictive, option, could be to consider only candidates selected with a single option (D0 xor D0bar) - } // end inner loop (Dbars) - } //end outer loop - } -}; - -/// D0-D0bar correlation pair builder - LIKE SIGN - for MC reco analysis (data-like but matching to true DO and D0bar) -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, -/// since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HFCorrelatorD0D0barBarrelFullPIDMcRecLs { - - Produces entryD0D0barPair; - Produces entryD0D0barRecoInfo; - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}}}; - - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMassD0MCRec", "D0,D0bar candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRec", "D0,D0bar candidates - MC reco;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0TOFplusRICHPID >= selectionFlagD0 || aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0barTOFplusRICHPID >= selectionFlagD0bar); - - void process(aod::Collision const& collision, soa::Filtered> const& candidates) - { - //MC reco level - for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - if (cutYCandMax >= 0. && std::abs(YD0(candidate1)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { - continue; - } - if (std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::D0ToPiK) { - //fill invariant mass plots and generic info from all D0/D0bar candidates - if (candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0 && candidate1.flagMCMatchRec() == DecayType::D0ToPiK) { //only reco and matched as D0 - registry.fill(HIST("hMassD0MCRec"), InvMassD0(candidate1)); - } - if (candidate1.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar && candidate1.flagMCMatchRec() == DecayType::D0ToPiK) { //only reco and matched as D0bar - registry.fill(HIST("hMassD0barMCRec"), InvMassD0bar(candidate1)); - } - registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); - registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1MCRec"), candidate1.ptProng1()); - registry.fill(HIST("hEtaMCRec"), candidate1.eta()); - registry.fill(HIST("hPhiMCRec"), candidate1.phi()); - registry.fill(HIST("hYMCRec"), YD0(candidate1)); - registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0barTOFplusRICHPID() + (candidate1.isSelD0TOFplusRICHPID() * 2)); - - //D-Dbar correlation dedicated section - //For like-sign, first loop on both D0 and D0bars. First candidate is for sure a D0 and D0bars (looping on filtered) and was already matched, so don't re-check anything on it) - for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { - continue; - } - bool conditionLSForD0 = (candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0bar && candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) && (candidate2.isSelD0TOFplusRICHPID() >= selectionFlagD0bar && candidate2.flagMCMatchRec() == 1 << DecayType::D0ToPiK); - bool conditionLSForD0bar = (candidate1.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar && candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) && (candidate2.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar && candidate2.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)); - if (conditionLSForD0 || conditionLSForD0bar) { //LS pair (of D0 or of D0bar) + pt2= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { - continue; - } - //Excluding self-correlations - if (candidate1.mRowIndex == candidate2.mRowIndex) { - continue; - } - entryD0D0barPair(getDeltaPhi(candidate2.phi(), candidate1.phi()), - candidate2.eta() - candidate1.eta(), - candidate1.pt(), - candidate2.pt()); - entryD0D0barRecoInfo(InvMassD0(candidate1), - InvMassD0bar(candidate2), - 0); //for LS studies we set a dummy 0 for pairSignalStatus (there are no more the usual 4 possible combinations) - - } //end inner if (MC match) - } // end inner loop (Dbars) - } //end outer if (MC match) - } //end outer loop - } -}; - -/// D0-D0bar correlation pair builder - for MC gen-level analysis, like sign particles -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, -/// since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HFCorrelatorD0D0barBarrelFullPIDMcGenLs { - - Produces entryD0D0barPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) - { - int counterD0D0bar = 0; - registry.fill(HIST("hMCEvtCount"), 0); - //MC gen level - for (auto& particle1 : particlesMC) { - //check if the particle is D0 or D0bar (both can be trigger) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { - continue; - } - double yD = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); - if (cutYCandMax >= 0. && std::abs(yD) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { - continue; - } - - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMCGen"), particle1.eta()); - registry.fill(HIST("hPhiMCGen"), particle1.phi()); - registry.fill(HIST("hYMCGen"), yD); - counterD0D0bar++; - //D-Dbar correlation dedicated section - //if it's D0, search for D0bar and evaluate correlations. - registry.fill(HIST("hcountD0triggersMCGen"), 0, particle1.pt()); //to count trigger D0 (normalisation) - for (auto& particle2 : particlesMC) { - if (std::abs(particle2.pdgCode()) != pdg::Code::kD0) { //check that associated is a D0/D0bar (both are fine) - continue; - } - if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { - continue; - } - if (particle2.pdgCode() == particle1.pdgCode()) { //like-sign condition (both 421 or both -421) and pT_Trig>pT_assoc - //Excluding self-correlations - if (particle1.mRowIndex == particle2.mRowIndex) { - continue; - } - entryD0D0barPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } - } // end inner loop (Dbars) - } //end outer loop - registry.fill(HIST("hcountD0D0barPerEvent"), counterD0D0bar); - } -}; -/// c-cbar correlator table builder - for MC gen-level analysis -struct HfCorrelatorCCbarBarrelFullPIDMCGen { + PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processMcGen, "Process MC Gen mode", false); - Produces entryccbarPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "c,cbar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "c,cbar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hYMCGen", "c,cbar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "c,cbar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) + /// c-cbar correlator table builder - for MC gen-level analysis + void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); int counterccbar = 0, counterccbarPreEtasel = 0; @@ -836,132 +493,23 @@ struct HfCorrelatorCCbarBarrelFullPIDMCGen { if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } - entryccbarPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } // end inner loop - } //end outer loop - registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); - } -}; - -/// c-cbar correlator table builder - for MC gen-level analysis - Like Sign -struct HfCorrelatorCCbarBarrelFullPIDMCGenLs { - - Produces entryccbarPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "c,cbar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "c,cbar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hYMCGen", "c,cbar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "c,cbar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) - { - registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarPreEtasel = 0; - - //loop over particles at MC gen level - for (auto& particle1 : particlesMC) { - if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles - continue; - } - int partMothPDG = particle1.mother0_as().pdgCode(); - //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it - if (partMothPDG == particle1.pdgCode()) { - continue; - } - counterccbarPreEtasel++; //count c or cbar (before kinematic selection) - double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); - if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { - continue; - } - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMCGen"), particle1.eta()); - registry.fill(HIST("hPhiMCGen"), particle1.phi()); - registry.fill(HIST("hYMCGen"), yC); - counterccbar++; //count if c or cbar don't come from themselves during fragmentation (after kinematic selection) - - //c-cbar correlation dedicated section - registry.fill(HIST("hcountCtriggersMCGen"), 0, particle1.pt()); //to count trigger c quark (for normalisation) - - for (auto& particle2 : particlesMC) { - if (std::abs(particle2.pdgCode()) != PDG_t::kCharm) { //search c or cbar for associated particles - continue; - } - if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { - continue; - } - if (particle2.pdgCode() == particle1.pdgCode()) { - //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it - if (particle2.mother0_as().pdgCode() == particle2.pdgCode()) { - continue; - } - //Excluding self-correlations - if (particle1.mRowIndex == particle2.mRowIndex) { - continue; - } - entryccbarPair(getDeltaPhi(particle2.phi(), particle1.phi()), + entryD0D0barPair(getDeltaPhi(particle2.phi(), particle1.phi()), particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt()); - } // end outer if (check PDG associate) - } // end inner loop - } //end outer loop + entryD0D0barRecoInfo(1.864, + 1.864, + 8); //dummy information + } // end inner loop + } //end outer loop registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); } + + PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processccbar, "Process ccbar pairs", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{}; - const bool doMCccbar = cfgc.options().get("doMCccbar"); - const bool doMCGen = cfgc.options().get("doMCGen"); - const bool doMCRec = cfgc.options().get("doMCRec"); - const bool doLikeSign = cfgc.options().get("doLikeSign"); - if (!doLikeSign) { //unlike-sign analyses - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCccbar) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - } else { //like-sign analyses - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCccbar) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - } - - return workflow; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-correlator-d0-d0bar-barrel-full-pid"})}; } diff --git a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx index 10036edd8dd..9ac7186d4a0 100644 --- a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx +++ b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx @@ -29,18 +29,6 @@ using namespace o2::aod::hf_correlation_ddbar; using namespace o2::analysis::hf_cuts_dplus_topikpi; using namespace o2::constants::math; -void customize(std::vector& workflowOptions) -{ - ConfigParamSpec optionDoLikeSign{"doLikeSign", VariantType::Bool, false, {"Run Like-Sign analysis."}}; - ConfigParamSpec optionDoMCccbar{"doMCccbar", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCGen{"doMCGen", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCRec{"doMCRec", VariantType::Bool, true, {"Run MC-Rec dedicated tasks."}}; - workflowOptions.push_back(optionDoLikeSign); - workflowOptions.push_back(optionDoMCccbar); - workflowOptions.push_back(optionDoMCGen); - workflowOptions.push_back(optionDoMCRec); -} - #include "Framework/runDataProcessing.h" /// @@ -62,7 +50,9 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_topikpi::npTBin const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; -/// Dplus-Dminus correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) +using MCParticlesPlus = soa::Join; +using MCParticlesPlus3Prong = soa::Join; + struct HfCorrelatorDplusDminus { Produces entryDplusDminusPair; Produces entryDplusDminusRecoInfo; @@ -80,7 +70,24 @@ struct HfCorrelatorDplusDminus { {"hY", "Dplus,Dminus candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; + {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hPtCandMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng0MCRec", "Dplus,Dminus candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng1MCRec", "Dplus,Dminus candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtProng2MCRec", "Dplus,Dminus candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hSelectionStatusMCRec", "Dplus,Dminus candidates - MC reco;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, + {"hEtaMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPhiMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, + {"hPtCandMCGen", "Dplus,Dminus particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hcountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hDDbarVsDaughterEtaCut", "Dplus,Dminus pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus,Dminus"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; @@ -96,11 +103,18 @@ struct HfCorrelatorDplusDminus { registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassDplus", "Dplus,Dminus candidates;inv. mass Dplus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassDminus", "Dplus,Dminus candidates;inv. mass Dminus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); - void process(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates, aod::BigTracks const& bigtracks) + /// Dplus-Dminus correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) + void processData(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates, aod::BigTracks const& bigtracks) { int nTracks = 0; if (collision.numContrib() > 1) { @@ -202,48 +216,11 @@ struct HfCorrelatorDplusDminus { } // end inner loop (Dminus) } //end outer loop (Dplus) } -}; - -/// Dplus-Dminus correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) -struct HfCorrelatorDplusDminusMcRec { - Produces entryDplusDminusPair; - Produces entryDplusDminusRecoInfo; - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassDplus for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCandMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "Dplus,Dminus candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "Dplus,Dminus candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng2MCRec", "Dplus,Dminus candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatusMCRec", "Dplus,Dminus candidates - MC reco;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, - {"hEtaMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; - - Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus,Dminus"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for D0 meson"}; - Configurable flagApplyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; - Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; - Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); + PROCESS_SWITCH(HfCorrelatorDplusDminus, processData, "Process data", false); - void process(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates, aod::BigTracks const& bigtracks) + /// Dplus-Dminus correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) + void processMcRec(aod::Collision const& collision, soa::Join& tracks, soa::Filtered> const& candidates, aod::BigTracks const& bigtracks) { int nTracks = 0; if (collision.numContrib() > 1) { @@ -363,36 +340,11 @@ struct HfCorrelatorDplusDminusMcRec { } //end outer loop } -}; - -using MCParticlesPlus = soa::Join; -/// Dplus-Dminus correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) -struct HfCorrelatorDplusDminusMcGen { + PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcRec, "Process MC Reco mode", true); - Produces entryDplusDminusPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "Dplus,Dminus particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut of D mesons;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hDDbarVsDaughterEtaCut", "Dplus,Dminus pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) + /// Dplus-Dminus correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) + void processMcGen(aod::McCollision const& mccollision, MCParticlesPlus3Prong const& particlesMC) { int counterDplusDminus = 0; registry.fill(HIST("hMCEvtCount"), 0); @@ -435,6 +387,9 @@ struct HfCorrelatorDplusDminusMcGen { particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt()); + entryDplusDminusRecoInfo(1.869, + 1.869, + 8); //Dummy double etaCut = 0.; double ptCut = 0.; @@ -451,12 +406,12 @@ struct HfCorrelatorDplusDminusMcGen { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } if (rightDecayChannels) { //fill with D and Dbar daughter particls acceptance checks - double etaCandidate1Daughter1 = particle1.daughter0_as().eta(); - double etaCandidate1Daughter2 = (particle1.daughter0_as() + 1).eta(); - double etaCandidate1Daughter3 = (particle1.daughter0_as() + 2).eta(); - double etaCandidate2Daughter1 = particle2.daughter0_as().eta(); - double etaCandidate2Daughter2 = (particle2.daughter0_as() + 1).eta(); - double etaCandidate2Daughter3 = (particle2.daughter0_as() + 2).eta(); + double etaCandidate1Daughter1 = particle1.daughter0_as().eta(); + double etaCandidate1Daughter2 = (particle1.daughter0_as() + 1).eta(); + double etaCandidate1Daughter3 = (particle1.daughter0_as() + 2).eta(); + double etaCandidate2Daughter1 = particle2.daughter0_as().eta(); + double etaCandidate2Daughter2 = (particle2.daughter0_as() + 1).eta(); + double etaCandidate2Daughter3 = (particle2.daughter0_as() + 2).eta(); if (std::abs(etaCandidate1Daughter1) < etaCut && std::abs(etaCandidate1Daughter2) < etaCut && std::abs(etaCandidate1Daughter3) < etaCut && std::abs(etaCandidate2Daughter1) < etaCut && std::abs(etaCandidate2Daughter2) < etaCut && std::abs(etaCandidate2Daughter3) < etaCut && particle1.pt() > ptCut && particle2.pt() > ptCut) { @@ -470,326 +425,11 @@ struct HfCorrelatorDplusDminusMcGen { } //end outer loop registry.fill(HIST("hcountDplusDminusPerEvent"), counterDplusDminus); } -}; - -/// Dplus-Dminus correlation pair builder - LIKE SIGN - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HfCorrelatorDplusDminusLs { - - Produces entryDplusDminusPair; - Produces entryDplusDminusRecoInfo; - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassDplus for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "Dplus,Dminus candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0", "Dplus,Dminus candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1", "Dplus,Dminus candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng2", "Dplus,Dminus candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatus", "Dplus,Dminus candidates;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, - {"hEta", "Dplus,Dminus candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhi", "Dplus,Dminus candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "Dplus,Dminus candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}}}; - - Configurable selectionFlagDplus{"dSelectivonFlagDplus", 1, "Selection Flag for Dplus,Dminus"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplus", "Dplus,Dminus candidates;inv. mass Dplus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminus", "Dplus,Dminus candidates;inv. mass Dminus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); - - void process(aod::Collision const& collision, soa::Filtered> const& candidates, aod::BigTracks const& bigtracks) - { - for (auto& candidate1 : candidates) { - if (cutYCandMax >= 0. && std::abs(YDPlus(candidate1)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { - continue; - } - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { //probably dummy since already selected? not sure... - continue; - } - int outerParticleSign = 1; //Dplus - auto outerSecondTrack = candidate1.index1_as(); - if (outerSecondTrack.sign() == 1) { - outerParticleSign = -1; //Dminus (second daughter track is positive) - } - //fill invariant mass plots and generic info from all Dplus/Dminus candidates - if (outerParticleSign == 1) { - registry.fill(HIST("hMass"), InvMassDPlus(candidate1), candidate1.pt()); - registry.fill(HIST("hMassDplus"), InvMassDPlus(candidate1), candidate1.pt()); - } else { - registry.fill(HIST("hMass"), InvMassDPlus(candidate1), candidate1.pt()); - registry.fill(HIST("hMassDminus"), InvMassDPlus(candidate1), candidate1.pt()); - } - registry.fill(HIST("hPtCand"), candidate1.pt()); - registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); - registry.fill(HIST("hPtProng2"), candidate1.ptProng2()); - registry.fill(HIST("hEta"), candidate1.eta()); - registry.fill(HIST("hPhi"), candidate1.phi()); - registry.fill(HIST("hY"), YDPlus(candidate1)); - registry.fill(HIST("hSelectionStatus"), candidate1.isSelDplusToPiKPi()); - - //D-Dbar correlation dedicated section - //For like-sign, first loop on both Dplus and Dminus. First candidate is for sure a Dplus/Dminus (checked before, so don't re-check anything on it) - for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::DPlusToPiKPi)) { - continue; - } - //check if inner particle is Dplus or Dminus - int innerParticleSign = 1; //Dplus - auto innerSecondTrack = candidate2.index1_as(); - if (innerSecondTrack.sign() == 1) { - innerParticleSign = -1; //Dminus (second daughter track is positive) - } - //for the associated, has to have smaller pT, and has to be Dplus if outer is Dplu, or Dminus if outer is Dminus - if (innerParticleSign == outerParticleSign) { - if (cutYCandMax >= 0. && std::abs(YDPlus(candidate2)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { - continue; - } - //Excluding self-correlations - if (candidate1.mRowIndex == candidate2.mRowIndex) { - continue; - } - entryDplusDminusPair(getDeltaPhi(candidate2.phi(), candidate1.phi()), - candidate2.eta() - candidate1.eta(), - candidate1.pt(), - candidate2.pt()); - entryDplusDminusRecoInfo(InvMassDPlus(candidate1), - InvMassDPlus(candidate2), - 0); - } - } // end inner loop - } //end outer loop - } -}; -/// Dplus-Dminus correlation pair builder - LIKE SIGN - for MC reco analysis (data-like but matching to true Dplus and Dminus) -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HfCorrelatorDplusDminusMcRecLs { - Produces entryDplusDminusPair; - Produces entryDplusDminusRecoInfo; + PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcGen, "Process MC Gen mode", false); - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCandMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "Dplus,Dminus candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "Dplus,Dminus candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng2MCRec", "Dplus,Dminus candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hSelectionStatusMCRec", "Dplus,Dminus candidates - MC reco;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, - {"hEtaMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}}}; - - Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus,Dminus"}; - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for candidate mass plots"}; - - void init(o2::framework::InitContext&) - { - registry.add("hMassDplusMCRec", "Dplus,Dminus candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRec", "Dplus,Dminus candidates - MC reco;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); - - void process(aod::Collision const& collision, soa::Filtered> const& candidates, aod::BigTracks const& bigtracks) - { - //MC reco level - for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { - continue; - } - if (cutYCandMax >= 0. && std::abs(YDPlus(candidate1)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { - continue; - } - int outerParticleSign = 1; //Dplus - auto outerSecondTrack = candidate1.index1_as(); - if (outerSecondTrack.sign() == 1) { - outerParticleSign = -1; //Dminus (second daughter track is positive) - } - if (std::abs(candidate1.flagMCMatchRec()) != 1 << DecayType::DPlusToPiKPi) { //keep only Dplus/Dminus matched candidates - continue; - } - //fill invariant mass plots and generic info from all Dplus/Dminus candidates - if (outerParticleSign == 1) { //matched as Dplus - registry.fill(HIST("hMassDplusMCRec"), InvMassDPlus(candidate1), candidate1.pt()); - } else { //matched as Dminus - registry.fill(HIST("hMassDminusMCRec"), InvMassDPlus(candidate1), candidate1.pt()); - } - registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); - registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1MCRec"), candidate1.ptProng1()); - registry.fill(HIST("hPtProng2MCRec"), candidate1.ptProng2()); - registry.fill(HIST("hEtaMCRec"), candidate1.eta()); - registry.fill(HIST("hPhiMCRec"), candidate1.phi()); - registry.fill(HIST("hYMCRec"), YDPlus(candidate1)); - registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelDplusToPiKPi()); - - //D-Dbar correlation dedicated section - //For like-sign, first loop on both Dplus and Dminus. First candidate is for sure a Dplus/Dminus (looping on filtered) and was already matched, so don't re-check anything on it) - for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::DPlusToPiKPi)) { - continue; - } - int innerParticleSign = 1; //Dplus - auto innerSecondTrack = candidate2.index1_as(); - if (innerSecondTrack.sign() == 1) { - innerParticleSign = -1; //Dminus (second daughter track is positive) - } - if (std::abs(candidate2.flagMCMatchRec()) != 1 << DecayType::DPlusToPiKPi) { //reject fake candidates - continue; - } - if (outerParticleSign == innerParticleSign) { //LS pair (of Dplus or Dminus) + pt2= 0. && std::abs(YDPlus(candidate2)) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { - continue; - } - //Excluding self-correlations (in principle not possible due to the '<' condition, but could rounding break it?) - if (candidate1.mRowIndex == candidate2.mRowIndex) { - continue; - } - entryDplusDminusPair(getDeltaPhi(candidate2.phi(), candidate1.phi()), - candidate2.eta() - candidate1.eta(), - candidate1.pt(), - candidate2.pt()); - entryDplusDminusRecoInfo(InvMassDPlus(candidate1), - InvMassDPlus(candidate2), - 0); //for LS studies we set a dummy 0 for pairSignalStatus (there are no more the usual 4 possible combinations) - - } //end inner if (MC match) - } // end inner loop - } //end outer loop - } -}; - -/// Dplus-Dminus correlation pair builder - for MC gen-level analysis, like sign particles -/// NOTE: At the moment, both dPhi-symmetrical correlation pairs (part1-part2 and part2-part1) are filled, since we bin in pT and selecting as trigger the largest pT particle would bias the distributions w.r.t. the ULS case. -struct HfCorrelatorDplusDminusMcGenLs { - - Produces entryDplusDminusPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "Dplus,Dminus particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, soa::Join const& particlesMC) - { - int counterDplusDminus = 0; - registry.fill(HIST("hMCEvtCount"), 0); - //MC gen level - for (auto& particle1 : particlesMC) { - //check if the particle is Dplus or Dminus (both can be trigger) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { - continue; - } - double yD = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); - if (cutYCandMax >= 0. && std::abs(yD) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { - continue; - } - - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMCGen"), particle1.eta()); - registry.fill(HIST("hPhiMCGen"), particle1.phi()); - registry.fill(HIST("hYMCGen"), yD); - counterDplusDminus++; - - //D-Dbar correlation dedicated section - //if it's Dplus/Dminus, search for LS pair companions and evaluate correlations. - registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); //to count trigger Dplus (normalisation) - for (auto& particle2 : particlesMC) { - if (std::abs(particle2.pdgCode()) != pdg::Code::kDPlus) { //check that associated is a Dplus/Dminus (both are fine) - continue; - } - if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { - continue; - } - if (particle2.pdgCode() == particle1.pdgCode()) { //like-sign condition (both 411 or both -411) and pT_Trig>pT_assoc - //Excluding self-correlations (in principle not possible due to the '<' condition, but could rounding break it?) - if (particle1.mRowIndex == particle2.mRowIndex) { - continue; - } - entryDplusDminusPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } - } // end inner loop - } //end outer loop - registry.fill(HIST("hcountDplusDminusPerEvent"), counterDplusDminus); - } -}; - -using MCParticlesPlus2 = soa::Join; - -/// c-cbar correlator table builder - for MC gen-level analysis -struct HfCorrelatorCCbarMcGen { - - Produces entryccbarPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "c,cbar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "c,cbar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hYMCGen", "c,cbar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "c,cbar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus2 const& particlesMC) + /// c-cbar correlator table builder - for MC gen-level analysis + void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); int counterccbar = 0, counterccbarPreEtasel = 0; @@ -799,7 +439,7 @@ struct HfCorrelatorCCbarMcGen { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles continue; } - int partMothPDG = particle1.mother0_as().pdgCode(); + int partMothPDG = particle1.mother0_as().pdgCode(); //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; @@ -836,135 +476,26 @@ struct HfCorrelatorCCbarMcGen { continue; } //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it - if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { + if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } - entryccbarPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } // end inner loop - } //end outer loop + entryDplusDminusPair(getDeltaPhi(particle2.phi(), particle1.phi()), + particle2.eta() - particle1.eta(), + particle1.pt(), + particle2.pt()); + entryDplusDminusRecoInfo(1.869, + 1.869, + 8); //Dummy + } // end inner loop + } //end outer loop registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); } -}; - -/// c-cbar correlator table builder - for MC gen-level analysis - Like Sign -struct HfCorrelatorCCbarMcGenLs { - - Produces entryccbarPair; - - HistogramRegistry registry{ - "registry", - {{"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "c,cbar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "c,cbar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hYMCGen", "c,cbar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "c,cbar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; - - Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; - Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; - Configurable> bins{"ptBinsForMass", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for trigger counters"}; - - void init(o2::framework::InitContext&) - { - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - } - - void process(aod::McCollision const& mccollision, MCParticlesPlus2 const& particlesMC) - { - registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarPreEtasel = 0; - //loop over particles at MC gen level - for (auto& particle1 : particlesMC) { - if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles - continue; - } - int partMothPDG = particle1.mother0_as().pdgCode(); - //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it - if (partMothPDG == particle1.pdgCode()) { - continue; - } - counterccbarPreEtasel++; //count c or cbar (before kinematic selection) - double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); - if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { - continue; - } - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMCGen"), particle1.eta()); - registry.fill(HIST("hPhiMCGen"), particle1.phi()); - registry.fill(HIST("hYMCGen"), yC); - counterccbar++; //count if c or cbar don't come from themselves during fragmentation (after kinematic selection) - - //c-cbar correlation dedicated section - registry.fill(HIST("hcountCtriggersMCGen"), 0, particle1.pt()); //to count trigger c quark (for normalisation) - - for (auto& particle2 : particlesMC) { - if (std::abs(particle2.pdgCode()) != PDG_t::kCharm) { //search c or cbar for associated particles - continue; - } - if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { - continue; - } - if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { - continue; - } - if (particle2.pdgCode() == particle1.pdgCode()) { - //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it - if (particle2.mother0_as().pdgCode() == particle2.pdgCode()) { - continue; - } - //Excluding self-correlations (in principle not possible due to the '<' condition, but could rounding break it?) - if (particle1.mRowIndex == particle2.mRowIndex) { - continue; - } - entryccbarPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt()); - } // end outer if (check PDG associate) - } // end inner loop - } //end outer loop - registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); - } + PROCESS_SWITCH(HfCorrelatorDplusDminus, processccbar, "Process ccbar pairs", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{}; - const bool doMCccbar = cfgc.options().get("doMCccbar"); - const bool doMCGen = cfgc.options().get("doMCGen"); - const bool doMCRec = cfgc.options().get("doMCRec"); - const bool doLikeSign = cfgc.options().get("doLikeSign"); - if (!doLikeSign) { //unlike-sign analyses - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCccbar) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - } else { //like-sign analyses - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCccbar) { //MC-Reco analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - } - - return workflow; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-correlator-dplus-dminus"})}; } diff --git a/PWGHF/Tasks/taskCorrelationDDbar.cxx b/PWGHF/Tasks/taskCorrelationDDbar.cxx index 80827078a37..6208dd18b1e 100644 --- a/PWGHF/Tasks/taskCorrelationDDbar.cxx +++ b/PWGHF/Tasks/taskCorrelationDDbar.cxx @@ -32,14 +32,6 @@ namespace o2::aod using DDbarPairFull = soa::Join; } // namespace o2::aod -void customize(std::vector& workflowOptions) -{ - ConfigParamSpec optionDoMCGen{"doMCGen", VariantType::Bool, false, {"Run MC-Gen dedicated tasks."}}; - ConfigParamSpec optionDoMCRec{"doMCRec", VariantType::Bool, true, {"Run MC-Rec dedicated tasks."}}; - workflowOptions.push_back(optionDoMCGen); - workflowOptions.push_back(optionDoMCRec); -} - #include "Framework/runDataProcessing.h" /// @@ -91,8 +83,6 @@ const int npTBinsEfficiency = o2::analysis::hf_cuts_d0_topik::npTBins; const double efficiencyDmesonDefault[npTBinsEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsEfficiency}; -/// D-Dbar correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) -/// Works on both USL and LS analyses pair tables struct HfTaskCorrelationDDbar { HistogramRegistry registry{ @@ -110,100 +100,8 @@ struct HfTaskCorrelationDDbar { {"hCorrel2DPtIntSidebands", stringDDbar + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, {"hCorrel2DVsPtSidebands", stringDDbar + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() {"hDeltaPtDDbarSidebands", stringDDbar + stringSideband + stringDeltaPt + "entries", {HistType::kTH1F, {{144, -36., 36.}}}}, - {"hDeltaPtMaxMinSidebands", stringDDbar + stringSideband + stringDeltaPtMaxMin + "entries", {HistType::kTH1F, {{72, 0., 36.}}}}}}; - - //pT ranges for correlation plots: the default values are those embedded in hf_cuts_d0_topik (i.e. the mass pT bins), but can be redefined via json files - Configurable> binsCorrelations{"ptBinsForCorrelations", std::vector{pTBinsCorrelations_v}, "pT bin limits for correlation plots"}; - //pT bins for effiencies: same as above - Configurable> binsEfficiency{"ptBinsForEfficiency", std::vector{o2::analysis::hf_cuts_d0_topik::pTBins_v}, "pT bin limits for efficiency"}; - //signal and sideband region edges, to be defined via json file (initialised to empty) - Configurable> signalRegionInner{"signalRegionInner", std::vector{signalRegionInner_v}, "Inner values of signal region vs pT"}; - Configurable> signalRegionOuter{"signalRegionOuter", std::vector{signalRegionOuter_v}, "Outer values of signal region vs pT"}; - Configurable> sidebandLeftInner{"sidebandLeftInner", std::vector{sidebandLeftInner_v}, "Inner values of left sideband vs pT"}; - Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{sidebandLeftOuter_v}, "Outer values of left sideband vs pT"}; - Configurable> sidebandRightInner{"sidebandRightInner", std::vector{sidebandRightInner_v}, "Inner values of right sideband vs pT"}; - Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{sidebandRightOuter_v}, "Outer values of right sideband vs pT"}; - Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for D meson specie under study"}; - Configurable flagApplyEfficiency{"efficiencyFlagD0", 1, "Flag for applying efficiency weights"}; - - void init(o2::framework::InitContext&) - { - // redefinition of pT axes for THnSparse holding correlation entries - int nBinspTaxis = binsCorrelations->size() - 1; - const double* valuespTaxis = binsCorrelations->data(); - - for (int i = 2; i <= 3; i++) { - registry.get(HIST("hMass2DCorrelationPairs"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); - registry.get(HIST("hCorrel2DVsPtSignalRegion"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); - registry.get(HIST("hCorrel2DVsPtSidebands"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); - registry.get(HIST("hMass2DCorrelationPairs"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); - registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); - } - } - - void process(aod::DDbarPairFull const& pairEntries) - { - for (auto& pairEntry : pairEntries) { - //define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptD = pairEntry.ptD(); - double ptDbar = pairEntry.ptDbar(); - double massD = pairEntry.mD(); - double massDbar = pairEntry.mDbar(); - - int pTBinD = o2::analysis::findBin(binsCorrelations, ptD); - int pTBinDbar = o2::analysis::findBin(binsCorrelations, ptDbar); - - double efficiencyWeight = 1.; - if (flagApplyEfficiency) { - efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptD)) * efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptDbar))); - } - - //fill 2D invariant mass plots - registry.fill(HIST("hMass2DCorrelationPairs"), massD, massDbar, ptD, ptDbar, efficiencyWeight); - - //reject entries outside pT ranges of interest - if (pTBinD == -1 || pTBinDbar == -1) { //at least one particle outside accepted pT range - continue; - } - - //check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots - if (massD > signalRegionInner->at(pTBinD) && massD < signalRegionOuter->at(pTBinD) && massDbar > signalRegionInner->at(pTBinDbar) && massDbar < signalRegionOuter->at(pTBinDbar)) { - //in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptD, ptDbar, efficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); - registry.fill(HIST("hDeltaPtDDbarSignalRegion"), ptDbar - ptD, efficiencyWeight); - registry.fill(HIST("hDeltaPtMaxMinSignalRegion"), std::abs(ptDbar - ptD), efficiencyWeight); - } - - if ((massD > sidebandLeftInner->at(pTBinD) && massD < sidebandLeftOuter->at(pTBinD) && massDbar > sidebandLeftInner->at(pTBinDbar) && massDbar < sidebandRightOuter->at(pTBinDbar)) || - (massD > sidebandRightInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD) && massDbar > sidebandLeftInner->at(pTBinDbar) && massDbar < sidebandRightOuter->at(pTBinDbar)) || - (massD > sidebandLeftInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD) && massDbar > sidebandLeftInner->at(pTBinDbar) && massDbar < sidebandLeftOuter->at(pTBinDbar)) || - (massD > sidebandLeftInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD) && massDbar > sidebandRightInner->at(pTBinDbar) && massDbar < sidebandRightOuter->at(pTBinDbar))) { - //in sideband region - registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptD, ptDbar, efficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, efficiencyWeight); - registry.fill(HIST("hDeltaPtDDbarSidebands"), ptDbar - ptD, efficiencyWeight); - registry.fill(HIST("hDeltaPtMaxMinSidebands"), std::abs(ptDbar - ptD), efficiencyWeight); - } - } //end loop - } -}; - -/// D-Dbar correlation pair filling task, from pair tables - for MC reco-level analysis (candidates matched to true signal only, but also bkg sources are studied) -/// Works on both USL and LS analyses pair tables -struct HfTaskCorrelationDDbarMcRec { - - HistogramRegistry registry{ - "registry", - //NOTE: use hMassD0 (from correlator task) for normalisation, and hMass2DCorrelationPairs for 2D-sideband-subtraction purposes - {{"hMass2DCorrelationPairsMCRecBkgBkg", stringDDbar + "2D BkgBkg - MC reco;inv. mass D (GeV/#it{c}^{2});inv. mass Dbar (GeV/#it{c}^{2});" + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{200, 1.6, 2.1}, {200, 1.6, 2.1}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hDeltaPtMaxMinSidebands", stringDDbar + stringSideband + stringDeltaPtMaxMin + "entries", {HistType::kTH1F, {{72, 0., 36.}}}}, + {"hMass2DCorrelationPairsMCRecBkgBkg", stringDDbar + "2D BkgBkg - MC reco;inv. mass D (GeV/#it{c}^{2});inv. mass Dbar (GeV/#it{c}^{2});" + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{200, 1.6, 2.1}, {200, 1.6, 2.1}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() {"hMass2DCorrelationPairsMCRecBkgRef", stringDDbar + "2D BkgRef - MC reco;inv. mass D (GeV/#it{c}^{2});inv. mass Dbar (GeV/#it{c}^{2});" + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{200, 1.6, 2.1}, {200, 1.6, 2.1}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() {"hMass2DCorrelationPairsMCRecBkgSig", stringDDbar + "2D BkgSig - MC reco;inv. mass D (GeV/#it{c}^{2});inv. mass Dbar (GeV/#it{c}^{2});" + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{200, 1.6, 2.1}, {200, 1.6, 2.1}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() {"hMass2DCorrelationPairsMCRecRefBkg", stringDDbar + "2D RefBkg - MC reco;inv. mass D (GeV/#it{c}^{2});inv. mass Dbar (GeV/#it{c}^{2});" + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{200, 1.6, 2.1}, {200, 1.6, 2.1}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() @@ -231,15 +129,21 @@ struct HfTaskCorrelationDDbarMcRec { {"hCorrel2DPtIntSidebandsMCRec", stringMCReco + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, {"hDeltaPtDDbarSidebandsMCRec", stringMCReco + stringSideband + stringDeltaPt + "entries", {HistType::kTH1F, {{144, -36., 36.}}}}, {"hDeltaPtMaxMinSidebandsMCRec", stringMCReco + stringSideband + stringDeltaPtMaxMin + "entries", {HistType::kTH1F, {{72, 0., 36.}}}}, - {"hCorrel2DVsPtSidebandsMCRecBkgBkg", stringMCReco + "BkgBkg" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecBkgRef", stringMCReco + "BkgRef" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecBkgSig", stringMCReco + "BkgSig" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecRefBkg", stringMCReco + "RefBkg" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecRefRef", stringMCReco + "RefRef" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecRefSig", stringMCReco + "RefSig" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecSigBkg", stringMCReco + "SigBkg" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecSigRef", stringMCReco + "SigRef" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hCorrel2DVsPtSidebandsMCRecSigSig", stringMCReco + "SigSig" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}}}; //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecBkgBkg", stringMCReco + "BkgBkg" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecBkgRef", stringMCReco + "BkgRef" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecBkgSig", stringMCReco + "BkgSig" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecRefBkg", stringMCReco + "RefBkg" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecRefRef", stringMCReco + "RefRef" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecRefSig", stringMCReco + "RefSig" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecSigBkg", stringMCReco + "SigBkg" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecSigRef", stringMCReco + "SigRef" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hCorrel2DVsPtSidebandsMCRecSigSig", stringMCReco + "SigSig" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hDeltaEtaPtIntMCGen", stringMCParticles + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, + {"hDeltaPhiPtIntMCGen", stringMCParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, + {"hCorrel2DPtIntMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, + {"hCorrel2DVsPtMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() + {"hDeltaPtDDbarMCGen", stringMCParticles + stringDeltaPt + "entries", {HistType::kTH1F, {{144, -36., 36.}}}}, + {"hDeltaPtMaxMinMCGen", stringMCParticles + stringDeltaPtMaxMin + "entries", {HistType::kTH1F, {{72, 0., 36.}}}}}}; //pT ranges for correlation plots: the default values are those embedded in hf_cuts_d0_topik (i.e. the mass pT bins), but can be redefined via json files Configurable> binsCorrelations{"ptBinsForCorrelations", std::vector{pTBinsCorrelations_v}, "pT bin limits for correlation plots"}; @@ -253,7 +157,7 @@ struct HfTaskCorrelationDDbarMcRec { Configurable> sidebandRightInner{"sidebandRightInner", std::vector{sidebandRightInner_v}, "Inner values of right sideband vs pT"}; Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{sidebandRightOuter_v}, "Outer values of right sideband vs pT"}; Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for D meson specie under study"}; - Configurable flagApplyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; + Configurable flagApplyEfficiency{"efficiencyFlagD", 1, "Flag for applying efficiency weights"}; void init(o2::framework::InitContext&) { @@ -262,6 +166,12 @@ struct HfTaskCorrelationDDbarMcRec { const double* valuespTaxis = binsCorrelations->data(); for (int i = 2; i <= 3; i++) { + registry.get(HIST("hMass2DCorrelationPairs"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSidebands"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hMass2DCorrelationPairs"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); registry.get(HIST("hMass2DCorrelationPairsMCRecBkgBkg"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); registry.get(HIST("hMass2DCorrelationPairsMCRecBkgRef"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); registry.get(HIST("hMass2DCorrelationPairsMCRecBkgSig"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); @@ -316,10 +226,71 @@ struct HfTaskCorrelationDDbarMcRec { registry.get(HIST("hCorrel2DVsPtSidebandsMCRecSigBkg"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandsMCRecSigRef"))->Sumw2(); registry.get(HIST("hCorrel2DVsPtSidebandsMCRecSigSig"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMCGen"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtMCGen"))->Sumw2(); } } - void process(aod::DDbarPairFull const& pairEntries) + /// D-Dbar correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) + /// Works on both USL and LS analyses pair tables + void processData(aod::DDbarPairFull const& pairEntries) + { + for (auto& pairEntry : pairEntries) { + //define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptD = pairEntry.ptD(); + double ptDbar = pairEntry.ptDbar(); + double massD = pairEntry.mD(); + double massDbar = pairEntry.mDbar(); + + int pTBinD = o2::analysis::findBin(binsCorrelations, ptD); + int pTBinDbar = o2::analysis::findBin(binsCorrelations, ptDbar); + + double efficiencyWeight = 1.; + if (flagApplyEfficiency) { + efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptD)) * efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptDbar))); + } + + //fill 2D invariant mass plots + registry.fill(HIST("hMass2DCorrelationPairs"), massD, massDbar, ptD, ptDbar, efficiencyWeight); + + //reject entries outside pT ranges of interest + if (pTBinD == -1 || pTBinDbar == -1) { //at least one particle outside accepted pT range + continue; + } + + //check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots + if (massD > signalRegionInner->at(pTBinD) && massD < signalRegionOuter->at(pTBinD) && massDbar > signalRegionInner->at(pTBinDbar) && massDbar < signalRegionOuter->at(pTBinDbar)) { + //in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptD, ptDbar, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); + registry.fill(HIST("hDeltaPtDDbarSignalRegion"), ptDbar - ptD, efficiencyWeight); + registry.fill(HIST("hDeltaPtMaxMinSignalRegion"), std::abs(ptDbar - ptD), efficiencyWeight); + } + + if ((massD > sidebandLeftInner->at(pTBinD) && massD < sidebandLeftOuter->at(pTBinD) && massDbar > sidebandLeftInner->at(pTBinDbar) && massDbar < sidebandRightOuter->at(pTBinDbar)) || + (massD > sidebandRightInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD) && massDbar > sidebandLeftInner->at(pTBinDbar) && massDbar < sidebandRightOuter->at(pTBinDbar)) || + (massD > sidebandLeftInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD) && massDbar > sidebandLeftInner->at(pTBinDbar) && massDbar < sidebandLeftOuter->at(pTBinDbar)) || + (massD > sidebandLeftInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD) && massDbar > sidebandRightInner->at(pTBinDbar) && massDbar < sidebandRightOuter->at(pTBinDbar))) { + //in sideband region + registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptD, ptDbar, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, efficiencyWeight); + registry.fill(HIST("hDeltaPtDDbarSidebands"), ptDbar - ptD, efficiencyWeight); + registry.fill(HIST("hDeltaPtMaxMinSidebands"), std::abs(ptDbar - ptD), efficiencyWeight); + } + } //end loop + } + + PROCESS_SWITCH(HfTaskCorrelationDDbar, processData, "Process data", false); + + /// D-Dbar correlation pair filling task, from pair tables - for MC reco-level analysis (candidates matched to true signal only, but also bkg sources are studied) + /// Works on both USL and LS analyses pair tables + void processMcRec(aod::DDbarPairFull const& pairEntries) { for (auto& pairEntry : pairEntries) { //define variables for widely used quantities @@ -461,37 +432,12 @@ struct HfTaskCorrelationDDbarMcRec { } } //end loop } -}; -/// D-Dbar correlation pair filling task, from pair tables - for MC gen-level analysis (no filter/selection, only true signal) - Ok for both USL and LS analyses -/// Works on both USL and LS analyses pair tables (and if tables are filled with quark pairs as well) -struct HfTaskCorrelationDDbarMcGen { + PROCESS_SWITCH(HfTaskCorrelationDDbar, processMcRec, "Process MC Reco mode", true); - HistogramRegistry registry{ - "registry", - {{"hDeltaEtaPtIntMCGen", stringMCParticles + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, - {"hDeltaPhiPtIntMCGen", stringMCParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, - {"hCorrel2DPtIntMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, - {"hCorrel2DVsPtMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtDbar + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {120, -6., 6.}, {10, 0., 10.}, {10, 0., 10.}}}}, //note: axes 3 and 4 (the pT) are updated in the init() - {"hDeltaPtDDbarMCGen", stringMCParticles + stringDeltaPt + "entries", {HistType::kTH1F, {{144, -36., 36.}}}}, - {"hDeltaPtMaxMinMCGen", stringMCParticles + stringDeltaPtMaxMin + "entries", {HistType::kTH1F, {{72, 0., 36.}}}}}}; - - //pT ranges for correlation plots: the default values are those embedded in hf_cuts_d0_topik (i.e. the mass pT bins), but can be redefined via json files - Configurable> binsCorrelations{"ptBinsForCorrelations", std::vector{pTBinsCorrelations_v}, "pT bin limits for correlation plots"}; - - void init(o2::framework::InitContext&) - { - // redefinition of pT axes for THnSparse holding correlation entries - int nBinspTaxis = binsCorrelations->size() - 1; - const double* valuespTaxis = binsCorrelations->data(); - - for (int i = 2; i <= 3; i++) { - registry.get(HIST("hCorrel2DVsPtMCGen"))->GetAxis(i)->Set(nBinspTaxis, valuespTaxis); - registry.get(HIST("hCorrel2DVsPtMCGen"))->Sumw2(); - } - } - - void process(aod::DDbarPair const& pairEntries) + /// D-Dbar correlation pair filling task, from pair tables - for MC gen-level analysis (no filter/selection, only true signal) - Ok for both USL and LS analyses + /// Works on both USL and LS analyses pair tables (and if tables are filled with quark pairs as well) + void processMcGen(aod::DDbarPair const& pairEntries) { for (auto& pairEntry : pairEntries) { //define variables for widely used quantities @@ -513,20 +459,11 @@ struct HfTaskCorrelationDDbarMcGen { registry.fill(HIST("hDeltaPtMaxMinMCGen"), std::abs(ptDbar - ptD)); } //end loop } + + PROCESS_SWITCH(HfTaskCorrelationDDbar, processMcGen, "Process MC Gen mode", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - WorkflowSpec workflow{}; - //MC-based tasks - const bool doMCGen = cfgc.options().get("doMCGen"); - const bool doMCRec = cfgc.options().get("doMCRec"); - if (doMCGen) { //MC-Gen analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else if (doMCRec) { //MC-Rec analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } else { //data analysis - workflow.push_back(adaptAnalysisTask(cfgc)); - } - return workflow; + return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-task-correlation-d-dbar"})}; } From dc76a08362d493ec20bed0df99efb273a48d6af8 Mon Sep 17 00:00:00 2001 From: Fabio Colamaria Date: Fri, 26 Nov 2021 11:58:12 +0100 Subject: [PATCH 02/16] Modifications related to review comments --- PWGHF/Tasks/HFCorrelatorD0D0bar.cxx | 29 ++++++++-------- .../HFCorrelatorD0D0barBarrelFullPID.cxx | 29 ++++++++-------- PWGHF/Tasks/HFCorrelatorDplusDminus.cxx | 33 ++++++++++--------- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx index d14fb2d0b47..36e0f7964e4 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx @@ -65,7 +65,7 @@ struct HfCorrelatorD0D0bar { {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "D0,D0bar candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, @@ -75,12 +75,12 @@ struct HfCorrelatorD0D0bar { {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, @@ -98,17 +98,18 @@ struct HfCorrelatorD0D0bar { void init(o2::framework::InitContext&) { - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + auto vbins = (std::vector)bins; + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= selectionFlagD0bar); diff --git a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx index 8babb0a66c8..28956013928 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx @@ -65,7 +65,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "D0,D0bar candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, @@ -75,12 +75,12 @@ struct HfCorrelatorD0D0barBarrelFullPid { {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, @@ -98,17 +98,18 @@ struct HfCorrelatorD0D0barBarrelFullPid { void init(o2::framework::InitContext&) { - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + auto vbins = (std::vector)bins; + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0TOFplusRICHPID >= selectionFlagD0 || aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0barTOFplusRICHPID >= selectionFlagD0bar); diff --git a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx index 9ac7186d4a0..89062d6585a 100644 --- a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx +++ b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx @@ -50,7 +50,7 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_topikpi::npTBin const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; -using MCParticlesPlus = soa::Join; +using MCParticlesPlus2Prong = soa::Join; using MCParticlesPlus3Prong = soa::Join; struct HfCorrelatorDplusDminus { @@ -67,7 +67,7 @@ struct HfCorrelatorDplusDminus { {"hSelectionStatus", "Dplus,Dminus candidates;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, {"hEta", "Dplus,Dminus candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhi", "Dplus,Dminus candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "Dplus,Dminus candidates;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hY", "Dplus,Dminus candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, @@ -78,12 +78,12 @@ struct HfCorrelatorDplusDminus { {"hSelectionStatusMCRec", "Dplus,Dminus candidates - MC reco;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, {"hEtaMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, {"hPtCandMCGen", "Dplus,Dminus particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hcountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hDDbarVsDaughterEtaCut", "Dplus,Dminus pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, @@ -100,15 +100,16 @@ struct HfCorrelatorDplusDminus { void init(o2::framework::InitContext&) { - registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplus", "Dplus,Dminus candidates;inv. mass Dplus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminus", "Dplus,Dminus candidates;inv. mass Dminus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {(std::vector)bins, "#it{p}_{T} (GeV/#it{c})"}}}); + auto vbins = (std::vector)bins; + registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplus", "Dplus,Dminus candidates;inv. mass Dplus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminus", "Dplus,Dminus candidates;inv. mass Dminus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); @@ -429,7 +430,7 @@ struct HfCorrelatorDplusDminus { PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcGen, "Process MC Gen mode", false); /// c-cbar correlator table builder - for MC gen-level analysis - void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) + void processccbar(aod::McCollision const& mccollision, MCParticlesPlus2Prong const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); int counterccbar = 0, counterccbarPreEtasel = 0; @@ -439,7 +440,7 @@ struct HfCorrelatorDplusDminus { if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles continue; } - int partMothPDG = particle1.mother0_as().pdgCode(); + int partMothPDG = particle1.mother0_as().pdgCode(); //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; @@ -476,7 +477,7 @@ struct HfCorrelatorDplusDminus { continue; } //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it - if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { + if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } entryDplusDminusPair(getDeltaPhi(particle2.phi(), particle1.phi()), From 2242fdbf75481179022b0af393c9eb812820a25c Mon Sep 17 00:00:00 2001 From: Fabio Colamaria Date: Wed, 15 Dec 2021 09:06:47 +0100 Subject: [PATCH 03/16] Addressing comments by Vit --- PWGHF/Tasks/HFCorrelatorD0D0bar.cxx | 152 +++++++++--------- .../HFCorrelatorD0D0barBarrelFullPID.cxx | 152 +++++++++--------- PWGHF/Tasks/HFCorrelatorDplusDminus.cxx | 144 ++++++++--------- 3 files changed, 224 insertions(+), 224 deletions(-) diff --git a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx index 36e0f7964e4..1e406b850a6 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HfCorrelatorD0D0bar.cxx +/// \file HFCorrelatorD0D0bar.cxx /// \brief D0-D0bar correlator task - data-like, MC-reco and MC-kine analyses. For ULS and LS pairs /// /// \author Fabio Colamaria , INFN Bari @@ -58,7 +58,7 @@ struct HfCorrelatorD0D0bar { HistogramRegistry registry{ "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes + // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, @@ -68,7 +68,7 @@ struct HfCorrelatorD0D0bar { {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, @@ -81,10 +81,10 @@ struct HfCorrelatorD0D0bar { {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; + {"hCountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hCountCCbarPerEventBeforeEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; @@ -108,8 +108,8 @@ struct HfCorrelatorD0D0bar { registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_selcandidate_d0::isSelD0bar >= selectionFlagD0bar); @@ -142,7 +142,7 @@ struct HfCorrelatorD0D0bar { if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { continue; } - //check decay channel flag for candidate1 + // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { continue; } @@ -152,7 +152,7 @@ struct HfCorrelatorD0D0bar { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); } - //fill invariant mass plots and generic info from all D0/D0bar candidates + // fill invariant mass plots and generic info from all D0/D0bar candidates if (candidate1.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hMass"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); registry.fill(HIST("hMassD0"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); @@ -169,26 +169,26 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hY"), YD0(candidate1)); registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); - //D-Dbar correlation dedicated section - //if the candidate is a D0, search for D0bar and evaluate correlations + // D-Dbar correlation dedicated section + // if the candidate is a D0, search for D0bar and evaluate correlations if (candidate1.isSelD0() < selectionFlagD0) { continue; } for (auto& candidate2 : candidates) { - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { //check decay channel flag for candidate2 + if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { // check decay channel flag for candidate2 continue; } - if (candidate2.isSelD0bar() < selectionFlagD0bar) { //keep only D0bar candidates passing the selection + if (candidate2.isSelD0bar() < selectionFlagD0bar) { // keep only D0bar candidates passing the selection continue; } - //kinematic selection on D0bar candidates + // kinematic selection on D0bar candidates if (cutYCandMax >= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { continue; } if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { continue; } - //excluding trigger self-correlations (possible in case of both mass hypotheses accepted) + // excluding trigger self-correlations (possible in case of both mass hypotheses accepted) if (candidate1.mRowIndex == candidate2.mRowIndex) { continue; } @@ -201,22 +201,22 @@ struct HfCorrelatorD0D0bar { 0); double etaCut = 0.; double ptCut = 0.; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(candidate1.eta()) < etaCut && std::abs(candidate2.eta()) < etaCut && candidate1.pt() > ptCut && candidate2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } ptCut += incrementPtThreshold; } while (ptCut < ptThresholdForMaxEtaCut - epsilon); } while (etaCut < maxEtaCut - epsilon); - //note: candidates selected as both D0 and D0bar are used, and considered in both situation (but not auto-correlated): reflections could play a relevant role. - //another, more restrictive, option, could be to consider only candidates selected with a single option (D0 xor D0bar) + // note: candidates selected as both D0 and D0bar are used, and considered in both situation (but not auto-correlated): reflections could play a relevant role. + // another, more restrictive, option, could be to consider only candidates selected with a single option (D0 xor D0bar) } // end inner loop (Dbars) - } //end outer loop + } // end outer loop } PROCESS_SWITCH(HfCorrelatorD0D0bar, processData, "Process data", false); @@ -242,13 +242,13 @@ struct HfCorrelatorD0D0bar { } registry.fill(HIST("hMultiplicity"), nTracks); - //MC reco level + // MC reco level bool flagD0Signal = false; bool flagD0Reflection = false; bool flagD0barSignal = false; bool flagD0barReflection = false; for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 + // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { continue; } @@ -265,7 +265,7 @@ struct HfCorrelatorD0D0bar { } if (std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::D0ToPiK) { - //fill per-candidate distributions from D0/D0bar true candidates + // fill per-candidate distributions from D0/D0bar true candidates registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); registry.fill(HIST("hPtProng1MCRec"), candidate1.ptProng1()); @@ -274,9 +274,9 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hYMCRec"), YD0(candidate1)); registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); } - //fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate1.isSelD0() >= selectionFlagD0) { //only reco as D0 - if (candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) { //also matched as D0 + // fill invariant mass plots from D0/D0bar signal and background candidates + if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0 + if (candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) { // also matched as D0 registry.fill(HIST("hMassD0MCRecSig"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); } else if (candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) { registry.fill(HIST("hMassD0MCRecRefl"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); @@ -284,8 +284,8 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hMassD0MCRecBkg"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); } } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { //only reco as D0bar - if (candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) { //also matched as D0bar + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) { // also matched as D0bar registry.fill(HIST("hMassD0barMCRecSig"), InvMassD0bar(candidate1), candidate1.pt(), efficiencyWeight); } else if (candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) { registry.fill(HIST("hMassD0barMCRecRefl"), InvMassD0bar(candidate1), candidate1.pt(), efficiencyWeight); @@ -294,34 +294,34 @@ struct HfCorrelatorD0D0bar { } } - //D-Dbar correlation dedicated section - //if the candidate is selected ad D0, search for D0bar and evaluate correlations - if (candidate1.isSelD0() < selectionFlagD0) { //discard candidates not selected as D0 in outer loop + // D-Dbar correlation dedicated section + // if the candidate is selected ad D0, search for D0bar and evaluate correlations + if (candidate1.isSelD0() < selectionFlagD0) { // discard candidates not selected as D0 in outer loop continue; } - flagD0Signal = candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK; //flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0Reflection = candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); //flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0Signal = candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) + flagD0Reflection = candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) for (auto& candidate2 : candidates) { - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { //check decay channel flag for candidate2 + if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { // check decay channel flag for candidate2 continue; } - if (candidate2.isSelD0bar() < selectionFlagD0bar) { //discard candidates not selected as D0bar in inner loop + if (candidate2.isSelD0bar() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop continue; } - flagD0barSignal = candidate2.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); //flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) - flagD0barReflection = candidate2.flagMCMatchRec() == 1 << DecayType::D0ToPiK; //flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) + flagD0barSignal = candidate2.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) + flagD0barReflection = candidate2.flagMCMatchRec() == 1 << DecayType::D0ToPiK; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) if (cutYCandMax >= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { continue; } if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { continue; } - //Excluding trigger self-correlations (possible in case of both mass hypotheses accepted) + // Excluding trigger self-correlations (possible in case of both mass hypotheses accepted) if (candidate1.mRowIndex == candidate2.mRowIndex) { continue; } - //choice of options (D0/D0bar signal/bkg) - int pairSignalStatus = 0; //0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig + // choice of options (D0/D0bar signal/bkg) + int pairSignalStatus = 0; // 0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig if (flagD0Signal) { pairSignalStatus += 6; } @@ -343,10 +343,10 @@ struct HfCorrelatorD0D0bar { pairSignalStatus); double etaCut = 0.; double ptCut = 0.; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(candidate1.eta()) < etaCut && std::abs(candidate2.eta()) < etaCut && candidate1.pt() > ptCut && candidate2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } @@ -355,7 +355,7 @@ struct HfCorrelatorD0D0bar { } while (etaCut < maxEtaCut - epsilon); } // end inner loop (Dbars) - } //end outer loop + } // end outer loop } PROCESS_SWITCH(HfCorrelatorD0D0bar, processMcRec, "Process MC Reco mode", true); @@ -365,9 +365,9 @@ struct HfCorrelatorD0D0bar { { int counterD0D0bar = 0; registry.fill(HIST("hMCEvtCount"), 0); - //MC gen level + // MC gen level for (auto& particle1 : particlesMC) { - //check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! + // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { continue; } @@ -384,14 +384,14 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hYMCGen"), yD); counterD0D0bar++; - //D-Dbar correlation dedicated section - //if it's a D0 particle, search for D0bar and evaluate correlations - if (particle1.pdgCode() != pdg::Code::kD0) { //just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + // D-Dbar correlation dedicated section + // if it's a D0 particle, search for D0bar and evaluate correlations + if (particle1.pdgCode() != pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } - registry.fill(HIST("hcountD0triggersMCGen"), 0, particle1.pt()); //to count trigger D0 (for normalisation) + registry.fill(HIST("hCountD0triggersMCGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) for (auto& particle2 : particlesMC) { - if (particle2.pdgCode() != pdg::Code::kD0bar) { //check that inner particle is D0bar + if (particle2.pdgCode() != pdg::Code::kD0bar) { // check that inner particle is D0bar continue; } if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { @@ -406,11 +406,11 @@ struct HfCorrelatorD0D0bar { particle2.pt()); entryD0D0barRecoInfo(1.864, 1.864, - 8); //dummy information + 8); // dummy information double etaCut = 0.; double ptCut = 0.; - //fill pairs vs etaCut plot + // fill pairs vs etaCut plot bool rightDecayChannels = false; if ((std::abs(particle1.flagMCMatchGen()) == 1 << DecayType::D0ToPiK) && (std::abs(particle2.flagMCMatchGen()) == 1 << DecayType::D0ToPiK)) { rightDecayChannels = true; @@ -418,11 +418,11 @@ struct HfCorrelatorD0D0bar { do { ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot - if (std::abs(particle1.eta()) < etaCut && std::abs(particle2.eta()) < etaCut && particle1.pt() > ptCut && particle2.pt() > ptCut) { //fill with D and Dbar acceptance checks + do { // fill pairs vs etaCut plot + if (std::abs(particle1.eta()) < etaCut && std::abs(particle2.eta()) < etaCut && particle1.pt() > ptCut && particle2.pt() > ptCut) { // fill with D and Dbar acceptance checks registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } - if (rightDecayChannels) { //fill with D and Dbar daughter particls acceptance checks + if (rightDecayChannels) { // fill with D and Dbar daughter particls acceptance checks double etaCandidate1Daughter1 = particle1.daughter0_as().eta(); double etaCandidate1Daughter2 = particle1.daughter1_as().eta(); double etaCandidate2Daughter1 = particle2.daughter0_as().eta(); @@ -436,9 +436,9 @@ struct HfCorrelatorD0D0bar { ptCut += incrementPtThreshold; } while (ptCut < ptThresholdForMaxEtaCut - epsilon); } while (etaCut < maxEtaCut - epsilon); - } //end inner loop - } //end outer loop - registry.fill(HIST("hcountD0D0barPerEvent"), counterD0D0bar); + } // end inner loop + } // end outer loop + registry.fill(HIST("hCountD0D0barPerEvent"), counterD0D0bar); } PROCESS_SWITCH(HfCorrelatorD0D0bar, processMcGen, "Process MC Gen mode", false); @@ -447,19 +447,19 @@ struct HfCorrelatorD0D0bar { void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarPreEtasel = 0; + int counterccbar = 0, counterccbarBeforeEtasel = 0; - //loop over particles at MC gen level + // loop over particles at MC gen level for (auto& particle1 : particlesMC) { - if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles + if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } int partMothPDG = particle1.mother0_as().pdgCode(); - //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it + // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; } - counterccbarPreEtasel++; //count c or cbar (before kinematic selection) + counterccbarBeforeEtasel++; // count c or cbar (before kinematic selection) double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { continue; @@ -471,17 +471,17 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hEtaMCGen"), particle1.eta()); registry.fill(HIST("hPhiMCGen"), particle1.phi()); registry.fill(HIST("hYMCGen"), yC); - counterccbar++; //count if c or cbar don't come from themselves during fragmentation (after kinematic selection) + counterccbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) - //c-cbar correlation dedicated section - //if it's c, search for cbar and evaluate correlations. + // c-cbar correlation dedicated section + // if it's c, search for cbar and evaluate correlations. if (particle1.pdgCode() != PDG_t::kCharm) { continue; } - registry.fill(HIST("hcountCtriggersMCGen"), 0, particle1.pt()); //to count trigger c quark (for normalisation) + registry.fill(HIST("hCountCtriggersMCGen"), 0, particle1.pt()); // to count trigger c quark (for normalisation) for (auto& particle2 : particlesMC) { - if (particle2.pdgCode() != PDG_t::kCharmBar) { //check that inner particle is a cbar + if (particle2.pdgCode() != PDG_t::kCharmBar) { // check that inner particle is a cbar continue; } if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { @@ -490,7 +490,7 @@ struct HfCorrelatorD0D0bar { if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { continue; } - //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it + // check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } @@ -500,11 +500,11 @@ struct HfCorrelatorD0D0bar { particle2.pt()); entryD0D0barRecoInfo(1.864, 1.864, - 8); //dummy information + 8); // dummy information } // end inner loop - } //end outer loop - registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); + } // end outer loop + registry.fill(HIST("hCountCCbarPerEvent"), counterccbar); + registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterccbarBeforeEtasel); } PROCESS_SWITCH(HfCorrelatorD0D0bar, processccbar, "Process ccbar pairs", false); @@ -512,5 +512,5 @@ struct HfCorrelatorD0D0bar { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-correlator-d0-d0bar"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx index 28956013928..0f9c194c25b 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HfCorrelatorD0D0barBarrelFullPid.cxx +/// \file HFCorrelatorD0D0barBarrelFullPid.cxx /// \brief Temporary D0-D0bar correlator task with full barrel PID implementation - data-like, MC-reco and MC-kine analyses. For ULS and LS pairs /// /// \author Fabio Colamaria , INFN Bari @@ -58,7 +58,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { HistogramRegistry registry{ "registry", - //NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes + // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, @@ -68,7 +68,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, @@ -81,10 +81,10 @@ struct HfCorrelatorD0D0barBarrelFullPid { {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; + {"hCountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hCountCCbarPerEventBeforeEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; @@ -108,8 +108,8 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0TOFplusRICHPID >= selectionFlagD0 || aod::hf_selcandidate_d0_ALICE3_Barrel::isSelD0barTOFplusRICHPID >= selectionFlagD0bar); @@ -142,7 +142,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { continue; } - //check decay channel flag for candidate1 + // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { continue; } @@ -152,7 +152,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); } - //fill invariant mass plots and generic info from all D0/D0bar candidates + // fill invariant mass plots and generic info from all D0/D0bar candidates if (candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0) { registry.fill(HIST("hMass"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); registry.fill(HIST("hMassD0"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); @@ -169,26 +169,26 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hY"), YD0(candidate1)); registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0barTOFplusRICHPID() + (candidate1.isSelD0TOFplusRICHPID() * 2)); - //D-Dbar correlation dedicated section - //if the candidate is a D0, search for D0bar and evaluate correlations + // D-Dbar correlation dedicated section + // if the candidate is a D0, search for D0bar and evaluate correlations if (candidate1.isSelD0TOFplusRICHPID() < selectionFlagD0) { continue; } for (auto& candidate2 : candidates) { - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { //check decay channel flag for candidate2 + if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { // check decay channel flag for candidate2 continue; } - if (candidate2.isSelD0barTOFplusRICHPID() < selectionFlagD0bar) { //keep only D0bar candidates passing the selection + if (candidate2.isSelD0barTOFplusRICHPID() < selectionFlagD0bar) { // keep only D0bar candidates passing the selection continue; } - //kinematic selection on D0bar candidates + // kinematic selection on D0bar candidates if (cutYCandMax >= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { continue; } if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { continue; } - //excluding trigger self-correlations (possible in case of both mass hypotheses accepted) + // excluding trigger self-correlations (possible in case of both mass hypotheses accepted) if (candidate1.mRowIndex == candidate2.mRowIndex) { continue; } @@ -201,22 +201,22 @@ struct HfCorrelatorD0D0barBarrelFullPid { 0); double etaCut = 0.; double ptCut = 0.; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(candidate1.eta()) < etaCut && std::abs(candidate2.eta()) < etaCut && candidate1.pt() > ptCut && candidate2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } ptCut += incrementPtThreshold; } while (ptCut < ptThresholdForMaxEtaCut - epsilon); } while (etaCut < maxEtaCut - epsilon); - //note: candidates selected as both D0 and D0bar are used, and considered in both situation (but not auto-correlated): reflections could play a relevant role. - //another, more restrictive, option, could be to consider only candidates selected with a single option (D0 xor D0bar) + // note: candidates selected as both D0 and D0bar are used, and considered in both situation (but not auto-correlated): reflections could play a relevant role. + // another, more restrictive, option, could be to consider only candidates selected with a single option (D0 xor D0bar) } // end inner loop (Dbars) - } //end outer loop + } // end outer loop } PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processData, "Process data", false); @@ -242,13 +242,13 @@ struct HfCorrelatorD0D0barBarrelFullPid { } registry.fill(HIST("hMultiplicity"), nTracks); - //MC reco level + // MC reco level bool flagD0Signal = false; bool flagD0Reflection = false; bool flagD0barSignal = false; bool flagD0barReflection = false; for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 + // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::D0ToPiK)) { continue; } @@ -265,7 +265,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { } if (std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::D0ToPiK) { - //fill per-candidate distributions from D0/D0bar true candidates + // fill per-candidate distributions from D0/D0bar true candidates registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); registry.fill(HIST("hPtProng1MCRec"), candidate1.ptProng1()); @@ -274,9 +274,9 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hYMCRec"), YD0(candidate1)); registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelD0barTOFplusRICHPID() + (candidate1.isSelD0TOFplusRICHPID() * 2)); } - //fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0) { //only reco as D0 - if (candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) { //also matched as D0 + // fill invariant mass plots from D0/D0bar signal and background candidates + if (candidate1.isSelD0TOFplusRICHPID() >= selectionFlagD0) { // only reco as D0 + if (candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) { // also matched as D0 registry.fill(HIST("hMassD0MCRecSig"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); } else if (candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) { registry.fill(HIST("hMassD0MCRecRefl"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); @@ -284,8 +284,8 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hMassD0MCRecBkg"), InvMassD0(candidate1), candidate1.pt(), efficiencyWeight); } } - if (candidate1.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar) { //only reco as D0bar - if (candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) { //also matched as D0bar + if (candidate1.isSelD0barTOFplusRICHPID() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK)) { // also matched as D0bar registry.fill(HIST("hMassD0barMCRecSig"), InvMassD0bar(candidate1), candidate1.pt(), efficiencyWeight); } else if (candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK) { registry.fill(HIST("hMassD0barMCRecRefl"), InvMassD0bar(candidate1), candidate1.pt(), efficiencyWeight); @@ -294,34 +294,34 @@ struct HfCorrelatorD0D0barBarrelFullPid { } } - //D-Dbar correlation dedicated section - //if the candidate is selected ad D0, search for D0bar and evaluate correlations - if (candidate1.isSelD0TOFplusRICHPID() < selectionFlagD0) { //discard candidates not selected as D0 in outer loop + // D-Dbar correlation dedicated section + // if the candidate is selected ad D0, search for D0bar and evaluate correlations + if (candidate1.isSelD0TOFplusRICHPID() < selectionFlagD0) { // discard candidates not selected as D0 in outer loop continue; } - flagD0Signal = candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK; //flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0Reflection = candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); //flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + flagD0Signal = candidate1.flagMCMatchRec() == 1 << DecayType::D0ToPiK; // flagD0Signal 'true' if candidate1 matched to D0 (particle) + flagD0Reflection = candidate1.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) for (auto& candidate2 : candidates) { - if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { //check decay channel flag for candidate2 + if (!(candidate2.hfflag() & 1 << DecayType::D0ToPiK)) { // check decay channel flag for candidate2 continue; } - if (candidate2.isSelD0barTOFplusRICHPID() < selectionFlagD0bar) { //discard candidates not selected as D0bar in inner loop + if (candidate2.isSelD0barTOFplusRICHPID() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop continue; } - flagD0barSignal = candidate2.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); //flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) - flagD0barReflection = candidate2.flagMCMatchRec() == 1 << DecayType::D0ToPiK; //flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) + flagD0barSignal = candidate2.flagMCMatchRec() == -(1 << DecayType::D0ToPiK); // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle) + flagD0barReflection = candidate2.flagMCMatchRec() == 1 << DecayType::D0ToPiK; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle) if (cutYCandMax >= 0. && std::abs(YD0(candidate2)) > cutYCandMax) { continue; } if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { continue; } - //Excluding trigger self-correlations (possible in case of both mass hypotheses accepted) + // Excluding trigger self-correlations (possible in case of both mass hypotheses accepted) if (candidate1.mRowIndex == candidate2.mRowIndex) { continue; } - //choice of options (D0/D0bar signal/bkg) - int pairSignalStatus = 0; //0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig + // choice of options (D0/D0bar signal/bkg) + int pairSignalStatus = 0; // 0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig if (flagD0Signal) { pairSignalStatus += 6; } @@ -343,10 +343,10 @@ struct HfCorrelatorD0D0barBarrelFullPid { pairSignalStatus); double etaCut = 0.; double ptCut = 0.; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(candidate1.eta()) < etaCut && std::abs(candidate2.eta()) < etaCut && candidate1.pt() > ptCut && candidate2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } @@ -355,7 +355,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { } while (etaCut < maxEtaCut - epsilon); } // end inner loop (Dbars) - } //end outer loop + } // end outer loop } PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processMcRec, "Process MC Reco mode", true); @@ -365,9 +365,9 @@ struct HfCorrelatorD0D0barBarrelFullPid { { int counterD0D0bar = 0; registry.fill(HIST("hMCEvtCount"), 0); - //MC gen level + // MC gen level for (auto& particle1 : particlesMC) { - //check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! + // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kD0) { continue; } @@ -384,14 +384,14 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hYMCGen"), yD); counterD0D0bar++; - //D-Dbar correlation dedicated section - //if it's a D0 particle, search for D0bar and evaluate correlations - if (particle1.pdgCode() != pdg::Code::kD0) { //just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + // D-Dbar correlation dedicated section + // if it's a D0 particle, search for D0bar and evaluate correlations + if (particle1.pdgCode() != pdg::Code::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } - registry.fill(HIST("hcountD0triggersMCGen"), 0, particle1.pt()); //to count trigger D0 (for normalisation) + registry.fill(HIST("hCountD0triggersMCGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) for (auto& particle2 : particlesMC) { - if (particle2.pdgCode() != pdg::Code::kD0bar) { //check that inner particle is D0bar + if (particle2.pdgCode() != pdg::Code::kD0bar) { // check that inner particle is D0bar continue; } if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { @@ -406,11 +406,11 @@ struct HfCorrelatorD0D0barBarrelFullPid { particle2.pt()); entryD0D0barRecoInfo(1.864, 1.864, - 8); //dummy information + 8); // dummy information double etaCut = 0.; double ptCut = 0.; - //fill pairs vs etaCut plot + // fill pairs vs etaCut plot bool rightDecayChannels = false; if ((std::abs(particle1.flagMCMatchGen()) == 1 << DecayType::D0ToPiK) && (std::abs(particle2.flagMCMatchGen()) == 1 << DecayType::D0ToPiK)) { rightDecayChannels = true; @@ -418,11 +418,11 @@ struct HfCorrelatorD0D0barBarrelFullPid { do { ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot - if (std::abs(particle1.eta()) < etaCut && std::abs(particle2.eta()) < etaCut && particle1.pt() > ptCut && particle2.pt() > ptCut) { //fill with D and Dbar acceptance checks + do { // fill pairs vs etaCut plot + if (std::abs(particle1.eta()) < etaCut && std::abs(particle2.eta()) < etaCut && particle1.pt() > ptCut && particle2.pt() > ptCut) { // fill with D and Dbar acceptance checks registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } - if (rightDecayChannels) { //fill with D and Dbar daughter particls acceptance checks + if (rightDecayChannels) { // fill with D and Dbar daughter particls acceptance checks double etaCandidate1Daughter1 = particle1.daughter0_as().eta(); double etaCandidate1Daughter2 = particle1.daughter1_as().eta(); double etaCandidate2Daughter1 = particle2.daughter0_as().eta(); @@ -436,9 +436,9 @@ struct HfCorrelatorD0D0barBarrelFullPid { ptCut += incrementPtThreshold; } while (ptCut < ptThresholdForMaxEtaCut - epsilon); } while (etaCut < maxEtaCut - epsilon); - } //end inner loop - } //end outer loop - registry.fill(HIST("hcountD0D0barPerEvent"), counterD0D0bar); + } // end inner loop + } // end outer loop + registry.fill(HIST("hCountD0D0barPerEvent"), counterD0D0bar); } PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processMcGen, "Process MC Gen mode", false); @@ -447,19 +447,19 @@ struct HfCorrelatorD0D0barBarrelFullPid { void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarPreEtasel = 0; + int counterccbar = 0, counterccbarBeforeEtasel = 0; - //loop over particles at MC gen level + // loop over particles at MC gen level for (auto& particle1 : particlesMC) { - if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles + if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } int partMothPDG = particle1.mother0_as().pdgCode(); - //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it + // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; } - counterccbarPreEtasel++; //count c or cbar (before kinematic selection) + counterccbarBeforeEtasel++; // count c or cbar (before kinematic selection) double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { continue; @@ -471,17 +471,17 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hEtaMCGen"), particle1.eta()); registry.fill(HIST("hPhiMCGen"), particle1.phi()); registry.fill(HIST("hYMCGen"), yC); - counterccbar++; //count if c or cbar don't come from themselves during fragmentation (after kinematic selection) + counterccbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) - //c-cbar correlation dedicated section - //if it's c, search for cbar and evaluate correlations. + // c-cbar correlation dedicated section + // if it's c, search for cbar and evaluate correlations. if (particle1.pdgCode() != PDG_t::kCharm) { continue; } - registry.fill(HIST("hcountCtriggersMCGen"), 0, particle1.pt()); //to count trigger c quark (for normalisation) + registry.fill(HIST("hCountCtriggersMCGen"), 0, particle1.pt()); // to count trigger c quark (for normalisation) for (auto& particle2 : particlesMC) { - if (particle2.pdgCode() != PDG_t::kCharmBar) { //check that inner particle is a cbar + if (particle2.pdgCode() != PDG_t::kCharmBar) { // check that inner particle is a cbar continue; } if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { @@ -490,7 +490,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { continue; } - //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it + // check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } @@ -500,11 +500,11 @@ struct HfCorrelatorD0D0barBarrelFullPid { particle2.pt()); entryD0D0barRecoInfo(1.864, 1.864, - 8); //dummy information + 8); // dummy information } // end inner loop - } //end outer loop - registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); + } // end outer loop + registry.fill(HIST("hCountCCbarPerEvent"), counterccbar); + registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterccbarBeforeEtasel); } PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processccbar, "Process ccbar pairs", false); @@ -512,5 +512,5 @@ struct HfCorrelatorD0D0barBarrelFullPid { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-correlator-d0-d0bar-barrel-full-pid"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx index 89062d6585a..4bb1c010778 100644 --- a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx +++ b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file HFCorrelatorDplusDminus.cxx +/// \file HfCorrelatorDplusDminus.cxx /// \brief Dplus-Dminus correlator task - data-like, MC-reco and MC-kine analyses. For ULS and LS pairs /// /// \author Fabio Colamaria , INFN Bari @@ -59,7 +59,7 @@ struct HfCorrelatorDplusDminus { HistogramRegistry registry{ "registry", - //NOTE: use hMassDplus for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes + // NOTE: use hMassDplus for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes {{"hPtCand", "Dplus,Dminus candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng0", "Dplus,Dminus candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng1", "Dplus,Dminus candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, @@ -70,7 +70,7 @@ struct HfCorrelatorDplusDminus { {"hY", "Dplus,Dminus candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hPtCandMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng0MCRec", "Dplus,Dminus candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, {"hPtProng1MCRec", "Dplus,Dminus candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, @@ -84,10 +84,10 @@ struct HfCorrelatorDplusDminus { {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hcountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hDDbarVsDaughterEtaCut", "Dplus,Dminus pairs vs #eta cut on D daughters;#eta_{max};entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hcountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, - {"hcountCCbarPerEventPreEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; + {"hCountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hDDbarVsDaughterEtaCut", "Dplus,Dminus pairs vs #eta cut on D daughters;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, + {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hCountCCbarPerEventBeforeEtaCut", "c,cbar particles - MC gen;Number per event pre #eta cut;entries", {HistType::kTH1F, {{20, 0., 20.}}}}}}; Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus,Dminus"}; Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; @@ -108,8 +108,8 @@ struct HfCorrelatorDplusDminus { registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hcountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } Filter filterSelectCandidates = (aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus); @@ -142,8 +142,8 @@ struct HfCorrelatorDplusDminus { if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { continue; } - //check decay channel flag for candidate1 - if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { //probably dummy since already selected? not sure... + // check decay channel flag for candidate1 + if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { // probably dummy since already selected? not sure... continue; } @@ -152,13 +152,13 @@ struct HfCorrelatorDplusDminus { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); } - int outerParticleSign = 1; //Dplus + int outerParticleSign = 1; // Dplus auto outerSecondTrack = candidate1.index1_as(); if (outerSecondTrack.sign() == 1) { - outerParticleSign = -1; //Dminus (second daughter track is positive) + outerParticleSign = -1; // Dminus (second daughter track is positive) } - //fill invariant mass plots and generic info from all Dplus/Dminus candidates + // fill invariant mass plots and generic info from all Dplus/Dminus candidates if (outerParticleSign == 1) { registry.fill(HIST("hMass"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); registry.fill(HIST("hMassDplus"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); @@ -175,18 +175,18 @@ struct HfCorrelatorDplusDminus { registry.fill(HIST("hY"), YDPlus(candidate1)); registry.fill(HIST("hSelectionStatus"), candidate1.isSelDplusToPiKPi()); - //D-Dbar correlation dedicated section - //if the candidate is a Dplus, search for Dminus and evaluate correlations + // D-Dbar correlation dedicated section + // if the candidate is a Dplus, search for Dminus and evaluate correlations if (outerParticleSign != 1) { continue; } for (auto& candidate2 : candidates) { - //check decay channel flag for candidate2 - if (!(candidate2.hfflag() & 1 << DecayType::DPlusToPiKPi)) { //probably dummy since already selected? not sure... + // check decay channel flag for candidate2 + if (!(candidate2.hfflag() & 1 << DecayType::DPlusToPiKPi)) { // probably dummy since already selected? not sure... continue; } auto innerSecondTrack = candidate2.index1_as(); - if (innerSecondTrack.sign() != 1) { //keep only Dminus (with second daughter track positive) + if (innerSecondTrack.sign() != 1) { // keep only Dminus (with second daughter track positive) continue; } if (cutYCandMax >= 0. && std::abs(YDPlus(candidate2)) > cutYCandMax) { @@ -204,10 +204,10 @@ struct HfCorrelatorDplusDminus { 0); double etaCut = 0.; double ptCut = 0.; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(candidate1.eta()) < etaCut && std::abs(candidate2.eta()) < etaCut && candidate1.pt() > ptCut && candidate2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } @@ -215,7 +215,7 @@ struct HfCorrelatorDplusDminus { } while (ptCut < ptThresholdForMaxEtaCut - epsilon); } while (etaCut < maxEtaCut - epsilon); } // end inner loop (Dminus) - } //end outer loop (Dplus) + } // end outer loop (Dplus) } PROCESS_SWITCH(HfCorrelatorDplusDminus, processData, "Process data", false); @@ -241,11 +241,11 @@ struct HfCorrelatorDplusDminus { } registry.fill(HIST("hMultiplicity"), nTracks); - //MC reco level + // MC reco level bool flagDplusSignal = false; bool flagDminusSignal = false; for (auto& candidate1 : candidates) { - //check decay channel flag for candidate1 + // check decay channel flag for candidate1 if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { continue; } @@ -261,16 +261,16 @@ struct HfCorrelatorDplusDminus { efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); } - int outerParticleSign = 1; //Dplus + int outerParticleSign = 1; // Dplus auto outerSecondTrack = candidate1.index1_as(); if (outerSecondTrack.sign() == 1) { - outerParticleSign = -1; //Dminus (second daughter track is positive) + outerParticleSign = -1; // Dminus (second daughter track is positive) } if (std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::DPlusToPiKPi) { - //fill invariant mass plots and per-candidate distributions from Dplus/Dminus signal candidates - if (outerParticleSign == 1) { //reco and matched as Dplus + // fill invariant mass plots and per-candidate distributions from Dplus/Dminus signal candidates + if (outerParticleSign == 1) { // reco and matched as Dplus registry.fill(HIST("hMassDplusMCRecSig"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); - } else { //reco and matched as Dminus + } else { // reco and matched as Dminus registry.fill(HIST("hMassDminusMCRecSig"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); } registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); @@ -282,36 +282,36 @@ struct HfCorrelatorDplusDminus { registry.fill(HIST("hYMCRec"), YDPlus(candidate1)); registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelDplusToPiKPi()); } else { - //fill invariant mass plots from Dplus/Dminus background candidates - if (outerParticleSign == 1) { //reco as Dplus + // fill invariant mass plots from Dplus/Dminus background candidates + if (outerParticleSign == 1) { // reco as Dplus registry.fill(HIST("hMassDplusMCRecBkg"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); - } else { //matched as Dminus + } else { // matched as Dminus registry.fill(HIST("hMassDminusMCRecBkg"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); } } - //D-Dbar correlation dedicated section + // D-Dbar correlation dedicated section if (outerParticleSign == -1) { - continue; //reject Dminus in outer loop + continue; // reject Dminus in outer loop } - flagDplusSignal = std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::DPlusToPiKPi; //flagDplusSignal 'true' if candidate1 matched to Dplus + flagDplusSignal = std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::DPlusToPiKPi; // flagDplusSignal 'true' if candidate1 matched to Dplus for (auto& candidate2 : candidates) { - if (!(candidate2.hfflag() & 1 << DecayType::DPlusToPiKPi)) { //check decay channel flag for candidate2 + if (!(candidate2.hfflag() & 1 << DecayType::DPlusToPiKPi)) { // check decay channel flag for candidate2 continue; } auto innerSecondTrack = candidate2.index1_as(); - if (innerSecondTrack.sign() != 1) { //keep only Dminus (with second daughter track positive) + if (innerSecondTrack.sign() != 1) { // keep only Dminus (with second daughter track positive) continue; } - flagDminusSignal = std::abs(candidate2.flagMCMatchRec()) == 1 << DecayType::DPlusToPiKPi; //flagDminusSignal 'true' if candidate2 matched to Dminus + flagDminusSignal = std::abs(candidate2.flagMCMatchRec()) == 1 << DecayType::DPlusToPiKPi; // flagDminusSignal 'true' if candidate2 matched to Dminus if (cutYCandMax >= 0. && std::abs(YDPlus(candidate2)) > cutYCandMax) { continue; } if (cutPtCandMin >= 0. && candidate2.pt() < cutPtCandMin) { continue; } - //choice of options (Dplus/Dminus signal/bkg) - int pairSignalStatus = 0; //0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig. Of course only 0,2,6,8 are relevant for D+D- + // choice of options (Dplus/Dminus signal/bkg) + int pairSignalStatus = 0; // 0 = bkg/bkg, 1 = bkg/ref, 2 = bkg/sig, 3 = ref/bkg, 4 = ref/ref, 5 = ref/sig, 6 = sig/bkg, 7 = sig/ref, 8 = sig/sig. Of course only 0,2,6,8 are relevant for D+D- if (flagDplusSignal) { pairSignalStatus += 6; } @@ -327,10 +327,10 @@ struct HfCorrelatorDplusDminus { pairSignalStatus); double etaCut = 0.; double ptCut = 0.; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(candidate1.eta()) < etaCut && std::abs(candidate2.eta()) < etaCut && candidate1.pt() > ptCut && candidate2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } @@ -339,7 +339,7 @@ struct HfCorrelatorDplusDminus { } while (etaCut < maxEtaCut - epsilon); } // end inner loop (Dbars) - } //end outer loop + } // end outer loop } PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcRec, "Process MC Reco mode", true); @@ -349,9 +349,9 @@ struct HfCorrelatorDplusDminus { { int counterDplusDminus = 0; registry.fill(HIST("hMCEvtCount"), 0); - //MC gen level + // MC gen level for (auto& particle1 : particlesMC) { - //check if the particle is Dplus or Dminus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! + // check if the particle is Dplus or Dminus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { continue; } @@ -368,14 +368,14 @@ struct HfCorrelatorDplusDminus { registry.fill(HIST("hYMCGen"), yD); counterDplusDminus++; - //D-Dbar correlation dedicated section - //if it's a Dplus particle, search for Dminus and evaluate correlations - if (particle1.pdgCode() != pdg::Code::kDPlus) { //just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + // D-Dbar correlation dedicated section + // if it's a Dplus particle, search for Dminus and evaluate correlations + if (particle1.pdgCode() != pdg::Code::kDPlus) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) continue; } - registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); //to count trigger Dplus (for normalisation) + registry.fill(HIST("hCountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus (for normalisation) for (auto& particle2 : particlesMC) { - if (particle2.pdgCode() != -pdg::Code::kDPlus) { //check that inner particle is a Dminus + if (particle2.pdgCode() != -pdg::Code::kDPlus) { // check that inner particle is a Dminus continue; } if (cutYCandMax >= 0. && std::abs(RecoDecay::Y(array{particle2.px(), particle2.py(), particle2.pz()}, RecoDecay::getMassPDG(particle2.pdgCode()))) > cutYCandMax) { @@ -390,11 +390,11 @@ struct HfCorrelatorDplusDminus { particle2.pt()); entryDplusDminusRecoInfo(1.869, 1.869, - 8); //Dummy + 8); // Dummy double etaCut = 0.; double ptCut = 0.; - //fill pairs vs etaCut plot + // fill pairs vs etaCut plot bool rightDecayChannels = false; if ((std::abs(particle1.flagMCMatchGen()) == 1 << DecayType::DPlusToPiKPi) && (std::abs(particle2.flagMCMatchGen()) == 1 << DecayType::DPlusToPiKPi)) { rightDecayChannels = true; @@ -402,11 +402,11 @@ struct HfCorrelatorDplusDminus { do { ptCut = 0.; etaCut += incrementEtaCut; - do { //fill pairs vs etaCut plot + do { // fill pairs vs etaCut plot if (std::abs(particle1.eta()) < etaCut && std::abs(particle2.eta()) < etaCut && particle1.pt() > ptCut && particle2.pt() > ptCut) { registry.fill(HIST("hDDbarVsEtaCut"), etaCut - epsilon, ptCut + epsilon); } - if (rightDecayChannels) { //fill with D and Dbar daughter particls acceptance checks + if (rightDecayChannels) { // fill with D and Dbar daughter particls acceptance checks double etaCandidate1Daughter1 = particle1.daughter0_as().eta(); double etaCandidate1Daughter2 = (particle1.daughter0_as() + 1).eta(); double etaCandidate1Daughter3 = (particle1.daughter0_as() + 2).eta(); @@ -422,9 +422,9 @@ struct HfCorrelatorDplusDminus { ptCut += incrementPtThreshold; } while (ptCut < ptThresholdForMaxEtaCut - epsilon); } while (etaCut < maxEtaCut - epsilon); - } //end inner loop - } //end outer loop - registry.fill(HIST("hcountDplusDminusPerEvent"), counterDplusDminus); + } // end inner loop + } // end outer loop + registry.fill(HIST("hCountDplusDminusPerEvent"), counterDplusDminus); } PROCESS_SWITCH(HfCorrelatorDplusDminus, processMcGen, "Process MC Gen mode", false); @@ -433,19 +433,19 @@ struct HfCorrelatorDplusDminus { void processccbar(aod::McCollision const& mccollision, MCParticlesPlus2Prong const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarPreEtasel = 0; + int counterccbar = 0, counterccbarBeforeEtasel = 0; - //loop over particles at MC gen level + // loop over particles at MC gen level for (auto& particle1 : particlesMC) { - if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { //search c or cbar particles + if (std::abs(particle1.pdgCode()) != PDG_t::kCharm) { // search c or cbar particles continue; } int partMothPDG = particle1.mother0_as().pdgCode(); - //check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it + // check whether mothers of quark c/cbar are still '4'/'-4' particles - in that case the c/cbar quark comes from its own fragmentation, skip it if (partMothPDG == particle1.pdgCode()) { continue; } - counterccbarPreEtasel++; //count c or cbar (before kinematic selection) + counterccbarBeforeEtasel++; // count c or cbar (before kinematic selection) double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { continue; @@ -457,14 +457,14 @@ struct HfCorrelatorDplusDminus { registry.fill(HIST("hEtaMCGen"), particle1.eta()); registry.fill(HIST("hPhiMCGen"), particle1.phi()); registry.fill(HIST("hYMCGen"), yC); - counterccbar++; //count if c or cbar don't come from themselves during fragmentation (after kinematic selection) + counterccbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) - //c-cbar correlation dedicated section - //if it's c, search for cbar and evaluate correlations. + // c-cbar correlation dedicated section + // if it's c, search for cbar and evaluate correlations. if (particle1.pdgCode() != PDG_t::kCharm) { continue; } - registry.fill(HIST("hcountCtriggersMCGen"), 0, particle1.pt()); //to count trigger c quark (for normalisation) + registry.fill(HIST("hCountCtriggersMCGen"), 0, particle1.pt()); // to count trigger c quark (for normalisation) for (auto& particle2 : particlesMC) { if (particle2.pdgCode() != PDG_t::kCharmBar) { @@ -476,7 +476,7 @@ struct HfCorrelatorDplusDminus { if (cutPtCandMin >= 0. && particle2.pt() < cutPtCandMin) { continue; } - //check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it + // check whether mothers of quark cbar (from associated loop) are still '-4' particles - in that case the cbar quark comes from its own fragmentation, skip it if (particle2.mother0_as().pdgCode() == PDG_t::kCharmBar) { continue; } @@ -486,11 +486,11 @@ struct HfCorrelatorDplusDminus { particle2.pt()); entryDplusDminusRecoInfo(1.869, 1.869, - 8); //Dummy + 8); // Dummy } // end inner loop - } //end outer loop - registry.fill(HIST("hcountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hcountCCbarPerEventPreEtaCut"), counterccbarPreEtasel); + } // end outer loop + registry.fill(HIST("hCountCCbarPerEvent"), counterccbar); + registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterccbarBeforeEtasel); } PROCESS_SWITCH(HfCorrelatorDplusDminus, processccbar, "Process ccbar pairs", false); @@ -498,5 +498,5 @@ struct HfCorrelatorDplusDminus { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"hf-correlator-dplus-dminus"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 9e191db92ab5926da46c5c5567bf10b20ff7d13c Mon Sep 17 00:00:00 2001 From: Fabio Colamaria Date: Thu, 27 Jan 2022 16:10:31 +0100 Subject: [PATCH 04/16] Small naming fix from Vit's comment --- PWGHF/Tasks/HFCorrelatorD0D0bar.cxx | 10 +++++----- PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx | 10 +++++----- PWGHF/Tasks/HFCorrelatorDplusDminus.cxx | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx index 1e406b850a6..2a171b65042 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx @@ -447,7 +447,7 @@ struct HfCorrelatorD0D0bar { void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarBeforeEtasel = 0; + int counterCCbar = 0, counterCCbarBeforeEtasel = 0; // loop over particles at MC gen level for (auto& particle1 : particlesMC) { @@ -459,7 +459,7 @@ struct HfCorrelatorD0D0bar { if (partMothPDG == particle1.pdgCode()) { continue; } - counterccbarBeforeEtasel++; // count c or cbar (before kinematic selection) + counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { continue; @@ -471,7 +471,7 @@ struct HfCorrelatorD0D0bar { registry.fill(HIST("hEtaMCGen"), particle1.eta()); registry.fill(HIST("hPhiMCGen"), particle1.phi()); registry.fill(HIST("hYMCGen"), yC); - counterccbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) + counterCCbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) // c-cbar correlation dedicated section // if it's c, search for cbar and evaluate correlations. @@ -503,8 +503,8 @@ struct HfCorrelatorD0D0bar { 8); // dummy information } // end inner loop } // end outer loop - registry.fill(HIST("hCountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterccbarBeforeEtasel); + registry.fill(HIST("hCountCCbarPerEvent"), counterCCbar); + registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterCCbarBeforeEtasel); } PROCESS_SWITCH(HfCorrelatorD0D0bar, processccbar, "Process ccbar pairs", false); diff --git a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx index 0f9c194c25b..bdadd7c1a2c 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx @@ -447,7 +447,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { void processccbar(aod::McCollision const& mccollision, MCParticlesPlus const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarBeforeEtasel = 0; + int counterCCbar = 0, counterCCbarBeforeEtasel = 0; // loop over particles at MC gen level for (auto& particle1 : particlesMC) { @@ -459,7 +459,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { if (partMothPDG == particle1.pdgCode()) { continue; } - counterccbarBeforeEtasel++; // count c or cbar (before kinematic selection) + counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { continue; @@ -471,7 +471,7 @@ struct HfCorrelatorD0D0barBarrelFullPid { registry.fill(HIST("hEtaMCGen"), particle1.eta()); registry.fill(HIST("hPhiMCGen"), particle1.phi()); registry.fill(HIST("hYMCGen"), yC); - counterccbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) + counterCCbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) // c-cbar correlation dedicated section // if it's c, search for cbar and evaluate correlations. @@ -503,8 +503,8 @@ struct HfCorrelatorD0D0barBarrelFullPid { 8); // dummy information } // end inner loop } // end outer loop - registry.fill(HIST("hCountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterccbarBeforeEtasel); + registry.fill(HIST("hCountCCbarPerEvent"), counterCCbar); + registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterCCbarBeforeEtasel); } PROCESS_SWITCH(HfCorrelatorD0D0barBarrelFullPid, processccbar, "Process ccbar pairs", false); diff --git a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx index 4bb1c010778..9eabe018a6a 100644 --- a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx +++ b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx @@ -433,7 +433,7 @@ struct HfCorrelatorDplusDminus { void processccbar(aod::McCollision const& mccollision, MCParticlesPlus2Prong const& particlesMC) { registry.fill(HIST("hMCEvtCount"), 0); - int counterccbar = 0, counterccbarBeforeEtasel = 0; + int counterCCbar = 0, counterCCbarBeforeEtasel = 0; // loop over particles at MC gen level for (auto& particle1 : particlesMC) { @@ -445,7 +445,7 @@ struct HfCorrelatorDplusDminus { if (partMothPDG == particle1.pdgCode()) { continue; } - counterccbarBeforeEtasel++; // count c or cbar (before kinematic selection) + counterCCbarBeforeEtasel++; // count c or cbar (before kinematic selection) double yC = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yC) > cutYCandMax) { continue; @@ -457,7 +457,7 @@ struct HfCorrelatorDplusDminus { registry.fill(HIST("hEtaMCGen"), particle1.eta()); registry.fill(HIST("hPhiMCGen"), particle1.phi()); registry.fill(HIST("hYMCGen"), yC); - counterccbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) + counterCCbar++; // count if c or cbar don't come from themselves during fragmentation (after kinematic selection) // c-cbar correlation dedicated section // if it's c, search for cbar and evaluate correlations. @@ -489,8 +489,8 @@ struct HfCorrelatorDplusDminus { 8); // Dummy } // end inner loop } // end outer loop - registry.fill(HIST("hCountCCbarPerEvent"), counterccbar); - registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterccbarBeforeEtasel); + registry.fill(HIST("hCountCCbarPerEvent"), counterCCbar); + registry.fill(HIST("hCountCCbarPerEventBeforeEtaCut"), counterCCbarBeforeEtasel); } PROCESS_SWITCH(HfCorrelatorDplusDminus, processccbar, "Process ccbar pairs", false); From b9b511548058a41e623a344e0c43717c183332be Mon Sep 17 00:00:00 2001 From: Fabio Colamaria Date: Thu, 3 Feb 2022 09:19:23 +0100 Subject: [PATCH 05/16] Moving to McParticle_000 --- PWGHF/Tasks/HFCorrelatorD0D0bar.cxx | 2 +- PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx | 2 +- PWGHF/Tasks/HFCorrelatorDplusDminus.cxx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx index 2a171b65042..2a12b63d9e0 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx @@ -50,7 +50,7 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_topik::npTBins; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; -using MCParticlesPlus = soa::Join; +using MCParticlesPlus = soa::Join; struct HfCorrelatorD0D0bar { Produces entryD0D0barPair; diff --git a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx index bdadd7c1a2c..b129c054731 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx @@ -50,7 +50,7 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_topik::npTBins; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; -using MCParticlesPlus = soa::Join; +using MCParticlesPlus = soa::Join; struct HfCorrelatorD0D0barBarrelFullPid { Produces entryD0D0barPair; diff --git a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx index 9eabe018a6a..fda229bdefc 100644 --- a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx +++ b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx @@ -50,8 +50,8 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_topikpi::npTBin const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; -using MCParticlesPlus2Prong = soa::Join; -using MCParticlesPlus3Prong = soa::Join; +using MCParticlesPlus2Prong = soa::Join; +using MCParticlesPlus3Prong = soa::Join; struct HfCorrelatorDplusDminus { Produces entryDplusDminusPair; From 7d3c55f6eb6c7c56bffe12bda61742a23ed5dbc8 Mon Sep 17 00:00:00 2001 From: Fabrizio Date: Thu, 3 Feb 2022 11:36:18 +0100 Subject: [PATCH 06/16] Revert 5da64a0855a8d9e6341fa0e2859240e45f020293 (#498) --- EventFiltering/PWGHF/HFFilter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index e4599722d0f..0647f791768 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -590,8 +590,8 @@ struct HfFilter { // Main struct for HF triggers using HfTrackIndexProng2withColl = soa::Join; using HfTrackIndexProng3withColl = soa::Join; - using BigTracksWithProtonPID = soa::Join; - using BigTracksMCPID = soa::Join; + using BigTracksWithProtonPID = soa::Join; + using BigTracksMCPID = soa::Join; void process(aod::Collision const& collision, HfTrackIndexProng2withColl const& cand2Prongs, From c80266bca86b25efb25d291a5068f806ab6aa5f3 Mon Sep 17 00:00:00 2001 From: Jan Fiete Date: Thu, 3 Feb 2022 13:13:41 +0100 Subject: [PATCH 07/16] Refactor V0 builder, add link table (#499) --- Common/DataModel/StrangenessTables.h | 71 +++++---- PWGLF/TableProducer/lambdakzerobuilder.cxx | 176 +++++++++------------ 2 files changed, 120 insertions(+), 127 deletions(-) diff --git a/Common/DataModel/StrangenessTables.h b/Common/DataModel/StrangenessTables.h index 85d1c1d3edd..4c33c1e0c9e 100644 --- a/Common/DataModel/StrangenessTables.h +++ b/Common/DataModel/StrangenessTables.h @@ -19,13 +19,13 @@ namespace o2::aod { namespace v0data { -//Needed to have shorter table that does not rely on existing one (filtering!) +// Needed to have shorter table that does not rely on existing one (filtering!) DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //! DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //! DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! DECLARE_SOA_INDEX_COLUMN(V0, v0); //! -//General V0 properties: position, momentum +// General V0 properties: position, momentum DECLARE_SOA_COLUMN(PosX, posX, float); //! positive track X at min DECLARE_SOA_COLUMN(NegX, negX, float); //! negative track X at min DECLARE_SOA_COLUMN(PxPos, pxpos, float); //! positive track px at min @@ -38,47 +38,47 @@ DECLARE_SOA_COLUMN(X, x, float); //! decay position X DECLARE_SOA_COLUMN(Y, y, float); //! decay position Y DECLARE_SOA_COLUMN(Z, z, float); //! decay position Z -//Saved from finding: DCAs +// Saved from finding: DCAs DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0daughters, float); //! DCA between V0 daughters DECLARE_SOA_COLUMN(DCAPosToPV, dcapostopv, float); //! DCA positive prong to PV DECLARE_SOA_COLUMN(DCANegToPV, dcanegtopv, float); //! DCA negative prong to PV -//Derived expressions -//Momenta +// Derived expressions +// Momenta DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! V0 pT [](float pxpos, float pypos, float pxneg, float pyneg) -> float { return RecoDecay::sqrtSumOfSquares(pxpos + pxneg, pypos + pyneg); }); -//Length quantities +// Length quantities DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, //! V0 decay radius (2D, centered at zero) [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); -//Distance Over To Mom +// Distance Over To Mom DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to V0decay distance over total momentum [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) { float P = RecoDecay::sqrtSumOfSquares(Px, Py, Pz); return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10); }); -//CosPA +// CosPA DECLARE_SOA_DYNAMIC_COLUMN(V0CosPA, v0cosPA, //! V0 CosPA [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return RecoDecay::CPA(array{pvX, pvY, pvZ}, array{X, Y, Z}, array{Px, Py, Pz}); }); DECLARE_SOA_DYNAMIC_COLUMN(DCAV0ToPV, dcav0topv, //! DCA of V0 to PV [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); }); -//Armenteros-Podolanski variables +// Armenteros-Podolanski variables DECLARE_SOA_DYNAMIC_COLUMN(Alpha, alpha, //! Armenteros Alpha [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) { float momTot = RecoDecay::P(pxpos + pxneg, pypos + pyneg, pzpos + pzneg); float lQlNeg = RecoDecay::dotProd(array{pxneg, pyneg, pzneg}, array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot; float lQlPos = RecoDecay::dotProd(array{pxpos, pypos, pzpos}, array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot; - return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); //alphav0 + return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); // alphav0 }); DECLARE_SOA_DYNAMIC_COLUMN(QtArm, qtarm, //! Armenteros Qt [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) { float momTot = RecoDecay::P2(pxpos + pxneg, pypos + pyneg, pzpos + pzneg); float dp = RecoDecay::dotProd(array{pxneg, pyneg, pzneg}, array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}); - return std::sqrt(RecoDecay::P2(pxneg, pyneg, pzneg) - dp * dp / momTot); //qtarm + return std::sqrt(RecoDecay::P2(pxneg, pyneg, pzneg) - dp * dp / momTot); // qtarm }); // Psi pair angle: angle between the plane defined by the electron and positron momenta and the xy plane @@ -93,7 +93,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(PsiPair, psipair, //! psi pair angle return std::asin(clipToPM1(argsin)); }); -//Calculated on the fly with mass assumption + dynamic tables +// Calculated on the fly with mass assumption + dynamic tables DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! mass under lambda hypothesis [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float { return RecoDecay::M(array{array{pxpos, pypos, pzpos}, array{pxneg, pyneg, pzneg}}, array{RecoDecay::getMassPDG(kProton), RecoDecay::getMassPDG(kPiPlus)}); }); DECLARE_SOA_DYNAMIC_COLUMN(MAntiLambda, mAntiLambda, //! mass under antilambda hypothesis @@ -141,7 +141,7 @@ DECLARE_SOA_TABLE_FULL(StoredV0Datas, "V0Datas", "AOD", "V0DATA", //! v0data::PxNeg, v0data::PyNeg, v0data::PzNeg, v0data::DCAV0Daughters, v0data::DCAPosToPV, v0data::DCANegToPV, - //Dynamic columns + // Dynamic columns v0data::Pt, v0data::V0Radius, v0data::DistOverTotMom, @@ -151,13 +151,13 @@ DECLARE_SOA_TABLE_FULL(StoredV0Datas, "V0Datas", "AOD", "V0DATA", //! v0data::QtArm, v0data::PsiPair, - //Invariant masses + // Invariant masses v0data::MLambda, v0data::MAntiLambda, v0data::MK0Short, v0data::MGamma, - //Longitudinal + // Longitudinal v0data::YK0Short, v0data::YLambda, v0data::Eta, @@ -174,13 +174,24 @@ DECLARE_SOA_EXTENDED_TABLE_USER(V0Datas, StoredV0Datas, "V0DATAEXT", //! v0data::Px, v0data::Py, v0data::Pz); // the table name has here to be the one with EXT which is not nice and under study using V0Data = V0Datas::iterator; +namespace v0data +{ +DECLARE_SOA_INDEX_COLUMN(V0Data, v0Data); //! Index to V0Data entry +} + +DECLARE_SOA_TABLE(V0DataLink, "AOD", "V0DATALINK", //! Joinable table with V0s which links to V0Data which is not produced for all entries + v0data::V0DataId); + +using V0sLinked = soa::Join; +using V0Linked = V0sLinked::iterator; + namespace cascdata { -//Necessary for full filtering functionality +// Necessary for full filtering functionality DECLARE_SOA_INDEX_COLUMN(V0, v0); //! DECLARE_SOA_INDEX_COLUMN_FULL(Bachelor, bachelor, int, Tracks, ""); //! DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -//General cascade properties: position, momentum +// General cascade properties: position, momentum DECLARE_SOA_COLUMN(Sign, sign, int); //! DECLARE_SOA_COLUMN(PxPos, pxpos, float); //! DECLARE_SOA_COLUMN(PyPos, pypos, float); //! @@ -198,25 +209,25 @@ DECLARE_SOA_COLUMN(Xlambda, xlambda, float); //! DECLARE_SOA_COLUMN(Ylambda, ylambda, float); //! DECLARE_SOA_COLUMN(Zlambda, zlambda, float); //! -//Saved from finding: DCAs +// Saved from finding: DCAs DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0daughters, float); //! DECLARE_SOA_COLUMN(DCACascDaughters, dcacascdaughters, float); //! DECLARE_SOA_COLUMN(DCAPosToPV, dcapostopv, float); //! DECLARE_SOA_COLUMN(DCANegToPV, dcanegtopv, float); //! DECLARE_SOA_COLUMN(DCABachToPV, dcabachtopv, float); //! -//Derived expressions -//Momenta +// Derived expressions +// Momenta DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! [](float Px, float Py) -> float { return RecoDecay::sqrtSumOfSquares(Px, Py); }); -//Length quantities +// Length quantities DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, //! [](float xlambda, float ylambda) -> float { return RecoDecay::sqrtSumOfSquares(xlambda, ylambda); }); DECLARE_SOA_DYNAMIC_COLUMN(CascRadius, cascradius, //! [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); -//CosPAs +// CosPAs DECLARE_SOA_DYNAMIC_COLUMN(V0CosPA, v0cosPA, //! [](float Xlambda, float Ylambda, float Zlambda, float PxLambda, float PyLambda, float PzLambda, float pvX, float pvY, float pvZ) -> float { return RecoDecay::CPA(array{pvX, pvY, pvZ}, array{Xlambda, Ylambda, Zlambda}, array{PxLambda, PyLambda, PzLambda}); }); DECLARE_SOA_DYNAMIC_COLUMN(CascCosPA, casccosPA, //! @@ -226,10 +237,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(DCAV0ToPV, dcav0topv, //! DECLARE_SOA_DYNAMIC_COLUMN(DCACascToPV, dcacasctopv, //! [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); }); -//Calculated on the fly with mass assumption + dynamic tables +// Calculated on the fly with mass assumption + dynamic tables DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! [](int charge, float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float { return RecoDecay::M(array{array{pxpos, pypos, pzpos}, array{pxneg, pyneg, pzneg}}, charge < 0 ? array{RecoDecay::getMassPDG(kProton), RecoDecay::getMassPDG(kPiPlus)} : array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kProton)}); }); -//Calculated on the fly with mass assumption + dynamic tables +// Calculated on the fly with mass assumption + dynamic tables DECLARE_SOA_DYNAMIC_COLUMN(MXi, mXi, //! [](float pxbach, float pybach, float pzbach, float PxLambda, float PyLambda, float PzLambda) -> float { return RecoDecay::M(array{array{pxbach, pybach, pzbach}, array{PxLambda, PyLambda, PzLambda}}, array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kLambda0)}); }); @@ -272,7 +283,7 @@ DECLARE_SOA_TABLE(CascData, "AOD", "CASCDATA", //! cascdata::DCAV0Daughters, cascdata::DCACascDaughters, cascdata::DCAPosToPV, cascdata::DCANegToPV, cascdata::DCABachToPV, - //Dynamic columns + // Dynamic columns cascdata::Pt, cascdata::V0Radius, cascdata::CascRadius, @@ -281,11 +292,11 @@ DECLARE_SOA_TABLE(CascData, "AOD", "CASCDATA", //! cascdata::DCAV0ToPV, cascdata::DCACascToPV, - //Invariant masses + // Invariant masses cascdata::MLambda, cascdata::MXi, cascdata::MOmega, - //Longitudinal + // Longitudinal cascdata::YXi, cascdata::YOmega, cascdata::Eta); @@ -301,9 +312,9 @@ using CascDataFull = CascDataExt; namespace v0ind { -DECLARE_SOA_INDEX_COLUMN(V0, v0); //the biggest object -DECLARE_SOA_INDEX_COLUMN(V0Data, v0data); //the skimmed object -DECLARE_SOA_INDEX_COLUMN(Cascade, cascade); //the part that will use the previous ones +DECLARE_SOA_INDEX_COLUMN(V0, v0); // the biggest object +DECLARE_SOA_INDEX_COLUMN(V0Data, v0data); // the skimmed object +DECLARE_SOA_INDEX_COLUMN(Cascade, cascade); // the part that will use the previous ones } // namespace v0ind DECLARE_SOA_INDEX_TABLE_EXCLUSIVE_USER(MatchedV0Cascades, V0s, "MATCHEDV0CASC", v0ind::V0DataId, v0ind::V0Id, v0ind::CascadeId); diff --git a/PWGLF/TableProducer/lambdakzerobuilder.cxx b/PWGLF/TableProducer/lambdakzerobuilder.cxx index 8cb8833cc05..1905d0b05b2 100644 --- a/PWGLF/TableProducer/lambdakzerobuilder.cxx +++ b/PWGLF/TableProducer/lambdakzerobuilder.cxx @@ -65,19 +65,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -// This table stores a filtered list of valid V0 indices -namespace o2::aod -{ -namespace v0goodindices -{ -DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); -DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); -DECLARE_SOA_INDEX_COLUMN(Collision, collision); -} // namespace v0goodindices -DECLARE_SOA_TABLE(V0GoodIndices, "AOD", "V0GOODINDICES", o2::soa::Index<>, - v0goodindices::PosTrackId, v0goodindices::NegTrackId, v0goodindices::CollisionId); -} // namespace o2::aod - using FullTracksExt = soa::Join; using FullTracksExtMC = soa::Join; @@ -93,10 +80,11 @@ using MyTracks = FullTracksExt; #define MY_DEBUG_MSG(condition, cmd) #endif -// This prefilter creates a skimmed list of good V0s to re-reconstruct so that +// Builder task: rebuilds V0s +// The prefilter part skims the list of good V0s to re-reconstruct so that // CPU is saved in case there are specific selections that are to be done // Note: more configurables, more options to be added as needed -struct lambdakzeroPrefilterPairs { +struct lambdakzeroBuilder { Configurable dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", .1, "DCA Pos To PV"}; Configurable mincrossedrows{"mincrossedrows", 70, "min crossed rows"}; @@ -108,80 +96,17 @@ struct lambdakzeroPrefilterPairs { Configurable> v_labelK0Sneg{"v_labelK0Sneg", {730, 2867, 4755}, "labels of K0S negative daughters, for debug"}; #endif - HistogramRegistry registry{ - "registry", - { - {"hGoodIndices", "hGoodIndices", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, - }, - }; - - Produces v0goodindices; - - void process(aod::Collision const& collision, aod::V0s const& V0s, - MyTracks const& tracks -#ifdef MY_DEBUG - , - aod::McParticles const& particlesMC -#endif - ) - { - for (auto& V0 : V0s) { - -#ifdef MY_DEBUG - auto labelPos = V0.posTrack_as().mcParticleId(); - auto labelNeg = V0.negTrack_as().mcParticleId(); - bool isK0SfromLc = isK0SfromLcFunc(labelPos, labelNeg, v_labelK0Spos, v_labelK0Sneg); -#endif - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "V0 builder: found K0S from Lc, posTrack --> " << labelPos << ", negTrack --> " << labelNeg); - - registry.fill(HIST("hGoodIndices"), 0.5); - if (isRun2) { - if (!(V0.posTrack_as().trackType() & o2::aod::track::TPCrefit)) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has no TPC refit"); - continue; // TPC refit - } - if (!(V0.negTrack_as().trackType() & o2::aod::track::TPCrefit)) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has no TPC refit"); - continue; // TPC refit - } - } - registry.fill(HIST("hGoodIndices"), 1.5); - if (V0.posTrack_as().tpcNClsCrossedRows() < mincrossedrows) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has " << V0.posTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); - continue; - } - if (V0.negTrack_as().tpcNClsCrossedRows() < mincrossedrows) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has " << V0.negTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); - continue; - } - registry.fill(HIST("hGoodIndices"), 2.5); - if (fabs(V0.posTrack_as().dcaXY()) < dcapostopv) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has dcaXY " << V0.posTrack_as().dcaXY() << " , cut at " << dcanegtopv); - continue; - } - if (fabs(V0.negTrack_as().dcaXY()) < dcanegtopv) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has dcaXY " << V0.negTrack_as().dcaXY() << " , cut at " << dcanegtopv); - continue; - } - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "Filling good indices: posTrack --> " << labelPos << ", negTrack --> " << labelNeg); - registry.fill(HIST("hGoodIndices"), 3.5); - v0goodindices(V0.posTrack_as().globalIndex(), - V0.negTrack_as().globalIndex(), - V0.posTrack_as().collisionId()); - } - } -}; - -/// Cascade builder task: rebuilds cascades -struct lambdakzeroBuilder { - Produces v0data; + Produces v0dataLink; Service ccdb; HistogramRegistry registry{ "registry", - {{"hEventCounter", "hEventCounter", {HistType::kTH1F, {{1, 0.0f, 1.0f}}}}, - {"hV0Candidate", "hV0Candidate", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}}, + { + {"hEventCounter", "hEventCounter", {HistType::kTH1F, {{1, 0.0f, 1.0f}}}}, + {"hV0Candidate", "hV0Candidate", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}, + {"hGoodIndices", "hGoodIndices", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, + }, }; // Configurables @@ -203,7 +128,7 @@ struct lambdakzeroBuilder { void init(InitContext& context) { - //using namespace analysis::lambdakzerobuilder; + // using namespace analysis::lambdakzerobuilder; ccdb->setURL("https://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -223,7 +148,7 @@ struct lambdakzeroBuilder { } } - void process(aod::Collision const& collision, aod::V0GoodIndices const& V0s, MyTracks const& tracks + void process(aod::Collision const& collision, aod::V0s const& V0s, MyTracks const& tracks #ifdef MY_DEBUG , aod::McParticles const& particlesMC @@ -244,6 +169,54 @@ struct lambdakzeroBuilder { registry.fill(HIST("hEventCounter"), 0.5); for (auto& V0 : V0s) { + + // Track preselection part +#ifdef MY_DEBUG + auto labelPos = V0.posTrack_as().mcParticleId(); + auto labelNeg = V0.negTrack_as().mcParticleId(); + bool isK0SfromLc = isK0SfromLcFunc(labelPos, labelNeg, v_labelK0Spos, v_labelK0Sneg); +#endif + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "V0 builder: found K0S from Lc, posTrack --> " << labelPos << ", negTrack --> " << labelNeg); + + registry.fill(HIST("hGoodIndices"), 0.5); + if (isRun2) { + if (!(V0.posTrack_as().trackType() & o2::aod::track::TPCrefit)) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has no TPC refit"); + v0dataLink(-1); + continue; // TPC refit + } + if (!(V0.negTrack_as().trackType() & o2::aod::track::TPCrefit)) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has no TPC refit"); + v0dataLink(-1); + continue; // TPC refit + } + } + registry.fill(HIST("hGoodIndices"), 1.5); + if (V0.posTrack_as().tpcNClsCrossedRows() < mincrossedrows) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has " << V0.posTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); + v0dataLink(-1); + continue; + } + if (V0.negTrack_as().tpcNClsCrossedRows() < mincrossedrows) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has " << V0.negTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); + v0dataLink(-1); + continue; + } + registry.fill(HIST("hGoodIndices"), 2.5); + if (fabs(V0.posTrack_as().dcaXY()) < dcapostopv) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has dcaXY " << V0.posTrack_as().dcaXY() << " , cut at " << dcanegtopv); + v0dataLink(-1); + continue; + } + if (fabs(V0.negTrack_as().dcaXY()) < dcanegtopv) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has dcaXY " << V0.negTrack_as().dcaXY() << " , cut at " << dcanegtopv); + v0dataLink(-1); + continue; + } + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "Filling good indices: posTrack --> " << labelPos << ", negTrack --> " << labelNeg); + registry.fill(HIST("hGoodIndices"), 3.5); + + // Candidate building part std::array pos = {0.}; std::array pvec0 = {0.}; std::array pvec1 = {0.}; @@ -261,28 +234,32 @@ struct lambdakzeroBuilder { auto pTrack = getTrackParCov(V0.posTrack_as()); auto nTrack = getTrackParCov(V0.negTrack_as()); - //Require collision-ID - if (V0.posTrack_as().collisionId() != V0.negTrack_as().collisionId() && rejDiffCollTracks) + // Require collision-ID + if (V0.posTrack_as().collisionId() != V0.negTrack_as().collisionId() && rejDiffCollTracks) { + v0dataLink(-1); continue; + } - //Act on copies for minimization + // Act on copies for minimization auto pTrackCopy = o2::track::TrackParCov(pTrack); auto nTrackCopy = o2::track::TrackParCov(nTrack); //---/---/---/ // Move close to minima int nCand = fitter.process(pTrackCopy, nTrackCopy); - if (nCand == 0) + if (nCand == 0) { + v0dataLink(-1); continue; + } double finalXpos = fitter.getTrack(0).getX(); double finalXneg = fitter.getTrack(1).getX(); - //Rotate to desired alpha + // Rotate to desired alpha pTrack.rotateParam(fitter.getTrack(0).getAlpha()); nTrack.rotateParam(fitter.getTrack(1).getAlpha()); - //Retry closer to minimum with material corrections + // Retry closer to minimum with material corrections o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; if (useMatCorrType == 1) matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo; @@ -293,8 +270,10 @@ struct lambdakzeroBuilder { o2::base::Propagator::Instance()->propagateToX(nTrack, finalXneg, d_bz, 0.85f, 2.0f, matCorr); nCand = fitter.process(pTrack, nTrack); - if (nCand == 0) + if (nCand == 0) { + v0dataLink(-1); continue; + } pTrack.getPxPyPzGlo(pvec0); nTrack.getPxPyPzGlo(pvec1); @@ -309,18 +288,21 @@ struct lambdakzeroBuilder { // Apply selections so a skimmed table is created only if (fitter.getChi2AtPCACandidate() > dcav0dau) { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack --> " << labelPos << ", negTrack --> " << labelNeg << " will be skipped due to dca cut"); + v0dataLink(-1); continue; } auto V0CosinePA = RecoDecay::CPA(array{collision.posX(), collision.posY(), collision.posZ()}, array{pos[0], pos[1], pos[2]}, array{pvec0[0] + pvec1[0], pvec0[1] + pvec1[1], pvec0[2] + pvec1[2]}); if (V0CosinePA < v0cospa) { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack --> " << labelPos << ", negTrack --> " << labelNeg << " will be skipped due to CPA cut"); + v0dataLink(-1); continue; } auto V0radius = RecoDecay::sqrtSumOfSquares(pos[0], pos[1]); // probably find better name to differentiate the cut from the variable if (V0radius < v0radius) { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack --> " << labelPos << ", negTrack --> " << labelNeg << " will be skipped due to radius cut"); + v0dataLink(-1); continue; } @@ -328,9 +310,9 @@ struct lambdakzeroBuilder { registry.fill(HIST("hV0Candidate"), 1.5); v0data( - V0.posTrack_as().globalIndex(), - V0.negTrack_as().globalIndex(), - V0.negTrack_as().collisionId(), + V0.posTrackId(), + V0.negTrackId(), + V0.collisionId(), V0.globalIndex(), fitter.getTrack(0).getX(), fitter.getTrack(1).getX(), pos[0], pos[1], pos[2], @@ -339,6 +321,7 @@ struct lambdakzeroBuilder { fitter.getChi2AtPCACandidate(), V0.posTrack_as().dcaXY(), V0.negTrack_as().dcaXY()); + v0dataLink(v0data.lastIndex()); } } }; @@ -352,7 +335,6 @@ struct lambdakzeroInitializer { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; } From 494ffb0c5b8f4706cc6407eb8c3513b98fb4bc9c Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Thu, 3 Feb 2022 17:38:44 +0100 Subject: [PATCH 08/16] New task for dndeta MFT standalone (#500) --- PWGMM/Tasks/CMakeLists.txt | 4 +- PWGMM/Tasks/analyse-mft-tracks.cxx | 100 ---------------- PWGMM/Tasks/dndeta-mft.cxx | 176 +++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 102 deletions(-) delete mode 100644 PWGMM/Tasks/analyse-mft-tracks.cxx create mode 100644 PWGMM/Tasks/dndeta-mft.cxx diff --git a/PWGMM/Tasks/CMakeLists.txt b/PWGMM/Tasks/CMakeLists.txt index 3717fe64801..23adc9fd885 100644 --- a/PWGMM/Tasks/CMakeLists.txt +++ b/PWGMM/Tasks/CMakeLists.txt @@ -19,8 +19,8 @@ o2physics_add_dpl_workflow(dndeta PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(analyse-mft-tracks - SOURCES analyse-mft-tracks.cxx +o2physics_add_dpl_workflow(dndeta-mft + SOURCES dndeta-mft.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGMM/Tasks/analyse-mft-tracks.cxx b/PWGMM/Tasks/analyse-mft-tracks.cxx deleted file mode 100644 index b1820bd9691..00000000000 --- a/PWGMM/Tasks/analyse-mft-tracks.cxx +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "TDatabasePDG.h" - -using namespace o2; -using namespace o2::framework; - -using Particles = aod::McParticles; - -//the task analyseMFTTracks loops over MFT tracks and generated particles and fills basic histograms - -struct analyseMFTTracks { - int icoll = 0; - Service pdg; - HistogramRegistry registry{ - "registry", - { - {"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - {"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEta", "#eta; N_{trk}; events", {HistType::kTH1F, {{35, -4.5, -1.}}}}, // - {"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // - {"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // - //{"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // - {"NtrkEtaGen", "#eta; N_{trk}; events", {HistType::kTH1F, {{35, -4.5, -1.}}}}, // - } // - }; - - void processRec(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks) - { - - auto z = collision.posZ(); - registry.fill(HIST("NtrkZvtx"), tracks.size(), z); - - for (auto& track : tracks) { - registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta()); - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("NtrkEta"), track.eta()); - } - icoll++; - } - //end of processRec - PROCESS_SWITCH(analyseMFTTracks, processRec, "Process rec level", true); - - void processGen(aod::McCollisions::iterator const& mcCollision, Particles const& particles) - { - - int nChargedPrimaryParticles = 0; - auto z = mcCollision.posZ(); - - for (auto& particle : particles) { - auto p = pdg->GetParticle(particle.pdgCode()); - int charge = 0; - if (p == nullptr) { - // unknown particles will be skipped - if (particle.pdgCode() > 1000000000) { - // auto x = (std::trunc(particle.pdgCode() / 10000) - 100000); - // charge = x - std::trunc(x / 1000) * 1000; - LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d) - } else { - LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode()); - } - } else { - charge = p->Charge(); - } - if (charge != 0 && particle.isPhysicalPrimary()) { - registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z); - registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - - registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - registry.fill(HIST("NtrkEtaGen"), particle.eta()); - nChargedPrimaryParticles++; - } - } - - registry.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ()); - } - - PROCESS_SWITCH(analyseMFTTracks, processGen, "Process gen level", true); -}; -//end of the task analyseMFTTracks - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc), - }; -} diff --git a/PWGMM/Tasks/dndeta-mft.cxx b/PWGMM/Tasks/dndeta-mft.cxx new file mode 100644 index 00000000000..24d3dac6645 --- /dev/null +++ b/PWGMM/Tasks/dndeta-mft.cxx @@ -0,0 +1,176 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +#include +#include "Framework/Configurable.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RuntimeError.h" +#include "Framework/runDataProcessing.h" + +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "CommonConstants/MathConstants.h" +#include "TDatabasePDG.h" +#include "MathUtils/Utils.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct PseudorapidityDensityMFT { + Service pdg; + + Configurable useEvSel{"useEvSel", true, "use event selection"}; + + HistogramRegistry registry{ + "registry", + { + {"EventsNtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, // + {"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, // + {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, // + {"EventSelection", ";status;events", {HistType::kTH1F, {{7, 0.5, 7.5}}}} // + } // + }; + + void init(InitContext&) + { + auto hstat = registry.get(HIST("EventSelection")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(1, "All"); + x->SetBinLabel(2, "Selected"); + x->SetBinLabel(3, "Selected INEL>0"); + x->SetBinLabel(4, "Rejected"); + x->SetBinLabel(5, "Good BCs"); + x->SetBinLabel(6, "BCs with collisions"); + x->SetBinLabel(7, "BCs with pile-up/splitting"); + + if (doprocessGen) { + registry.add({"EventsNtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}); + registry.add({"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{21, -2.1, 2.1}, {201, -20.1, 20.1}}}}); + registry.add({"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}); + registry.add({"EventEfficiency", "; status; events", {HistType::kTH1F, {{5, 0.5, 5.5}}}}); + registry.add({"NotFoundEventZvtx", " ; Z_{vtx}", {HistType::kTH1F, {{201, -20.1, 20.1}}}}); + + auto heff = registry.get(HIST("EventEfficiency")); + x = heff->GetXaxis(); + x->SetBinLabel(1, "Generated"); + x->SetBinLabel(2, "Generated INEL>0"); + x->SetBinLabel(3, "Reconstructed"); + x->SetBinLabel(4, "Selected"); + x->SetBinLabel(5, "Selected INEL>0"); + } + } + + using FullBCs = soa::Join; + void processTagging(FullBCs const& bcs, soa::Join const& collisions) + { + std::vector::iterator> cols; + for (auto& bc : bcs) { + if (!useEvSel || (useEvSel && ((bc.selection()[aod::EventSelectionFlags::kIsBBT0A] & bc.selection()[aod::EventSelectionFlags::kIsBBT0C]) != 0))) { + registry.fill(HIST("EventSelection"), 5.); + cols.clear(); + for (auto& collision : collisions) { + if (collision.has_foundBC()) { + if (collision.foundBCId() == bc.globalIndex()) { + cols.emplace_back(collision); + } + } else if (collision.bcId() == bc.globalIndex()) { + cols.emplace_back(collision); + } + } + LOGP(debug, "BC {} has {} collisions", bc.globalBC(), cols.size()); + if (!cols.empty()) { + registry.fill(HIST("EventSelection"), 6.); + if (cols.size() > 1) { + registry.fill(HIST("EventSelection"), 7.); + } + } + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processTagging, "Collect event sample stats", true); + + void process(soa::Join::iterator const& collision, aod::MFTTracks const& tracks) + { + registry.fill(HIST("EventSelection"), 1.); + if (!useEvSel || (useEvSel && collision.sel8())) { + registry.fill(HIST("EventSelection"), 2.); + auto z = collision.posZ(); + + auto groupedTracks = tracks.sliceBy(o2::aod::fwdtrack::collisionId, collision.globalIndex()); + + registry.fill(HIST("EventsNtrkZvtx"), groupedTracks.size(), z); + for (auto& track : tracks) { + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("TracksPhiEta"), phi, track.eta()); + } + } else { + registry.fill(HIST("EventSelection"), 4.); + } + } + + using Particles = aod::McParticles; + expressions::Filter primaries = (aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; + + void processGen(aod::McCollisions::iterator const& mcCollision, o2::soa::SmallGroups> const& collisions, soa::Filtered const& particles, aod::MFTTracks const& tracks) + { + + registry.fill(HIST("EventEfficiency"), 1.); + + bool atLeastOne = false; + + LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), collisions.size()); + for (auto& collision : collisions) { + registry.fill(HIST("EventEfficiency"), 3.); + if (!useEvSel || (useEvSel && collision.sel8())) { + atLeastOne = true; + auto groupedTracks = tracks.sliceBy(o2::aod::fwdtrack::collisionId, collision.globalIndex()); + + registry.fill(HIST("EventEfficiency"), 4.); + + registry.fill(HIST("EventsNtrkZvtxGen"), groupedTracks.size(), collision.posZ()); + } + } + if (collisions.size() == 0) { + registry.fill(HIST("NotFoundEventZvtx"), mcCollision.posZ()); + } + for (auto& particle : particles) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = (int)p->Charge(); + } + if (charge != 0) { + + if (atLeastOne) { + registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), mcCollision.posZ()); + } + registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGen, "Process generator-level info", false); +}; + +WorkflowSpec + defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 0a7b54aef4394357f5348e88cd911ceb92371636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 4 Feb 2022 14:19:13 +0100 Subject: [PATCH 09/16] Extend PID utils (#504) * Extend PID utils * - Throw fatal if requested value is not available --- Common/Core/PID/PIDResponse.h | 533 +++++++++++++++++++++++++++++++--- 1 file changed, 491 insertions(+), 42 deletions(-) diff --git a/Common/Core/PID/PIDResponse.h b/Common/Core/PID/PIDResponse.h index c38e76a908d..399b4d4a184 100644 --- a/Common/Core/PID/PIDResponse.h +++ b/Common/Core/PID/PIDResponse.h @@ -25,6 +25,7 @@ #include "Framework/ASoA.h" #include "Framework/AnalysisDataModel.h" #include "ReconstructionDataFormats/PID.h" +#include "Framework/Logger.h" namespace o2::aod { @@ -45,8 +46,6 @@ void packInTable(const float& separation, tableType& table, const float& lowest, } } -static constexpr float defaultNSigma = -999.f; /// Default return value in case N sigma measurement is not available - template using hasTOFEl = decltype(std::declval().tofNSigmaEl()); template @@ -66,66 +65,291 @@ using hasTOFHe = decltype(std::declval().tofNSigmaHe()); template using hasTOFAl = decltype(std::declval().tofNSigmaAl()); +// PID index as template argument +template +const auto tofNSigma(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tofNSigmaEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tofNSigmaMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tofNSigmaPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tofNSigmaKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tofNSigmaPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tofNSigmaDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tofNSigmaTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tofNSigmaHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tofNSigmaAl(); + } +} + +// PID index as template argument +template +const auto tofExpSigma(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tofExpSigmaEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tofExpSigmaMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tofExpSigmaPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tofExpSigmaKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tofExpSigmaPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tofExpSigmaDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tofExpSigmaTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tofExpSigmaHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tofExpSigmaAl(); + } +} + +// PID index as template argument +template +const auto tofExpSignal(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tofExpSignalEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tofExpSignalMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tofExpSignalPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tofExpSignalKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tofExpSignalPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tofExpSignalDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tofExpSignalTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tofExpSignalHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tofExpSignalAl(); + } +} + +// PID index as template argument +template +const auto tofExpSignalDiff(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tofExpSignalDiffEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tofExpSignalDiffMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tofExpSignalDiffPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tofExpSignalDiffKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tofExpSignalDiffPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tofExpSignalDiffDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tofExpSignalDiffTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tofExpSignalDiffHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tofExpSignalDiffAl(); + } +} + +// PID index as function argument template -const auto tofNSigma(const o2::track::PID::ID& index, const TrackType& track) +const auto tofNSigma(const o2::track::PID::ID index, const TrackType& track) { switch (index) { case o2::track::PID::Electron: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaEl(); - } else { - return defaultNSigma; } case o2::track::PID::Muon: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaMu(); - } else { - return defaultNSigma; } case o2::track::PID::Pion: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaPi(); - } else { - return defaultNSigma; } case o2::track::PID::Kaon: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaKa(); - } else { - return defaultNSigma; } case o2::track::PID::Proton: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaPr(); - } else { - return defaultNSigma; } case o2::track::PID::Deuteron: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaDe(); - } else { - return defaultNSigma; } case o2::track::PID::Triton: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaTr(); - } else { - return defaultNSigma; } case o2::track::PID::Helium3: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaHe(); - } else { - return defaultNSigma; } case o2::track::PID::Alpha: if constexpr (std::experimental::is_detected::value) { return track.tofNSigmaAl(); - } else { - return defaultNSigma; } default: - return defaultNSigma; + LOGF(fatal, "TOF PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; + } +} + +// PID index as function argument +template +const auto tofExpSigma(const o2::track::PID::ID index, const TrackType& track) +{ + switch (index) { + case o2::track::PID::Electron: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaEl(); + } + case o2::track::PID::Muon: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaMu(); + } + case o2::track::PID::Pion: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaPi(); + } + case o2::track::PID::Kaon: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaKa(); + } + case o2::track::PID::Proton: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaPr(); + } + case o2::track::PID::Deuteron: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaDe(); + } + case o2::track::PID::Triton: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaTr(); + } + case o2::track::PID::Helium3: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaHe(); + } + case o2::track::PID::Alpha: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSigmaAl(); + } + default: + LOGF(fatal, "TOF PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; + } +} + +// PID index as function argument +template +const auto tofExpSignal(const o2::track::PID::ID index, const TrackType& track) +{ + switch (index) { + case o2::track::PID::Electron: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalEl(); + } + case o2::track::PID::Muon: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalMu(); + } + case o2::track::PID::Pion: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalPi(); + } + case o2::track::PID::Kaon: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalKa(); + } + case o2::track::PID::Proton: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalPr(); + } + case o2::track::PID::Deuteron: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDe(); + } + case o2::track::PID::Triton: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalTr(); + } + case o2::track::PID::Helium3: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalHe(); + } + case o2::track::PID::Alpha: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalAl(); + } + default: + LOGF(fatal, "TOF PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; + } +} + +// PID index as function argument +template +const auto tofExpSignalDiff(const o2::track::PID::ID index, const TrackType& track) +{ + switch (index) { + case o2::track::PID::Electron: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffEl(); + } + case o2::track::PID::Muon: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffMu(); + } + case o2::track::PID::Pion: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffPi(); + } + case o2::track::PID::Kaon: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffKa(); + } + case o2::track::PID::Proton: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffPr(); + } + case o2::track::PID::Deuteron: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffDe(); + } + case o2::track::PID::Triton: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffTr(); + } + case o2::track::PID::Helium3: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffHe(); + } + case o2::track::PID::Alpha: + if constexpr (std::experimental::is_detected::value) { + return track.tofExpSignalDiffAl(); + } + default: + LOGF(fatal, "TOF PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; } } @@ -148,66 +372,291 @@ using hasTPCHe = decltype(std::declval().tpcNSigmaHe()); template using hasTPCAl = decltype(std::declval().tpcNSigmaAl()); +// PID index as template argument +template +const auto tpcNSigma(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tpcNSigmaEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tpcNSigmaMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tpcNSigmaPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tpcNSigmaKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tpcNSigmaPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tpcNSigmaDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tpcNSigmaTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tpcNSigmaHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tpcNSigmaAl(); + } +} + +// PID index as template argument +template +const auto tpcExpSigma(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tpcExpSigmaEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tpcExpSigmaMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tpcExpSigmaPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tpcExpSigmaKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tpcExpSigmaPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tpcExpSigmaDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tpcExpSigmaTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tpcExpSigmaHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tpcExpSigmaAl(); + } +} + +// PID index as template argument +template +const auto tpcExpSignal(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tpcExpSignalEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tpcExpSignalMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tpcExpSignalPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tpcExpSignalKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tpcExpSignalPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tpcExpSignalDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tpcExpSignalTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tpcExpSignalHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tpcExpSignalAl(); + } +} + +// PID index as template argument +template +const auto tpcExpSignalDiff(const TrackType& track) +{ + if constexpr (index == o2::track::PID::Electron) { + return track.tpcExpSignalDiffEl(); + } else if constexpr (index == o2::track::PID::Muon) { + return track.tpcExpSignalDiffMu(); + } else if constexpr (index == o2::track::PID::Pion) { + return track.tpcExpSignalDiffPi(); + } else if constexpr (index == o2::track::PID::Kaon) { + return track.tpcExpSignalDiffKa(); + } else if constexpr (index == o2::track::PID::Proton) { + return track.tpcExpSignalDiffPr(); + } else if constexpr (index == o2::track::PID::Deuteron) { + return track.tpcExpSignalDiffDe(); + } else if constexpr (index == o2::track::PID::Triton) { + return track.tpcExpSignalDiffTr(); + } else if constexpr (index == o2::track::PID::Helium3) { + return track.tpcExpSignalDiffHe(); + } else if constexpr (index == o2::track::PID::Alpha) { + return track.tpcExpSignalDiffAl(); + } +} + +// PID index as function argument template -const auto tpcNSigma(const o2::track::PID::ID& index, const TrackType& track) +const auto tpcNSigma(const o2::track::PID::ID index, const TrackType& track) { switch (index) { case o2::track::PID::Electron: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaEl(); - } else { - return defaultNSigma; } case o2::track::PID::Muon: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaMu(); - } else { - return defaultNSigma; } case o2::track::PID::Pion: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaPi(); - } else { - return defaultNSigma; } case o2::track::PID::Kaon: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaKa(); - } else { - return defaultNSigma; } case o2::track::PID::Proton: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaPr(); - } else { - return defaultNSigma; } case o2::track::PID::Deuteron: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaDe(); - } else { - return defaultNSigma; } case o2::track::PID::Triton: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaTr(); - } else { - return defaultNSigma; } case o2::track::PID::Helium3: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaHe(); - } else { - return defaultNSigma; } case o2::track::PID::Alpha: if constexpr (std::experimental::is_detected::value) { return track.tpcNSigmaAl(); - } else { - return defaultNSigma; } default: - return defaultNSigma; + LOGF(fatal, "TPC PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; + } +} + +// PID index as function argument +template +const auto tpcExpSigma(const o2::track::PID::ID index, const TrackType& track) +{ + switch (index) { + case o2::track::PID::Electron: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaEl(); + } + case o2::track::PID::Muon: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaMu(); + } + case o2::track::PID::Pion: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaPi(); + } + case o2::track::PID::Kaon: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaKa(); + } + case o2::track::PID::Proton: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaPr(); + } + case o2::track::PID::Deuteron: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaDe(); + } + case o2::track::PID::Triton: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaTr(); + } + case o2::track::PID::Helium3: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaHe(); + } + case o2::track::PID::Alpha: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSigmaAl(); + } + default: + LOGF(fatal, "TPC PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; + } +} + +// PID index as function argument +template +const auto tpcExpSignal(const o2::track::PID::ID index, const TrackType& track) +{ + switch (index) { + case o2::track::PID::Electron: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalEl(); + } + case o2::track::PID::Muon: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalMu(); + } + case o2::track::PID::Pion: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalPi(); + } + case o2::track::PID::Kaon: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalKa(); + } + case o2::track::PID::Proton: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalPr(); + } + case o2::track::PID::Deuteron: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDe(); + } + case o2::track::PID::Triton: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalTr(); + } + case o2::track::PID::Helium3: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalHe(); + } + case o2::track::PID::Alpha: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalAl(); + } + default: + LOGF(fatal, "TPC PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; + } +} + +// PID index as function argument +template +const auto tpcExpSignalDiff(const o2::track::PID::ID index, const TrackType& track) +{ + switch (index) { + case o2::track::PID::Electron: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffEl(); + } + case o2::track::PID::Muon: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffMu(); + } + case o2::track::PID::Pion: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffPi(); + } + case o2::track::PID::Kaon: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffKa(); + } + case o2::track::PID::Proton: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffPr(); + } + case o2::track::PID::Deuteron: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffDe(); + } + case o2::track::PID::Triton: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffTr(); + } + case o2::track::PID::Helium3: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffHe(); + } + case o2::track::PID::Alpha: + if constexpr (std::experimental::is_detected::value) { + return track.tpcExpSignalDiffAl(); + } + default: + LOGF(fatal, "TPC PID table for PID index %i (%s) is not available", index, o2::track::PID::getName(index)); + return 0.f; } } From d6fca692756cbaa14bb1f75491530ff2219405a6 Mon Sep 17 00:00:00 2001 From: Jan Fiete Date: Fri, 4 Feb 2022 14:20:35 +0100 Subject: [PATCH 10/16] Rename HF tables, adjust index to V0 (#501) * add V0Link table to finder * Rename HF tables, adjust index to V0 --- Common/Tools/aodDataModelGraph.cxx | 4 +- EventFiltering/PWGHF/HFFilter.cxx | 18 +++---- PWGHF/DataModel/HFSecondaryVertex.h | 54 +++++++++++-------- .../HFCandidateCreator2Prong.cxx | 18 +++---- .../HFCandidateCreator3Prong.cxx | 2 +- .../HFCandidateCreatorCascade.cxx | 17 +++--- .../HFTrackIndexSkimsCreator.cxx | 10 ++-- PWGLF/TableProducer/lambdakzerofinder.cxx | 6 ++- 8 files changed, 75 insertions(+), 54 deletions(-) diff --git a/Common/Tools/aodDataModelGraph.cxx b/Common/Tools/aodDataModelGraph.cxx index 43f355e1589..e857a80f166 100644 --- a/Common/Tools/aodDataModelGraph.cxx +++ b/Common/Tools/aodDataModelGraph.cxx @@ -281,8 +281,8 @@ int main(int, char**) displayEntities(); - displayEntities(); - displayEntities(); + displayEntities(); + displayEntities(); graphFooter(); return 0; diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index 0647f791768..ceb06a44cc6 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -225,8 +225,8 @@ struct AddCollisionId { Produces colls2Prong; Produces colls3Prong; - void process(aod::HfTrackIndexProng2 const& cand2Prongs, - aod::HfTrackIndexProng3 const& cand3Prongs, + void process(aod::Hf2Prong const& cand2Prongs, + aod::Hf3Prong const& cand3Prongs, aod::Tracks const&) { for (const auto& cand2Prong : cand2Prongs) { @@ -572,7 +572,7 @@ struct HfFilter { // Main struct for HF triggers /// \param CharmCandMomentum is the three momentum of a charm candidate /// \param CharmMass is the mass of the charm hadron /// \return relative momentum of pair - template //template + template // template float computeRelativeMomentum(const T& track, const std::array& CharmCandMomentum, const float& CharmMass) { ROOT::Math::PxPyPzMVector part1(track.px(), track.py(), track.pz(), massProton); @@ -586,10 +586,10 @@ struct HfFilter { // Main struct for HF triggers float kStar = 0.5 * trackRelK.P(); return kStar; - } //float computeRelativeMomentum(const T& track, const std::array& CharmCandMomentum, const float& CharmMass) + } // float computeRelativeMomentum(const T& track, const std::array& CharmCandMomentum, const float& CharmMass) - using HfTrackIndexProng2withColl = soa::Join; - using HfTrackIndexProng3withColl = soa::Join; + using HfTrackIndexProng2withColl = soa::Join; + using HfTrackIndexProng3withColl = soa::Join; using BigTracksWithProtonPID = soa::Join; using BigTracksMCPID = soa::Join; @@ -863,8 +863,8 @@ struct HfFilter { // Main struct for HF triggers } } - void processTraining(aod::HfTrackIndexProng2 const& cand2Prongs, - aod::HfTrackIndexProng3 const& cand3Prongs, + void processTraining(aod::Hf2Prong const& cand2Prongs, + aod::Hf3Prong const& cand3Prongs, aod::McParticles_000 const& particlesMC, BigTracksMCPID const&) { @@ -918,7 +918,7 @@ struct HfFilter { // Main struct for HF triggers } if (indexRec < 0) { // Ds± → K± K∓ π± - indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); //TODO: replace hard coded pdg code + indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); // TODO: replace hard coded pdg code if (indexRec >= 0) { channel = kDs; } diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index db8629dd822..aba3a1f7183 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -64,12 +64,11 @@ using BigTracksPIDExtended = soa::Join; namespace hf_track_index { -DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(Index3, index3, int, Tracks, "_3"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(IndexV0, indexV0, int, aod::V0Datas, "_V0"); //! -DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //! +DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //! Index to first prong +DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //! Index to second prong +DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //! Index to third prong +DECLARE_SOA_INDEX_COLUMN(V0, v0); //! Index to V0 prong +DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //! DECLARE_SOA_COLUMN(D0ToKPiFlag, d0ToKPiFlag, uint8_t); //! DECLARE_SOA_COLUMN(JpsiToEEFlag, jpsiToEEFlag, uint8_t); //! @@ -81,27 +80,40 @@ DECLARE_SOA_COLUMN(DsKKPiFlag, dsKKPiFlag, uint8_t); //! DECLARE_SOA_COLUMN(XicToPKPiFlag, xicToPKPiFlag, uint8_t); //! } // namespace hf_track_index -DECLARE_SOA_TABLE(HfTrackIndexProng2, "AOD", "HFTRACKIDXP2", //! +DECLARE_SOA_TABLE(Hf2Prong, "AOD", "HF2PRONG", //! Table for HF 2 prong candidates + o2::soa::Index<>, hf_track_index::Index0Id, hf_track_index::Index1Id, hf_track_index::HFflag); -DECLARE_SOA_TABLE(HfTrackIndexCasc, "AOD", "HFTRACKIDXCASC", //! +DECLARE_SOA_TABLE(HfCascade, "AOD", "HFCASCADE", //! Table for HF candidates with a V0 + o2::soa::Index<>, hf_track_index::Index0Id, - hf_track_index::IndexV0Id, + hf_track_index::V0Id, hf_track_index::HFflag); -DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //! - hf_track_index::D0ToKPiFlag, - hf_track_index::JpsiToEEFlag, - hf_track_index::JpsiToMuMuFlag); - -DECLARE_SOA_TABLE(HfTrackIndexProng3, "AOD", "HFTRACKIDXP3", //! +DECLARE_SOA_TABLE(Hf3Prong, "AOD", "HF3PRONG", //! Table for HF 3 prong candidates + o2::soa::Index<>, hf_track_index::Index0Id, hf_track_index::Index1Id, hf_track_index::Index2Id, hf_track_index::HFflag); +namespace hf_track_index +{ +DECLARE_SOA_INDEX_COLUMN_FULL(IndexD0, indexD0, int, Hf2Prong, ""); //! Index to a D0 prong +} // namespace hf_track_index + +DECLARE_SOA_TABLE(HfDStar, "AOD", "HFDSTAR", //! D* -> D0pi candidates + o2::soa::Index<>, + hf_track_index::Index0Id, + hf_track_index::IndexD0Id); + +DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //! + hf_track_index::D0ToKPiFlag, + hf_track_index::JpsiToEEFlag, + hf_track_index::JpsiToMuMuFlag); + DECLARE_SOA_TABLE(HfCutStatusProng3, "AOD", "HFCUTSTATUSP3", //! hf_track_index::DPlusPiKPiFlag, hf_track_index::LcPKPiFlag, @@ -236,7 +248,7 @@ DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); //! particle origin, enum DecayType { D0ToPiK = 0, JpsiToEE, JpsiToMuMu, - N2ProngDecays }; //always keep N2ProngDecays at the end + N2ProngDecays }; // always keep N2ProngDecays at the end // functions for specific particles @@ -402,7 +414,7 @@ DECLARE_SOA_EXPRESSION_COLUMN(Py, py, //! float, 1.f * aod::hf_cand::pyProng0 + 1.f * aod::hf_cand::pyProng1); DECLARE_SOA_EXPRESSION_COLUMN(Pz, pz, //! float, 1.f * aod::hf_cand::pzProng0 + 1.f * aod::hf_cand::pzProng1); -//DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); }); +// DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); }); DECLARE_SOA_DYNAMIC_COLUMN(PtV0Pos, ptV0Pos, //! [](float px, float py) { return RecoDecay::Pt(px, py); }); DECLARE_SOA_DYNAMIC_COLUMN(PtV0Neg, ptV0Neg, //! @@ -425,7 +437,7 @@ auto InvMassGamma(const T& candidate) } // namespace hf_cand_casc DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //! - // general columns + // general columns HFCAND_COLUMNS, // cascade specific columns hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0, @@ -433,7 +445,7 @@ DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //! hf_cand::ImpactParameter0, hf_cand::ImpactParameter1, hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1, hf_track_index::Index0Id, - hf_track_index::IndexV0Id, // V0 index + hf_track_index::V0Id, // V0 index hf_track_index::HFflag, // V0 v0data::X, v0data::Y, v0data::Z, @@ -613,7 +625,7 @@ enum DecayType { DPlusToPiKPi = 0, LcToPKPi, DsToPiKK, XicToPKPi, - N3ProngDecays }; //always keep N3ProngDecays at the end + N3ProngDecays }; // always keep N3ProngDecays at the end // functions for specific particles @@ -1132,7 +1144,7 @@ DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mi enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future? // Λb → Λc+ π- → p K- π+ π- -//float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); +// float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0); template auto CtLb(const T& candidate) { diff --git a/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx b/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx index 688777dcb03..9642130980b 100644 --- a/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/HFCandidateCreator2Prong.cxx @@ -50,7 +50,7 @@ struct HFCandidateCreator2Prong { double massKPi{0.}; void process(aod::Collisions const& collisions, - aod::HfTrackIndexProng2 const& rowsTrackIndexProng2, + aod::Hf2Prong const& rowsTrackIndexProng2, aod::BigTracks const& tracks) { // 2-prong vertex fitter @@ -152,13 +152,13 @@ struct HFCandidateCreator2ProngExpressions { // Match reconstructed candidates. // Spawned table can be used directly for (auto& candidate : *rowCandidateProng2) { - //Printf("New rec. candidate"); + // Printf("New rec. candidate"); flag = 0; origin = 0; auto arrayDaughters = array{candidate.index0_as(), candidate.index1_as()}; // D0(bar) → π± K∓ - //Printf("Checking D0(bar) → π± K∓"); + // Printf("Checking D0(bar) → π± K∓"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign); if (indexRec > -1) { flag = sign * (1 << DecayType::D0ToPiK); @@ -166,7 +166,7 @@ struct HFCandidateCreator2ProngExpressions { // J/ψ → e+ e− if (flag == 0) { - //Printf("Checking J/ψ → e+ e−"); + // Printf("Checking J/ψ → e+ e−"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToEE; @@ -175,7 +175,7 @@ struct HFCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { - //Printf("Checking J/ψ → μ+ μ−"); + // Printf("Checking J/ψ → μ+ μ−"); indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true); if (indexRec > -1) { flag = 1 << DecayType::JpsiToMuMu; @@ -193,19 +193,19 @@ struct HFCandidateCreator2ProngExpressions { // Match generated particles. for (auto& particle : particlesMC) { - //Printf("New gen. candidate"); + // Printf("New gen. candidate"); flag = 0; origin = 0; // D0(bar) → π± K∓ - //Printf("Checking D0(bar) → π± K∓"); + // Printf("Checking D0(bar) → π± K∓"); if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign)) { flag = sign * (1 << DecayType::D0ToPiK); } // J/ψ → e+ e− if (flag == 0) { - //Printf("Checking J/ψ → e+ e−"); + // Printf("Checking J/ψ → e+ e−"); if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true)) { flag = 1 << DecayType::JpsiToEE; } @@ -213,7 +213,7 @@ struct HFCandidateCreator2ProngExpressions { // J/ψ → μ+ μ− if (flag == 0) { - //Printf("Checking J/ψ → μ+ μ−"); + // Printf("Checking J/ψ → μ+ μ−"); if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true)) { flag = 1 << DecayType::JpsiToMuMu; } diff --git a/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx b/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx index de1e9ab08f0..501011cbfd9 100644 --- a/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/HFCandidateCreator3Prong.cxx @@ -55,7 +55,7 @@ struct HFCandidateCreator3Prong { double massPiKPi{0.}; void process(aod::Collisions const& collisions, - aod::HfTrackIndexProng3 const& rowsTrackIndexProng3, + aod::Hf3Prong const& rowsTrackIndexProng3, aod::BigTracks const& tracks) { // 3-prong vertex fitter diff --git a/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx b/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx index e63ff7e6d07..bb5adfdeb49 100644 --- a/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/HFCandidateCreatorCascade.cxx @@ -75,10 +75,11 @@ struct HFCandidateCreatorCascade { double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus); double mass2K0sP{0.}; - void process(aod::Collisions const& collisions, - aod::HfTrackIndexCasc const& rowsTrackIndexCasc, - MyBigTracks const& tracks, - aod::V0Datas const& V0s + void process(aod::Collisions const&, + aod::HfCascade const& rowsTrackIndexCasc, + MyBigTracks const&, + aod::V0sLinked const&, + aod::V0Datas const& #ifdef MY_DEBUG , aod::McParticles_000& mcParticles @@ -99,7 +100,11 @@ struct HFCandidateCreatorCascade { for (const auto& casc : rowsTrackIndexCasc) { const auto& bach = casc.index0_as(); - const auto& v0 = casc.indexV0_as(); + if (!casc.v0_as().has_v0Data()) { + LOGF(warning, "V0Data not there for V0 %d in HF cascade %d. Skipping candidate.", casc.v0Id(), casc.globalIndex()); + continue; + } + const auto& v0 = casc.v0_as().v0Data(); const auto& trackV0DaughPos = v0.posTrack_as(); const auto& trackV0DaughNeg = v0.negTrack_as(); @@ -176,7 +181,7 @@ struct HFCandidateCreatorCascade { pVecV0[0], pVecV0[1], pVecV0[2], impactParameterBach.getY(), impactParameterV0.getY(), std::sqrt(impactParameterBach.getSigmaY2()), std::sqrt(impactParameterV0.getSigmaY2()), - casc.index0Id(), casc.indexV0Id(), + casc.index0Id(), casc.v0Id(), casc.hfflag(), v0.x(), v0.y(), v0.z(), //v0.posTrack(), v0.negTrack(), // why this was not fine? diff --git a/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx b/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx index 62628dd5fdd..98c971c1dc9 100644 --- a/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx +++ b/PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx @@ -524,9 +524,9 @@ struct HfTagSelTracks { /// Pre-selection of 2-prong and 3-prong secondary vertices struct HfTrackIndexSkimsCreator { - Produces rowTrackIndexProng2; + Produces rowTrackIndexProng2; Produces rowProng2CutStatus; - Produces rowTrackIndexProng3; + Produces rowTrackIndexProng3; Produces rowProng3CutStatus; //Configurable nCollsMax{"nCollsMax", -1, "Max collisions per file"}; //can be added to run over limited collisions per file - for tesing purposes @@ -1323,15 +1323,15 @@ struct HfTrackIndexSkimsCreator { //________________________________________________________________________________________________________________________ /// Pre-selection of cascade secondary vertices -/// It will produce in any case a HfTrackIndexProng2 object, but mixing a V0 +/// It will produce in any case a Hf2Prong object, but mixing a V0 /// with a track, instead of 2 tracks /// to run: o2-analysis-weak-decay-indices --aod-file AO2D.root -b | o2-analysis-lambdakzerobuilder -b | /// o2-analysis-trackextension -b | o2-analysis-hf-track-index-skims-creator -b struct HfTrackIndexSkimsCreatorCascades { - Produces rowTrackIndexCasc; - // Produces rowTrackIndexCasc; + Produces rowTrackIndexCasc; + // Produces rowTrackIndexCasc; // whether to do or not validation plots Configurable doValPlots{"doValPlots", true, "fill histograms"}; diff --git a/PWGLF/TableProducer/lambdakzerofinder.cxx b/PWGLF/TableProducer/lambdakzerofinder.cxx index e33b8da740d..a00c6d5096c 100644 --- a/PWGLF/TableProducer/lambdakzerofinder.cxx +++ b/PWGLF/TableProducer/lambdakzerofinder.cxx @@ -122,6 +122,8 @@ struct lambdakzeroprefilter { struct lambdakzerofinder { Produces v0data; + Produces v0; + Produces v0datalink; HistogramRegistry registry{ "registry", @@ -155,7 +157,7 @@ struct lambdakzerofinder { Long_t lNCand = 0; - for (auto& t0id : ptracks) { //FIXME: turn into combination(...) + for (auto& t0id : ptracks) { // FIXME: turn into combination(...) auto t0 = t0id.goodTrack_as>(); auto Track1 = getTrackParCov(t0); for (auto& t1id : ntracks) { @@ -197,6 +199,7 @@ struct lambdakzerofinder { } lNCand++; + v0(t0.collisionId(), t0.globalIndex(), t1.globalIndex()); v0data(t0.globalIndex(), t1.globalIndex(), t0.collisionId(), fitter.getTrack(0).getX(), fitter.getTrack(1).getX(), 0, pos[0], pos[1], pos[2], @@ -204,6 +207,7 @@ struct lambdakzerofinder { pvec1[0], pvec1[1], pvec1[2], fitter.getChi2AtPCACandidate(), t0id.dcaXY(), t1id.dcaXY()); + v0datalink(v0data.lastIndex()); } } registry.fill(HIST("hCandPerEvent"), lNCand); From d165db0e62f44804fb41c035029196e486fe0e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Fri, 4 Feb 2022 15:26:27 +0100 Subject: [PATCH 11/16] Add efficiency per charge (#502) --- DPG/Tasks/qaEfficiency.cxx | 130 ++++++++++++++++++++++++++++++++----- 1 file changed, 113 insertions(+), 17 deletions(-) diff --git a/DPG/Tasks/qaEfficiency.cxx b/DPG/Tasks/qaEfficiency.cxx index fdd36efc4e1..3370b83e212 100644 --- a/DPG/Tasks/qaEfficiency.cxx +++ b/DPG/Tasks/qaEfficiency.cxx @@ -41,14 +41,30 @@ void customize(std::vector& workflowOptions) {"eff-pr", VariantType::Int, 0, {"Efficiency for the Proton PDG code"}}, {"eff-de", VariantType::Int, 0, {"Efficiency for the Deuteron PDG code"}}, {"eff-tr", VariantType::Int, 0, {"Efficiency for the Triton PDG code"}}, - {"eff-he", VariantType::Int, 0, {"Efficiency for the Helium3 PDG code"}}}; + {"eff-he", VariantType::Int, 0, {"Efficiency for the Helium3 PDG code"}}, + {"eff-el-pos", VariantType::Int, 0, {"Efficiency for the Electron Positive PDG code"}}, + {"eff-mu-pos", VariantType::Int, 0, {"Efficiency for the Muon Positive PDG code"}}, + {"eff-pi-pos", VariantType::Int, 0, {"Efficiency for the Pion Positive PDG code"}}, + {"eff-ka-pos", VariantType::Int, 0, {"Efficiency for the Kaon Positive PDG code"}}, + {"eff-pr-pos", VariantType::Int, 0, {"Efficiency for the Proton Positive PDG code"}}, + {"eff-de-pos", VariantType::Int, 0, {"Efficiency for the Deuteron Positive PDG code"}}, + {"eff-tr-pos", VariantType::Int, 0, {"Efficiency for the Triton Positive PDG code"}}, + {"eff-he-pos", VariantType::Int, 0, {"Efficiency for the Helium3 Positive PDG code"}}, + {"eff-el-neg", VariantType::Int, 0, {"Efficiency for the Electron Negative PDG code"}}, + {"eff-mu-neg", VariantType::Int, 0, {"Efficiency for the Muon Negative PDG code"}}, + {"eff-pi-neg", VariantType::Int, 0, {"Efficiency for the Pion Negative PDG code"}}, + {"eff-ka-neg", VariantType::Int, 0, {"Efficiency for the Kaon Negative PDG code"}}, + {"eff-pr-neg", VariantType::Int, 0, {"Efficiency for the Proton Negative PDG code"}}, + {"eff-de-neg", VariantType::Int, 0, {"Efficiency for the Deuteron Negative PDG code"}}, + {"eff-tr-neg", VariantType::Int, 0, {"Efficiency for the Triton Negative PDG code"}}, + {"eff-he-neg", VariantType::Int, 0, {"Efficiency for the Helium3 Negative PDG code"}}}; std::swap(workflowOptions, options); } #include "Framework/runDataProcessing.h" /// Task to QA the efficiency of a particular particle defined by its pdg code -template +template struct QaTrackingEfficiency { static constexpr int nSpecies = 8; static constexpr int PDGs[nSpecies] = {kElectron, kMuonMinus, kPiPlus, kKPlus, kProton, 1000010020, 1000010030, 1000020030}; @@ -64,7 +80,6 @@ struct QaTrackingEfficiency { Configurable ptMin{"pt-min", 0.f, "Lower limit in pT"}; Configurable ptMax{"pt-max", 5.f, "Upper limit in pT"}; Configurable selPrim{"sel-prim", 1, "1 select primaries, 0 select all particles"}; - Configurable pdgSign{"pdgSign", 0, "Sign to give to the PDG. If 0 both signs are accepted."}; Configurable noFakes{"noFakes", false, "Flag to reject tracks that have fake hits"}; // Event selection Configurable nMinNumberOfContributors{"nMinNumberOfContributors", 2, "Minimum required number of contributors to the primary vertex"}; @@ -84,8 +99,8 @@ struct QaTrackingEfficiency { void init(InitContext&) { - if (pdgSign != 0 && pdgSign != 1 && pdgSign != -1) { - LOG(fatal) << "Provide pdgSign as 0, 1, -1. Provided: " << pdgSign.value; + if constexpr (pdgSign != 0 && pdgSign != 1 && pdgSign != -1) { + LOG(fatal) << "Provide pdgSign as 0, 1, -1. Provided: " << pdgSign; } AxisSpec axisPt{ptBins, ptMin, ptMax, "#it{p}_{T} (GeV/#it{c})"}; if (logPt) { @@ -273,7 +288,7 @@ struct QaTrackingEfficiency { histos.fill(h, 7); // Selecting PDG code - switch ((int)pdgSign) { + switch (pdgSign) { case 0: if (abs(p.pdgCode()) != pdg) { return true; @@ -290,7 +305,7 @@ struct QaTrackingEfficiency { } break; default: - LOG(fatal) << "Provide pdgSign as 0, 1, -1. Provided: " << pdgSign.value; + LOG(fatal) << "Provide pdgSign as 0, 1, -1. Provided: " << pdgSign; break; } histos.fill(h, 8); @@ -462,6 +477,26 @@ struct QaTrackingEfficiencyData { histos.add("phi/num", "Numerator " + tagPhi, kTH1D, {axisPhi}); histos.add("phi/den", "Denominator " + tagPhi, kTH1D, {axisPhi}); + // Pos + histos.add("ptpos/num", "Numerator Positve " + tagPt, kTH1D, {axisPt}); + histos.add("ptpos/den", "Denominator Positve " + tagPt, kTH1D, {axisPt}); + + histos.add("etapos/num", "Numerator Positve " + tagEta, kTH1D, {axisEta}); + histos.add("etapos/den", "Denominator Positve " + tagEta, kTH1D, {axisEta}); + + histos.add("phipos/num", "Numerator Positve " + tagPhi, kTH1D, {axisPhi}); + histos.add("phipos/den", "Denominator Positve " + tagPhi, kTH1D, {axisPhi}); + + // Neg + histos.add("ptneg/num", "Numerator Negative " + tagPt, kTH1D, {axisPt}); + histos.add("ptneg/den", "Denominator Negative " + tagPt, kTH1D, {axisPt}); + + histos.add("etaneg/num", "Numerator Negative " + tagEta, kTH1D, {axisEta}); + histos.add("etaneg/den", "Denominator Negative " + tagEta, kTH1D, {axisEta}); + + histos.add("phineg/num", "Numerator Negative " + tagPhi, kTH1D, {axisPhi}); + histos.add("phineg/den", "Denominator Negative " + tagPhi, kTH1D, {axisPhi}); + list.setObject(new TList); if (makeEff) { auto makeEfficiency = [&](TString effname, TString efftitle, auto templateHisto) { @@ -532,6 +567,15 @@ struct QaTrackingEfficiencyData { histos.fill(HIST("pt/num"), track.pt()); histos.fill(HIST("eta/num"), track.eta()); histos.fill(HIST("phi/num"), track.phi()); + if (track.sign() > 0) { + histos.fill(HIST("ptpos/num"), track.pt()); + histos.fill(HIST("etapos/num"), track.eta()); + histos.fill(HIST("phipos/num"), track.phi()); + } else { + histos.fill(HIST("ptneg/num"), track.pt()); + histos.fill(HIST("etaneg/num"), track.eta()); + histos.fill(HIST("phineg/num"), track.phi()); + } } if (makeEff) { @@ -549,32 +593,84 @@ struct QaTrackingEfficiencyData { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec w; + // Data + if (cfgc.options().get("eff-data")) { + w.push_back(adaptAnalysisTask(cfgc)); + } + // Sign blind if (cfgc.options().get("eff-el")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-electron"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-electron"})); } if (cfgc.options().get("eff-mu")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-muon"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-muon"})); } if (cfgc.options().get("eff-pi")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-pion"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-pion"})); } if (cfgc.options().get("eff-ka")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-kaon"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-kaon"})); } if (cfgc.options().get("eff-pr")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-proton"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-proton"})); } if (cfgc.options().get("eff-de")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-deuteron"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-deuteron"})); } if (cfgc.options().get("eff-tr")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-triton"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-triton"})); } if (cfgc.options().get("eff-he")) { - w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-helium3"})); + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-helium3"})); } - if (cfgc.options().get("eff-data")) { - w.push_back(adaptAnalysisTask(cfgc)); + // Pos + if (cfgc.options().get("eff-el-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-electron-pos"})); + } + if (cfgc.options().get("eff-mu-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-muon-pos"})); + } + if (cfgc.options().get("eff-pi-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-pion-pos"})); + } + if (cfgc.options().get("eff-ka-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-kaon-pos"})); + } + if (cfgc.options().get("eff-pr-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-proton-pos"})); + } + if (cfgc.options().get("eff-de-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-deuteron-pos"})); + } + if (cfgc.options().get("eff-tr-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-triton-pos"})); + } + if (cfgc.options().get("eff-he-pos")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-helium3-pos"})); + } + // Neg + if (cfgc.options().get("eff-el-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-electron-neg"})); + } + if (cfgc.options().get("eff-mu-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-muon-neg"})); + } + if (cfgc.options().get("eff-pi-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-pion-neg"})); + } + if (cfgc.options().get("eff-ka-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-kaon-neg"})); + } + if (cfgc.options().get("eff-pr-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-proton-neg"})); + } + if (cfgc.options().get("eff-de-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-deuteron-neg"})); + } + if (cfgc.options().get("eff-tr-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-triton-neg"})); + } + if (cfgc.options().get("eff-he-neg")) { + w.push_back(adaptAnalysisTask>(cfgc, TaskName{"qa-tracking-efficiency-helium3-neg"})); } return w; } From 1c404377445fa1111e6941944404defebe7c321e Mon Sep 17 00:00:00 2001 From: Valentina Mantovani Sarti <35900978+sartozza@users.noreply.github.com> Date: Fri, 4 Feb 2022 22:28:29 +0100 Subject: [PATCH 12/16] Including V0M definition for comparison to Run 2 (#506) --- .../femtoDreamProducerReducedTask.cxx | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/PWGCF/FemtoDream/femtoDreamProducerReducedTask.cxx b/PWGCF/FemtoDream/femtoDreamProducerReducedTask.cxx index d7fb65e14f4..8d5b716bcdd 100644 --- a/PWGCF/FemtoDream/femtoDreamProducerReducedTask.cxx +++ b/PWGCF/FemtoDream/femtoDreamProducerReducedTask.cxx @@ -113,28 +113,29 @@ struct femtoDreamProducerReducedTask { void process(aod::FilteredFullCollision const& col, aod::BCsWithTimestamps const&, aod::FilteredFullTracks const& tracks) /// \todo with FilteredFullV0s { auto bc = col.bc_as(); /// adding timestamp to access magnetic field later + const auto vtxZ = col.posZ(); + const auto spher = colCuts.computeSphericity(col, tracks); + ///For benchmarking on Run 2, V0M in FemtoDreamRun2 is defined V0M/2 + int mult = 0; + if (ConfIsRun3) { + mult = col.multT0A(); ///Mult based on T0, temporary storing to be fixed and checked + } else { + mult = 0.5 * (col.multV0M()); + } /// First thing to do is to check whether the basic event selection criteria are fulfilled // If the basic selection is NOT fullfilled: // in case of skimming run - don't store such collisions // in case of trigger run - store such collisions but don't store any particle candidates for such collisions if (!colCuts.isSelected(col)) { if (ConfIsTrigger) { - outputCollision(col.posZ(), col.multV0M(), colCuts.computeSphericity(col, tracks), bc.timestamp()); + outputCollision(col.posZ(), mult, colCuts.computeSphericity(col, tracks), bc.timestamp()); } return; } - const auto vtxZ = col.posZ(); - const auto mult = col.multV0M(); - const auto spher = colCuts.computeSphericity(col, tracks); colCuts.fillQA(col); - // now the table is filled - if (ConfIsRun3) { - outputCollision(vtxZ, col.multT0A(), spher, bc.timestamp()); - } else { - outputCollision(vtxZ, mult, spher, bc.timestamp()); - } + outputCollision(vtxZ, mult, spher, bc.timestamp()); int childIDs[2] = {0, 0}; // these IDs are necessary to keep track of the children for (auto& track : tracks) { From 4d5e52e6ff98f8a2636eed22843c720dea87b7d4 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Fri, 4 Feb 2022 23:10:57 +0100 Subject: [PATCH 13/16] Moving to the default McParticles (#507) --- PWGCF/TableProducer/dptdptfilter.cxx | 14 ++++++------- PWGCF/TableProducer/dptdptfilter.h | 30 +++++++++++++++++----------- PWGCF/Tasks/match-reco-gen.cxx | 4 ++-- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index 79b4b245ceb..d70a1ec1a70 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -638,15 +638,15 @@ struct DptDptFilter { PROCESS_SWITCH(DptDptFilter, processWithoutCentPIDDetectorLevel, "Process PID MC detector level without centrality", false); template - void processGenerated(CollisionObject const& mccollision, aod::McParticles_000 const& mcparticles, float centormult); + void processGenerated(CollisionObject const& mccollision, aod::McParticles const& mcparticles, float centormult); void processWithCentGeneratorLevel(aod::McCollision const& mccollision, soa::Join const& collisions, - aod::McParticles_000 const& mcparticles); + aod::McParticles const& mcparticles); PROCESS_SWITCH(DptDptFilter, processWithCentGeneratorLevel, "Process generated with centrality", false); void processWithoutCentGeneratorLevel(aod::McCollision const& mccollision, - aod::McParticles_000 const& mcparticles); + aod::McParticles const& mcparticles); PROCESS_SWITCH(DptDptFilter, processWithoutCentGeneratorLevel, "Process generated without centrality", false); }; @@ -666,7 +666,7 @@ MatchRecoGenSpecies DptDptFilter::trackIdentification(TrackObject const& track) } } else if (recoIdMethod == 2) { if constexpr (framework::has_type_v) { - sp = IdentifyParticle(track.template mcParticle_as()); + sp = IdentifyParticle(track.template mcParticle_as()); } else { LOGF(fatal, "Track identification required from MC particle but MC information not present"); } @@ -936,7 +936,7 @@ void DptDptFilter::processWithoutCentPIDDetectorLevel(aod::CollisionEvSel const& } template -void DptDptFilter::processGenerated(CollisionObject const& mccollision, aod::McParticles_000 const& mcparticles, float centormult) +void DptDptFilter::processGenerated(CollisionObject const& mccollision, aod::McParticles const& mcparticles, float centormult) { using namespace dptdptfilter; @@ -972,7 +972,7 @@ void DptDptFilter::processGenerated(CollisionObject const& mccollision, aod::McP void DptDptFilter::processWithCentGeneratorLevel(aod::McCollision const& mccollision, soa::Join const& collisions, - aod::McParticles_000 const& mcparticles) + aod::McParticles const& mcparticles) { using namespace dptdptfilter; @@ -996,7 +996,7 @@ void DptDptFilter::processWithCentGeneratorLevel(aod::McCollision const& mccolli } void DptDptFilter::processWithoutCentGeneratorLevel(aod::McCollision const& mccollision, - aod::McParticles_000 const& mcparticles) + aod::McParticles const& mcparticles) { using namespace dptdptfilter; diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 80b92889e8f..f7a60e1b3de 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -421,6 +421,20 @@ inline void AcceptTrack(TrackObject const& track, uint8_t& asone, uint8_t& astwo } } +template +void exploreMothers(ParticleObject& particle, MCCollisionObject& collision) +{ + for (auto& m : particle.template mothers_as()) { + LOGF(info, " mother index: %d", m.globalIndex()); + LOGF(info, " Tracking back mother"); + LOGF(info, " assigned collision Id: %d, looping on collision Id: %d", m.mcCollisionId(), collision.globalIndex()); + LOGF(info, " index: %d, pdg code: %d", m.globalIndex(), m.pdgCode()); + LOGF(info, " Passed isPhysicalPrimary(): %s", m.isPhysicalPrimary() ? "YES" : "NO"); + + exploreMothers(m, collision); + } +} + template inline void AcceptParticle(ParticleObject& particle, MCCollisionObject const& collision, uint8_t& asone, uint8_t& astwo) { @@ -439,21 +453,13 @@ inline void AcceptParticle(ParticleObject& particle, MCCollisionObject const& co float dcaz = TMath::Abs(particle.vz() - collision.posZ()); if (not((dcaxy < particleMaxDCAxy) and (dcaz < particleMaxDCAZ))) { if ((particle.mcCollisionId() == 0) and traceCollId0) { - auto currparticle = particle; LOGF(info, "Rejecting particle with dcaxy: %.2f and dcaz: %.2f", dcaxy, dcaz); - LOGF(info, " assigned collision Id: %d, looping on collision Id: %d", currparticle.mcCollisionId(), collision.globalIndex()); + LOGF(info, " assigned collision Id: %d, looping on collision Id: %d", particle.mcCollisionId(), collision.globalIndex()); LOGF(info, " Collision x: %.5f, y: %.5f, z: %.5f", collision.posX(), collision.posY(), collision.posZ()); LOGF(info, " Particle x: %.5f, y: %.5f, z: %.5f", particle.vx(), particle.vy(), particle.vz()); - LOGF(info, " index: %d, pdg code: %d", currparticle.globalIndex(), currparticle.pdgCode()); - while (currparticle.has_mother0()) { - LOGF(info, " mother0 index: %d, mother1 index: %d", currparticle.mother0Id(), currparticle.mother1Id()); - LOGF(info, " Tracking back mother0 index"); - auto newcurrparticle = currparticle.template mother0_as(); - LOGF(info, " assigned collision Id: %d, looping on collision Id: %d", newcurrparticle.mcCollisionId(), collision.globalIndex()); - LOGF(info, " index: %d, pdg code: %d", newcurrparticle.globalIndex(), newcurrparticle.pdgCode()); - LOGF(info, " Passed isPhysicalPrimary(): %s", newcurrparticle.isPhysicalPrimary() ? "YES" : "NO"); - currparticle = newcurrparticle; - } + LOGF(info, " index: %d, pdg code: %d", particle.globalIndex(), particle.pdgCode()); + + exploreMothers(particle, collision); } return; } diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/match-reco-gen.cxx index 7fc143d43c0..f89c788b529 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/match-reco-gen.cxx @@ -352,7 +352,7 @@ struct CheckGeneratorLevelVsDetectorLevel { int64_t recix = track.globalIndex(); int32_t label = track.mcParticleId(); - LOGF(MATCHRECGENLOGTRACKS, "Track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.template mcParticle_as().mcCollisionId()); + LOGF(MATCHRECGENLOGTRACKS, "Track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.template mcParticle_as().mcCollisionId()); if (track.collisionId() < 0) { if (label >= 0) { mclabelpos[kNEGATIVE][label].push_back(recix); @@ -415,7 +415,7 @@ struct CheckGeneratorLevelVsDetectorLevel { if ((asone == uint8_t(true)) or (astwo == uint8_t(true))) { /* the track has been accepted */ nreco++; - LOGF(MATCHRECGENLOGTRACKS, "Accepted track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.template mcParticle_as().mcCollisionId()); + LOGF(MATCHRECGENLOGTRACKS, "Accepted track with global Id %d and collision Id %d has label %d associated to MC collision %d", recix, track.collisionId(), label, track.template mcParticle_as().mcCollisionId()); mclabelpos[kPOSITIVE][label].push_back(recix); } } From 0a6ca5e9e792a51efeba9d9e188b8869f1919816 Mon Sep 17 00:00:00 2001 From: sarahherrmann <83958698+sarahherrmann@users.noreply.github.com> Date: Sat, 5 Feb 2022 13:55:15 +0100 Subject: [PATCH 14/16] Change in run2dndeta task to reweight tracks histograms for sim reco (#503) --- PWGMM/Tasks/run2dndeta.cxx | 71 +++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 13 deletions(-) diff --git a/PWGMM/Tasks/run2dndeta.cxx b/PWGMM/Tasks/run2dndeta.cxx index 19e441310fa..a1c00b058e6 100644 --- a/PWGMM/Tasks/run2dndeta.cxx +++ b/PWGMM/Tasks/run2dndeta.cxx @@ -24,6 +24,9 @@ #include "CommonConstants/MathConstants.h" #include "TDatabasePDG.h" +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -37,6 +40,11 @@ struct PseudorapidityDensity { {VARIABLE_WIDTH, 0., 0.01, 0.1, 0.5, 1, 5, 10, 15, 20, 30, 40, 50, 70, 100}, "Centrality/multiplicity percentile binning"}; + Configurable> parRatio{"parRatio", {0.773047, 0.00131658, 0.00232244, 1.53395e-05, -2.36494e-05, -3.71754e-08, 4.4547e-08}, "parameters of pol6 of mes /reco tracks versus zvtx"}; + + TF1* fRatio = 0; + TRandom2* rand = 0; + HistogramRegistry registry{ "registry", { @@ -76,6 +84,12 @@ struct PseudorapidityDensity { x->SetBinLabel(3, "Reconstructed"); x->SetBinLabel(4, "Selected"); x->SetBinLabel(5, "Selected INEL>0"); + + fRatio = new TF1("fRatio", "pol6", -15, 15); + auto param = (std::vector)parRatio; + fRatio->SetParameters(param[0], param[1], param[2], param[3], param[4], param[5], param[6]); + + rand = new TRandom2(); } if (doprocessBinned) { @@ -100,23 +114,54 @@ struct PseudorapidityDensity { void process(soa::Join::iterator const& collision, Trks const& tracks) { registry.fill(HIST("EventSelection"), 1.); - if (!useEvSel || (useEvSel && collision.sel7())) { - registry.fill(HIST("EventSelection"), 2.); - auto z = collision.posZ(); - auto perCollisionSample = sample->sliceByCached(aod::track::collisionId, collision.globalIndex()); - if (perCollisionSample.size() > 0) { - registry.fill(HIST("EventSelection"), 3.); - } - registry.fill(HIST("EventsNtrkZvtx"), perCollisionSample.size(), z); - for (auto& track : tracks) { - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - registry.fill(HIST("TracksPhiEta"), track.phi(), track.eta()); + if (doprocessGen) //we are sudying the MC, that needs correction + { + if (!useEvSel || (useEvSel && collision.sel7())) { + + auto z = collision.posZ(); + auto perCollisionSample = sample->sliceByCached(aod::track::collisionId, collision.globalIndex()); + auto v = fRatio->Eval(z); + + double r = rand->Rndm(); //random number between 0 and 1 + if ((1 - v) > r) //we discard the event + { + registry.fill(HIST("EventSelection"), 4.); + return; + } + registry.fill(HIST("EventSelection"), 2.); if (perCollisionSample.size() > 0) { - registry.fill(HIST("TracksEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("EventSelection"), 3.); } + registry.fill(HIST("EventsNtrkZvtx"), perCollisionSample.size(), z); + for (auto& track : tracks) { + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("TracksPhiEta"), track.phi(), track.eta()); + if (perCollisionSample.size() > 0) { + registry.fill(HIST("TracksEtaZvtx_gt0"), track.eta(), z); + } + } + } else { + registry.fill(HIST("EventSelection"), 4.); } } else { - registry.fill(HIST("EventSelection"), 4.); + if (!useEvSel || (useEvSel && collision.sel7())) { + registry.fill(HIST("EventSelection"), 2.); + auto z = collision.posZ(); + auto perCollisionSample = sample->sliceByCached(aod::track::collisionId, collision.globalIndex()); + if (perCollisionSample.size() > 0) { + registry.fill(HIST("EventSelection"), 3.); + } + registry.fill(HIST("EventsNtrkZvtx"), perCollisionSample.size(), z); + for (auto& track : tracks) { + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("TracksPhiEta"), track.phi(), track.eta()); + if (perCollisionSample.size() > 0) { + registry.fill(HIST("TracksEtaZvtx_gt0"), track.eta(), z); + } + } + } else { + registry.fill(HIST("EventSelection"), 4.); + } } } From f279fd9a8499b6ddca36cecbff7435e8487b447e Mon Sep 17 00:00:00 2001 From: lauraser <45659867+lauraser@users.noreply.github.com> Date: Mon, 7 Feb 2022 03:09:47 +0100 Subject: [PATCH 15/16] Include more QA histograms, change V0M value (#508) --- EventFiltering/PWGCF/CFFilter.cxx | 88 ++++++++++++++++++------------- 1 file changed, 50 insertions(+), 38 deletions(-) diff --git a/EventFiltering/PWGCF/CFFilter.cxx b/EventFiltering/PWGCF/CFFilter.cxx index 2c02abfbc48..b36b55a338c 100644 --- a/EventFiltering/PWGCF/CFFilter.cxx +++ b/EventFiltering/PWGCF/CFFilter.cxx @@ -92,19 +92,19 @@ struct CFFilter { Configurable> confQ3TriggerLimit{"Q3TriggerLimitC", std::vector{0.6f, 0.6f, 0.6f, 0.6f}, "Q3 limit for selection"}; Configurable Q3Trigger{"Q3Trigger", 0, "Choice which trigger to run"}; - Configurable ldeltaPhiMax{"ldeltaPhiMax", 0.017, "Max limit of delta phi"}; - Configurable ldeltaEtaMax{"ldeltaEtaMax", 0.017, "Max limit of delta eta"}; + Configurable ldeltaPhiMax{"ldeltaPhiMax", 0.010, "Max limit of delta phi"}; + Configurable ldeltaEtaMax{"ldeltaEtaMax", 0.010, "Max limit of delta eta"}; // Obtain particle and antiparticle candidates of protons and lambda hyperons for current femto collision - Partition partsProton0Part = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0) && ((o2::aod::femtodreamparticle::pidcut & knSigmaProton) > kValue0); + Partition partsProton0Part = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0); // Consider later: && ((o2::aod::femtodreamparticle::pidcut & knSigmaProton) > kValue0); Partition partsLambda0Part = (o2::aod::femtodreamparticle::partType == V0) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0); - Partition partsProton1Part = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0) && ((o2::aod::femtodreamparticle::pidcut & knSigmaProton) > kValue0); + Partition partsProton1Part = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0); // Consider later: && ((o2::aod::femtodreamparticle::pidcut & knSigmaProton) > kValue0); Partition partsLambda1Part = (o2::aod::femtodreamparticle::partType == V0) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0); HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registryQA{"registryQA", {}, OutputObjHandlingPolicy::AnalysisObject}; - Service ccdb; ///Accessing the CCDB + Service ccdb; /// Accessing the CCDB // FemtoDreamPairCleaner pairCleanerTT; Currently not used, will be needed later FemtoDreamPairCleaner pairCleanerTV; @@ -127,7 +127,7 @@ struct CFFilter { { float pidThresh = 0.75; bool pidSelection = false; - auto vSpecies = std::vector{2}; + auto vSpecies = std::vector{0}; if (momentum < pidThresh) { /// TPC PID only pidSelection = isPIDSelected(pidCut, vSpecies, 3.5, kDetector::kTPC); @@ -157,7 +157,9 @@ struct CFFilter { registry.add("fZvtxBefore", "Zvtx of all processed events", HistType::kTH1F, {{1000, -15, 15}}); registry.add("fZvtxAfter", "Zvtx of events which passed ppp trigger", HistType::kTH1F, {{1000, -15, 15}}); registry.add("fPtBefore", "Transverse momentum of all processed tracks", HistType::kTH1F, {{1000, 0, 10}}); - registry.add("fPtAfter", "Transverse momentum of processed tracks which passed ppp trigger", HistType::kTH1F, {{1000, 0, 10}}); + registry.add("fPtAfter", "Transverse momentum of processed tracks which passed selections", HistType::kTH1F, {{1000, 0, 10}}); + registry.add("fPtBeforeAnti", "Transverse momentum of all processed antitracks", HistType::kTH1F, {{1000, 0, 10}}); + registry.add("fPtAfterAnti", "Transverse momentum of processed antitracks passed selection", HistType::kTH1F, {{1000, 0, 10}}); } if (Q3Trigger == 1 || Q3Trigger == 11) { registry.add("fSameEventPartPPL", "CF - same event ppL distribution for particles;;events", HistType::kTH1F, {{8000, 0, 8}}); @@ -202,16 +204,32 @@ struct CFFilter { auto tmstamp = col.timestamp(); auto mafneticField = getMagneticFieldTesla(tmstamp); registry.get(HIST("fProcessedEvents"))->Fill(0); - registry.get(HIST("fMultiplicityBefore"))->Fill(col.multV0M()); + registry.get(HIST("fMultiplicityBefore"))->Fill(col.multV0M() / 2.); registry.get(HIST("fZvtxBefore"))->Fill(col.posZ()); for (auto p1pt : partsProton0) { registry.get(HIST("fPtBefore"))->Fill(p1pt.pt()); } + for (auto p1pt : partsProton0) { + if (isFullPIDSelectedProton(p1pt.pidcut(), p1pt.p())) + registry.get(HIST("fPtAfter"))->Fill(p1pt.pt()); + } + + for (auto p1pt : partsProton1) { + registry.get(HIST("fPtBeforeAnti"))->Fill(p1pt.pt()); + } + + for (auto p1pt : partsProton1) { + if (isFullPIDSelectedProton(p1pt.pidcut(), p1pt.p())) + registry.get(HIST("fPtAfterAnti"))->Fill(p1pt.pt()); + } + bool keepEvent[nTriplets]{false}; int lowQ3Triplets[2] = {0, 0}; if (partsFemto.size() != 0) { + registry.get(HIST("fMultiplicityAfter"))->Fill(col.multV0M() / 2.); + registry.get(HIST("fZvtxAfter"))->Fill(col.posZ()); auto Q3TriggerLimit = (std::vector)confQ3TriggerLimit; // TRIGGER FOR PPP TRIPLETS if (Q3Trigger == 0 || Q3Trigger == 11) { @@ -239,32 +257,32 @@ struct CFFilter { } } // end if - /*if (lowQ3Triplets[0] == 0) { // if at least one triplet found in particles, no need to check antiparticles - if (partsProton1.size() >= 3) { - for (auto& [p1, p2, p3] : combinations(partsProton1, partsProton1, partsProton1)) { + // if (lowQ3Triplets[0] == 0) // Use this in final version only, for testing comment { // if at least one triplet found in particles, no need to check antiparticles + if (partsProton1.size() >= 3) { + for (auto& [p1, p2, p3] : combinations(partsProton1, partsProton1, partsProton1)) { - if (!isFullPIDSelectedProton(p1.pidcut(), p1.p()) || !isFullPIDSelectedProton(p2.pidcut(), p2.p()) || !isFullPIDSelectedProton(p3.pidcut(), p3.p())) { - continue; - } - // Think if pair cleaning is needed in current framework - // Run close pair rejection - if (closePairRejectionTT.isClosePair(p1, p2, partsFemto, mafneticField)) { - continue; - } - if (closePairRejectionTT.isClosePair(p1, p3, partsFemto, mafneticField)) { - continue; - } - if (closePairRejectionTT.isClosePair(p2, p3, partsFemto, mafneticField)) { - continue; - } - auto Q3 = FemtoDreamMath::getQ3(p1, mMassProton, p2, mMassProton, p3, mMassProton); - registry.get(HIST("fSameEventAntiPartPPP"))->Fill(Q3); - if (Q3 < Q3TriggerLimit.at(0)) { - lowQ3Triplets[0]++; - } + if (!isFullPIDSelectedProton(p1.pidcut(), p1.p()) || !isFullPIDSelectedProton(p2.pidcut(), p2.p()) || !isFullPIDSelectedProton(p3.pidcut(), p3.p())) { + continue; } - } // end if - }*/ + // Think if pair cleaning is needed in current framework + // Run close pair rejection + if (closePairRejectionTT.isClosePair(p1, p2, partsFemto, mafneticField)) { + continue; + } + if (closePairRejectionTT.isClosePair(p1, p3, partsFemto, mafneticField)) { + continue; + } + if (closePairRejectionTT.isClosePair(p2, p3, partsFemto, mafneticField)) { + continue; + } + auto Q3 = FemtoDreamMath::getQ3(p1, mMassProton, p2, mMassProton, p3, mMassProton); + registry.get(HIST("fSameEventAntiPartPPP"))->Fill(Q3); + if (Q3 < Q3TriggerLimit.at(0)) { + lowQ3Triplets[0]++; + } + } + } // end if + //} } // TRIGGER FOR PPL TRIPLETS @@ -323,12 +341,6 @@ struct CFFilter { if (lowQ3Triplets[0] > 0) { keepEvent[kPPP] = true; - registry.get(HIST("fMultiplicityAfter"))->Fill(col.multV0M()); - registry.get(HIST("fZvtxAfter"))->Fill(col.posZ()); - for (auto p1pt : partsProton0) { - // All protons from selected events - registry.get(HIST("fPtAfter"))->Fill(p1pt.pt()); - } } if (lowQ3Triplets[1] > 0) { From 05b9b4e612982fae1f0f374f59656017533dcfb9 Mon Sep 17 00:00:00 2001 From: Fabio Colamaria Date: Tue, 8 Feb 2022 11:04:49 +0100 Subject: [PATCH 16/16] Using variables for histogram binning definition --- PWGHF/Tasks/HFCorrelatorD0D0bar.cxx | 64 +++++++++++-------- .../HFCorrelatorD0D0barBarrelFullPID.cxx | 64 +++++++++++-------- PWGHF/Tasks/HFCorrelatorDplusDminus.cxx | 64 +++++++++++-------- 3 files changed, 117 insertions(+), 75 deletions(-) diff --git a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx index 2a12b63d9e0..78ac9815211 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0bar.cxx @@ -50,6 +50,20 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_topik::npTBins; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +// histogram binning definition +const int massAxisBins = 120; +const double massAxisMin = 1.5848; +const double massAxisMax = 2.1848; +const int phiAxisBins = 32; +const double phiAxisMin = 0.; +const double phiAxisMax = 2. * o2::constants::math::PI; +const int yAxisBins = 100; +const double yAxisMin = -5.; +const double yAxisMax = 5.; +const int ptDAxisBins = 180; +const double ptDAxisMin = 0.; +const double ptDAxisMax = 36.; + using MCParticlesPlus = soa::Join; struct HfCorrelatorD0D0bar { @@ -59,28 +73,28 @@ struct HfCorrelatorD0D0bar { HistogramRegistry registry{ "registry", // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hCountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, @@ -99,15 +113,15 @@ struct HfCorrelatorD0D0bar { void init(o2::framework::InitContext&) { auto vbins = (std::vector)bins; - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } diff --git a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx index b129c054731..e216dcc692d 100644 --- a/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx +++ b/PWGHF/Tasks/HFCorrelatorD0D0barBarrelFullPID.cxx @@ -50,6 +50,20 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_topik::npTBins; const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +// histogram binning definition +const int massAxisBins = 120; +const double massAxisMin = 1.5848; +const double massAxisMax = 2.1848; +const int phiAxisBins = 32; +const double phiAxisMin = 0.; +const double phiAxisMax = 2. * o2::constants::math::PI; +const int yAxisBins = 100; +const double yAxisMin = -5.; +const double yAxisMax = 5.; +const int ptDAxisBins = 180; +const double ptDAxisMin = 0.; +const double ptDAxisMax = 36.; + using MCParticlesPlus = soa::Join; struct HfCorrelatorD0D0barBarrelFullPid { @@ -59,28 +73,28 @@ struct HfCorrelatorD0D0barBarrelFullPid { HistogramRegistry registry{ "registry", // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hDDbarVsEtaCut", "D0,D0bar pairs vs #eta cut;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtCandMCRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0MCRec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1MCRec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, {"hSelectionStatusMCRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hEtaMCRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPtCandMCGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hEtaMCGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hCountD0D0barPerEvent", "D0,D0bar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hDDbarVsDaughterEtaCut", "D0,D0bar pairs vs #eta cut on D daughters;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, @@ -99,15 +113,15 @@ struct HfCorrelatorD0D0barBarrelFullPid { void init(o2::framework::InitContext&) { auto vbins = (std::vector)bins; - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0", "D0,D0bar candidates;inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0bar", "D0,D0bar candidates;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecRefl", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0MCRecBkg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCountD0triggersMCGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } diff --git a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx index fda229bdefc..dcb4c87c7cc 100644 --- a/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx +++ b/PWGHF/Tasks/HFCorrelatorDplusDminus.cxx @@ -50,6 +50,20 @@ const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_topikpi::npTBin const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; +// histogram binning definition +const int massAxisBins = 120; +const double massAxisMin = 1.5848; +const double massAxisMax = 2.1848; +const int phiAxisBins = 32; +const double phiAxisMin = 0.; +const double phiAxisMax = 2. * o2::constants::math::PI; +const int yAxisBins = 100; +const double yAxisMin = -5.; +const double yAxisMax = 5.; +const int ptDAxisBins = 180; +const double ptDAxisMin = 0.; +const double ptDAxisMax = 36.; + using MCParticlesPlus2Prong = soa::Join; using MCParticlesPlus3Prong = soa::Join; @@ -60,30 +74,30 @@ struct HfCorrelatorDplusDminus { HistogramRegistry registry{ "registry", // NOTE: use hMassDplus for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "Dplus,Dminus candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0", "Dplus,Dminus candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1", "Dplus,Dminus candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng2", "Dplus,Dminus candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {{"hPtCand", "Dplus,Dminus candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0", "Dplus,Dminus candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1", "Dplus,Dminus candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng2", "Dplus,Dminus candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, {"hSelectionStatus", "Dplus,Dminus candidates;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, - {"hEta", "Dplus,Dminus candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhi", "Dplus,Dminus candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hY", "Dplus,Dminus candidates;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hEta", "Dplus,Dminus candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhi", "Dplus,Dminus candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hY", "Dplus,Dminus candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, {"hDDbarVsEtaCut", "Dplus,Dminus pairs vs #eta cut;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, - {"hPtCandMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng0MCRec", "Dplus,Dminus candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng1MCRec", "Dplus,Dminus candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hPtProng2MCRec", "Dplus,Dminus candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, + {"hPtCandMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0MCRec", "Dplus,Dminus candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1MCRec", "Dplus,Dminus candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng2MCRec", "Dplus,Dminus candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, {"hSelectionStatusMCRec", "Dplus,Dminus candidates - MC reco;selection status;entries", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, - {"hEtaMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hEtaMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCRec", "Dplus,Dminus candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandMCGen", "Dplus,Dminus particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{180, 0., 36.}}}}, - {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, - {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{32, 0., 2. * o2::constants::math::PI}}}}, - {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{100, -5., 5.}}}}, + {"hPtCandMCGen", "Dplus,Dminus particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hEtaMCGen", "Dplus,Dminus particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCGen", "Dplus,Dminus particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCGen", "Dplus,Dminus candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, {"hCountDplusDminusPerEvent", "Dplus,Dminus particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, {"hDDbarVsDaughterEtaCut", "Dplus,Dminus pairs vs #eta cut on D daughters;#eta_{max};candidates #it{p}_{T} threshold (GeV/#it{c});entries", {HistType::kTH2F, {{(int)(maxEtaCut / incrementEtaCut), 0., maxEtaCut}, {(int)(ptThresholdForMaxEtaCut / incrementPtThreshold), 0., ptThresholdForMaxEtaCut}}}}, {"hCountCCbarPerEvent", "c,cbar particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, @@ -101,13 +115,13 @@ struct HfCorrelatorDplusDminus { void init(o2::framework::InitContext&) { auto vbins = (std::vector)bins; - registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplus", "Dplus,Dminus candidates;inv. mass Dplus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminus", "Dplus,Dminus candidates;inv. mass Dminus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{120, 1.5848, 2.1848}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMass", "Dplus,Dminus candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplus", "Dplus,Dminus candidates;inv. mass Dplus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminus", "Dplus,Dminus candidates;inv. mass Dminus only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminusMCRecSig", "Dminus signal candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass D+ only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDminusMCRecBkg", "Dminus background candidates - MC reco;inv. mass D- only (#pi K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hCountCtriggersMCGen", "c trigger particles - MC gen;;N of trigger c quark", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); }