From 5e4b5debaae35645d0556021a756d7cf6795d325 Mon Sep 17 00:00:00 2001 From: Fabrizio Chinu <91954233+fchinu@users.noreply.github.com> Date: Sat, 10 Feb 2024 07:46:07 +0100 Subject: [PATCH 01/26] PWGHF: Add D+ -> KKPi flag for MC (#4616) * PWGHF: Add nSigma TPC TOF to Ds tree creator output * MegaLinter fixes * PWGHF: Add D+ -> KKPi flag * Please consider the following formatting changes * Add comments and fixed formatting * Please consider the following formatting changes * Refactored candidateCreator D meson selections * MegaLinter fixes * Fix formatting * Imlemented suggestions --------- Co-authored-by: ALICE Action Bot --- PWGHF/D2H/Tasks/taskDs.cxx | 254 +++++++++++++----- .../DataModel/CandidateReconstructionTables.h | 10 +- .../TableProducer/candidateCreator3Prong.cxx | 47 ++-- PWGHF/TableProducer/treeCreatorDsToKKPi.cxx | 43 ++- 4 files changed, 252 insertions(+), 102 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskDs.cxx b/PWGHF/D2H/Tasks/taskDs.cxx index 718d2b62065..a9cb389574e 100644 --- a/PWGHF/D2H/Tasks/taskDs.cxx +++ b/PWGHF/D2H/Tasks/taskDs.cxx @@ -32,7 +32,8 @@ using namespace o2::framework::expressions; /// Ds± analysis task struct HfTaskDs { - Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds->PhiPi->KKpi, 2 for Ds->K0*K->KKPi"}; + Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"}; + Configurable fillDplusMc{"fillDplusMc", true, "Switch to fill Dplus MC information"}; Configurable selectionFlagDs{"selectionFlagDs", 7, "Selection Flag for Ds"}; Configurable yCandGenMax{"yCandGenMax", 0.5, "max. gen particle rapidity"}; Configurable yCandRecoMax{"yCandRecoMax", 0.8, "max. cand. rapidity"}; @@ -44,12 +45,15 @@ struct HfTaskDs { using CandDsMcReco = soa::Filtered>; using CandDsMcGen = soa::Join; + int offsetDplusDecayChannel = aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi - aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; // Offset between Dplus and Ds to use the same decay channel. See aod::hf_cand_3prong::DecayChannelDToKKPi + Filter filterDsFlag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi))) != static_cast(0); Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; + Partition reconstructedCandDsSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; + Partition reconstructedCandDplusSig = fillDplusMc && nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == (decayChannel + offsetDplusDecayChannel); Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)); HistogramRegistry registry{ @@ -58,11 +62,14 @@ struct HfTaskDs { {"hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, {"hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, {"hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"hCPARecSig", "3-prong candidates (matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, + {"hCPARecSigDs", "3-prong Ds candidates (matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, + {"hCPARecSigDplus", "3-prong Dplus candidates (matched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, {"hCPARecBkg", "3-prong candidates (unmatched);cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, + {"hEtaRecSigDs", "3-prong Ds candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, + {"hEtaRecSigDplus", "3-prong Dplus candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, {"hEtaRecBkg", "3-prong candidates (unmatched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; + {"hEtaGenDs", "MC Ds particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, + {"hEtaGenDplus", "MC Dplus particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}}}; void init(InitContext&) { @@ -89,26 +96,45 @@ struct HfTaskDs { registry.add("hd0Prong0", "3-prong candidates;prong 0 DCA to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hd0Prong1", "3-prong candidates;prong 1 DCA to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hd0Prong2", "3-prong candidates;prong 2 DCA to prim. vertex (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtRecSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtRecSigDs", "3-prong candidates (Ds matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtRecSigDsPrompt", "3-prong candidates (Ds matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtRecSigDsNonPrompt", "3-prong candidates (Ds matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtRecSigDplus", "3-prong candidates (Dplus matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtRecSigDplusPrompt", "3-prong candidates (Dplus matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtRecSigDplusNonPrompt", "3-prong candidates (Dplus matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("hPtRecBkg", "3-prong candidates (unmatched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtGenSig", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hPtVsYRecSigRecoPID", "3-prong candidates (RecoPID - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigPromptRecoPID", "3-prong candidates (RecoPID - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigNonPromptRecoPID", "3-prong candidates (RecoPID - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigRecoTopol", "3-prong candidates (RecoTopol - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigPromptRecoTopol", "3-prong candidates (RecoTopol - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigNonPromptRecoTopol", "3-prong candidates (RecoTopol - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigRecoSkim", "3-prong candidates (RecoSkim - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigPromptRecoSkim", "3-prong candidates (RecoSkim - matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYRecSigNonPromptRecoSkim", "3-prong candidates (RecoSkim - matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYGen", "MC particles (matched);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); - registry.add("hPtVsYGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtGenDs", "MC Ds particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenDplus", "MC Dplus particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenSigDs", "MC Ds particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenSigDplus", "MC Dplus particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenDsPrompt", "MC Ds particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenDsNonPrompt", "MC Ds particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenDplusPrompt", "MC Dplus particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtGenDplusNonPrompt", "MC Dplus particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hPtVsYRecSigDsRecoPID", "3-prong candidates (RecoPID - matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsPromptRecoPID", "3-prong candidates (RecoPID - Ds matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsNonPromptRecoPID", "3-prong candidates (RecoPID - Ds matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsRecoTopol", "3-prong candidates (RecoTopol - Ds matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsPromptRecoTopol", "3-prong candidates (RecoTopol - Ds matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsNonPromptRecoTopol", "3-prong candidates (RecoTopol - Ds matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsRecoSkim", "3-prong candidates (RecoSkim - Ds matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsPromptRecoSkim", "3-prong candidates (RecoSkim - Ds matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDsNonPromptRecoSkim", "3-prong candidates (RecoSkim - Ds matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusRecoPID", "3-prong candidates (RecoPID - Dplus matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusPromptRecoPID", "3-prong candidates (RecoPID - Dplus matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusNonPromptRecoPID", "3-prong candidates (RecoPID - Dplus matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusRecoTopol", "3-prong candidates (RecoTopol - Dplus matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusPromptRecoTopol", "3-prong candidates (RecoTopol - Dplus matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusNonPromptRecoTopol", "3-prong candidates (RecoTopol - Dplus matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusRecoSkim", "3-prong candidates (RecoSkim - Dplus matched);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusPromptRecoSkim", "3-prong candidates (RecoSkim - Dplus matched, prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYRecSigDplusNonPromptRecoSkim", "3-prong candidates (RecoSkim - Dplus matched, non-prompt);#it{p}_{T}^{rec.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYGenDs", "MC Ds particles (matched);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYGenDsPrompt", "MC Ds particles (matched, prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYGenDsNonPrompt", "MC Ds particles (matched, non-prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYGenDplus", "MC Dplus particles (matched);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYGenDplusPrompt", "MC Dplus particles (matched, prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); + registry.add("hPtVsYGenDplusNonPrompt", "MC Dplus particles (matched, non-prompt);#it{p}_{T}^{gen.}; #it{y}", {HistType::kTH2F, {{vbins, "#it{p}_{T} (GeV/#it{c})"}, {ybins}}}); } /// Fill histograms of quantities independent from the daugther-mass hypothesis @@ -174,43 +200,86 @@ struct HfTaskDs { /// \param candidate is candidate /// \param flag is the selection flag, obtained from either isSelDsToKKPi() or isSelDsToPiKK() template - void fillHistoMCRec(const T1& candidate, int flag) + void fillHistoMCRec(const T1& candidate, int flag, bool isDplus) { auto pt = candidate.pt(); // rec. level pT + // Dplus + if (isDplus) { + auto y = hfHelper.yDplus(candidate); + + registry.fill(HIST("hPtRecSigDplus"), pt); + registry.fill(HIST("hCPARecSigDplus"), candidate.cpa()); + registry.fill(HIST("hEtaRecSigDplus"), candidate.eta()); + registry.fill(HIST("hPtVsYRecSigDplusRecoSkim"), pt, y); + if (TESTBIT(flag, aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigDplusRecoTopol"), pt, y); + } + if (TESTBIT(flag, aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSigDplusRecoPID"), pt, y); + } + + // prompt + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hPtRecSigDplusPrompt"), pt); + registry.fill(HIST("hPtVsYRecSigDplusPromptRecoSkim"), pt, y); + if (TESTBIT(flag, aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigDplusPromptRecoTopol"), pt, y); + } + if (TESTBIT(flag, aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSigDplusPromptRecoPID"), pt, y); + } + } + + // non-prompt + if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("hPtRecSigDplusNonPrompt"), pt); + registry.fill(HIST("hPtVsYRecSigDplusNonPromptRecoSkim"), pt, y); + if (TESTBIT(flag, aod::SelectionStep::RecoTopol)) { + registry.fill(HIST("hPtVsYRecSigDplusNonPromptRecoTopol"), pt, y); + } + if (TESTBIT(flag, aod::SelectionStep::RecoPID)) { + registry.fill(HIST("hPtVsYRecSigDplusNonPromptRecoPID"), pt, y); + } + } + + return; + } + + // Ds auto y = hfHelper.yDs(candidate); - registry.fill(HIST("hPtRecSig"), pt); - registry.fill(HIST("hCPARecSig"), candidate.cpa()); - registry.fill(HIST("hEtaRecSig"), candidate.eta()); - registry.fill(HIST("hPtVsYRecSigRecoSkim"), pt, y); + registry.fill(HIST("hPtRecSigDs"), pt); + registry.fill(HIST("hCPARecSigDs"), candidate.cpa()); + registry.fill(HIST("hEtaRecSigDs"), candidate.eta()); + registry.fill(HIST("hPtVsYRecSigDsRecoSkim"), pt, y); if (TESTBIT(flag, aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigRecoTopol"), pt, y); + registry.fill(HIST("hPtVsYRecSigDsRecoTopol"), pt, y); } if (TESTBIT(flag, aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigRecoPID"), pt, y); + registry.fill(HIST("hPtVsYRecSigDsRecoPID"), pt, y); } // prompt if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hPtRecSigPrompt"), pt); - registry.fill(HIST("hPtVsYRecSigPromptRecoSkim"), pt, y); + registry.fill(HIST("hPtRecSigDsPrompt"), pt); + registry.fill(HIST("hPtVsYRecSigDsPromptRecoSkim"), pt, y); if (TESTBIT(flag, aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigPromptRecoTopol"), pt, y); + registry.fill(HIST("hPtVsYRecSigDsPromptRecoTopol"), pt, y); } if (TESTBIT(flag, aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigPromptRecoPID"), pt, y); + registry.fill(HIST("hPtVsYRecSigDsPromptRecoPID"), pt, y); } } // non-prompt if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("hPtRecSigNonPrompt"), pt); - registry.fill(HIST("hPtVsYRecSigNonPromptRecoSkim"), pt, y); + registry.fill(HIST("hPtRecSigDsNonPrompt"), pt); + registry.fill(HIST("hPtVsYRecSigDsNonPromptRecoSkim"), pt, y); if (TESTBIT(flag, aod::SelectionStep::RecoTopol)) { - registry.fill(HIST("hPtVsYRecSigNonPromptRecoTopol"), pt, y); + registry.fill(HIST("hPtVsYRecSigDsNonPromptRecoTopol"), pt, y); } if (TESTBIT(flag, aod::SelectionStep::RecoPID)) { - registry.fill(HIST("hPtVsYRecSigNonPromptRecoPID"), pt, y); + registry.fill(HIST("hPtVsYRecSigDsNonPromptRecoPID"), pt, y); } } @@ -241,24 +310,47 @@ struct HfTaskDs { aod::TracksWMc const&) { // MC rec. - for (const auto& candidate : reconstructedCandSig) { - if (yCandRecoMax >= 0. && std::abs(hfHelper.yDs(candidate)) > yCandRecoMax) { - continue; - } - + // Ds± → K± K∓ π± + for (const auto& candidate : reconstructedCandDsSig) { auto prong0McPart = candidate.prong0_as().mcParticle_as(); auto indexMother = RecoDecay::getMother(mcParticles, prong0McPart, o2::constants::physics::Pdg::kDS, true); - auto particleMother = mcParticles.iteratorAt(indexMother); - registry.fill(HIST("hPtGenSig"), particleMother.pt()); // gen. level pT + if (indexMother != -1) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yDs(candidate)) > yCandRecoMax) { + continue; + } + auto particleMother = mcParticles.iteratorAt(indexMother); + registry.fill(HIST("hPtGenSigDs"), particleMother.pt()); // gen. level pT + // KKPi + if (candidate.isCandidateSwapped() == 0) { // 0 corresponds to KKPi + fillHistoMCRec(candidate, candidate.isSelDsToKKPi(), false); + } - // KKPi - if (candidate.isCandidateSwapped() == 0) { // 0 corresponds to KKPi - fillHistoMCRec(candidate, candidate.isSelDsToKKPi()); + // PiKK + if (candidate.isCandidateSwapped() == 1) { // 1 corresponds to PiKK + fillHistoMCRec(candidate, candidate.isSelDsToPiKK(), false); + } } + } + // Dplus± → K± K∓ π± + for (const auto& candidate : reconstructedCandDplusSig) { + auto prong0McPart = candidate.prong0_as().mcParticle_as(); + auto indexMother = RecoDecay::getMother(mcParticles, prong0McPart, o2::constants::physics::Pdg::kDPlus, true); + if (indexMother != -1) { + if (yCandRecoMax >= 0. && std::abs(hfHelper.yDplus(candidate)) > yCandRecoMax) { + continue; + } + indexMother = RecoDecay::getMother(mcParticles, prong0McPart, o2::constants::physics::Pdg::kDPlus, true); + auto particleMother = mcParticles.iteratorAt(indexMother); + registry.fill(HIST("hPtGenSigDplus"), particleMother.pt()); // gen. level pT + // KKPi + if (candidate.isCandidateSwapped() == 0) { // 0 corresponds to KKPi + fillHistoMCRec(candidate, candidate.isSelDsToKKPi(), true); + } - // PiKK - if (candidate.isCandidateSwapped() == 1) { // 1 corresponds to PiKK - fillHistoMCRec(candidate, candidate.isSelDsToPiKK()); + // PiKK + if (candidate.isCandidateSwapped() == 1) { // 1 corresponds to PiKK + fillHistoMCRec(candidate, candidate.isSelDsToPiKK(), true); + } } } @@ -276,28 +368,46 @@ struct HfTaskDs { // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::DsToKKPi) { - if (particle.flagMcDecayChanGen() != decayChannel) { + if (particle.flagMcDecayChanGen() == decayChannel || (fillDplusMc && particle.flagMcDecayChanGen() == (decayChannel + offsetDplusDecayChannel))) { + auto pt = particle.pt(); + auto y = 0; + + if (particle.flagMcDecayChanGen() == decayChannel) { + y = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDS); + if (yCandGenMax >= 0. && std::abs(y) > yCandGenMax) { + continue; + } + registry.fill(HIST("hPtGenDs"), pt); + registry.fill(HIST("hPtVsYGenDs"), pt, y); + registry.fill(HIST("hEtaGenDs"), particle.eta()); + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hPtGenDsPrompt"), pt); + registry.fill(HIST("hPtVsYGenDsPrompt"), pt, y); + } + if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("hPtGenDsNonPrompt"), pt); + registry.fill(HIST("hPtVsYGenDsNonPrompt"), pt, y); + } + } else if (fillDplusMc) { + y = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDPlus); + if (yCandGenMax >= 0. && std::abs(y) > yCandGenMax) { + continue; + } + registry.fill(HIST("hPtGenDplus"), pt); + registry.fill(HIST("hPtVsYGenDplus"), pt, y); + registry.fill(HIST("hEtaGenDplus"), particle.eta()); + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + registry.fill(HIST("hPtGenDplusPrompt"), pt); + registry.fill(HIST("hPtVsYGenDplusPrompt"), pt, y); + } + if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { + registry.fill(HIST("hPtGenDplusNonPrompt"), pt); + registry.fill(HIST("hPtVsYGenDplusNonPrompt"), pt, y); + } + } + } else { continue; } - auto pt = particle.pt(); - auto y = RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, o2::constants::physics::MassDS); - if (yCandGenMax >= 0. && std::abs(y) > yCandGenMax) { - continue; - } - - registry.fill(HIST("hPtGen"), pt); - registry.fill(HIST("hPtVsYGen"), pt, y); - registry.fill(HIST("hEtaGen"), particle.eta()); - - if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { - registry.fill(HIST("hPtGenPrompt"), pt); - registry.fill(HIST("hPtVsYGenPrompt"), pt, y); - } - - if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { - registry.fill(HIST("hPtGenNonPrompt"), pt); - registry.fill(HIST("hPtVsYGenNonPrompt"), pt, y); - } } } } diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index c53e6765012..86ac79a6aea 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -766,11 +766,13 @@ enum DecayType { DplusToPiKPi = 0, XicToPKPi, N3ProngDecays }; // always keep N3ProngDecays at the end -// Ds± → K± K∓ π± +// Ds± → K± K∓ π± or D± → K± K∓ π± -enum DecayChannelDs { - PhiPi = 1, - K0starK +enum DecayChannelDToKKPi { + DsToPhiPi = 1, + DsToK0starK, + DplusToPhiPi, // used to describe D+ in MC production for Ds analysis + DplusToK0starK // used to describe D+ in MC production for Ds analysis }; } // namespace hf_cand_3prong diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index d734341d336..9d9f0947abc 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -278,11 +278,11 @@ struct HfCandidateCreator3ProngExpressions { int8_t channel = 0; std::vector arrDaughIndex; std::array arrPDGDaugh; - std::array arrPDGResonant1 = {kProton, 313}; // Λc± → p± K* - std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ - std::array arrPDGResonant3 = {3124, kPiPlus}; // Λc± → Λ(1520) π± - std::array arrPDGResonantDsPhiPi = {333, kPiPlus}; // Ds± → Phi π± - std::array arrPDGResonantDsKstarK = {313, kKPlus}; // Ds± → K*(892)0bar K± + std::array arrPDGResonant1 = {kProton, 313}; // Λc± → p± K* + std::array arrPDGResonant2 = {2224, kKPlus}; // Λc± → Δ(1232)±± K∓ + std::array arrPDGResonant3 = {3124, kPiPlus}; // Λc± → Λ(1520) π± + std::array arrPDGResonantDPhiPi = {333, kPiPlus}; // Ds± → Phi π± and D± → Phi π± + std::array arrPDGResonantDKstarK = {313, kKPlus}; // Ds± → K*(892)0bar K± and D± → K*(892)0bar K± // Match reconstructed candidates. // Spawned table can be used directly @@ -300,10 +300,17 @@ struct HfCandidateCreator3ProngExpressions { flag = sign * (1 << DecayType::DplusToPiKPi); } - // Ds± → K± K∓ π± + // Ds± → K± K∓ π± and D± → K± K∓ π± if (flag == 0) { + bool isDplus = false; indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + if (indexRec == -1) { + isDplus = true; + indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2); + } if (indexRec > -1) { + // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + // TODO: move to different and explicit flags flag = sign * (1 << DecayType::DsToKKPi); if (arrayDaughters[0].has_mcParticle()) { swapping = int8_t(std::abs(arrayDaughters[0].mcParticle().pdgCode()) == kPiPlus); @@ -314,10 +321,10 @@ struct HfCandidateCreator3ProngExpressions { auto daughI = mcParticles.rawIteratorAt(arrDaughIndex[iProng]); arrPDGDaugh[iProng] = std::abs(daughI.pdgCode()); } - if ((arrPDGDaugh[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[0])) { - channel = DecayChannelDs::PhiPi; - } else if ((arrPDGDaugh[0] == arrPDGResonantDsKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDsKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDsKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDsKstarK[0])) { - channel = DecayChannelDs::K0starK; + if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { + channel = isDplus ? DecayChannelDToKKPi::DplusToPhiPi : DecayChannelDToKKPi::DsToPhiPi; + } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { + channel = isDplus ? DecayChannelDToKKPi::DplusToK0starK : DecayChannelDToKKPi::DsToK0starK; } } } @@ -379,20 +386,30 @@ struct HfCandidateCreator3ProngExpressions { flag = sign * (1 << DecayType::DplusToPiKPi); } - // Ds± → K± K∓ π± + // Ds± → K± K∓ π± and D± → K± K∓ π± if (flag == 0) { + bool isDplus = false; if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDS, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + // TODO: move to different and explicit flags + flag = sign * (1 << DecayType::DsToKKPi); + } else if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) { + // DecayType::DsToKKPi is used to flag both Ds± → K± K∓ π± and D± → K± K∓ π± + // TODO: move to different and explicit flags flag = sign * (1 << DecayType::DsToKKPi); + isDplus = true; + } + if (flag != 0) { RecoDecay::getDaughters(particle, &arrDaughIndex, std::array{0}, 1); if (arrDaughIndex.size() == 2) { for (auto jProng = 0u; jProng < arrDaughIndex.size(); ++jProng) { auto daughJ = mcParticles.rawIteratorAt(arrDaughIndex[jProng]); arrPDGDaugh[jProng] = std::abs(daughJ.pdgCode()); } - if ((arrPDGDaugh[0] == arrPDGResonantDsPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDsPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDsPhiPi[0])) { - channel = DecayChannelDs::PhiPi; - } else if ((arrPDGDaugh[0] == arrPDGResonantDsKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDsKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDsKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDsKstarK[0])) { - channel = DecayChannelDs::K0starK; + if ((arrPDGDaugh[0] == arrPDGResonantDPhiPi[0] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[1]) || (arrPDGDaugh[0] == arrPDGResonantDPhiPi[1] && arrPDGDaugh[1] == arrPDGResonantDPhiPi[0])) { + channel = isDplus ? DecayChannelDToKKPi::DplusToPhiPi : DecayChannelDToKKPi::DsToPhiPi; + } else if ((arrPDGDaugh[0] == arrPDGResonantDKstarK[0] && arrPDGDaugh[1] == arrPDGResonantDKstarK[1]) || (arrPDGDaugh[0] == arrPDGResonantDKstarK[1] && arrPDGDaugh[1] == arrPDGResonantDKstarK[0])) { + channel = isDplus ? channel = DecayChannelDToKKPi::DplusToK0starK : DecayChannelDToKKPi::DsToK0starK; } } } diff --git a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx index 141cfd4f582..74b1c72fb08 100644 --- a/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx +++ b/PWGHF/TableProducer/treeCreatorDsToKKPi.cxx @@ -126,7 +126,8 @@ DECLARE_SOA_TABLE(HfCandDsLites, "AOD", "HFCANDDSLITE", full::AbsCos3PiK, hf_cand::Chi2PCA, hf_cand_3prong::FlagMcMatchRec, - hf_cand_3prong::OriginMcRec) + hf_cand_3prong::OriginMcRec, + hf_cand_3prong::FlagMcDecayChanRec) DECLARE_SOA_TABLE(HfCandDsFulls, "AOD", "HFCANDDSFULL", collision::BCId, @@ -195,7 +196,8 @@ DECLARE_SOA_TABLE(HfCandDsFulls, "AOD", "HFCANDDSFULL", full::AbsCos3PiK, hf_cand::Chi2PCA, hf_cand_3prong::FlagMcMatchRec, - hf_cand_3prong::OriginMcRec); + hf_cand_3prong::OriginMcRec, + hf_cand_3prong::FlagMcDecayChanRec); DECLARE_SOA_TABLE(HfCandDsFullEvs, "AOD", "HFCANDDSFULLEV", collision::BCId, @@ -223,7 +225,8 @@ struct HfTreeCreatorDsToKKPi { Produces rowCandidateFullParticles; Produces rowCandidateLite; - Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds->PhiPi->KKpi, 2 for Ds->K0*K->KKPi"}; + Configurable decayChannel{"decayChannel", 1, "Switch between decay channels: 1 for Ds/Dplus->PhiPi->KKpi, 2 for Ds/Dplus->K0*K->KKPi"}; + Configurable fillDplusMc{"fillDplusMc", false, "Switch to fill Dplus MC information"}; Configurable selectionFlagDs{"selectionFlagDs", 1, "Selection flag for Ds"}; Configurable fillCandidateLiteTable{"fillCandidateLiteTable", false, "Switch to fill lite table with candidate properties"}; // parameters for production of training samples @@ -239,13 +242,15 @@ struct HfTreeCreatorDsToKKPi { using CandDsMcGen = soa::Filtered>; using TracksWPid = soa::Join; + int offsetDplusDecayChannel = aod::hf_cand_3prong::DecayChannelDToKKPi::DplusToPhiPi - aod::hf_cand_3prong::DecayChannelDToKKPi::DsToPhiPi; // Offset between Dplus and Ds to use the same decay channel. See aod::hf_cand_3prong::DecayChannelDToKKPi + Filter filterSelectCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanGen == decayChannel; + Filter filterMcGenMatching = nabs(o2::aod::hf_cand_3prong::flagMcMatchGen) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && (aod::hf_cand_3prong::flagMcDecayChanGen == decayChannel || (fillDplusMc && aod::hf_cand_3prong::flagMcDecayChanGen == (decayChannel + offsetDplusDecayChannel))); // Do not store Dplus MC if fillDplusMc is false Partition selectedDsToKKPiCand = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs; Partition selectedDsToPiKKCand = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs; - Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel; + Partition reconstructedCandSig = nabs(aod::hf_cand_3prong::flagMcMatchRec) == static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)) && (aod::hf_cand_3prong::flagMcDecayChanRec == decayChannel || (fillDplusMc && aod::hf_cand_3prong::flagMcDecayChanRec == (decayChannel + offsetDplusDecayChannel))); // Do not store Dplus MC if fillDplusMc is false Partition reconstructedCandBkg = nabs(aod::hf_cand_3prong::flagMcMatchRec) != static_cast(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi)); void init(InitContext const&) @@ -274,9 +279,23 @@ struct HfTreeCreatorDsToKKPi { { int8_t flagMc = 0; int8_t originMc = 0; + int8_t channelMc = 0; + float yCand = 0; + float eCand = 0; + float ctCand = 0; if constexpr (doMc) { flagMc = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); + channelMc = candidate.flagMcDecayChanRec(); + if (fillDplusMc && candidate.flagMcDecayChanRec() == (decayChannel + offsetDplusDecayChannel)) { + yCand = hfHelper.yDplus(candidate); + eCand = hfHelper.eDplus(candidate); + ctCand = hfHelper.ctDplus(candidate); + } else { + yCand = hfHelper.yDs(candidate); + eCand = hfHelper.eDs(candidate); + ctCand = hfHelper.ctDs(candidate); + } } float invMassDs = 0; @@ -328,7 +347,7 @@ struct HfTreeCreatorDsToKKPi { candidate.pt(), candidate.eta(), candidate.phi(), - hfHelper.yDs(candidate), + yCand, candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), @@ -341,7 +360,8 @@ struct HfTreeCreatorDsToKKPi { absCos3PiKDs, candidate.chi2PCA(), flagMc, - originMc); + originMc, + channelMc); } else { rowCandidateFull( candidate.collision().bcId(), @@ -393,11 +413,11 @@ struct HfTreeCreatorDsToKKPi { invMassDs, candidate.pt(), candidate.p(), - hfHelper.ctDs(candidate), + ctCand, candidate.eta(), candidate.phi(), - hfHelper.yDs(candidate), - hfHelper.eDs(candidate), + yCand, + eCand, candidate.decayLength(), candidate.decayLengthXY(), candidate.decayLengthNormalised(), @@ -410,7 +430,8 @@ struct HfTreeCreatorDsToKKPi { absCos3PiKDs, candidate.chi2PCA(), flagMc, - originMc); + originMc, + channelMc); } } From b5960b19a4127abf2ed7df7b1be55994a86acd37 Mon Sep 17 00:00:00 2001 From: Luca Barioglio Date: Sat, 10 Feb 2024 08:40:47 +0100 Subject: [PATCH 02/26] Adapt nucleiFlow to the updated data model (#4650) --- PWGLF/TableProducer/nucleiSpectra.cxx | 12 ++++++------ PWGLF/Tasks/Nuspex/nucleiFlow.cxx | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/PWGLF/TableProducer/nucleiSpectra.cxx b/PWGLF/TableProducer/nucleiSpectra.cxx index 2355a626bcd..66b6c7c777d 100644 --- a/PWGLF/TableProducer/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/nucleiSpectra.cxx @@ -340,9 +340,9 @@ struct nucleiSpectra { } } if (doprocessDataFlow) { - spectra.add("hScalarProductFT0AvsFT0C", "", HistType::kTH2F, {ft0Aft0CspAxis, centAxis}); - spectra.add("hScalarProductFV0AvsFT0C", "", HistType::kTH2F, {fv0Aft0CspAxis, centAxis}); - spectra.add("hScalarProductFV0AvsFT0A", "", HistType::kTH2F, {fv0Aft0AspAxis, centAxis}); + spectra.add("hScalarProductFT0AvsFT0C", "", HistType::kTH2F, {centAxis, ft0Aft0CspAxis}); + spectra.add("hScalarProductFV0AvsFT0C", "", HistType::kTH2F, {centAxis, fv0Aft0CspAxis}); + spectra.add("hScalarProductFV0AvsFT0A", "", HistType::kTH2F, {centAxis, fv0Aft0AspAxis}); } for (int iS{0}; iS < nuclei::species; ++iS) { @@ -390,9 +390,9 @@ struct nucleiSpectra { if constexpr (std::is_same::value) { if (doprocessDataFlow) { - spectra.fill(HIST("hScalarProductFT0AvsFT0C"), collision.qvecFT0ARe() * collision.qvecFT0CRe() + collision.qvecFT0AIm() * collision.qvecFT0CIm(), centrality); - spectra.fill(HIST("hScalarProductFV0AvsFT0C"), collision.qvecFV0ARe() * collision.qvecFT0CRe() + collision.qvecFV0AIm() * collision.qvecFT0CIm(), centrality); - spectra.fill(HIST("hScalarProductFV0AvsFT0A"), collision.qvecFT0ARe() * collision.qvecFV0ARe() + collision.qvecFT0AIm() * collision.qvecFV0AIm(), centrality); + spectra.fill(HIST("hScalarProductFT0AvsFT0C"), centrality, collision.qvecFT0ARe() * collision.qvecFT0CRe() + collision.qvecFT0AIm() * collision.qvecFT0CIm()); + spectra.fill(HIST("hScalarProductFV0AvsFT0C"), centrality, collision.qvecFV0ARe() * collision.qvecFT0CRe() + collision.qvecFV0AIm() * collision.qvecFT0CIm()); + spectra.fill(HIST("hScalarProductFV0AvsFT0A"), centrality, collision.qvecFT0ARe() * collision.qvecFV0ARe() + collision.qvecFT0AIm() * collision.qvecFV0AIm()); } } diff --git a/PWGLF/Tasks/Nuspex/nucleiFlow.cxx b/PWGLF/Tasks/Nuspex/nucleiFlow.cxx index 85729edf30d..53bc2cfddec 100644 --- a/PWGLF/Tasks/Nuspex/nucleiFlow.cxx +++ b/PWGLF/Tasks/Nuspex/nucleiFlow.cxx @@ -103,6 +103,9 @@ struct nucleiFlow { /// \brief bethe-bloch parameters Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {nuclei_spectra::betheBlochDefault[0], 5, 6, nuclei_spectra::names, nuclei_spectra::betheBlochParNames}, "TPC Bethe-Bloch parameterisation for light nuclei"}; + // Selected nuclei tracks with the ID of the collision + using TracksWithFlowCollID = soa::Join; + EventPlaneHelper epHelper; /// \brief Get n-sigma TPC @@ -221,7 +224,7 @@ struct nucleiFlow { histos.add("hSpFV0AvsNsigmaHe3VsPtvsCent", "", HistType::kTHnSparseF, {FV0AspAxis, nSigmaTPCHe3Axis, ptAxis, centAxis}); } - void process(aod::NucleiFlowColl const& coll, aod::NucleiTable const& tracks) + void process(aod::NucleiFlowColl const& coll, TracksWithFlowCollID const& tracks) { histos.fill(HIST("hCentFV0A"), coll.centFV0A()); histos.fill(HIST("hCentFT0M"), coll.centFT0M()); From 7a645428a4badf9c02ce36ef8d50a731aff68259 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sat, 10 Feb 2024 09:06:04 +0100 Subject: [PATCH 03/26] PWGLF: Add centrality QA/testing mode for der data (#4653) * PWGLF: Add centrality QA/testing mode for der data * Please consider the following formatting changes (#234) * Add feeddown matrix calculation for first test * Please consider the following formatting changes (#235) * Add plain QA mode for cross-checks * Fix minor bugs introduced in last commit --------- Co-authored-by: ALICE Builder --- PWGLF/TableProducer/strangederivedbuilder.cxx | 27 +- .../derivedlambdakzeroanalysis.cxx | 258 ++++++++++++++---- 2 files changed, 236 insertions(+), 49 deletions(-) diff --git a/PWGLF/TableProducer/strangederivedbuilder.cxx b/PWGLF/TableProducer/strangederivedbuilder.cxx index 5cad9c8fc0a..e890ffc030b 100644 --- a/PWGLF/TableProducer/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/strangederivedbuilder.cxx @@ -129,6 +129,8 @@ struct strangederivedbuilder { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisCentrality{"axisCentrality", {100, 0.0f, 100.0f}, "Centrality"}; + ConfigurableAxis axisRawCentrality{"axisRawCentrality", {VARIABLE_WIDTH, 0.000f, 52.320f, 75.400f, 95.719f, 115.364f, 135.211f, 155.791f, 177.504f, 200.686f, 225.641f, 252.645f, 281.906f, 313.850f, 348.302f, 385.732f, 426.307f, 470.146f, 517.555f, 568.899f, 624.177f, 684.021f, 748.734f, 818.078f, 892.577f, 973.087f, 1058.789f, 1150.915f, 1249.319f, 1354.279f, 1465.979f, 1584.790f, 1710.778f, 1844.863f, 1985.746f, 2134.643f, 2291.610f, 2456.943f, 2630.653f, 2813.959f, 3006.631f, 3207.229f, 3417.641f, 3637.318f, 3865.785f, 4104.997f, 4354.938f, 4615.786f, 4885.335f, 5166.555f, 5458.021f, 5762.584f, 6077.881f, 6406.834f, 6746.435f, 7097.958f, 7462.579f, 7839.165f, 8231.629f, 8635.640f, 9052.000f, 9484.268f, 9929.111f, 10389.350f, 10862.059f, 11352.185f, 11856.823f, 12380.371f, 12920.401f, 13476.971f, 14053.087f, 14646.190f, 15258.426f, 15890.617f, 16544.433f, 17218.024f, 17913.465f, 18631.374f, 19374.983f, 20136.700f, 20927.783f, 21746.796f, 22590.880f, 23465.734f, 24372.274f, 25314.351f, 26290.488f, 27300.899f, 28347.512f, 29436.133f, 30567.840f, 31746.818f, 32982.664f, 34276.329f, 35624.859f, 37042.588f, 38546.609f, 40139.742f, 41837.980f, 43679.429f, 45892.130f, 400000.000f}, "raw centrality signal"}; // for QA + ConfigurableAxis axisNVertices{"axisNVertices", {10, -0.5f, 9.5f}, "N(vertices)"}; Configurable fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"}; @@ -144,6 +146,8 @@ struct strangederivedbuilder { Configurable fillRawFV0A{"fillRawFV0A", false, "Fill raw FV0A information for debug"}; Configurable fillRawNTracksEta1{"fillRawNTracksEta1", true, "Fill raw NTracks |eta|<1 information for debug"}; + Configurable qaCentrality{"qaCentrality", false, "qa centrality flag: check base raw values"}; + // For manual sliceBy Preslice V0perCollision = o2::aod::v0data::collisionId; Preslice CascperCollision = o2::aod::cascdata::collisionId; @@ -180,6 +184,14 @@ struct strangederivedbuilder { } histos.add("h2dNVerticesVsCentrality", "h2dNVerticesVsCentrality", kTH2D, {axisCentrality, axisNVertices}); + + // for QA and test purposes + auto hRawCentrality = histos.add("hRawCentrality", "hRawCentrality", kTH1F, {axisRawCentrality}); + + for (int ii = 1; ii < 101; ii++) { + float value = 100.5f - static_cast(ii); + hRawCentrality->SetBinContent(ii, value); + } } void processCollisionsV0sOnly(soa::Join const& collisions, aod::V0Datas const& V0s, aod::BCsWithTimestamps const&) @@ -213,6 +225,13 @@ struct strangederivedbuilder { { for (const auto& collision : collisions) { const uint64_t collIdx = collision.globalIndex(); + + float centrality = collision.centFT0C(); + if (qaCentrality) { + auto hRawCentrality = histos.get(HIST("hRawCentrality")); + centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); + } + auto V0Table_thisColl = V0s.sliceBy(V0perCollision, collIdx); auto CascTable_thisColl = Cascades.sliceBy(CascperCollision, collIdx); auto KFCascTable_thisColl = KFCascades.sliceBy(KFCascperCollision, collIdx); @@ -225,7 +244,7 @@ struct strangederivedbuilder { if (strange || fillEmptyCollisions) { strangeColl(collision.posX(), collision.posY(), collision.posZ()); strangeCents(collision.centFT0M(), collision.centFT0A(), - collision.centFT0C(), collision.centFV0A()); + centrality, collision.centFV0A()); strangeEvSels(collision.sel8()); auto bc = collision.bc_as(); strangeStamps(bc.runNumber(), bc.timestamp()); @@ -487,7 +506,7 @@ struct strangederivedbuilder { } } - void processReconstructedSimulation(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) + void processReconstructedSimulation(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) { // this process function also checks if a given collision was reconstructed and checks explicitly for splitting, etc @@ -498,6 +517,10 @@ struct strangederivedbuilder { if (biggestNContribs < collision.numContrib()) { biggestNContribs = collision.numContrib(); bestCentrality = collision.centFT0C(); + if (qaCentrality) { + auto hRawCentrality = histos.get(HIST("hRawCentrality")); + bestCentrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); + } } } histos.fill(HIST("h2dNVerticesVsCentrality"), bestCentrality, collisions.size()); diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index 598da25ddb1..ee2616a1fb7 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -56,7 +56,7 @@ using std::array; using dauTracks = soa::Join; using v0Candidates = soa::Join; -using v0MCCandidates = soa::Join; +using v0MCCandidates = soa::Join; // simple checkers #define bitset(var, nbit) ((var) |= (1 << (nbit))) @@ -69,6 +69,7 @@ struct derivedlambdakzeroanalysis { Configurable analyseK0Short{"analyseK0Short", true, "process K0Short-like candidates"}; Configurable analyseLambda{"analyseLambda", true, "process Lambda-like candidates"}; Configurable analyseAntiLambda{"analyseAntiLambda", true, "process AntiLambda-like candidates"}; + Configurable calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "fill feeddown matrix if MC"}; // Selection criteria: acceptance Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; @@ -93,9 +94,11 @@ struct derivedlambdakzeroanalysis { // PID (TPC) Configurable TpcPidNsigmaCut{"TpcPidNsigmaCut", 5, "TpcPidNsigmaCut"}; - Configurable doQA{"doQA", true, "do topological variable QA histograms"}; + Configurable doCompleteQA{"doCompleteQA", false, "do topological variable QA histograms"}; + Configurable doPlainQA{"doPlainQA", true, "do simple 1D QA of candidates"}; Configurable qaMinPt{"qaMinPt", 0.0f, "minimum pT for QA plots"}; - Configurable qaMaxPt{"qaMaxPt", 0.0f, "maximum pT for QA plots"}; + Configurable qaMaxPt{"qaMaxPt", 1000.0f, "maximum pT for QA plots"}; + Configurable qaCentrality{"qaCentrality", false, "qa centrality flag: check base raw values"}; // for MC Configurable doMCAssociation{"doMCAssociation", true, "if MC, do MC association"}; @@ -104,11 +107,14 @@ struct derivedlambdakzeroanalysis { Configurable> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for analysis"}; + ConfigurableAxis axisPtXi{"axisPtXi", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for feeddown from Xi"}; ConfigurableAxis axisPtCoarse{"axisPtCoarse", {VARIABLE_WIDTH, 0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 7.0f, 10.0f, 15.0f}, "pt axis for QA"}; ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, ""}; ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.101f, 1.131f}, ""}; ConfigurableAxis axisCentrality{"axisCentrality", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f}, "Centrality"}; + ConfigurableAxis axisRawCentrality{"axisRawCentrality", {VARIABLE_WIDTH, 0.000f, 52.320f, 75.400f, 95.719f, 115.364f, 135.211f, 155.791f, 177.504f, 200.686f, 225.641f, 252.645f, 281.906f, 313.850f, 348.302f, 385.732f, 426.307f, 470.146f, 517.555f, 568.899f, 624.177f, 684.021f, 748.734f, 818.078f, 892.577f, 973.087f, 1058.789f, 1150.915f, 1249.319f, 1354.279f, 1465.979f, 1584.790f, 1710.778f, 1844.863f, 1985.746f, 2134.643f, 2291.610f, 2456.943f, 2630.653f, 2813.959f, 3006.631f, 3207.229f, 3417.641f, 3637.318f, 3865.785f, 4104.997f, 4354.938f, 4615.786f, 4885.335f, 5166.555f, 5458.021f, 5762.584f, 6077.881f, 6406.834f, 6746.435f, 7097.958f, 7462.579f, 7839.165f, 8231.629f, 8635.640f, 9052.000f, 9484.268f, 9929.111f, 10389.350f, 10862.059f, 11352.185f, 11856.823f, 12380.371f, 12920.401f, 13476.971f, 14053.087f, 14646.190f, 15258.426f, 15890.617f, 16544.433f, 17218.024f, 17913.465f, 18631.374f, 19374.983f, 20136.700f, 20927.783f, 21746.796f, 22590.880f, 23465.734f, 24372.274f, 25314.351f, 26290.488f, 27300.899f, 28347.512f, 29436.133f, 30567.840f, 31746.818f, 32982.664f, 34276.329f, 35624.859f, 37042.588f, 38546.609f, 40139.742f, 41837.980f, 43679.429f, 45892.130f, 400000.000f}, "raw centrality signal"}; // for QA + // topological variable QA axes ConfigurableAxis axisDCAtoPV{"axisDCAtoPV", {20, 0.0f, 1.0f}, "DCA (cm)"}; ConfigurableAxis axisDCAdau{"axisDCAdau", {20, 0.0f, 2.0f}, "DCA (cm)"}; @@ -119,6 +125,10 @@ struct derivedlambdakzeroanalysis { ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; ConfigurableAxis axisAPQt{"axisAPQt", {220, 0.0f, 0.5f}, "V0 AP alpha"}; + // Track quality axes + ConfigurableAxis axisTPCrows{"axisTPCrows", {160, 0.0f, 160.0f}, "N TPC rows"}; + ConfigurableAxis axisITSclus{"axisITSclus", {7, 0.0f, 7.0f}, "N ITS Clusters"}; + enum species { spK0Short = 0, spLambda, spAntiLambda }; @@ -140,9 +150,12 @@ struct derivedlambdakzeroanalysis { selNegGoodTPCTrack, selPosItsOnly, selNegItsOnly, - selConsiderK0Short, // for mc tagging - selConsiderLambda, // for mc tagging - selConsiderAntiLambda // for mc tagging + selConsiderK0Short, // for mc tagging + selConsiderLambda, // for mc tagging + selConsiderAntiLambda, // for mc tagging + selPhysPrimK0Short, // for mc tagging + selPhysPrimLambda, // for mc tagging + selPhysPrimAntiLambda // for mc tagging }; uint32_t maskTopological; @@ -161,6 +174,9 @@ struct derivedlambdakzeroanalysis { uint32_t maskSelectionLambda; uint32_t maskSelectionAntiLambda; + uint32_t secondaryMaskSelectionLambda; + uint32_t secondaryMaskSelectionAntiLambda; + void init(InitContext const&) { // initialise bit masks @@ -187,9 +203,14 @@ struct derivedlambdakzeroanalysis { maskLambdaSpecific = (1 << selLambdaRapidity) | (1 << selLambdaTPC) | (1 << selLambdaCTau) | (1 << selConsiderLambda); maskAntiLambdaSpecific = (1 << selLambdaRapidity) | (1 << selAntiLambdaTPC) | (1 << selLambdaCTau) | (1 << selConsiderAntiLambda); - maskSelectionK0Short = maskTopological | maskTrackTypes | maskK0ShortSpecific; - maskSelectionLambda = maskTopological | maskTrackTypes | maskLambdaSpecific; - maskSelectionAntiLambda = maskTopological | maskTrackTypes | maskAntiLambdaSpecific; + // Primary particle selection, central to analysis + maskSelectionK0Short = maskTopological | maskTrackTypes | maskK0ShortSpecific | (1 << selPhysPrimK0Short); + maskSelectionLambda = maskTopological | maskTrackTypes | maskLambdaSpecific | (1 << selPhysPrimLambda); + maskSelectionAntiLambda = maskTopological | maskTrackTypes | maskAntiLambdaSpecific | (1 << selPhysPrimAntiLambda); + + // No primary requirement for feeddown matrix + secondaryMaskSelectionLambda = maskTopological | maskTrackTypes | maskLambdaSpecific; + secondaryMaskSelectionAntiLambda = maskTopological | maskTrackTypes | maskAntiLambdaSpecific; // Event Counters histos.add("hEventSelection", "hEventSelection", kTH1F, {{3, -0.5f, +2.5f}}); @@ -199,6 +220,14 @@ struct derivedlambdakzeroanalysis { histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{100, 0.0f, +100.0f}}); + // for QA and test purposes + auto hRawCentrality = histos.add("hRawCentrality", "hRawCentrality", kTH1F, {axisRawCentrality}); + + for (int ii = 1; ii < 101; ii++) { + float value = 100.5f - static_cast(ii); + hRawCentrality->SetBinContent(ii, value); + } + // histograms versus mass if (analyseK0Short) histos.add("h3dMassK0Short", "h3dMassK0Short", kTH3F, {axisCentrality, axisPt, axisK0Mass}); @@ -207,11 +236,16 @@ struct derivedlambdakzeroanalysis { if (analyseAntiLambda) histos.add("h3dMassAntiLambda", "h3dMassAntiLambda", kTH3F, {axisCentrality, axisPt, axisLambdaMass}); + if (analyseLambda && calculateFeeddownMatrix && doprocessMonteCarlo) + histos.add("h3dLambdaFeeddown", "h3dLambdaFeeddown", kTH3F, {axisCentrality, axisPt, axisPtXi}); + if (analyseAntiLambda && calculateFeeddownMatrix && doprocessMonteCarlo) + histos.add("h3dAntiLambdaFeeddown", "h3dAntiLambdaFeeddown", kTH3F, {axisCentrality, axisPt, axisPtXi}); + // demo // fast histos.add("hMassK0Short", "hMassK0Short", kTH1F, {axisK0Mass}); // QA histograms if requested - if (doQA) { + if (doCompleteQA) { // initialize for K0short... if (analyseK0Short) { histos.add("K0Short/h4dPosDCAToPV", "h4dPosDCAToPV", kTHnF, {axisCentrality, axisPtCoarse, axisK0Mass, axisDCAtoPV}); @@ -234,11 +268,50 @@ struct derivedlambdakzeroanalysis { histos.add("AntiLambda/h4dPointingAngle", "h4dPointingAngle", kTHnF, {axisCentrality, axisPtCoarse, axisLambdaMass, axisPointingAngle}); histos.add("AntiLambda/h4dV0Radius", "h4dV0Radius", kTHnF, {axisCentrality, axisPtCoarse, axisLambdaMass, axisV0Radius}); } + } - // Check if doing the right thing in AP space please - histos.add("GeneralQA/h2dArmenterosAll", "h2dArmenterosAll", kTH2F, {axisAPAlpha, axisAPQt}); - histos.add("GeneralQA/h2dArmenterosSelected", "h2dArmenterosSelected", kTH2F, {axisAPAlpha, axisAPQt}); + if (doPlainQA) { + // All candidates received + histos.add("hPosDCAToPV", "hPosDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("hNegDCAToPV", "hNegDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("hDCADaughters", "hDCADaughters", kTH1F, {axisDCAdau}); + histos.add("hPointingAngle", "hPointingAngle", kTH1F, {axisPointingAngle}); + histos.add("hV0Radius", "hV0Radius", kTH1F, {axisV0Radius}); + histos.add("h2dPositiveITSvsTPCpts", "h2dPositiveITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + histos.add("h2dNegativeITSvsTPCpts", "h2dNegativeITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + + if (analyseK0Short) { + histos.add("K0Short/hPosDCAToPV", "hPosDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("K0Short/hNegDCAToPV", "hNegDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("K0Short/hDCADaughters", "hDCADaughters", kTH1F, {axisDCAdau}); + histos.add("K0Short/hPointingAngle", "hPointingAngle", kTH1F, {axisPointingAngle}); + histos.add("K0Short/hV0Radius", "hV0Radius", kTH1F, {axisV0Radius}); + histos.add("K0Short/h2dPositiveITSvsTPCpts", "h2dPositiveITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + histos.add("K0Short/h2dNegativeITSvsTPCpts", "h2dNegativeITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + } + if (analyseLambda) { + histos.add("Lambda/hPosDCAToPV", "hPosDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("Lambda/hNegDCAToPV", "hNegDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("Lambda/hDCADaughters", "hDCADaughters", kTH1F, {axisDCAdau}); + histos.add("Lambda/hPointingAngle", "hPointingAngle", kTH1F, {axisPointingAngle}); + histos.add("Lambda/hV0Radius", "hV0Radius", kTH1F, {axisV0Radius}); + histos.add("Lambda/h2dPositiveITSvsTPCpts", "h2dPositiveITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + histos.add("Lambda/h2dNegativeITSvsTPCpts", "h2dNegativeITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + } + if (analyseAntiLambda) { + histos.add("AntiLambda/hPosDCAToPV", "hPosDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("AntiLambda/hNegDCAToPV", "hNegDCAToPV", kTH1F, {axisDCAtoPV}); + histos.add("AntiLambda/hDCADaughters", "hDCADaughters", kTH1F, {axisDCAdau}); + histos.add("AntiLambda/hPointingAngle", "hPointingAngle", kTH1F, {axisPointingAngle}); + histos.add("AntiLambda/hV0Radius", "hV0Radius", kTH1F, {axisV0Radius}); + histos.add("AntiLambda/h2dPositiveITSvsTPCpts", "h2dPositiveITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + histos.add("AntiLambda/h2dNegativeITSvsTPCpts", "h2dNegativeITSvsTPCpts", kTH2F, {axisTPCrows, axisITSclus}); + } } + + // Check if doing the right thing in AP space please + histos.add("GeneralQA/h2dArmenterosAll", "h2dArmenterosAll", kTH2F, {axisAPAlpha, axisAPQt}); + histos.add("GeneralQA/h2dArmenterosSelected", "h2dArmenterosSelected", kTH2F, {axisAPAlpha, axisAPQt}); } template @@ -325,14 +398,20 @@ struct derivedlambdakzeroanalysis { uint32_t bitMap = 0; // check for specific particle species - if (v0.pdgCode() == 310 && v0.pdgCodePositive() == 211 && v0.pdgCodeNegative() == -211 && v0.isPhysicalPrimary()) { + if (v0.pdgCode() == 310 && v0.pdgCodePositive() == 211 && v0.pdgCodeNegative() == -211) { bitset(bitMap, selConsiderK0Short); + if (v0.isPhysicalPrimary()) + bitset(bitMap, selPhysPrimK0Short); } - if (v0.pdgCode() == 3122 && v0.pdgCodePositive() == 2212 && v0.pdgCodeNegative() == -211 && v0.isPhysicalPrimary()) { + if (v0.pdgCode() == 3122 && v0.pdgCodePositive() == 2212 && v0.pdgCodeNegative() == -211) { bitset(bitMap, selConsiderLambda); + if (v0.isPhysicalPrimary()) + bitset(bitMap, selPhysPrimLambda); } - if (v0.pdgCode() == -3122 && v0.pdgCodePositive() == 211 && v0.pdgCodeNegative() == -2212 && v0.isPhysicalPrimary()) { + if (v0.pdgCode() == -3122 && v0.pdgCodePositive() == 211 && v0.pdgCodeNegative() == -2212) { bitset(bitMap, selConsiderAntiLambda); + if (v0.isPhysicalPrimary()) + bitset(bitMap, selPhysPrimAntiLambda); } return bitMap; } @@ -342,70 +421,136 @@ struct derivedlambdakzeroanalysis { return (bitmap & mask) == mask; } - template - void analyseCandidate(TV0 v0, TCollision collision, uint32_t selMap) + template + void analyseCandidate(TV0 v0, float centrality, uint32_t selMap) // precalculate this information so that a check is one mask operation, not many { + auto posTrackExtra = v0.template posTrackExtra_as(); + auto negTrackExtra = v0.template negTrackExtra_as(); + + // __________________________________________ + // fill with no selection if plain QA requested + if (doPlainQA) { + histos.fill(HIST("hPosDCAToPV"), v0.dcapostopv()); + histos.fill(HIST("hNegDCAToPV"), v0.dcanegtopv()); + histos.fill(HIST("hDCADaughters"), v0.dcaV0daughters()); + histos.fill(HIST("hPointingAngle"), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("hV0Radius"), v0.v0radius()); + histos.fill(HIST("h2dPositiveITSvsTPCpts"), posTrackExtra.tpcCrossedRows(), posTrackExtra.itsNCls()); + histos.fill(HIST("h2dNegativeITSvsTPCpts"), negTrackExtra.tpcCrossedRows(), negTrackExtra.itsNCls()); + } + // __________________________________________ // main analysis if (verifyMask(selMap, maskSelectionK0Short) && analyseK0Short) { histos.fill(HIST("GeneralQA/h2dArmenterosSelected"), v0.alpha(), v0.qtarm()); // cross-check - histos.fill(HIST("h3dMassK0Short"), collision.centFT0C(), v0.pt(), v0.mK0Short()); + histos.fill(HIST("h3dMassK0Short"), centrality, v0.pt(), v0.mK0Short()); histos.fill(HIST("hMassK0Short"), v0.mK0Short()); + if (doPlainQA) { + histos.fill(HIST("K0Short/hPosDCAToPV"), v0.dcapostopv()); + histos.fill(HIST("K0Short/hNegDCAToPV"), v0.dcanegtopv()); + histos.fill(HIST("K0Short/hDCADaughters"), v0.dcaV0daughters()); + histos.fill(HIST("K0Short/hPointingAngle"), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("K0Short/hV0Radius"), v0.v0radius()); + histos.fill(HIST("K0Short/h2dPositiveITSvsTPCpts"), posTrackExtra.tpcCrossedRows(), posTrackExtra.itsNCls()); + histos.fill(HIST("K0Short/h2dNegativeITSvsTPCpts"), negTrackExtra.tpcCrossedRows(), negTrackExtra.itsNCls()); + } } if (verifyMask(selMap, maskSelectionLambda) && analyseLambda) { - histos.fill(HIST("h3dMassLambda"), collision.centFT0C(), v0.pt(), v0.mLambda()); + histos.fill(HIST("h3dMassLambda"), centrality, v0.pt(), v0.mLambda()); + if (doPlainQA) { + histos.fill(HIST("Lambda/hPosDCAToPV"), v0.dcapostopv()); + histos.fill(HIST("Lambda/hNegDCAToPV"), v0.dcanegtopv()); + histos.fill(HIST("Lambda/hDCADaughters"), v0.dcaV0daughters()); + histos.fill(HIST("Lambda/hPointingAngle"), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("Lambda/hV0Radius"), v0.v0radius()); + histos.fill(HIST("Lambda/h2dPositiveITSvsTPCpts"), posTrackExtra.tpcCrossedRows(), posTrackExtra.itsNCls()); + histos.fill(HIST("Lambda/h2dNegativeITSvsTPCpts"), negTrackExtra.tpcCrossedRows(), negTrackExtra.itsNCls()); + } } if (verifyMask(selMap, maskSelectionAntiLambda) && analyseAntiLambda) { - histos.fill(HIST("h3dMassAntiLambda"), collision.centFT0C(), v0.pt(), v0.mAntiLambda()); + histos.fill(HIST("h3dMassAntiLambda"), centrality, v0.pt(), v0.mAntiLambda()); + if (doPlainQA) { + histos.fill(HIST("AntiLambda/hPosDCAToPV"), v0.dcapostopv()); + histos.fill(HIST("AntiLambda/hNegDCAToPV"), v0.dcanegtopv()); + histos.fill(HIST("AntiLambda/hDCADaughters"), v0.dcaV0daughters()); + histos.fill(HIST("AntiLambda/hPointingAngle"), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("AntiLambda/hV0Radius"), v0.v0radius()); + histos.fill(HIST("AntiLambda/h2dPositiveITSvsTPCpts"), posTrackExtra.tpcCrossedRows(), posTrackExtra.itsNCls()); + histos.fill(HIST("AntiLambda/h2dNegativeITSvsTPCpts"), negTrackExtra.tpcCrossedRows(), negTrackExtra.itsNCls()); + } } // __________________________________________ // do systematics / qa plots - if (doQA) { + if (doCompleteQA) { if (analyseK0Short) { if (verifyMask(selMap, maskTopoNoV0Radius | maskK0ShortSpecific)) - histos.fill(HIST("K0Short/h4dV0Radius"), collision.centFT0C(), v0.pt(), v0.mK0Short(), v0.v0radius()); + histos.fill(HIST("K0Short/h4dV0Radius"), centrality, v0.pt(), v0.mK0Short(), v0.v0radius()); if (verifyMask(selMap, maskTopoNoDCAPosToPV | maskK0ShortSpecific)) - histos.fill(HIST("K0Short/h4dPosDCAToPV"), collision.centFT0C(), v0.pt(), v0.mK0Short(), TMath::Abs(v0.dcapostopv())); + histos.fill(HIST("K0Short/h4dPosDCAToPV"), centrality, v0.pt(), v0.mK0Short(), TMath::Abs(v0.dcapostopv())); if (verifyMask(selMap, maskTopoNoDCANegToPV | maskK0ShortSpecific)) - histos.fill(HIST("K0Short/h4dNegDCAToPV"), collision.centFT0C(), v0.pt(), v0.mK0Short(), TMath::Abs(v0.dcanegtopv())); + histos.fill(HIST("K0Short/h4dNegDCAToPV"), centrality, v0.pt(), v0.mK0Short(), TMath::Abs(v0.dcanegtopv())); if (verifyMask(selMap, maskTopoNoCosPA | maskK0ShortSpecific)) - histos.fill(HIST("K0Short/h4dPointingAngle"), collision.centFT0C(), v0.pt(), v0.mK0Short(), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("K0Short/h4dPointingAngle"), centrality, v0.pt(), v0.mK0Short(), TMath::ACos(v0.v0cosPA())); if (verifyMask(selMap, maskTopoNoDCAV0Dau | maskK0ShortSpecific)) - histos.fill(HIST("K0Short/h4dDCADaughters"), collision.centFT0C(), v0.pt(), v0.mK0Short(), v0.dcaV0daughters()); + histos.fill(HIST("K0Short/h4dDCADaughters"), centrality, v0.pt(), v0.mK0Short(), v0.dcaV0daughters()); } if (analyseLambda) { if (verifyMask(selMap, maskTopoNoV0Radius | maskLambdaSpecific)) - histos.fill(HIST("Lambda/h4dV0Radius"), collision.centFT0C(), v0.pt(), v0.mLambda(), v0.v0radius()); + histos.fill(HIST("Lambda/h4dV0Radius"), centrality, v0.pt(), v0.mLambda(), v0.v0radius()); if (verifyMask(selMap, maskTopoNoDCAPosToPV | maskLambdaSpecific)) - histos.fill(HIST("Lambda/h4dPosDCAToPV"), collision.centFT0C(), v0.pt(), v0.mLambda(), TMath::Abs(v0.dcapostopv())); + histos.fill(HIST("Lambda/h4dPosDCAToPV"), centrality, v0.pt(), v0.mLambda(), TMath::Abs(v0.dcapostopv())); if (verifyMask(selMap, maskTopoNoDCANegToPV | maskLambdaSpecific)) - histos.fill(HIST("Lambda/h4dNegDCAToPV"), collision.centFT0C(), v0.pt(), v0.mLambda(), TMath::Abs(v0.dcanegtopv())); + histos.fill(HIST("Lambda/h4dNegDCAToPV"), centrality, v0.pt(), v0.mLambda(), TMath::Abs(v0.dcanegtopv())); if (verifyMask(selMap, maskTopoNoCosPA | maskLambdaSpecific)) - histos.fill(HIST("Lambda/h4dPointingAngle"), collision.centFT0C(), v0.pt(), v0.mLambda(), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("Lambda/h4dPointingAngle"), centrality, v0.pt(), v0.mLambda(), TMath::ACos(v0.v0cosPA())); if (verifyMask(selMap, maskTopoNoDCAV0Dau | maskLambdaSpecific)) - histos.fill(HIST("Lambda/h4dDCADaughters"), collision.centFT0C(), v0.pt(), v0.mLambda(), v0.dcaV0daughters()); + histos.fill(HIST("Lambda/h4dDCADaughters"), centrality, v0.pt(), v0.mLambda(), v0.dcaV0daughters()); } if (analyseAntiLambda) { if (verifyMask(selMap, maskTopoNoV0Radius | maskAntiLambdaSpecific)) - histos.fill(HIST("AntiLambda/h4dV0Radius"), collision.centFT0C(), v0.pt(), v0.mAntiLambda(), v0.v0radius()); + histos.fill(HIST("AntiLambda/h4dV0Radius"), centrality, v0.pt(), v0.mAntiLambda(), v0.v0radius()); if (verifyMask(selMap, maskTopoNoDCAPosToPV | maskAntiLambdaSpecific)) - histos.fill(HIST("AntiLambda/h4dPosDCAToPV"), collision.centFT0C(), v0.pt(), v0.mAntiLambda(), TMath::Abs(v0.dcapostopv())); + histos.fill(HIST("AntiLambda/h4dPosDCAToPV"), centrality, v0.pt(), v0.mAntiLambda(), TMath::Abs(v0.dcapostopv())); if (verifyMask(selMap, maskTopoNoDCANegToPV | maskAntiLambdaSpecific)) - histos.fill(HIST("AntiLambda/h4dNegDCAToPV"), collision.centFT0C(), v0.pt(), v0.mAntiLambda(), TMath::Abs(v0.dcanegtopv())); + histos.fill(HIST("AntiLambda/h4dNegDCAToPV"), centrality, v0.pt(), v0.mAntiLambda(), TMath::Abs(v0.dcanegtopv())); if (verifyMask(selMap, maskTopoNoCosPA | maskAntiLambdaSpecific)) - histos.fill(HIST("AntiLambda/h4dPointingAngle"), collision.centFT0C(), v0.pt(), v0.mAntiLambda(), TMath::ACos(v0.v0cosPA())); + histos.fill(HIST("AntiLambda/h4dPointingAngle"), centrality, v0.pt(), v0.mAntiLambda(), TMath::ACos(v0.v0cosPA())); if (verifyMask(selMap, maskTopoNoDCAV0Dau | maskAntiLambdaSpecific)) - histos.fill(HIST("AntiLambda/h4dDCADaughters"), collision.centFT0C(), v0.pt(), v0.mAntiLambda(), v0.dcaV0daughters()); + histos.fill(HIST("AntiLambda/h4dDCADaughters"), centrality, v0.pt(), v0.mAntiLambda(), v0.dcaV0daughters()); } } // end systematics / qa } + template + void fillFeeddownMatrix(TV0 v0, float centrality, uint32_t selMap) + // fill feeddown matrix for Lambdas or AntiLambdas + // fixme: a potential improvement would be to consider mass windows for the l/al + { + if (!v0.has_motherMCPart()) + return; // does not have mother particle in record, skip + + auto v0mother = v0.motherMCPart(); + float rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXiMinus); + if (fabs(rapidityXi) > 0.5f) + return; // not a valid mother rapidity (PDG selection is later) + + // __________________________________________ + if (verifyMask(selMap, secondaryMaskSelectionLambda) && analyseLambda) { + if (v0mother.pdgCode() == 3312 && v0mother.isPhysicalPrimary()) + histos.fill(HIST("h3dLambdaFeeddown"), centrality, v0.pt(), std::hypot(v0mother.px(), v0mother.py())); + } + if (verifyMask(selMap, secondaryMaskSelectionAntiLambda) && analyseAntiLambda) { + if (v0mother.pdgCode() == -3312 && v0mother.isPhysicalPrimary()) + histos.fill(HIST("h3dAntiLambdaFeeddown"), centrality, v0.pt(), std::hypot(v0mother.px(), v0mother.py())); + } + } + // ______________________________________________________ // Real data processing - no MC subscription - void processRealData(soa::Join::iterator const& collision, v0Candidates const& fullV0s, dauTracks const&) + void processRealData(soa::Join::iterator const& collision, v0Candidates const& fullV0s, dauTracks const&) { histos.fill(HIST("hEventSelection"), 0. /* all collisions */); if (!collision.sel8()) { @@ -417,7 +562,14 @@ struct derivedlambdakzeroanalysis { return; } histos.fill(HIST("hEventSelection"), 2 /* vertex-Z selected */); - histos.fill(HIST("hEventCentrality"), collision.centFT0C()); + + float centrality = collision.centFT0C(); + if (qaCentrality) { + auto hRawCentrality = histos.get(HIST("hRawCentrality")); + centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); + } + + histos.fill(HIST("hEventCentrality"), centrality); // __________________________________________ // perform main analysis @@ -432,14 +584,15 @@ struct derivedlambdakzeroanalysis { // consider for histograms for all species selMap = selMap | (1 << selConsiderK0Short) | (1 << selConsiderLambda) | (1 << selConsiderAntiLambda); + selMap = selMap | (1 << selPhysPrimK0Short) | (1 << selPhysPrimLambda) | (1 << selPhysPrimAntiLambda); - analyseCandidate(v0, collision, selMap); + analyseCandidate(v0, centrality, selMap); } // end v0 loop } // ______________________________________________________ // Simulated processing (subscribes to MC information too) - void processMonteCarlo(soa::Join::iterator const& collision, v0MCCandidates const& fullV0s, dauTracks const&) + void processMonteCarlo(soa::Join::iterator const& collision, v0MCCandidates const& fullV0s, dauTracks const&, aod::MotherMCParts const&) { histos.fill(HIST("hEventSelection"), 0. /* all collisions */); if (!collision.sel8()) { @@ -451,7 +604,14 @@ struct derivedlambdakzeroanalysis { return; } histos.fill(HIST("hEventSelection"), 2 /* vertex-Z selected */); - histos.fill(HIST("hEventCentrality"), collision.centFT0C()); + + float centrality = collision.centFT0C(); + if (qaCentrality) { + auto hRawCentrality = histos.get(HIST("hRawCentrality")); + centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); + } + + histos.fill(HIST("hEventCentrality"), centrality); // __________________________________________ // perform main analysis @@ -463,15 +623,19 @@ struct derivedlambdakzeroanalysis { histos.fill(HIST("GeneralQA/h2dArmenterosAll"), v0.alpha(), v0.qtarm()); uint32_t selMap = computeReconstructionBitmap(v0, collision); + selMap = selMap | computeMCAssociation(v0); + + // feeddown matrix always with association + if (calculateFeeddownMatrix) + fillFeeddownMatrix(v0, centrality, selMap); - // consider only associated candidates if asked to do so - if (doMCAssociation) { - selMap = selMap | computeMCAssociation(v0); - } else { + // consider only associated candidates if asked to do so, disregard association + if (!doMCAssociation) { selMap = selMap | (1 << selConsiderK0Short) | (1 << selConsiderLambda) | (1 << selConsiderAntiLambda); + selMap = selMap | (1 << selPhysPrimK0Short) | (1 << selPhysPrimLambda) | (1 << selPhysPrimAntiLambda); } - analyseCandidate(v0, collision, selMap); + analyseCandidate(v0, centrality, selMap); } // end v0 loop } From 01d5ef06bc8e3478e3712b2ca22b36928aa24268 Mon Sep 17 00:00:00 2001 From: Chiara De Martin <39315597+ChiaraDeMartin95@users.noreply.github.com> Date: Sat, 10 Feb 2024 09:32:24 +0100 Subject: [PATCH 04/26] First version of cascadeflow (#4652) * first commit of task forcascade flow analysis * fix to make it run over strangeness derived data * add process MC * add selection on cascade candidates for signal training * Formatting and fix cut counter Co-authored-by: Maximiliano Puccio * Please consider the following formatting changes --------- Co-authored-by: Chiara De Martin Co-authored-by: Maximiliano Puccio Co-authored-by: ALICE Action Bot --- PWGLF/DataModel/cascqaanalysis.h | 4 + PWGLF/TableProducer/CMakeLists.txt | 5 + PWGLF/TableProducer/cascadeflow.cxx | 216 ++++++++++++++++++++++++++++ 3 files changed, 225 insertions(+) create mode 100644 PWGLF/TableProducer/cascadeflow.cxx diff --git a/PWGLF/DataModel/cascqaanalysis.h b/PWGLF/DataModel/cascqaanalysis.h index c5377b201fa..edbf9a42c32 100644 --- a/PWGLF/DataModel/cascqaanalysis.h +++ b/PWGLF/DataModel/cascqaanalysis.h @@ -129,6 +129,10 @@ DECLARE_SOA_TABLE(MyCascades, "AOD", "MYCASCADES", o2::soa::Index<>, mycascades::IsINELgt0, mycascades::IsINELgt1); +DECLARE_SOA_TABLE(CascTraining, "AOD", "CascTraining", o2::soa::Index<>, + mycascades::MultFT0M, mycascades::Sign, mycascades::Pt, mycascades::Eta, mycascades::MassXi, mycascades::MassOmega, mycascades::MassLambdaDau, mycascades::CascRadius, mycascades::V0Radius, mycascades::CascCosPA, mycascades::V0CosPA, mycascades::DCAPosToPV, mycascades::DCANegToPV, + mycascades::DCABachToPV, mycascades::DCACascDaughters, mycascades::DCAV0Daughters, mycascades::DCAV0ToPV, mycascades::BachBaryonCosPA, mycascades::BachBaryonDCAxyToPV, mycascades::McPdgCode); + namespace myMCcascades { diff --git a/PWGLF/TableProducer/CMakeLists.txt b/PWGLF/TableProducer/CMakeLists.txt index d3a58259240..0074e9b6b05 100644 --- a/PWGLF/TableProducer/CMakeLists.txt +++ b/PWGLF/TableProducer/CMakeLists.txt @@ -172,6 +172,11 @@ o2physics_add_dpl_workflow(cascqaanalysis PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(cascadeflow + SOURCES cascadeflow.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # Spectra o2physics_add_dpl_workflow(spectra-derived SOURCES spectraDerivedMaker.cxx diff --git a/PWGLF/TableProducer/cascadeflow.cxx b/PWGLF/TableProducer/cascadeflow.cxx new file mode 100644 index 00000000000..a9a16880adc --- /dev/null +++ b/PWGLF/TableProducer/cascadeflow.cxx @@ -0,0 +1,216 @@ +// 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. +/// +/// \brief Task to create derived data for cascade flow analyses +/// \authors: Chiara De Martin (chiara.de.martin@cern.ch), Maximiliano Puccio (maximiliano.puccio@cern.ch) + +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "PWGLF/DataModel/cascqaanalysis.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "TRandom3.h" +#include "Framework/ASoAHelpers.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using std::array; + +using DauTracks = soa::Join; + +namespace cascadev2 +{ +enum species { Xi = 0, + Omega = 1 }; +constexpr double massSigmaParameters[4][2]{ + {4.9736e-3, 0.006815}, + {-2.39594, -2.257}, + {1.8064e-3, 0.00138}, + {1.03468e-1, 0.1898}}; +static const std::vector massSigmaParameterNames{"p0", "p1", "p2", "p3"}; +static const std::vector speciesNames{"Xi", "Omega"}; +} // namespace cascadev2 + +struct cascadeFlow { + + Configurable sideBandStart{"sideBandStart", 5, "Start of the sideband region in number of sigmas"}; + Configurable sideBandEnd{"sideBandEnd", 7, "End of the sideband region in number of sigmas"}; + Configurable downsample{"downsample", 1., "Downsample training output tree"}; + Configurable doNTPCSigmaCut{"doNTPCSigmaCut", 1, "doNtpcSigmaCut"}; + Configurable nsigmatpcPr{"nsigmatpcPr", 5, "nsigmatpcPr"}; + Configurable nsigmatpcPi{"nsigmatpcPi", 5, "nsigmatpcPi"}; + Configurable mintpccrrows{"mintpccrrows", 3, "mintpccrrows"}; + + template + bool IsCascAccepted(TCascade casc, TDaughter negExtra, TDaughter posExtra, TDaughter bachExtra, int& counter) // loose cuts on topological selections of cascades + { + // TPC cuts as those implemented for the training of the signal + if (doNTPCSigmaCut) { + if (casc.sign() < 0) { + if (std::abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi) + return false; + } else if (casc.sign() > 0) { + if (std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi || std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr) + return false; + } + } + counter++; + + if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows || bachExtra.tpcCrossedRows() < mintpccrrows) + return false; + + counter++; + return true; + } + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Tables to produce + Produces trainingSample; + Configurable> parSigmaMass{ + "parSigmaMass", + {cascadev2::massSigmaParameters[0], 4, 2, + cascadev2::massSigmaParameterNames, cascadev2::speciesNames}, + "Mass resolution parameters: [0]*exp([1]*x)+[2]*exp([3]*x)"}; + + float getNsigmaMass(const cascadev2::species s, const float pt, const float nsigma = 6) + { + const auto sigma = parSigmaMass->get(0u, s) * exp(parSigmaMass->get(1, s) * pt) + parSigmaMass->get(2, s) * exp(parSigmaMass->get(3, s) * pt); + return nsigma * sigma; + } + + template + void fillTrainingTable(collision_t coll, cascade_t casc, int pdgCode) + { + trainingSample(coll.centFT0M(), + casc.sign(), + casc.pt(), + casc.eta(), + casc.mXi(), + casc.mOmega(), + casc.mLambda(), + casc.cascradius(), + casc.v0radius(), + casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()), + casc.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), + casc.dcapostopv(), + casc.dcanegtopv(), + casc.dcabachtopv(), + casc.dcacascdaughters(), + casc.dcaV0daughters(), + casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ()), + casc.bachBaryonCosPA(), + casc.bachBaryonDCAxyToPV(), + pdgCode); + } + + void init(InitContext const&) + { + ConfigurableAxis vertexZ{"vertexZ", {20, -10, 10}, "vertex axis for histograms"}; + histos.add("hEventVertexZ", "hEventVertexZ", kTH1F, {vertexZ}); + histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{101, 0, 101}}); + histos.add("hEventSelection", "hEventSelection", kTH1F, {{4, 0, 4}}); + histos.add("hCandidate", "hCandidate", HistType::kTH1D, {{22, -0.5, 21.5}}); + histos.add("hCascadeSignal", "hCascadeSignal", HistType::kTH1D, {{6, -0.5, 5.5}}); + } + + void processTrainingBackground(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) + { + + int counter = 0; + + if (!coll.sel8() || std::abs(coll.posZ()) > 10.) { + return; + } + + for (auto& casc : Cascades) { + if (gRandom->Uniform() > downsample) { + continue; + } + + float sigmaRangeXi[2]{getNsigmaMass(cascadev2::Xi, casc.pt(), sideBandStart), getNsigmaMass(cascadev2::Xi, casc.pt(), sideBandEnd)}; + float sigmaRangeOmega[2]{getNsigmaMass(cascadev2::Omega, casc.pt(), sideBandStart), getNsigmaMass(cascadev2::Omega, casc.pt(), sideBandEnd)}; + + if ((std::abs(casc.mXi() - constants::physics::MassXiMinus) < sigmaRangeXi[0] || + std::abs(casc.mXi() - constants::physics::MassXiMinus) > sigmaRangeXi[1]) && + (std::abs(casc.mOmega() - constants::physics::MassOmegaMinus) < sigmaRangeOmega[0] || + std::abs(casc.mOmega() - constants::physics::MassOmegaMinus) > sigmaRangeOmega[1])) { + continue; + } + + /// Add some minimal cuts for single track variables (min number of TPC clusters) + auto negExtra = casc.negTrackExtra_as>(); + auto posExtra = casc.posTrackExtra_as>(); + auto bachExtra = casc.bachTrackExtra_as>(); + + if (doNTPCSigmaCut) { + if (casc.sign() < 0) { + if (std::abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || std::abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else if (casc.sign() > 0) { + if (std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi || std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } + } else + ++counter; + + if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows || bachExtra.tpcCrossedRows() < mintpccrrows) + continue; + histos.fill(HIST("hCandidate"), ++counter); + + fillTrainingTable(coll, casc, 0); + } + } + + void processTrainingSignal(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&) + { + + if (!coll.sel8() || std::abs(coll.posZ()) > 10.) { + return; + } + + for (auto& casc : Cascades) { + int pdgCode{casc.pdgCode()}; + if (!(std::abs(pdgCode) == 3312 && std::abs(casc.pdgCodeV0()) == 3122 && std::abs(casc.pdgCodeBachelor() == 211)) // Xi + && !(std::abs(pdgCode) == 3334 && std::abs(casc.pdgCodeV0()) == 3122 && std::abs(casc.pdgCodeBachelor() == 321))) // Omega + continue; + + auto negExtra = casc.negTrackExtra_as>(); + auto posExtra = casc.posTrackExtra_as>(); + auto bachExtra = casc.bachTrackExtra_as>(); + + int counter = 0; + IsCascAccepted(casc, negExtra, posExtra, bachExtra, counter); + histos.fill(HIST("hCascadeSignal"), counter); + + // PDG cascades + fillTrainingTable(coll, casc, pdgCode); + } + } + + PROCESS_SWITCH(cascadeFlow, processTrainingBackground, "Process to create the training dataset for the background", true); + PROCESS_SWITCH(cascadeFlow, processTrainingSignal, "Process to create the training dataset for the signal", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"lf-cascade-flow"})}; +} From b0955ff03edae91b652993a9e05815d35435d2ac Mon Sep 17 00:00:00 2001 From: Yash Patley <52608802+yashpatley@users.noreply.github.com> Date: Sun, 11 Feb 2024 03:10:52 +0530 Subject: [PATCH 05/26] PWGLF: Update lambda1520SpherocityAnalysis.cxx (#4663) --- .../lambda1520SpherocityAnalysis.cxx | 78 ++++++++++++------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520SpherocityAnalysis.cxx b/PWGLF/Tasks/Resonances/lambda1520SpherocityAnalysis.cxx index fde61fb0af9..7805b66f281 100644 --- a/PWGLF/Tasks/Resonances/lambda1520SpherocityAnalysis.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520SpherocityAnalysis.cxx @@ -10,9 +10,7 @@ // or submit itself to any jurisdiction. /// \file lambda1520_spherocity_analysis.cxx -/// \brief Produce Spherocity table. -/// Invariant Mass Reconstruction of Lambda(1520) Resonance. -/// +/// \brief Invariant Mass Reconstruction of Lambda(1520) Resonance /// \author Yash Patley #include @@ -49,11 +47,15 @@ struct lambdaAnalysis { Configurable cEtaCut{"cEtaCut", 0.8, "Pseudorapidity cut"}; Configurable cDcaz{"cDcazMin", 1., "Minimum DCAz"}; Configurable cDcaxy{"cDcaxyMin", 0.1, "Minimum DCAxy"}; - Configurable cKinCuts{"cKinCuts", false, "Kinematic Cuts for p-K pair opening angle"}; Configurable cPrimaryTrack{"cPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable cGlobalWoDCATrack{"cGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) Configurable cPVContributor{"cPVContributor", true, "PV contributor track selection"}; // PV Contriuibutor + // Kinematics cuts + Configurable cKinCuts{"cKinCuts", true, "Kinematic Cuts for p-K pair opening angle"}; + Configurable> cKinCutsPt{"cKinCutsPt", {0.0, 0.8, 1.2, 1.6, 2.0, 9999999999.}, "p_{T} of L* for kinematic cuts"}; + Configurable> cKinCutsAlpha{"cKinCutsAlpha", {3.0, 1.8, 1.4, 1.0, 0.8}, "Opening angle of p-K of L*"}; + // PID Selections Configurable cUseOnlyTOFTrackPr{"cUseOnlyTOFTrackPr", false, "Use only TOF track for PID selection"}; // Use only TOF track for Proton PID selection Configurable cUseOnlyTOFTrackKa{"cUseOnlyTOFTrackKa", false, "Use only TOF track for PID selection"}; // Use only TOF track for Kaon PID selection @@ -70,8 +72,8 @@ struct lambdaAnalysis { Configurable cMaxTPCnSigmaKaon{"cMaxTPCnSigmaKaon", 4.0, "TPC nSigma cut for Kaon"}; // TPC Configurable cMaxTOFnSigmaKaon{"cMaxTOFnSigmaKaon", 3.0, "TOF nSigma cut for Kaon"}; // TOF Configurable nsigmaCutCombinedKaon{"nsigmaCutCombinedKaon", 3.0, "Combined nSigma cut for Kaon"}; // Combined - Configurable> kaonTPCPIDp{"kaonTPCPIDp", {0.15, 0.3, 0.35, 0.40}, "p dependent TPC cuts kaons"}; - Configurable> kaonTPCPIDcut{"kaonTPCPIDcut", {5., 4., 3.}, "TPC nsigma cuts kaons"}; + Configurable> kaonTPCPIDp{"kaonTPCPIDp", {0.15, 0.3, 0.35, 0.40, 0.54}, "p dependent TPC cuts kaons"}; + Configurable> kaonTPCPIDcut{"kaonTPCPIDcut", {5., 4., 3., 2.}, "TPC nsigma cuts kaons"}; // Event Mixing. Configurable cMixSph{"cMixSph", true, "Include Sph Bins to be mixed"}; Configurable cNumMixEv{"cNumMixEv", 20, "Number of Events to be mixed"}; @@ -92,6 +94,7 @@ struct lambdaAnalysis { const AxisSpec axisP_pid(600, 0., 6., "p (GeV/c)"); const AxisSpec axisPt_pid(600, 0., 6., "p_{T} (GeV/c)"); const AxisSpec axisPt(nBinsPt, 0., 10., "p_{T} (GeV/c)"); + const AxisSpec axisAlpha(200, 0 - 0.15, 2 * TMath::Pi() + 0.15, "#alpha"); const AxisSpec axisEta(40, -1, 1, "#eta"); const AxisSpec axisPhi(128, -0.05, 6.35, "#phi (rad)"); const AxisSpec axisDCAz(500, -0.5, 0.5, {"DCA_{z} (cm)"}); @@ -117,28 +120,28 @@ struct lambdaAnalysis { histos.add("QAbefore/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma^{TPC} vs n#sigma^{TOF} Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); // QA After - histos.add("QAafter/Proton/h1d_pr_pt", "p_{T}-spectra Protons", kTH1F, {axisPt_pid}); - histos.add("QAafter/Proton/h2d_pr_dca_z", "dca_{z} Protons", kTH2F, {axisPt_pid, axisDCAz}); - histos.add("QAafter/Proton/h2d_pr_dca_xy", "dca_{xy} Protons", kTH2F, {axisPt_pid, axisDCAxy}); + histos.add("QAafter/Proton/h2d_pr_dca_z", "Protons", kTH2F, {axisPt_pid, axisDCAz}); + histos.add("QAafter/Proton/h2d_pr_dca_xy", "Protons", kTH2F, {axisPt_pid, axisDCAxy}); histos.add("QAafter/Proton/h2d_pr_dEdx_p", "TPC Signal Protons", kTH2F, {axisP_pid, axisdEdx}); - histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_pt", " Protons", kTH2F, {axisPt_pid, axisTPCNsigma}); - histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_p", " Protons", kTH2F, {axisP_pid, axisTPCNsigma}); - histos.add("QAafter/Proton/h2d_pr_nsigma_tof_pt", " Protons", kTH2F, {axisPt_pid, axisTOFNsigma}); - histos.add("QAafter/Proton/h2d_pr_nsigma_tof_p", " Protons", kTH2F, {axisP_pid, axisTOFNsigma}); + histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_pt", "Protons", kTH2F, {axisPt_pid, axisTPCNsigma}); + histos.add("QAafter/Proton/h2d_pr_nsigma_tpc_p", "Protons", kTH2F, {axisP_pid, axisTPCNsigma}); + histos.add("QAafter/Proton/h2d_pr_nsigma_tof_pt", "Protons", kTH2F, {axisPt_pid, axisTOFNsigma}); + histos.add("QAafter/Proton/h2d_pr_nsigma_tof_p", "Protons", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); - histos.add("QAafter/Kaon/h1d_ka_pt", "p_{T}-spectra Kaons", kTH1F, {axisPt_pid}); - histos.add("QAafter/Kaon/h2d_ka_dca_z", "dca_{z} Kaons", kTH2F, {axisPt_pid, axisDCAz}); - histos.add("QAafter/Kaon/h2d_ka_dca_xy", "dca_{xy} Kaons", kTH2F, {axisPt_pid, axisDCAxy}); + histos.add("QAafter/Kaon/h2d_ka_dca_z", "Kaons", kTH2F, {axisPt_pid, axisDCAz}); + histos.add("QAafter/Kaon/h2d_ka_dca_xy", "Kaons", kTH2F, {axisPt_pid, axisDCAxy}); histos.add("QAafter/Kaon/h2d_ka_dEdx_p", "TPC Signal Kaon", kTH2F, {axisP_pid, axisdEdx}); - histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_pt", " Kaons", kTH2F, {axisPt_pid, axisTPCNsigma}); - histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_p", " Kaons", kTH2F, {axisP_pid, axisTPCNsigma}); - histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_pt", " Kaons", kTH2F, {axisPt_pid, axisTOFNsigma}); - histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_p", " Kaons", kTH2F, {axisP_pid, axisTOFNsigma}); + histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_pt", "Kaons", kTH2F, {axisPt_pid, axisTPCNsigma}); + histos.add("QAafter/Kaon/h2d_ka_nsigma_tpc_p", "Kaons", kTH2F, {axisP_pid, axisTPCNsigma}); + histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_pt", "Kaons", kTH2F, {axisPt_pid, axisTOFNsigma}); + histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_p", "Kaons", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); // QA checks for protons and kaons histos.add("QAChecks/h1d_pr_pt", "p_{T}-spectra Protons", kTH1F, {axisPt_pid}); histos.add("QAChecks/h1d_ka_pt", "p_{T}-spectra Kaons", kTH1F, {axisPt_pid}); + histos.add("QAChecks/h2d_lstar_alpha_vs_pt", "#alpha_{oa} vs p_{T} Before Cuts", kTH2F, {axisPt, axisAlpha}); + histos.add("QAChecks/h2d_sel_kincuts_lstar_alpha_vs_pt", "#alpha_{oa} vs p_{T} After Cuts", kTH2F, {axisPt, axisAlpha}); // Analysis // Lambda Invariant Mass @@ -324,6 +327,30 @@ struct lambdaAnalysis { return false; } + // kinematic cuts method + template + bool kinCuts(trackType trkPr, trackType trkKa, T p, float& alpha) + { + // initialize + std::vector kinCutsPt = static_cast>(cKinCutsPt); + std::vector kinCutsAlpha = static_cast>(cKinCutsAlpha); + int kinCutsSize = static_cast(kinCutsAlpha.size()); + + TVector3 v1(trkPr.px(), trkPr.py(), trkPr.pz()); + TVector3 v2(trkKa.px(), trkKa.py(), trkKa.pz()); + alpha = v1.Angle(v2); + + histos.fill(HIST("QAChecks/h2d_lstar_alpha_vs_pt"), p.Pt(), alpha); + + for (int i = 0; i < kinCutsSize; ++i) { + if ((p.Pt() > kinCutsPt[i] && p.Pt() <= kinCutsPt[i + 1]) && (alpha > kinCutsAlpha[i])) { + return false; + } + } + + return true; + } + template void fillDataHistos(trackType const& trk1, trackType const& trk2, float const& sph, float const& mult) { @@ -368,7 +395,6 @@ struct lambdaAnalysis { // Fill QA after track selection. if constexpr (!mix) { // Proton - histos.fill(HIST("QAafter/Proton/h1d_pr_pt"), trkPr.pt()); histos.fill(HIST("QAafter/Proton/h2d_pr_dca_z"), trkPr.pt(), trkPr.dcaZ()); histos.fill(HIST("QAafter/Proton/h2d_pr_dca_xy"), trkPr.pt(), trkPr.dcaXY()); histos.fill(HIST("QAafter/Proton/h2d_pr_dEdx_p"), p_ptot, trkPr.tpcSignal()); @@ -380,7 +406,6 @@ struct lambdaAnalysis { histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc"), trkPr.tpcNSigmaPr(), trkPr.tofNSigmaPr()); } // Kaon - histos.fill(HIST("QAafter/Kaon/h1d_ka_pt"), trkKa.pt()); histos.fill(HIST("QAafter/Kaon/h2d_ka_dca_z"), trkKa.pt(), trkKa.dcaZ()); histos.fill(HIST("QAafter/Kaon/h2d_ka_dca_xy"), trkKa.pt(), trkKa.dcaXY()); histos.fill(HIST("QAafter/Kaon/h2d_ka_dEdx_p"), k_ptot, trkKa.tpcSignal()); @@ -403,11 +428,12 @@ struct lambdaAnalysis { // Apply kinematic cuts. if (cKinCuts) { - TVector3 v1(trkPr.px(), trkPr.py(), trkPr.pz()); - TVector3 v2(trkKa.px(), trkKa.py(), trkKa.pz()); - float alpha = v1.Angle(v2); - if (alpha > 1.4 && alpha < 2.4) + float alpha = 0; + bool kinCutFlag = kinCuts(trkPr, trkKa, p, alpha); + if (!kinCutFlag) { continue; + } + histos.fill(HIST("QAChecks/h2d_sel_kincuts_lstar_alpha_vs_pt"), p.Pt(), alpha); } // Fill Invariant Mass Histograms. From 07d565ce58f48439b5f2b8d9c0c5f66fc462f929 Mon Sep 17 00:00:00 2001 From: R-Rohith <92912027+R-Rohith@users.noreply.github.com> Date: Sun, 11 Feb 2024 06:28:01 +0530 Subject: [PATCH 06/26] Update r2p2-4-id.cxx (#4658) * Update r2p2-4-id.cxx Condensed the PID functions into one common template accepting the Configurable cuts. Added Process for MC data to check PID efficiency. Reduced the r2p2 task to now run for one kind of identified pair at a time. Also added functionality to find cross-correlations between two pt ranges. * Update r2p2-4-id.cxx --- .../Tasks/r2p2-4-id.cxx | 681 +++++++++--------- 1 file changed, 333 insertions(+), 348 deletions(-) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx b/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx index 017fdaebe86..df39f019cf1 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/r2p2-4-id.cxx @@ -20,72 +20,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -//-----PID Functions----------------------------------------------------------- -template -bool NO_PID(T track) -{ - return true; -} -template -bool PID_PION(T track) -{ - float tpccut = 2.5, tofcut = 2.5; - if (fabs(track.tpcNSigmaPi()) >= tpccut) - return false; - if (track.pt() >= 0.6) { - if (track.hasTOF()) { - if (fabs(track.tofNSigmaPi()) >= tofcut) - return false; - } else { - return false; - } - } - return true; -} -template -bool PID_KAON(T track) -{ - float tpccut = 2, tofcut = 2; - if (track.pt() < 0.6) { - if (track.pt() < 0.45) - tpccut = 2; - else if (track.pt() < 0.55) - tpccut = 1; - else - tpccut = 0.6; - if (fabs(track.tpcNSigmaKa()) > tpccut) - return false; - } else if (track.hasTOF()) { - if ((fabs(track.tpcNSigmaKa()) > tpccut) || (fabs(track.tofNSigmaKa()) > tofcut)) - return false; - } else { - return false; - } - return true; -} -template -bool PID_PROTON(T track) -{ - float tpccut = 2.2, tofcut = 2; - if (track.pt() < 1.1) { - if (track.pt() < 0.85) - tpccut = 2.2; - else - tpccut = 1; - if (fabs(track.tpcNSigmaPr()) > tpccut) - return false; - } else if (track.hasTOF()) { - if ((fabs(track.tpcNSigmaPr()) > tpccut) || (fabs(track.tofNSigmaPr()) > tofcut)) - return false; - } else { - return false; - } - return true; -} -//----------------------------------------------------------------------------- -template -bool (*pidarray[4])(T) = {NO_PID, PID_PION, PID_KAON, PID_PROTON}; // Array of PID functions - namespace o2::aod { namespace idr2p2columns @@ -95,350 +29,401 @@ DECLARE_SOA_COLUMN(BinNPIDFlag, binNpid, int8_t); // Flag tracks without proper DECLARE_SOA_TABLE(Flags, "AOD", "Flags", idr2p2columns::BinNPIDFlag); } // namespace o2::aod struct FillFlagsTable { - Produces ftable; + Configurable> TPCnsigmacutsPi{"TPCnsigmacutsPi", {2.5}, "TPC Nsigma cuts for Pion"}; + Configurable> TPCpTrangesPi{"TPCpTrangesPi", {2}, "TPC pT ranges for Pion"}; + Configurable> TOFnsigmacutsPi{"TOFnsigmacutsPi", {2.5}, "TOF Nsigma cuts for Pion"}; + Configurable> TOFpTrangesPi{"TOFpTrangesPi", {0.6}, "TOF pT ranges for Pion"}; + Configurable> TPCnsigmacutsKa{"TPCnsigmacutsKa", {2, 1, 0.6, 2}, "TPC Nsigma cuts for Kaon"}; + Configurable> TPCpTrangesKa{"TPCpTrangesKa", {0.45, 0.55, 0.6, 2}, "TPC pT ranges for Kaon"}; + Configurable> TOFnsigmacutsKa{"TOFnsigmacutsKa", {2}, "TOF Nsigma cuts for Kaon"}; + Configurable> TOFpTrangesKa{"TOFpTrangesKa", {0.6}, "TOF pT ranges for Kaon"}; + Configurable> TPCnsigmacutsPr{"TPCnsigmacutsPr", {2.2, 1, 2.2}, "TPC Nsigma cuts for Proton"}; + Configurable> TPCpTrangesPr{"TPCpTrangesPr", {0.85, 1.1, 2}, "TPC pT ranges for Proton"}; + Configurable> TOFnsigmacutsPr{"TOFnsigmacutsPr", {2}, "TOF Nsigma cuts for Proton"}; + Configurable> TOFpTrangesPr{"TOFpTrangesPr", {1.1}, "TOF pT ranges for Proton"}; + + bool PID(float trackpt, float tracknsigmatpc, float tracknsigmatof, int8_t species) + { + int8_t tpcindex = -1, tofindex = -1; + auto tpcpt = (std::vector>){TPCpTrangesPi, TPCpTrangesKa, TPCpTrangesPr}; + auto tpcnsigma = (std::vector>){TPCnsigmacutsPi, TPCnsigmacutsKa, TPCnsigmacutsPr}; + auto tofpt = (std::vector>){TOFpTrangesPi, TOFpTrangesKa, TOFpTrangesPr}; + auto tofnsigma = (std::vector>){TOFnsigmacutsPi, TOFnsigmacutsKa, TOFnsigmacutsPr}; + for (int8_t i = 0; i < tpcpt[species].size(); i++) + if (trackpt < tpcpt[species][i]) { + tpcindex = i; + break; + } + for (int8_t i = 0; i < tofpt[species].size(); i++) + if (trackpt >= tofpt[species][i]) { + tofindex = i; + break; + } + if (tracknsigmatpc > tpcnsigma[species][tpcindex]) + return false; + if ((tofindex != -1) && (tracknsigmatof > tofnsigma[species][tofindex])) + return false; + return true; + } + HistogramRegistry histos{"PID", {}, OutputObjHandlingPolicy::AnalysisObject}; + void init(InitContext const&) + { + const AxisSpec ptaxis{100, 0, 2, "p_T"}, nsigmaaxis{50, -6, 6, "N#sigma"}, dcaxyaxis{50, -6, 6, "DCA_{X}"}, dcazaxis{50, -6, 6, "DCA_{Z}"}; + histos.add("nsigmatpcpi", "N#sigma_{TPC} Pion", kTH2F, {ptaxis, nsigmaaxis}); + histos.add("nsigmatofpi", "N#sigma_{TOF} Pion", kTH2F, {ptaxis, nsigmaaxis}); + histos.add("nsigmatpcka", "N#sigma_{TPC} Kaon", kTH2F, {ptaxis, nsigmaaxis}); + histos.add("nsigmatofka", "N#sigma_{TOF} Kaon", kTH2F, {ptaxis, nsigmaaxis}); + histos.add("nsigmatpcpr", "N#sigma_{TPC} Proton", kTH2F, {ptaxis, nsigmaaxis}); + histos.add("nsigmatofpr", "N#sigma_{TOF} Proton", kTH2F, {ptaxis, nsigmaaxis}); + histos.add("dcaxypi", "DCA_{XY} Pion", kTH2F, {ptaxis, dcaxyaxis}); + histos.add("dcazpi", "DCA_{Z} Pion", kTH2F, {ptaxis, dcazaxis}); + histos.add("dcaxyka", "DCA_{XY} Kaon", kTH2F, {ptaxis, dcaxyaxis}); + histos.add("dcazka", "DCA_{Z} Kaon", kTH2F, {ptaxis, dcazaxis}); + histos.add("dcaxypr", "DCA_{XY} Proton", kTH2F, {ptaxis, dcaxyaxis}); + histos.add("dcazpr", "DCA_{Z} Proton", kTH2F, {ptaxis, dcazaxis}); + histos.add("ptpi", "p_T distribution Pion", kTH1I, {ptaxis}); + histos.add("ptka", "p_T distribution Kaon", kTH1I, {ptaxis}); + histos.add("ptpr", "p_T distribution Proton", kTH1I, {ptaxis}); + + histos.add("recodcaxypi", "DCA_{XY} Pion", kTH2F, {ptaxis, dcaxyaxis}); + histos.add("recodcazpi", "DCA_{Z} Pion", kTH2F, {ptaxis, dcazaxis}); + histos.add("recodcaxyka", "DCA_{XY} Kaon", kTH2F, {ptaxis, dcaxyaxis}); + histos.add("recodcazka", "DCA_{Z} Kaon", kTH2F, {ptaxis, dcazaxis}); + histos.add("recodcaxypr", "DCA_{XY} Proton", kTH2F, {ptaxis, dcaxyaxis}); + histos.add("recodcazpr", "DCA_{Z} Proton", kTH2F, {ptaxis, dcazaxis}); - void process(soa::Join const& tracks) + histos.add("genptpi", "Generated p_T distribution Pion", kTH1I, {ptaxis}); + histos.add("genptka", "Generated p_T distribution Kaon", kTH1I, {ptaxis}); + histos.add("genptpr", "Generated p_T distribution Proton", kTH1I, {ptaxis}); + histos.add("recoptpi", "Reconstructed p_T distribution Pion", kTH1I, {ptaxis}); + histos.add("recoptka", "Reconstructed p_T distribution Kaon", kTH1I, {ptaxis}); + histos.add("recoptpr", "Reconstructed p_T distribution Proton", kTH1I, {ptaxis}); + histos.add("pureidptpi", "Identifed w/o impurity p_T distribution Pion", kTH1I, {ptaxis}); + histos.add("pureidptka", "Identifed w/o impurity p_T distribution Kaon", kTH1I, {ptaxis}); + histos.add("pureidptpr", "Identifed w/o impurity p_T distribution Proton", kTH1I, {ptaxis}); + } + Produces ftable; + void processData(soa::Join const& tracks) { - int etabin, phibin; - int8_t binNpid; - float nsigma_array[3]; + int8_t etabin, phibin, binNpid; for (auto track : tracks) { etabin = (track.eta() + 0.8) * 15; // 15= 24/1.6 phibin = 36 * track.phi() / (2 * constants::math::PI); if ((etabin < 0) || (etabin >= 24) || (phibin < 0) || (phibin >= 36)) { binNpid = -1; } else { + float nsigma_array[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + float tofnsigma_array[3] = {track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr()}; binNpid = 0; - for (int i = 0; i < 4; i++) { - if (pidarray[i](track)) - binNpid = binNpid * 10 + i; + for (int8_t i = 0; i < 3; i++) { + if (PID(track.pt(), fabs(nsigma_array[i]), fabs(tofnsigma_array[i]), i)) + binNpid = binNpid * 10 + i + 1; if (binNpid > 10) // If a track is identified as two different tracks. { - nsigma_array[0] = track.tpcNSigmaPi(); - nsigma_array[1] = track.tpcNSigmaKa(); - nsigma_array[2] = track.tpcNSigmaPr(); if (fabs(nsigma_array[(binNpid / 10) - 1]) < fabs(nsigma_array[(binNpid % 10) - 1])) // The track is identified as the particle whose |nsigma| is the least. binNpid /= 10; else binNpid %= 10; } } + + switch (binNpid) { + case 1: + histos.fill(HIST("nsigmatpcpi"), track.pt(), nsigma_array[0]); + histos.fill(HIST("nsigmatofpi"), track.pt(), tofnsigma_array[0]); + histos.fill(HIST("dcaxypi"), track.pt(), track.dcaXY()); + histos.fill(HIST("dcazpi"), track.pt(), track.dcaZ()); + histos.fill(HIST("ptpi"), track.pt()); + break; + case 2: + histos.fill(HIST("nsigmatpcka"), track.pt(), nsigma_array[1]); + histos.fill(HIST("nsigmatofka"), track.pt(), tofnsigma_array[1]); + histos.fill(HIST("dcaxyka"), track.pt(), track.dcaXY()); + histos.fill(HIST("dcazka"), track.pt(), track.dcaZ()); + histos.fill(HIST("ptka"), track.pt()); + break; + case 3: + histos.fill(HIST("nsigmatpcpr"), track.pt(), nsigma_array[2]); + histos.fill(HIST("nsigmatofpr"), track.pt(), tofnsigma_array[2]); + histos.fill(HIST("dcaxypr"), track.pt(), track.dcaXY()); + histos.fill(HIST("dcazpr"), track.pt(), track.dcaZ()); + histos.fill(HIST("ptpr"), track.pt()); + break; + } + } + ftable(binNpid); + } + } + PROCESS_SWITCH(FillFlagsTable, processData, "Process Data", true); + + void processMC(soa::Join const& recotracks, aod::McParticles const& gentracks) + { + int8_t etabin, phibin, binNpid; + for (auto track : recotracks) { + if (track.has_mcParticle()) { + etabin = (track.eta() + 0.8) * 15; // 15= 24/1.6 + phibin = 36 * track.phi() / (2 * constants::math::PI); + if ((etabin < 0) || (etabin >= 24) || (phibin < 0) || (phibin >= 36)) { + binNpid = -1; + } else { + float nsigma_array[3] = {track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + float tofnsigma_array[3] = {track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr()}; + binNpid = 0; + for (int8_t i = 0; i < 3; i++) { + if (PID(track.pt(), fabs(nsigma_array[i]), fabs(tofnsigma_array[i]), i)) + binNpid = binNpid * 10 + i + 1; + if (binNpid > 10) // If a track is identified as two different tracks. + { + if (fabs(nsigma_array[(binNpid / 10) - 1]) < fabs(nsigma_array[(binNpid % 10) - 1])) // The track is identified as the particle whose |nsigma| is the least. + binNpid /= 10; + else + binNpid %= 10; + } + } + switch (binNpid) { + case 1: + histos.fill(HIST("nsigmatpcpi"), track.pt(), nsigma_array[0]); + histos.fill(HIST("nsigmatofpi"), track.pt(), tofnsigma_array[0]); + histos.fill(HIST("dcaxypi"), track.pt(), track.dcaXY()); + histos.fill(HIST("dcazpi"), track.pt(), track.dcaZ()); + histos.fill(HIST("ptpi"), track.pt()); + + if (abs(track.mcParticle().pdgCode()) == 211) + histos.fill(HIST("pureidptpi"), track.pt()); + break; + case 2: + histos.fill(HIST("nsigmatpcka"), track.pt(), nsigma_array[1]); + histos.fill(HIST("nsigmatofka"), track.pt(), tofnsigma_array[1]); + histos.fill(HIST("dcaxyka"), track.pt(), track.dcaXY()); + histos.fill(HIST("dcazka"), track.pt(), track.dcaZ()); + histos.fill(HIST("ptka"), track.pt()); + + if (abs(track.mcParticle().pdgCode()) == 321) + histos.fill(HIST("pureidptka"), track.pt()); + break; + case 3: + histos.fill(HIST("nsigmatpcpr"), track.pt(), nsigma_array[2]); + histos.fill(HIST("nsigmatofpr"), track.pt(), tofnsigma_array[2]); + histos.fill(HIST("dcaxypr"), track.pt(), track.dcaXY()); + histos.fill(HIST("dcazpr"), track.pt(), track.dcaZ()); + histos.fill(HIST("ptpr"), track.pt()); + + if (abs(track.mcParticle().pdgCode()) == 2212) + histos.fill(HIST("pureidptpr"), track.pt()); + break; + } + switch (abs(track.mcParticle().pdgCode())) { + case 211: + histos.fill(HIST("recoptpi"), track.pt()); + histos.fill(HIST("recodcaxypi"), track.pt(), track.dcaXY()); + histos.fill(HIST("recodcazpi"), track.pt(), track.dcaZ()); + break; + case 321: + histos.fill(HIST("recoptka"), track.pt()); + histos.fill(HIST("recodcaxyka"), track.pt(), track.dcaXY()); + histos.fill(HIST("recodcazka"), track.pt(), track.dcaZ()); + break; + case 2212: + histos.fill(HIST("recoptpr"), track.pt()); + histos.fill(HIST("recodcaxypr"), track.pt(), track.dcaXY()); + histos.fill(HIST("recodcazpr"), track.pt(), track.dcaZ()); + break; + } + } + } else { + binNpid = -1; } ftable(binNpid); } + for (auto track : gentracks) { + switch (abs(track.pdgCode())) { + case 211: + histos.fill(HIST("genptpi"), track.pt()); + break; + case 321: + histos.fill(HIST("genptka"), track.pt()); + break; + case 2212: + histos.fill(HIST("genptpr"), track.pt()); + break; + } + } } + PROCESS_SWITCH(FillFlagsTable, processMC, "Process MC Data", false); }; + struct r2p24id { + Configurable minpT{"minpT", 0.2, "Minimum pT"}; Configurable maxpT{"maxpT", 2.0, "Maximum pT"}; + Configurable trackpartition{"trackpartition", 1.0, "where(in pT) to partition"}; + + Configurable pid_particle1{"pid_particle1", 1, "Define particle1 type"}; // 1->Pion, 2->Kaon, 3->Proton + Configurable pid_particle2{"pid_particle2", 1, "Define particle2 type"}; + + Configurable iftrackpartition{"iftrackpartition", false, "If track partition is needed"}; + Configurable ifpid{"ifpid", false, "If PID is needed"}; + + struct histarray { + std::shared_ptr h2d_1p[2][2][2], h2d_2p[2][2][4]; + std::shared_ptr h1d_1p[2][2]; + } hist; + + unsigned int mult1, mult2; + uint8_t etabin1, phibin1, etabin2, phibin2; + int8_t sign1, sign2; + bool iftrack2; + + HistogramRegistry histos{"R2P2", {}, OutputObjHandlingPolicy::AnalysisObject}; + + SliceCache cache; + //-----Track&Event Selection------------------------------------------------- Filter col = aod::evsel::sel8 == true; Filter collisionFilter = (nabs(aod::collision::posZ) < 10.f); Filter ptfilter = aod::track::pt > minpT&& aod::track::pt < maxpT; Filter globalfilter = requireGlobalTrackInFilter(); Filter properbinfilter = aod::idr2p2columns::binNpid != -1; - //--------------------------------------------------------------------------- - HistogramRegistry histos{"R2P2", {}, OutputObjHandlingPolicy::AnalysisObject}; - struct histarray { - std::shared_ptr h2d_1p[4][2][2], h2d_2p[7][2][2][4]; - std::shared_ptr h1d_1p[4][2]; - } hist; + Partition>> Tracks_set1 = (ifnode(iftrackpartition.node() == true, (aod::track::pt < trackpartition), true) && ifnode(ifpid.node() == true, (aod::idr2p2columns::binNpid == pid_particle1), true)); + Partition>> Tracks_set2 = (ifnode(iftrackpartition.node() == true, (aod::track::pt > trackpartition), true) && ifnode(ifpid.node() == true, (aod::idr2p2columns::binNpid == pid_particle2), true)); + //--------------------------------------------------------------------------- void init(InitContext const&) { - //-----Defining Histograms------------------------------------------------- - const AxisSpec phi{36, 0, 2.0 * constants::math::PI, "phi"}; - const AxisSpec eta{24, -0.8, 0.8, "eta"}; - const AxisSpec etaphi1{864, 0, 864, "etaphi1"}; - const AxisSpec etaphi2{864, 0, 864, "etaphi2"}; - char histname[50]; - char name[4][3] = {"ch", "pi", "ka", "pr"}; - - histos.add("h1d_n1_phi", "#phi distribution", kTH1D, {phi}); - histos.add("h1d_n1_eta", "#eta distribution", kTH1D, {eta}); - histos.add("h1d_n1_pt", "p_T", kTH1D, {{100, 0, 5, "p_T"}}); + iftrack2 = (((int8_t)pid_particle1 != (int8_t)pid_particle2) && (static_cast(ifpid))) || (static_cast(iftrackpartition)); // denotes whether the partiton1 is different from partition2 + //-----Defining Histograms--------------------------------------------------- + const AxisSpec phi{36, 0, 2.0 * constants::math::PI, "phi"}, eta{24, -0.8, 0.8, "eta"}, etaphi1{864, 0, 864, "etaphi1"}, etaphi2{864, 0, 864, "etaphi2"}; + histos.add("h1d_n1_phi", "#phi distribution Particle", kTH1D, {phi}); + histos.add("h1d_n1_eta", "#eta distribution Particle", kTH1D, {eta}); + histos.add("h1d_n1_ptP1", "p_T for +ve_1", kTH1D, {{30, 0, 6, "p_T"}}); + histos.add("h1d_n1_ptM1", "p_T for -ve_1", kTH1D, {{30, 0, 6, "p_T"}}); + histos.add("h1d_n1_ptP2", "p_T for +ve_2", kTH1D, {{30, 0, 6, "p_T"}}); + histos.add("h1d_n1_ptM2", "p_T for -ve_2", kTH1D, {{30, 0, 6, "p_T"}}); histos.add("h1i_n1_multPM", "Multiplicity", kTH1I, {{200, 0, 200, "Multiplicity"}}); + histos.add("h2d_n1_etaPhiP1", "#rho_1 for +ve particle1", kTH2D, {eta, phi}); + histos.add("h2d_n1_etaPhiM1", "#rho_1 for -ve particle1", kTH2D, {eta, phi}); + histos.add("h2d_n1_etaPhiP2", "#rho_1 for +ve particle2", kTH2D, {eta, phi}); + histos.add("h2d_n1_etaPhiM2", "#rho_1 for -ve particle2", kTH2D, {eta, phi}); + histos.add("h2d_n2_eta1Phi1Eta2Phi2PP", "#rho_2 for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_n2_eta1Phi1Eta2Phi2PM12", "#rho_2 for +ve_1 -ve_2 particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_n2_eta1Phi1Eta2Phi2PM21", "#rho_2 for +ve_2 -ve_1 particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_n2_eta1Phi1Eta2Phi2MM", "#rho_2 for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_pt_etaPhiP1", "p_T for +ve particle1", kTH2D, {eta, phi}); + histos.add("h2d_pt_etaPhiM1", "p_T for -ve particle1", kTH2D, {eta, phi}); + histos.add("h2d_pt_etaPhiP2", "p_T for +ve particle2", kTH2D, {eta, phi}); + histos.add("h2d_pt_etaPhiM2", "p_T for -ve particle2", kTH2D, {eta, phi}); + histos.add("h2d_ptpt_eta1Phi1Eta2Phi2PM12", "p_Tp_T for +ve_1 -ve_2", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptpt_eta1Phi1Eta2Phi2PM21", "p_Tp_T for +ve_2 -ve_1", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptpt_eta1Phi1Eta2Phi2PP", "p_Tp_T for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptpt_eta1Phi1Eta2Phi2MM", "p_Tp_T for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptn_eta1Phi1Eta2Phi2PM12", "p_Tn for +ve_1 -ve_2", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptn_eta1Phi1Eta2Phi2PM21", "p_Tn for +ve_2 -ve_1", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptn_eta1Phi1Eta2Phi2PP", "p_Tn for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_ptn_eta1Phi1Eta2Phi2MM", "p_Tn for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_npt_eta1Phi1Eta2Phi2PM12", "np_T for +ve_1 -ve_2", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_npt_eta1Phi1Eta2Phi2PM21", "np_T for +ve_1 -ve_2", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_npt_eta1Phi1Eta2Phi2PP", "np_T for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h2d_npt_eta1Phi1Eta2Phi2MM", "np_T for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); + histos.add("h1d_n1_pt", "p_T", kTH1D, {{100, 0, 5, "p_T"}}); + //--------------------------------------------------------------------------- + //-----Histogram Arrays------------------------------------------------------ + hist.h2d_1p[0][0][0] = histos.template get(HIST("h2d_n1_etaPhiM1")); + hist.h2d_1p[0][0][1] = histos.template get(HIST("h2d_pt_etaPhiM1")); + hist.h2d_1p[0][1][0] = histos.template get(HIST("h2d_n1_etaPhiP1")); + hist.h2d_1p[0][1][1] = histos.template get(HIST("h2d_pt_etaPhiP1")); + hist.h2d_1p[1][0][0] = histos.template get(HIST("h2d_n1_etaPhiM2")); + hist.h2d_1p[1][0][1] = histos.template get(HIST("h2d_pt_etaPhiM2")); + hist.h2d_1p[1][1][0] = histos.template get(HIST("h2d_n1_etaPhiP2")); + hist.h2d_1p[1][1][1] = histos.template get(HIST("h2d_pt_etaPhiP2")); - for (int i = 0; i < 7; i++) { - if (i < 4) { // Single particle distribution histograms - snprintf(histname, sizeof(histname), "h1d_n1_ptP_%s", name[i]); - histos.add(histname, "p_T for +ve particles", kTH1D, {{100, 0, 6, "p_T"}}); - snprintf(histname, sizeof(histname), "h1d_n1_ptM_%s", name[i]); - histos.add(histname, "p_T for -ve particles", kTH1D, {{100, 0, 6, "p_T"}}); - snprintf(histname, sizeof(histname), "h2d_n1_etaPhiP_%s", name[i]); - histos.add(histname, "#rho_1 for +ve particles", kTH2D, {eta, phi}); - snprintf(histname, sizeof(histname), "h2d_n1_etaPhiM_%s", name[i]); - histos.add(histname, "#rho_1 for -ve particles", kTH2D, {eta, phi}); - snprintf(histname, sizeof(histname), "h2d_pt_etaPhiP_%s", name[i]); - histos.add(histname, "p_T for +ve particles", kTH2D, {eta, phi}); - snprintf(histname, sizeof(histname), "h2d_pt_etaPhiM_%s", name[i]); - histos.add(histname, "p_T for -ve particles", kTH2D, {eta, phi}); - } - //---Two patricle distribution histograms-------------------------------- - int e = i, f = i; - if (i > 3) { - e = 1; - f = 3; - if (i == 4) - f = 2; - else if (i == 6) - e = 2; - // There are two kinds of "********PM_*" histograms here, one is for when track1 is +ve the other is for when track2 is +ve. - snprintf(histname, sizeof(histname), "h2d_n2_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "#rho_2 for +ve_1 -ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptpt_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "p_Tp_T for +ve_1 -ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptn_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "p_Tn for +ve_1 -ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_npt_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "np_T for +ve_1 -ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_n2_eta1Phi1Eta2Phi2PM_%s%s", name[f], name[e]); - histos.add(histname, "#rho_2 for -ve_1 +ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptpt_eta1Phi1Eta2Phi2PM_%s%s", name[f], name[e]); - histos.add(histname, "p_Tp_T for -ve_1 +ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptn_eta1Phi1Eta2Phi2PM_%s%s", name[f], name[e]); - histos.add(histname, "p_Tn for -ve_1 +ve_2 particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_npt_eta1Phi1Eta2Phi2PM_%s%s", name[f], name[e]); - histos.add(histname, "np_T for -ve_1 +ve_2 particles", kTH2D, {etaphi1, etaphi2}); - } else { - snprintf(histname, sizeof(histname), "h2d_n2_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "#rho_2 for +ve-ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptpt_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "p_Tp_T for +ve-ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptn_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "p_Tn for +ve-ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_npt_eta1Phi1Eta2Phi2PM_%s%s", name[e], name[f]); - histos.add(histname, "np_T for +ve-ve particles", kTH2D, {etaphi1, etaphi2}); - } - snprintf(histname, sizeof(histname), "h2d_n2_eta1Phi1Eta2Phi2PP_%s%s", name[e], name[f]); - histos.add(histname, "#rho_2 for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_n2_eta1Phi1Eta2Phi2MM_%s%s", name[e], name[f]); - histos.add(histname, "#rho_2 for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptpt_eta1Phi1Eta2Phi2PP_%s%s", name[e], name[f]); - histos.add(histname, "p_Tp_T for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptpt_eta1Phi1Eta2Phi2MM_%s%s", name[e], name[f]); - histos.add(histname, "p_Tp_T for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptn_eta1Phi1Eta2Phi2PP_%s%s", name[e], name[f]); - histos.add(histname, "p_Tn for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_ptn_eta1Phi1Eta2Phi2MM_%s%s", name[e], name[f]); - histos.add(histname, "p_Tn for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_npt_eta1Phi1Eta2Phi2PP_%s%s", name[e], name[f]); - histos.add(histname, "np_T for +ve+ve particles", kTH2D, {etaphi1, etaphi2}); - snprintf(histname, sizeof(histname), "h2d_npt_eta1Phi1Eta2Phi2MM_%s%s", name[e], name[f]); - histos.add(histname, "np_T for -ve-ve particles", kTH2D, {etaphi1, etaphi2}); - //----------------------------------------------------------------------- + hist.h2d_2p[0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM")); + hist.h2d_2p[0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM")); + hist.h2d_2p[0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM")); + hist.h2d_2p[0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM")); + if (iftrack2) { + hist.h2d_2p[0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM21")); + hist.h2d_2p[0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM21")); + hist.h2d_2p[0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM21")); + hist.h2d_2p[0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM21")); + } else { + hist.h2d_2p[0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM12")); } - //------------------------------------------------------------------------- - //-----Assigning histogram pointers to an Array---------------------------- - //------Single Particle..........------------------------------------------ - hist.h1d_1p[0][0] = histos.template get(HIST("h1d_n1_ptM_ch")); - hist.h1d_1p[0][1] = histos.template get(HIST("h1d_n1_ptP_ch")); - hist.h2d_1p[0][0][0] = histos.template get(HIST("h2d_n1_etaPhiM_ch")); - hist.h2d_1p[0][0][1] = histos.template get(HIST("h2d_pt_etaPhiM_ch")); - hist.h2d_1p[0][1][0] = histos.template get(HIST("h2d_n1_etaPhiP_ch")); - hist.h2d_1p[0][1][1] = histos.template get(HIST("h2d_pt_etaPhiP_ch")); - - hist.h1d_1p[1][0] = histos.template get(HIST("h1d_n1_ptM_pi")); - hist.h1d_1p[1][1] = histos.template get(HIST("h1d_n1_ptP_pi")); - hist.h2d_1p[1][0][0] = histos.template get(HIST("h2d_n1_etaPhiM_pi")); - hist.h2d_1p[1][0][1] = histos.template get(HIST("h2d_pt_etaPhiM_pi")); - hist.h2d_1p[1][1][0] = histos.template get(HIST("h2d_n1_etaPhiP_pi")); - hist.h2d_1p[1][1][1] = histos.template get(HIST("h2d_pt_etaPhiP_pi")); - - hist.h1d_1p[2][0] = histos.template get(HIST("h1d_n1_ptM_ka")); - hist.h1d_1p[2][1] = histos.template get(HIST("h1d_n1_ptP_ka")); - hist.h2d_1p[2][0][0] = histos.template get(HIST("h2d_n1_etaPhiM_ka")); - hist.h2d_1p[2][0][1] = histos.template get(HIST("h2d_pt_etaPhiM_ka")); - hist.h2d_1p[2][1][0] = histos.template get(HIST("h2d_n1_etaPhiP_ka")); - hist.h2d_1p[2][1][1] = histos.template get(HIST("h2d_pt_etaPhiP_ka")); - - hist.h1d_1p[3][0] = histos.template get(HIST("h1d_n1_ptM_pr")); - hist.h1d_1p[3][1] = histos.template get(HIST("h1d_n1_ptP_pr")); - hist.h2d_1p[3][0][0] = histos.template get(HIST("h2d_n1_etaPhiM_pr")); - hist.h2d_1p[3][0][1] = histos.template get(HIST("h2d_pt_etaPhiM_pr")); - hist.h2d_1p[3][1][0] = histos.template get(HIST("h2d_n1_etaPhiP_pr")); - hist.h2d_1p[3][1][1] = histos.template get(HIST("h2d_pt_etaPhiP_pr")); - //------------------------------------------------------------------------- - //------Two Particle............------------------------------------------- - hist.h2d_2p[0][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_chch")); - hist.h2d_2p[0][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_chch")); - hist.h2d_2p[0][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_chch")); - hist.h2d_2p[0][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_chch")); - hist.h2d_2p[0][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_chch")); - hist.h2d_2p[0][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_chch")); - hist.h2d_2p[0][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_chch")); - hist.h2d_2p[0][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_chch")); - hist.h2d_2p[0][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_chch")); - - hist.h2d_2p[1][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_pipi")); - hist.h2d_2p[1][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_pipi")); - hist.h2d_2p[1][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_pipi")); - hist.h2d_2p[1][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_pipi")); - hist.h2d_2p[1][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_pipi")); - hist.h2d_2p[1][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_pipi")); - hist.h2d_2p[1][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_pipi")); - hist.h2d_2p[1][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_pipi")); - hist.h2d_2p[1][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_pipi")); - - hist.h2d_2p[2][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_kaka")); - hist.h2d_2p[2][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_kaka")); - hist.h2d_2p[2][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_kaka")); - hist.h2d_2p[2][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_kaka")); - hist.h2d_2p[2][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_kaka")); - hist.h2d_2p[2][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_kaka")); - hist.h2d_2p[2][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_kaka")); - hist.h2d_2p[2][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_kaka")); - hist.h2d_2p[2][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_kaka")); - - hist.h2d_2p[3][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_prpr")); - hist.h2d_2p[3][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_prpr")); - hist.h2d_2p[3][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_prpr")); - hist.h2d_2p[3][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_prpr")); - hist.h2d_2p[3][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_prpr")); - hist.h2d_2p[3][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_prpr")); - hist.h2d_2p[3][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_prpr")); - hist.h2d_2p[3][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_prpr")); - hist.h2d_2p[3][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_prpr")); - - hist.h2d_2p[4][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_pika")); - hist.h2d_2p[4][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_pika")); - hist.h2d_2p[4][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_pika")); - hist.h2d_2p[4][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_pika")); - hist.h2d_2p[4][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_kapi")); - hist.h2d_2p[4][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_kapi")); - hist.h2d_2p[4][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_kapi")); - hist.h2d_2p[4][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_kapi")); - hist.h2d_2p[4][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_pika")); - hist.h2d_2p[4][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_pika")); - hist.h2d_2p[4][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_pika")); - hist.h2d_2p[4][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_pika")); - hist.h2d_2p[4][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_pika")); - hist.h2d_2p[4][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_pika")); - hist.h2d_2p[4][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_pika")); - hist.h2d_2p[4][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_pika")); - - hist.h2d_2p[5][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_pipr")); - hist.h2d_2p[5][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_pipr")); - hist.h2d_2p[5][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_pipr")); - hist.h2d_2p[5][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_pipr")); - hist.h2d_2p[5][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_prpi")); - hist.h2d_2p[5][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_prpi")); - hist.h2d_2p[5][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_prpi")); - hist.h2d_2p[5][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_prpi")); - hist.h2d_2p[5][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_pipr")); - hist.h2d_2p[5][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_pipr")); - hist.h2d_2p[5][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_pipr")); - hist.h2d_2p[5][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_pipr")); - hist.h2d_2p[5][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_pipr")); - hist.h2d_2p[5][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_pipr")); - hist.h2d_2p[5][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_pipr")); - hist.h2d_2p[5][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_pipr")); - - hist.h2d_2p[6][0][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2MM_kapr")); - hist.h2d_2p[6][0][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2MM_kapr")); - hist.h2d_2p[6][0][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2MM_kapr")); - hist.h2d_2p[6][0][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2MM_kapr")); - hist.h2d_2p[6][0][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_prka")); - hist.h2d_2p[6][0][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_prka")); - hist.h2d_2p[6][0][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_prka")); - hist.h2d_2p[6][0][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_prka")); - hist.h2d_2p[6][1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM_kapr")); - hist.h2d_2p[6][1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM_kapr")); - hist.h2d_2p[6][1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM_kapr")); - hist.h2d_2p[6][1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM_kapr")); - hist.h2d_2p[6][1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP_kapr")); - hist.h2d_2p[6][1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP_kapr")); - hist.h2d_2p[6][1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP_kapr")); - hist.h2d_2p[6][1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP_kapr")); - //------------------------------------------------------------------------- - //------------------------------------------------------------------------- + hist.h2d_2p[1][0][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[1][0][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[1][0][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[1][0][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PM12")); + hist.h2d_2p[1][1][0] = histos.template get(HIST("h2d_n2_eta1Phi1Eta2Phi2PP")); + hist.h2d_2p[1][1][1] = histos.template get(HIST("h2d_npt_eta1Phi1Eta2Phi2PP")); + hist.h2d_2p[1][1][2] = histos.template get(HIST("h2d_ptn_eta1Phi1Eta2Phi2PP")); + hist.h2d_2p[1][1][3] = histos.template get(HIST("h2d_ptpt_eta1Phi1Eta2Phi2PP")); + + hist.h1d_1p[0][0] = histos.template get(HIST("h1d_n1_ptP1")); + hist.h1d_1p[0][1] = histos.template get(HIST("h1d_n1_ptM1")); + hist.h1d_1p[1][0] = histos.template get(HIST("h1d_n1_ptP2")); + hist.h1d_1p[1][1] = histos.template get(HIST("h1d_n1_ptM2")); + //--------------------------------------------------------------------------- } + void process(soa::Filtered>::iterator const& filteredCollision, soa::Filtered> const& tracks) { - int mult = 0; - int8_t pid1, pid2; - int sign1, sign2; - int etabin1, phibin1, etabin2, phibin2; + auto tracks1 = Tracks_set1->sliceByCached(aod::track::collisionId, filteredCollision.globalIndex(), cache); + auto tracks2 = Tracks_set2->sliceByCached(aod::track::collisionId, filteredCollision.globalIndex(), cache); + mult1 = tracks1.size(); + mult2 = tracks2.size(); + if ((iftrack2 && ((mult1 < 1) || (mult2 < 1))) || ((!iftrack2) && (mult1 < 2))) // Reject Collisions without sufficient particles + return; for (auto track1 : tracks) { - - mult++; histos.fill(HIST("h1d_n1_phi"), track1.phi()); histos.fill(HIST("h1d_n1_eta"), track1.eta()); histos.fill(HIST("h1d_n1_pt"), track1.pt()); - //---Single Particle Distribution---------------------------------------- + } + histos.fill(HIST("h1i_n1_multPM"), mult1 + mult2); + + for (auto track1 : tracks1) { + //---Single Particle Distribution (particle1)---------------------------------------- sign1 = (track1.sign() + 1) / 2; - pid1 = track1.binNpid(); - if (pid1 > 0) // Filling histograms for different particle species; pid1 = 0 means ch, 1->pi, 2->ka, 3->pr. - { - hist.h1d_1p[pid1][sign1]->Fill(track1.pt(), 1.0 / (2.0 * constants::math::PI * track1.pt())); // h1d_n1_pt* - hist.h2d_1p[pid1][sign1][0]->Fill(track1.eta(), track1.phi()); // h2d_n1_etaphi* - hist.h2d_1p[pid1][sign1][1]->Fill(track1.eta(), track1.phi(), track1.pt()); // h2d_pt_etaPhi* - } - hist.h1d_1p[0][sign1]->Fill(track1.pt(), 1.0 / (2.0 * constants::math::PI * track1.pt())); // h1d_n1_pt*ch - hist.h2d_1p[0][sign1][0]->Fill(track1.eta(), track1.phi()); // h2d_n1_etaphi*ch - hist.h2d_1p[0][sign1][1]->Fill(track1.eta(), track1.phi(), track1.pt()); // h2d_pt_etaPhi*ch + hist.h1d_1p[0][sign1]->Fill(track1.pt(), 1.0 / (2.0 * constants::math::PI * track1.pt())); // h1d_n1_pt*1 + hist.h2d_1p[0][sign1][0]->Fill(track1.eta(), track1.phi()); // h2d_n1_etaphi*1 + hist.h2d_1p[0][sign1][1]->Fill(track1.eta(), track1.phi(), track1.pt()); // h2d_pt_etaPhi*1 //----------------------------------------------------------------------- + } + if (iftrack2) { + for (auto track2 : tracks2) { + //---Single Particle Distribution (particle2)---------------------------------------- + sign2 = (track2.sign() + 1) / 2; + hist.h1d_1p[1][sign2]->Fill(track2.pt(), 1.0 / (2.0 * constants::math::PI * track2.pt())); // h1d_n1_pt*2 + hist.h2d_1p[1][sign2][0]->Fill(track2.eta(), track2.phi()); // h2d_n1_etaphi*2 + hist.h2d_1p[1][sign2][1]->Fill(track2.eta(), track2.phi(), track2.pt()); // h2d_pt_etaPhi*2 + //----------------------------------------------------------------------- + } + } + for (auto track1 : tracks1) { + sign1 = (track1.sign() + 1) / 2; etabin1 = (track1.eta() + 0.8) * 15; // 15= 24/1.6 phibin1 = 36 * track1.phi() / (2 * constants::math::PI); - for (auto track2 : tracks) { + for (auto track2 : tracks2) { if (track1.index() == track2.index()) continue; + etabin2 = (track2.eta() + 0.8) * 15; // 15= 24/1.6 phibin2 = 36 * track2.phi() / (2 * constants::math::PI); sign2 = (track2.sign() + 1) / 2; - pid2 = track2.binNpid(); //-----Two Particle Distribution--------------------------------------- - int i; - if ((pid1 > 0) && (pid2 >= pid1)) { - i = ((pid2 - pid1) / 2 + (pid2 - pid1) % 2); - i = i + (pid1 + pid2) * (1 + i) / 2; // This formula gives 1 for pipi, 2 for kaka, 3->prpr, 4->pik, 5->pip, 6->kp - - hist.h2d_2p[i][sign1][sign2][0]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5); // h2d_n2_eta1Phi1Eta2Phi2* - hist.h2d_2p[i][sign1][sign2][1]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track2.pt()); // h2d_npt_eta1Phi1Eta2Phi2* - hist.h2d_2p[i][sign1][sign2][2]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track1.pt()); // h2d_ptn_eta1Phi1Eta2Phi2* - hist.h2d_2p[i][sign1][sign2][3]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track1.pt() * track2.pt()); // h2d_ptpt_eta1Phi1Eta2Phi2* - } - hist.h2d_2p[0][sign1][sign2][0]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5); // h2d_n2_eta1Phi1Eta2Phi2*chch - hist.h2d_2p[0][sign1][sign2][1]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track2.pt()); // h2d_npt_eta1Phi1Eta2Phi2*chch - hist.h2d_2p[0][sign1][sign2][2]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track1.pt()); // h2d_ptn_eta1Phi1Eta2Phi2*chch - hist.h2d_2p[0][sign1][sign2][3]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track1.pt() * track2.pt()); // h2d_ptpt_eta1Phi1Eta2Phi2*chch + hist.h2d_2p[sign1][sign2][0]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5); // h2d_n2_eta1Phi1Eta2Phi2* + hist.h2d_2p[sign1][sign2][1]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track2.pt()); // h2d_npt_eta1Phi1Eta2Phi2* + hist.h2d_2p[sign1][sign2][2]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track1.pt()); // h2d_ptn_eta1Phi1Eta2Phi2* + hist.h2d_2p[sign1][sign2][3]->Fill(36 * etabin1 + phibin1 + 0.5, 36 * etabin2 + phibin2 + 0.5, track1.pt() * track2.pt()); // h2d_ptpt_eta1Phi1Eta2Phi2* //--------------------------------------------------------------------- } } - histos.fill(HIST("h1i_n1_multPM"), mult); } }; From 77e709646dc1a199aa08ca6ddff3e25e0fa22959 Mon Sep 17 00:00:00 2001 From: Zhiyong <71517277+Luzhiyongg@users.noreply.github.com> Date: Sun, 11 Feb 2024 14:16:37 +0800 Subject: [PATCH 07/26] PWGCF: flow-pb-pb: modify filter conditions (#4656) * modify filter conditions * modify the code according to the reviews of PR#4562 --- PWGCF/Flow/Tasks/FlowPbPbTask.cxx | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/PWGCF/Flow/Tasks/FlowPbPbTask.cxx b/PWGCF/Flow/Tasks/FlowPbPbTask.cxx index 9e38f410581..3032dae0a36 100644 --- a/PWGCF/Flow/Tasks/FlowPbPbTask.cxx +++ b/PWGCF/Flow/Tasks/FlowPbPbTask.cxx @@ -61,7 +61,7 @@ struct FlowPbPbTask { ConfigurableAxis axisMultiplicity{"axisMultiplicity", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "centrality axis for histograms"}; Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtMin) && (aod::track::pt < cfgCutPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && (aod::track::tpcChi2NCl < cfgCutChi2prTPCcls); // Corrections TH1D* mEfficiency = nullptr; @@ -328,7 +328,7 @@ struct FlowPbPbTask { correctionsLoaded = true; } - bool setCurrentParticleWeights(float& weight_nue, float& weight_nua, const float& phi, const float& eta, const float& pt, const float& vtxz) + bool setCurrentParticleWeights(float& weight_nue, float& weight_nua, float phi, float eta, float pt, float vtxz) { float eff = 1.; if (mEfficiency) @@ -370,38 +370,35 @@ struct FlowPbPbTask { double sum_ptSquare_wSquare_WithinGap08 = 0., sum_pt_wSquare_WithinGap08 = 0.; for (auto& track : tracks) { - double pt = track.pt(); - double eta = track.eta(); - double phi = track.phi(); if (cfgOutputNUAWeights) - fWeights->Fill(phi, eta, vtxz, pt, cent, 0); - if (!setCurrentParticleWeights(weff, wacc, phi, eta, pt, vtxz)) + fWeights->Fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0); + if (!setCurrentParticleWeights(weff, wacc, track.phi(), track.eta(), track.pt(), vtxz)) continue; - bool WithinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range - bool WithinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax); // within RF pT range - bool WithinEtaGap08 = (eta >= -0.4) && (eta <= 0.4); + bool WithinPtPOI = (cfgCutPtPOIMin < track.pt()) && (track.pt() < cfgCutPtPOIMax); // within POI pT range + bool WithinPtRef = (cfgCutPtMin < track.pt()) && (track.pt() < cfgCutPtMax); // within RF pT range + bool WithinEtaGap08 = (track.eta() >= -0.4) && (track.eta() <= 0.4); if (WithinPtRef) { - registry.fill(HIST("hPhi"), phi); + registry.fill(HIST("hPhi"), track.phi()); registry.fill(HIST("hEta"), track.eta()); - registry.fill(HIST("hPt"), pt); + registry.fill(HIST("hPt"), track.pt()); weffEvent += weff; waccEvent += wacc; - ptSum += weff * pt; + ptSum += weff * track.pt(); TrackNum++; if (WithinEtaGap08) { - ptSum_Gap08 += weff * pt; - sum_pt_wSquare_WithinGap08 += weff * weff * pt; - sum_ptSquare_wSquare_WithinGap08 += weff * weff * pt * pt; + ptSum_Gap08 += weff * track.pt(); + sum_pt_wSquare_WithinGap08 += weff * weff * track.pt(); + sum_ptSquare_wSquare_WithinGap08 += weff * weff * track.pt() * track.pt(); weffEvent_WithinGap08 += weff; weffEventSquare_WithinGap08 += weff * weff; } } if (WithinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, phi, wacc * weff, 1); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1); if (WithinPtPOI) - fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, phi, wacc * weff, 2); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 2); if (WithinPtPOI && WithinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(pt) - 1, phi, wacc * weff, 4); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 4); } double WeffEvent_diff_WithGap08 = weffEvent_WithinGap08 * weffEvent_WithinGap08 - weffEventSquare_WithinGap08; From 907bd4b90100bd319d71cfc9d89a3deaed5c87b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Sun, 11 Feb 2024 09:43:18 +0100 Subject: [PATCH 08/26] DPG: Fix QA efficiency (#4651) - add missing break --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index d41f77495ec..49ee3432789 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -1640,18 +1640,25 @@ struct QaEfficiency { switch (globalTrackSelection) { case 0: isTrackSelectedAfteAll = true; + break; case 1: isTrackSelectedAfteAll = track.isGlobalTrack(); + break; case 2: isTrackSelectedAfteAll = track.isGlobalTrackWoPtEta(); + break; case 3: isTrackSelectedAfteAll = track.isGlobalTrackWoDCA(); + break; case 4: isTrackSelectedAfteAll = track.isQualityTrack(); + break; case 5: isTrackSelectedAfteAll = track.isInAcceptanceTrack(); + break; case 6: isTrackSelectedAfteAll = customTrackCuts.IsSelected(track); + break; default: LOG(fatal) << "Can't interpret track asked selection " << globalTrackSelection; } From 361e4312b693130fcd670258f625f5e3730c968a Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sun, 11 Feb 2024 14:37:15 +0100 Subject: [PATCH 09/26] [PWGCF] First step towards identified analysis (#4667) * First step towards identified analysis * Fixed first wave of MegaLinter errors --------- Co-authored-by: Victor --- PWGCF/Core/AnalysisConfigurableCuts.h | 26 +- PWGCF/Core/PWGCFCoreLinkDef.h | 4 + PWGCF/TableProducer/dptdptfilter.cxx | 595 ++++++++++++++++---------- PWGCF/TableProducer/dptdptfilter.h | 40 +- PWGCF/Tasks/match-reco-gen.cxx | 15 +- 5 files changed, 416 insertions(+), 264 deletions(-) diff --git a/PWGCF/Core/AnalysisConfigurableCuts.h b/PWGCF/Core/AnalysisConfigurableCuts.h index 78752a7ff36..ef262298fec 100644 --- a/PWGCF/Core/AnalysisConfigurableCuts.h +++ b/PWGCF/Core/AnalysisConfigurableCuts.h @@ -8,9 +8,10 @@ // 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. -#ifndef ANALYSIS_CONFIGURABLE_CUTS_CLASSES_H -#define ANALYSIS_CONFIGURABLE_CUTS_CLASSES_H +#ifndef PWGCF_CORE_ANALYSISCONFIGURABLECUTS_H_ +#define PWGCF_CORE_ANALYSISCONFIGURABLECUTS_H_ +#include #include #include #include @@ -84,6 +85,25 @@ class TrackSelectionCfg ClassDefNV(TrackSelectionCfg, 1); }; +/// \brief Simple class to configure a selection based on PID +/// The nsigmas information is for closeness to the line of interest +/// and for separation to the other lines +class TrackSelectionPIDCfg +{ + public: + bool mUseIt = false; + float mMinNSigmasTPC[5] = {-3.0, -3.0, -3.0, -3.0, -3.0}; ///< nsigmas TPC lower limit for e, mu, pi, Ka, and p + float mMaxNSigmasTPC[5] = {3.0, 3.0, 3.0, 3.0, 3.0}; ///< nsigmas TPC upper limit for e, mu, pi, Ka, and p + float mPThreshold = 0.0; ///< momentum threshold for considering TOF information + bool mRequireTOF = true; ///< require or not the presence of TOF when the momentum threshold is passed + float mMinNSigmasTOF[5] = {-3.0, -3.0, -3.0, -3.0, -3.0}; ///< nsigmas TOF lower limit for e, mu, pi, Ka, and p + float mMaxNSigmasTOF[5] = {-3.0, -3.0, 3.0, 3.0, 3.0}; ///< nsigmas TOF upper limit for e, mu, pi, Ka, and p + bool m2Dcut = true; ///< use an elliptic cut using TPC and TOF nsigmas + int mExclude = false; ///< should the identified track be excluded for analysis? + private: + ClassDefNV(TrackSelectionPIDCfg, 1); +}; + class SimpleInclusiveCut : public TNamed { public: @@ -102,4 +122,4 @@ class SimpleInclusiveCut : public TNamed } // namespace analysis } // namespace o2 -#endif // ANALYSIS_CONFIGURABLE_CUTS_CLASSES_H +#endif // PWGCF_CORE_ANALYSISCONFIGURABLECUTS_H_ diff --git a/PWGCF/Core/PWGCFCoreLinkDef.h b/PWGCF/Core/PWGCFCoreLinkDef.h index 06ba35f3f36..e90e7dc9cf7 100644 --- a/PWGCF/Core/PWGCFCoreLinkDef.h +++ b/PWGCF/Core/PWGCFCoreLinkDef.h @@ -8,6 +8,8 @@ // 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. +#ifndef PWGCF_CORE_PWGCFCORELINKDEF_H_ +#define PWGCF_CORE_PWGCFCORELINKDEF_H_ #pragma link off all globals; #pragma link off all classes; @@ -17,5 +19,7 @@ #pragma link C++ class o2::analysis::DptDptBinningCuts + ; #pragma link C++ class o2::analysis::CheckRangeCfg + ; #pragma link C++ class o2::analysis::TrackSelectionCfg + ; +#pragma link C++ class o2::analysis::TrackSelectionPIDCfg + ; #pragma link C++ class o2::analysis::SimpleInclusiveCut + ; #pragma link C++ class CorrelationContainer + ; +#endif // PWGCF_CORE_PWGCFCORELINKDEF_H_ diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index 842215eb001..cd3c4c83664 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -10,6 +10,7 @@ // or submit itself to any jurisdiction. #include +#include #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -88,15 +89,15 @@ TH1F* fhVertexZA = nullptr; TH1F* fhMultB = nullptr; TH1F* fhMultA = nullptr; TH1F* fhPB = nullptr; -TH1F* fhPA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhPA; TH1F* fhPtB = nullptr; -TH1F* fhPtA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhPtA; TH1F* fhPtPosB = nullptr; -TH1F* fhPtPosA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhPtPosA; TH1F* fhPtNegB = nullptr; -TH1F* fhPtNegA[kDptDptNoOfSpecies] = {nullptr}; -TH2F* fhNPosNegA[kDptDptNoOfSpecies] = {nullptr}; -TH1F* fhDeltaNA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhPtNegA; +std::vector fhNPosNegA; +std::vector fhDeltaNA; TH1F* fhEtaB = nullptr; TH1F* fhEtaA = nullptr; @@ -122,15 +123,15 @@ TH1F* fhTrueVertexZB = nullptr; TH1F* fhTrueVertexZA = nullptr; TH1F* fhTrueVertexZAA = nullptr; TH1F* fhTruePB = nullptr; -TH1F* fhTruePA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhTruePA; TH1F* fhTruePtB = nullptr; -TH1F* fhTruePtA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhTruePtA; TH1F* fhTruePtPosB = nullptr; -TH1F* fhTruePtPosA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhTruePtPosA; TH1F* fhTruePtNegB = nullptr; -TH1F* fhTruePtNegA[kDptDptNoOfSpecies] = {nullptr}; -TH2F* fhTrueNPosNegA[kDptDptNoOfSpecies] = {nullptr}; -TH1F* fhTrueDeltaNA[kDptDptNoOfSpecies] = {nullptr}; +std::vector fhTruePtNegA; +std::vector fhTrueNPosNegA; +std::vector fhTrueDeltaNA; TH1F* fhTrueEtaB = nullptr; TH1F* fhTrueEtaA = nullptr; @@ -147,10 +148,10 @@ TH1F* fhTrueDCAzA = nullptr; //============================================================================================ // The DptDptFilter multiplicity counters //============================================================================================ -int trkMultPos[kDptDptNoOfSpecies]; // multiplicity of positive tracks -int trkMultNeg[kDptDptNoOfSpecies]; // multiplicity of negative tracks -int partMultPos[kDptDptNoOfSpecies]; // multiplicity of positive particles -int partMultNeg[kDptDptNoOfSpecies]; // multiplicity of negative particles +std::vector trkMultPos; // multiplicity of positive tracks +std::vector trkMultNeg; // multiplicity of negative tracks +std::vector partMultPos; // multiplicity of positive particles +std::vector partMultNeg; // multiplicity of negative particles } // namespace o2::analysis::dptdptfilter using namespace dptdptfilter; @@ -528,6 +529,168 @@ T computeRMS(std::vector& vec) } struct DptDptFilterTracks { + + struct PIDSpeciesSelection { + static const std::vector pdgcodes; + static const std::vector spnames; + static const std::vector sptitles; + static const std::vector spfnames; + static const char hadname[]; + static const char hadtitle[]; + static const char hadfname[]; + uint getNSpecies() { return config.size(); } + const std::string& getSpeciesName(uint8_t ix) { return spnames[species[ix]]; } + const std::string& getSpeciesTitle(uint8_t ix) { return sptitles[species[ix]]; } + const std::string& getSpeciesFName(uint8_t ix) { return spfnames[species[ix]]; } + static const char* getHadName() { return hadname; } + static const char* getHadTitle() { return hadtitle; } + static const char* getHadFName() { return hadfname; } + void Add(uint8_t sp, const o2::analysis::TrackSelectionPIDCfg* cfg) + { + config.push_back(cfg); + species.push_back(sp); + } + void AddExclude(uint8_t sp, const o2::analysis::TrackSelectionPIDCfg* cfg) + { + configexclude.push_back(cfg); + speciesexclude.push_back(sp); + } + template + int8_t whichSpecies(TrackObject const& track) + { + static std::vector tpcnsigmas = {track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr()}; + static std::vector tofnsigmas = {track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr()}; + + auto closeTo = [](auto values, auto mindet, auto maxdet, uint8_t sp) { + if (mindet[sp] <= values[sp] && values[sp] < maxdet[sp]) { + return true; + } else { + return false; + } + }; + auto awayFrom = [](auto values, auto mindet, auto maxdet, uint8_t sp) { + for (int ix = 0; ix < 5; ix++) { + if (ix != sp) { + if (mindet[ix] <= values[ix] && values[ix] < maxdet[ix]) { + return false; + } + } else { + continue; + } + } + return true; + }; + auto closeToTPC = [&](auto config, uint8_t sp) { + return closeTo(tpcnsigmas, config->mMinNSigmasTPC, config->mMaxNSigmasTPC, sp); + }; + auto awayFromTPC = [&](auto config, uint8_t sp) { + return awayFrom(tpcnsigmas, config->mMinNSigmasTPC, config->mMaxNSigmasTPC, sp); + }; + auto closeToTPCTOF = [&](auto config, uint8_t sp) { + float a = (config->mMaxNSigmasTPC[sp] - config->mMinNSigmasTPC[sp]) / 2.0; + float b = (config->mMaxNSigmasTOF[sp] - config->mMinNSigmasTOF[sp]) / 2.0; + float oa = (config->mMaxNSigmasTPC[sp] + config->mMinNSigmasTPC[sp]) / 2.0; + float ob = (config->mMaxNSigmasTOF[sp] + config->mMinNSigmasTOF[sp]) / 2.0; + float vtpc = tpcnsigmas[sp] - oa; + float vtof = tofnsigmas[sp] - ob; + return (vtpc * vtpc / a / a + vtof * vtof / b / b < 1); + }; + auto closeToTOF = [&](auto config, uint8_t sp) { + if (!track.hasTOF()) { + if (config->mRequireTOF) { + return false; + } else { + return true; + } + } else { + if (config->m2Dcut) { + return closeToTPCTOF(config, sp); + } else { + return closeTo(tofnsigmas, config->mMinNSigmasTOF, config->mMaxNSigmasTOF, sp); + } + } + }; + auto awayFromTOF = [&](auto config, uint8_t sp) { + /* if we are here is because the track has TOF */ + if (config->m2Dcut) { + for (uint8_t ix = 0; ix < 5; ++ix) { + if (ix != sp) { + if (closeToTPCTOF(config, ix)) { + return false; + } + } else { + continue; + } + } + return true; + } else { + return awayFrom(tofnsigmas, config->mMinNSigmasTOF, config->mMaxNSigmasTOF, sp); + } + }; + auto aboveThreshold = [&](auto config) { + return ((config->mPThreshold > 0.0) && (config->mPThreshold < track.p())); + }; + + /* let's first check the exclusion from the analysis */ + for (uint8_t ix = 0; ix < configexclude.size(); ++ix) { + if (closeToTPC(configexclude[ix], speciesexclude[ix]) && awayFromTPC(configexclude[ix], speciesexclude[ix])) { + if (aboveThreshold(configexclude[ix])) { + if (closeToTOF(configexclude[ix], speciesexclude[ix]) && awayFromTOF(configexclude[ix], speciesexclude[ix])) { + return -ix; + } + } + } + } + /* we don't exclude it so check which species if any required */ + if (config.size() > 0) { + int8_t id = -127; + for (uint8_t ix = 0; ix < config.size(); ++ix) { + if (closeToTPC(config[ix], species[ix]) && awayFromTPC(config[ix], species[ix])) { + if (aboveThreshold(config[ix])) { + if (closeToTOF(config[ix], species[ix]) && awayFromTOF(config[ix], species[ix])) { + if (id < 0) { + id = ix; + } else { + /* already identified once */ + return -127; + } + } + } + } + } + return id; + } else { + return 0; + } + } + template + int8_t whichTruthSpecies(ParticleObject part) + { + int pdgcode = abs(part.pdgCode()); + /* let's first check the exclusion from the analysis */ + for (uint8_t ix = 0; ix < configexclude.size(); ++ix) { + if (pdgcode == pdgcodes[speciesexclude[ix]]) { + return -ix; + } + } + /* we don't exclude it so check which species if any required */ + if (config.size() > 0) { + for (uint8_t ix = 0; ix < config.size(); ++ix) { + if (pdgcode == pdgcodes[species[ix]]) { + return ix; + } + } + return -127; + } else { + return 0; + } + } + std::vector config; ///< the PID selection configuration of the species to include in the analysis + std::vector species; ///< the species index of the species to include in the analysis + std::vector configexclude; ///< the PID selection configuration of the species to exclude from the analysis + std::vector speciesexclude; ///< the species index of teh species to exclude from the analysis + }; + Produces scannedtracks; Produces tracksinfo; Produces scannedgentracks; @@ -544,8 +707,21 @@ struct DptDptFilterTracks { Configurable cfgTraceOutOfSpeciesParticles{"trackoutparticles", false, "Track the particles which are not e,mu,pi,K,p: false/true. Default false"}; Configurable cfgRecoIdMethod{"recoidmethod", 0, "Method for identifying reconstructed tracks: 0 No PID, 1 PID, 2 mcparticle. Default 0"}; Configurable cfgTrackSelection{"tracksel", {false, false, 0, 70, 0.8, 2.4, 3.2}, "Track selection: {useit: true/false, ongen: true/false, tpccls, tpcxrws, tpcxrfc, dcaxy, dcaz}. Default {false,0.70.0.8,2.4,3.2}"}; + Configurable cfgPionPIDSelection{"pipidsel", + {}, + "PID criteria for pions"}; + Configurable cfgKaonPIDSelection{"kapidsel", + {}, + "PID criteria for kaons"}; + Configurable cfgProtonPIDSelection{"prpidsel", + {}, + "PID criteria for protons"}; + Configurable cfgElectronPIDSelection{"elpidsel", + {}, + "PID criteria for electrons"}; OutputObj fOutput{"DptDptFilterTracksInfo", OutputObjHandlingPolicy::AnalysisObject}; + PIDSpeciesSelection pidselector; bool checkAmbiguousTracks = false; void init(InitContext&) @@ -611,6 +787,23 @@ struct DptDptFilterTracks { checkAmbiguousTracks = true; } + /* configure the PID selection */ + auto insertInPIDselector = [&](auto cfg, int sp) { + if (cfg.value.mUseIt) { + if (cfg.value.mExclude) { + LOGF(info, "Incorporating species: %s to PID selection for exclusion", pidselector.getSpeciesName(sp)); + pidselector.AddExclude(sp, &(cfg.value)); + } else { + LOGF(info, "Incorporating species: %s to PID selection", pidselector.getSpeciesName(sp)); + pidselector.Add(sp, &(cfg.value)); + } + } + }; + insertInPIDselector(cfgPionPIDSelection, 2); + insertInPIDselector(cfgKaonPIDSelection, 3); + insertInPIDselector(cfgProtonPIDSelection, 4); + insertInPIDselector(cfgElectronPIDSelection, 0); + /* create the output list which will own the task histograms */ TList* fOutputList = new TList(); fOutputList->SetOwner(true); @@ -646,25 +839,51 @@ struct DptDptFilterTracks { fhCompatibleCollisionsZVtxRms = new TH2F("fHistCompatibleCollisionsZVtxRms", "Compatible collisions #it{z}_{vtx} RMS;#sigma_{#it{z}_{vtx}};Multiplicity (%);counts", 100, -10.0, 10.0, 101, -0.5, 100.5); } - for (int sp = 0; sp < kDptDptNoOfSpecies; ++sp) { - fhPA[sp] = new TH1F(TString::Format("fHistPA_%s", speciesName[sp]).Data(), - TString::Format("p distribution for reconstructed %s;p (GeV/c);dN/dp (c/GeV)", speciesTitle[sp]).Data(), + uint nspecies = pidselector.getNSpecies(); + auto reserveHistos = [&](uint n) { + fhPA.reserve(n); + fhPtA.reserve(n); + fhPtPosA.reserve(n); + fhPtNegA.reserve(n); + fhNPosNegA.reserve(n); + fhDeltaNA.reserve(n); + trkMultPos.reserve(n); + trkMultNeg.reserve(n); + }; + auto createHistos = [&](uint ix, auto name, auto title) { + fhPA[ix] = new TH1F(TString::Format("fHistPA_%s", name).Data(), + TString::Format("#it{p} distribution for reconstructed %s;#it{p} (GeV/#it{c});d#it{N}/d#it{p} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhPtA[sp] = new TH1F(TString::Format("fHistPtA_%s", speciesName[sp]), - TString::Format("p_{T} distribution for reconstructed %s;p_{T} (GeV/c);dN/dP_{T} (c/GeV)", speciesTitle[sp]).Data(), + fhPtA[ix] = new TH1F(TString::Format("fHistPtA_%s", name).Data(), + TString::Format("#it{p}_{T} distribution for reconstructed %s;#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{P}_{T} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhPtPosA[sp] = new TH1F(TString::Format("fHistPtPosA_%s", speciesName[sp]), - TString::Format("P_{T} distribution for reconstructed %s^{#plus};P_{T} (GeV/c);dN/dP_{T} (c/GeV)", speciesTitle[sp]).Data(), + fhPtPosA[ix] = new TH1F(TString::Format("fHistPtPosA_%s", name).Data(), + TString::Format("#it{p}_{T} distribution for reconstructed %s^{#plus};#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhPtNegA[sp] = new TH1F(TString::Format("fHistPtNegA_%s", speciesName[sp]), - TString::Format("P_{T} distribution for reconstructed %s^{#minus};P_{T} (GeV/c);dN/dP_{T} (c/GeV)", speciesTitle[sp]).Data(), + fhPtNegA[ix] = new TH1F(TString::Format("fHistPtNegA_%s", name).Data(), + TString::Format("#it{p}_{T} distribution for reconstructed %s^{#minus};#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhNPosNegA[sp] = new TH2F(TString::Format("fhNPosNegA_%s", speciesName[sp]).Data(), - TString::Format("N(%s^{#plus}) N(%s^{#minus}) distribution for reconstructed;N(%s^{#plus});N(%s^{#minus})", speciesTitle[sp], speciesTitle[sp], speciesTitle[sp], speciesTitle[sp]).Data(), + fhNPosNegA[ix] = new TH2F(TString::Format("fhNPosNegA_%s", name).Data(), + TString::Format("#it{N}(%s^{#plus}) #it{N}(%s^{#minus}) distribution for reconstructed;#it{N}(%s^{#plus});#it{N}(%s^{#minus})", title, title, title, title).Data(), 40, -0.5, 39.5, 40, -0.5, 39.5); - fhDeltaNA[sp] = new TH1F(TString::Format("fhDeltaNA_%s", speciesName[sp]).Data(), - TString::Format("N(%s^{#plus}) #minus N(%s^{#minus}) distribution for reconstructed;N(%s^{#plus}) #minus N(%s^{#minus})", speciesTitle[sp], speciesTitle[sp], speciesTitle[sp], speciesTitle[sp]).Data(), + fhDeltaNA[ix] = new TH1F(TString::Format("fhDeltaNA_%s", name).Data(), + TString::Format("#it{N}(%s^{#plus}) #minus #it{N}(%s^{#minus}) distribution for reconstructed;#it{N}(%s^{#plus}) #minus #it{N}(%s^{#minus})", title, title, title, title).Data(), 79, -39.5, 39.5); + trkMultPos[ix] = 0; + trkMultNeg[ix] = 0; + }; + if (nspecies == 0) { + /* no species so charged tracks analysis*/ + LOGF(info, "Unidentified analysis"); + reserveHistos(1); + createHistos(0, pidselector.getHadFName(), pidselector.getHadTitle()); + } else { + reserveHistos(nspecies); + LOGF(info, "Identified analysis with %d species", nspecies); + for (uint sp = 0; sp < nspecies; ++sp) { + LOGF(info, "Adding species %s", pidselector.getSpeciesFName(sp)); + createHistos(sp, pidselector.getSpeciesFName(sp).c_str(), pidselector.getSpeciesTitle(sp).c_str()); + } } /* add the hstograms to the output list */ @@ -688,8 +907,8 @@ struct DptDptFilterTracks { fOutputList->Add(fhAmbiguityDegree); fOutputList->Add(fhCompatibleCollisionsZVtxRms); } - - for (int sp = 0; sp < kDptDptNoOfSpecies; ++sp) { + uint nhsets = (nspecies > 0) ? nspecies : 1; + for (uint sp = 0; sp < nhsets; ++sp) { fOutputList->Add(fhPA[sp]); fOutputList->Add(fhPtA[sp]); fOutputList->Add(fhPtPosA[sp]); @@ -701,43 +920,65 @@ struct DptDptFilterTracks { if ((fDataType != kData) && (fDataType != kDataNoEvtSel)) { /* create the true data histograms */ - fhTruePB = new TH1F("fTrueHistPB", "p distribution before (truth);p (GeV/c);dN/dp (c/GeV)", 100, 0.0, 15.0); - fhTruePtB = new TH1F("fTrueHistPtB", "p_{T} distribution before (truth);p_{T} (GeV/c);dN/dP_{T} (c/GeV)", 100, 0.0, 15.0); - fhTruePtPosB = new TH1F("fTrueHistPtPosB", "P_{T} distribution (#plus) before (truth);P_{T} (GeV/c);dN/dP_{T} (c/GeV)", 100, 0.0, 15.0); - fhTruePtNegB = new TH1F("fTrueHistPtNegB", "P_{T} distribution (#minus) before (truth);P_{T} (GeV/c);dN/dP_{T} (c/GeV)", 100, 0.0, 15.0); + fhTruePB = new TH1F("fTrueHistPB", "#it{p} distribution before (truth);#it{p} (GeV/#it{c});d#it{N}/d#it{p} (#it{c}/GeV)", 100, 0.0, 15.0); + fhTruePtB = new TH1F("fTrueHistPtB", "#it{p}_{T} distribution before (truth);#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", 100, 0.0, 15.0); + fhTruePtPosB = new TH1F("fTrueHistPtPosB", "#it{p}_{T} distribution (#plus) before (truth);#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", 100, 0.0, 15.0); + fhTruePtNegB = new TH1F("fTrueHistPtNegB", "#it{p}_{T} distribution (#minus) before (truth);#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", 100, 0.0, 15.0); fhTrueEtaB = new TH1F("fTrueHistEtaB", "#eta distribution before (truth);#eta;counts", 40, -2.0, 2.0); fhTrueEtaA = new TH1F("fTrueHistEtaA", "#eta distribution (truth);#eta;counts", etabins, etalow, etaup); fhTruePhiB = new TH1F("fTrueHistPhiB", "#phi distribution before (truth);#phi;counts", 360, 0.0, constants::math::TwoPI); fhTruePhiA = new TH1F("fTrueHistPhiA", "#phi distribution (truth);#phi;counts", 360, 0.0, constants::math::TwoPI); - fhTrueDCAxyB = new TH1F("TrueDCAxyB", "DCA_{xy} distribution for generated before;DCA_{xy} (cm);counts", 1000, -4.0, 4.0); + fhTrueDCAxyB = new TH1F("TrueDCAxyB", "DCA_{#it{xy}} distribution for generated before;DCA_{#it{xy}} (cm);counts", 1000, -4.0, 4.0); if (traceDCAOutliers.mDoIt) { fhTrueDCAxyBid = new TH1F("PDGCodeDCAxyB", TString::Format("PDG code within %.2f<|DCA_{#it{xy}}|<%.2f; PDG code", traceDCAOutliers.mLowValue, traceDCAOutliers.mUpValue).Data(), 100, 0.5, 100.5); } - fhTrueDCAxyA = new TH1F("TrueDCAxyA", "DCA_{xy} distribution for generated;DCA_{xy};counts (cm)", 1000, -4., 4.0); - fhTrueDCAzB = new TH1F("TrueDCAzB", "DCA_{z} distribution for generated before;DCA_{z} (cm);counts", 1000, -4.0, 4.0); - fhTrueDCAzA = new TH1F("TrueDCAzA", "DCA_{z} distribution for generated;DCA_{z} (cm);counts", 1000, -4.0, 4.0); - - for (int sp = 0; sp < kDptDptNoOfSpecies; ++sp) { - fhTruePA[sp] = new TH1F(TString::Format("fTrueHistPA_%s", speciesName[sp]).Data(), - TString::Format("p distribution %s (truth);p (GeV/c);dN/dp (c/GeV)", speciesTitle[sp]).Data(), + fhTrueDCAxyA = new TH1F("TrueDCAxyA", "DCA_{#it{xy}} distribution for generated;DCA_{#it{xy}};counts (cm)", 1000, -4., 4.0); + fhTrueDCAzB = new TH1F("TrueDCAzB", "DCA_{#it{z}} distribution for generated before;DCA_{#it{z}} (cm);counts", 1000, -4.0, 4.0); + fhTrueDCAzA = new TH1F("TrueDCAzA", "DCA_{#it{z}} distribution for generated;DCA_{#it{z}} (cm);counts", 1000, -4.0, 4.0); + + auto reserveTruthHistos = [&](uint n) { + fhTruePA.reserve(n); + fhTruePtA.reserve(n); + fhTruePtPosA.reserve(n); + fhTruePtNegA.reserve(n); + fhTrueNPosNegA.reserve(n); + fhTrueDeltaNA.reserve(n); + partMultPos.reserve(n); + partMultNeg.reserve(n); + }; + auto createTruthHistos = [&](uint ix, auto name, auto title) { + fhTruePA[ix] = new TH1F(TString::Format("fTrueHistPA_%s", name).Data(), + TString::Format("#it{p} distribution %s (truth);#it{p} (GeV/#it{c});d#it{N}/d#it{p} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhTruePtA[sp] = new TH1F(TString::Format("fTrueHistPtA_%s", speciesName[sp]), - TString::Format("p_{T} distribution %s (truth);p_{T} (GeV/c);dN/dP_{T} (c/GeV)", speciesTitle[sp]).Data(), + fhTruePtA[ix] = new TH1F(TString::Format("fTrueHistPtA_%s", name).Data(), + TString::Format("#it{p}_{T} distribution %s (truth);#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhTruePtPosA[sp] = new TH1F(TString::Format("fTrueHistPtPosA_%s", speciesName[sp]), - TString::Format("P_{T} distribution %s^{#plus} (truth);P_{T} (GeV/c);dN/dP_{T} (c/GeV)", speciesTitle[sp]).Data(), + fhTruePtPosA[ix] = new TH1F(TString::Format("fTrueHistPtPosA_%s", name).Data(), + TString::Format("#it{p}_{T} distribution %s^{#plus} (truth);#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhTruePtNegA[sp] = new TH1F(TString::Format("fTrueHistPtNegA_%s", speciesName[sp]), - TString::Format("P_{T} distribution %s^{#minus} (truth);P_{T} (GeV/c);dN/dP_{T} (c/GeV)", speciesTitle[sp]).Data(), + fhTruePtNegA[ix] = new TH1F(TString::Format("fTrueHistPtNegA_%s", name).Data(), + TString::Format("#it{p}_{T} distribution %s^{#minus} (truth);#it{p}_{T} (GeV/#it{c});d#it{N}/d#it{p}_{T} (#it{c}/GeV)", title).Data(), ptbins, ptlow, ptup); - fhTrueNPosNegA[sp] = new TH2F(TString::Format("fhTrueNPosNegA_%s", speciesName[sp]).Data(), - TString::Format("N(%s^{#plus}) N(%s^{#minus}) distribution (truth);N(%s^{#plus});N(%s^{#minus})", speciesTitle[sp], speciesTitle[sp], speciesTitle[sp], speciesTitle[sp]).Data(), + fhTrueNPosNegA[ix] = new TH2F(TString::Format("fhTrueNPosNegA_%s", name).Data(), + TString::Format("#it{N}(%s^{#plus}) #it{N}(%s^{#minus}) distribution (truth);#it{N}(%s^{#plus});#it{N}(%s^{#minus})", title, title, title, title).Data(), 40, -0.5, 39.5, 40, -0.5, 39.5); - fhTrueDeltaNA[sp] = new TH1F(TString::Format("fhTrueDeltaNA_%s", speciesName[sp]).Data(), - TString::Format("N(%s^{#plus}) #minus N(%s^{#minus}) distribution (truth);N(%s^{#plus}) #minus N(%s^{#minus})", speciesTitle[sp], speciesTitle[sp], speciesTitle[sp], speciesTitle[sp]).Data(), + fhTrueDeltaNA[ix] = new TH1F(TString::Format("fhTrueDeltaNA_%s", name).Data(), + TString::Format("#it{N}(%s^{#plus}) #minus #it{N}(%s^{#minus}) distribution (truth);#it{N}(%s^{#plus}) #minus #it{N}(%s^{#minus})", title, title, title, title).Data(), 79, -39.5, 39.5); + partMultPos[ix] = 0; + partMultNeg[ix] = 0; + }; + uint nspecies = pidselector.getNSpecies(); + if (nspecies == 0) { + reserveTruthHistos(1); + createTruthHistos(0, pidselector.getHadFName(), pidselector.getHadTitle()); + } else { + reserveTruthHistos(nspecies); + for (uint sp = 0; sp < nspecies; ++sp) { + createTruthHistos(sp, pidselector.getSpeciesFName(sp).c_str(), pidselector.getSpeciesTitle(sp).c_str()); + } } /* add the hstograms to the output list */ @@ -756,8 +997,8 @@ struct DptDptFilterTracks { fOutputList->Add(fhTrueDCAxyA); fOutputList->Add(fhTrueDCAzB); fOutputList->Add(fhTrueDCAzA); - - for (int sp = 0; sp < kDptDptNoOfSpecies; ++sp) { + uint nhsets = (nspecies > 0) ? nspecies : 1; + for (uint sp = 0; sp < nhsets; ++sp) { fOutputList->Add(fhTruePA[sp]); fOutputList->Add(fhTruePtA[sp]); fOutputList->Add(fhTruePtPosA[sp]); @@ -769,19 +1010,19 @@ struct DptDptFilterTracks { } template - inline MatchRecoGenSpecies IdentifyTrack(TrackObject const& track); - template - MatchRecoGenSpecies trackIdentification(TrackObject const& track); + int8_t trackIdentification(TrackObject const& track); template int8_t selectTrack(TrackObject const& track); template int8_t selectTrackAmbiguousCheck(CollisionObjects const& collisions, TrackObject const& track); template - inline MatchRecoGenSpecies IdentifyParticle(ParticleObject const& particle); + int8_t identifyParticle(ParticleObject const& particle); + template + int8_t selectParticle(ParticleObject const& particle, MCCollisionObject const& mccollision); template void fillTrackHistosBeforeSelection(TrackObject const& track); template - void fillTrackHistosAfterSelection(TrackObject const& track, MatchRecoGenSpecies sp); + void fillTrackHistosAfterSelection(TrackObject const& track, int8_t sp); template void fillParticleHistosBeforeSelection(ParticleObject const& particle, MCCollisionObject const& collision, @@ -790,7 +1031,7 @@ struct DptDptFilterTracks { void fillParticleHistosAfterSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge, - MatchRecoGenSpecies sp); + int8_t sp); /* TODO: as it is now when the derived data is stored (fullDerivedData = true) */ /* the collision index stored with the track is wrong. This has to be fixed */ @@ -868,46 +1109,12 @@ struct DptDptFilterTracks { } int8_t pid = -1; - if (charge != 0) { if (particle.has_mcCollision() && (particle.template mcCollision_as>()).collisionaccepted()) { auto mccollision = particle.template mcCollision_as>(); - /* before particle selection */ - fillParticleHistosBeforeSelection(particle, mccollision, charge); - - /* track selection */ - /* TODO: at some point the pid has to be substituted by the identified species */ - pid = AcceptParticle(particle, mccollision); + pid = selectParticle(particle, mccollision); if (!(pid < 0)) { - /* the particle has been accepted */ - /* let's identify the particle */ - /* TODO: probably this needs to go to AcceptParticle */ - MatchRecoGenSpecies sp = IdentifyParticle(particle); - if (sp != kWrongSpecies) { - if (sp != kDptDptCharged) { - /* fill the charged particle histograms */ - fillParticleHistosAfterSelection(particle, mccollision, charge, kDptDptCharged); - /* update charged multiplicities */ - if (pid % 2 == 0) { - partMultPos[kDptDptCharged]++; - } - if (pid % 2 == 1) { - partMultNeg[kDptDptCharged]++; - } - } - /* fill the species histograms */ - fillParticleHistosAfterSelection(particle, mccollision, charge, sp); - /* update species multiplicities */ - if (pid % 2 == 0) { - partMultPos[sp]++; - } - if (pid % 2 == 1) { - partMultNeg[sp]++; - } - acceptedparticles++; - } else { - pid = -1; - } + acceptedparticles++; } } } else { @@ -980,123 +1187,34 @@ struct DptDptFilterTracks { { filterParticles(gencollisions, particles); } - PROCESS_SWITCH(DptDptFilterTracks, filterGenerated, "Generated particles filering", true) + PROCESS_SWITCH(DptDptFilterTracks, filterGenerated, "Generated particles filtering", true) }; -template -inline MatchRecoGenSpecies DptDptFilterTracks::IdentifyParticle(ParticleObject const& particle) -{ - using namespace dptdptfilter; - - constexpr int pdgcodeEl = 11; - constexpr int pdgcodeMu = 13; - constexpr int pdgcodePi = 211; - constexpr int pdgcodeKa = 321; - constexpr int pdgcodePr = 2212; - - int pdgcode = abs(particle.pdgCode()); - - switch (pdgcode) { - case pdgcodeEl: - return kDptDptElectron; - break; - case pdgcodeMu: - return kDptDptMuon; - break; - case pdgcodePi: - return kDptDptPion; - break; - case pdgcodeKa: - return kDptDptKaon; - break; - case pdgcodePr: - return kDptDptProton; - break; - - default: - if (traceOutOfSpeciesParticles) { - LOGF(info, "Wrong particle passed selection cuts. PDG code: %d", pdgcode); - } - return kWrongSpecies; - break; - } -} - -template -inline MatchRecoGenSpecies DptDptFilterTracks::IdentifyTrack(TrackObject const& track) -{ - using namespace o2::analysis::dptdptfilter; - - float nsigmas[kDptDptNoOfSpecies]; - if (track.p() < 0.8) { - nsigmas[kDptDptCharged] = 999.0f; - nsigmas[kDptDptElectron] = track.tpcNSigmaEl(); - nsigmas[kDptDptMuon] = track.tpcNSigmaMu(); - nsigmas[kDptDptPion] = track.tpcNSigmaPi(); - nsigmas[kDptDptKaon] = track.tpcNSigmaKa(); - nsigmas[kDptDptProton] = track.tpcNSigmaPr(); - } else { - /* introduce require TOF flag */ - if (track.hasTOF()) { - nsigmas[kDptDptCharged] = 999.0f; - nsigmas[kDptDptElectron] = sqrtf(track.tpcNSigmaEl() * track.tpcNSigmaEl() + track.tofNSigmaEl() * track.tofNSigmaEl()); - nsigmas[kDptDptMuon] = sqrtf(track.tpcNSigmaMu() * track.tpcNSigmaMu() + track.tofNSigmaMu() * track.tofNSigmaMu()); - nsigmas[kDptDptPion] = sqrtf(track.tpcNSigmaPi() * track.tpcNSigmaPi() + track.tofNSigmaPi() * track.tofNSigmaPi()); - nsigmas[kDptDptKaon] = sqrtf(track.tpcNSigmaKa() * track.tpcNSigmaKa() + track.tofNSigmaKa() * track.tofNSigmaKa()); - nsigmas[kDptDptProton] = sqrtf(track.tpcNSigmaPr() * track.tpcNSigmaPr() + track.tofNSigmaPr() * track.tofNSigmaPr()); - } else { - nsigmas[kDptDptCharged] = 999.0f; - nsigmas[kDptDptElectron] = track.tpcNSigmaEl(); - nsigmas[kDptDptMuon] = track.tpcNSigmaMu(); - nsigmas[kDptDptPion] = track.tpcNSigmaPi(); - nsigmas[kDptDptKaon] = track.tpcNSigmaKa(); - nsigmas[kDptDptProton] = track.tpcNSigmaPr(); - } - } - float min_nsigma = 999.0f; - MatchRecoGenSpecies sp_min_nsigma = kWrongSpecies; - for (int sp = 0; sp < kDptDptNoOfSpecies; ++sp) { - if (nsigmas[sp] < min_nsigma) { - min_nsigma = nsigmas[sp]; - sp_min_nsigma = MatchRecoGenSpecies(sp); - } - } - bool doublematch = false; - if (min_nsigma < 3.0) { - for (int sp = 0; (sp < kDptDptNoOfSpecies) && !doublematch; ++sp) { - if (sp != sp_min_nsigma) { - if (nsigmas[sp] < 3.0) { - doublematch = true; - } - } - } - if (doublematch) { - return kWrongSpecies; - } else { - return sp_min_nsigma; - } - } else { - return kWrongSpecies; - } -} +const std::vector DptDptFilterTracks::PIDSpeciesSelection::pdgcodes = {11, 13, 211, 321, 2212}; +const std::vector DptDptFilterTracks::PIDSpeciesSelection::spnames = {"e", "mu", "pi", "ka", "p"}; +const std::vector DptDptFilterTracks::PIDSpeciesSelection::sptitles = {"e", "#mu", "#pi", "K", "p"}; +const std::vector DptDptFilterTracks::PIDSpeciesSelection::spfnames = {"E", "Mu", "Pi", "Ka", "Pr"}; +const char DptDptFilterTracks::PIDSpeciesSelection::hadname[] = "h"; +const char DptDptFilterTracks::PIDSpeciesSelection::hadtitle[] = "h"; +const char DptDptFilterTracks::PIDSpeciesSelection::hadfname[] = "Ha"; template -MatchRecoGenSpecies DptDptFilterTracks::trackIdentification(TrackObject const& track) +int8_t DptDptFilterTracks::trackIdentification(TrackObject const& track) { using namespace dptdptfilter; - MatchRecoGenSpecies sp = kWrongSpecies; + int8_t sp = -127; if (recoIdMethod == 0) { - sp = kDptDptCharged; + sp = 0; } else if (recoIdMethod == 1) { if constexpr (framework::has_type_v) { - sp = IdentifyTrack(track); + sp = pidselector.whichSpecies(track); } else { LOGF(fatal, "Track identification required but PID information not present"); } } 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"); } @@ -1113,36 +1231,27 @@ int8_t DptDptFilterTracks::selectTrack(TrackObject const& track) fillTrackHistosBeforeSelection(track); /* track selection */ - int8_t pid = AcceptTrack(track); - if (!(pid < 0)) { + int8_t sp = -127; + if (AcceptTrack(track)) { /* the track has been accepted */ /* let's identify it */ - /* TODO: probably this needs to go inside AcceptTrack */ - MatchRecoGenSpecies sp = trackIdentification(track); - if (sp != kWrongSpecies) { - if (sp != kDptDptCharged) { - /* fill the charged histograms */ - fillTrackHistosAfterSelection(track, kDptDptCharged); - /* update charged multiplicities */ - if (pid % 2 == 0) { - trkMultPos[kDptDptCharged]++; - } - if (pid % 2 == 1) { - trkMultNeg[kDptDptCharged]++; - } - } + sp = trackIdentification(track); + if (!(sp < 0)) { /* fill the species histograms */ fillTrackHistosAfterSelection(track, sp); /* update species multiplicities */ - if (pid % 2 == 0) { + if (track.sign() > 0) { trkMultPos[sp]++; - } - if (pid % 2 == 1) { + /* positive tracks even pid */ + sp = sp * 2; + } else if (track.sign() < 0) { trkMultNeg[sp]++; + /* negative tracks odd pid */ + sp = sp * 2 + 1; } } } - return pid; + return sp; } template @@ -1216,7 +1325,7 @@ void DptDptFilterTracks::fillTrackHistosBeforeSelection(TrackObject const& track } template -void DptDptFilterTracks::fillTrackHistosAfterSelection(TrackObject const& track, MatchRecoGenSpecies sp) +void DptDptFilterTracks::fillTrackHistosAfterSelection(TrackObject const& track, int8_t sp) { /* the charged species should have been called first so avoid double counting */ if (sp == kDptDptCharged) { @@ -1240,6 +1349,50 @@ void DptDptFilterTracks::fillTrackHistosAfterSelection(TrackObject const& track, } } +template +inline int8_t DptDptFilterTracks::identifyParticle(ParticleObject const& particle) +{ + using namespace dptdptfilter; + return pidselector.whichTruthSpecies(particle); +} + +template +inline int8_t DptDptFilterTracks::selectParticle(ParticleObject const& particle, MCCollisionObject const& mccollision) +{ + float charge = 0.0; + TParticlePDG* pdgparticle = fPDG->GetParticle(particle.pdgCode()); + if (pdgparticle != nullptr) { + charge = (pdgparticle->Charge() / 3 >= 1) ? 1.0 : ((pdgparticle->Charge() / 3 <= -1) ? -1.0 : 0); + } + int8_t sp = -127; + if (charge != 0) { + /* before particle selection */ + fillParticleHistosBeforeSelection(particle, mccollision, charge); + + /* track selection */ + if (AcceptParticle(particle, mccollision)) { + /* the particle has been accepted */ + /* let's identify the particle */ + int8_t sp = identifyParticle(particle); + if (!(sp < 0)) { + /* fill the species histograms */ + fillParticleHistosAfterSelection(particle, mccollision, charge, sp); + /* update species multiplicities */ + if (charge > 0) { + partMultPos[sp]++; + /* positive species even pid */ + sp = sp * 2; + } else { + partMultNeg[sp]++; + /* negative species odd pid */ + sp = sp * 2 + 1; + } + } + } + } + return sp; +} + template void DptDptFilterTracks::fillParticleHistosBeforeSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge) { @@ -1265,7 +1418,7 @@ void DptDptFilterTracks::fillParticleHistosBeforeSelection(ParticleObject const& } template -void DptDptFilterTracks::fillParticleHistosAfterSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge, MatchRecoGenSpecies sp) +void DptDptFilterTracks::fillParticleHistosAfterSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge, int8_t sp) { /* the charged species should have been called first so avoid double counting */ if (sp == kDptDptCharged) { diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index 905f14abc00..cb6ee2ffbe1 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -659,33 +659,23 @@ inline bool matchTrackType(TrackObject const& track) /// \brief Accepts or not the passed track /// \param track the track of interest -/// \return the internal track id, -1 if not accepted -/// TODO: the PID implementation -/// For the time being we keep the convention -/// - positive track pid even -/// - negative track pid odd -/// - charged hadron 0/1 +/// \return true if the track is accepted, otherwise false template -inline int8_t AcceptTrack(TrackObject const& track) +inline bool AcceptTrack(TrackObject const& track) { /* TODO: incorporate a mask in the scanned tracks table for the rejecting track reason */ if constexpr (framework::has_type_v) { if (track.mcParticleId() < 0) { - return -1; + return false; } } if (matchTrackType(track)) { if (ptlow < track.pt() && track.pt() < ptup && etalow < track.eta() && track.eta() < etaup) { - if (track.sign() > 0) { - return 0; - } - if (track.sign() < 0) { - return 1; - } + return true; } } - return -1; + return false; } template @@ -704,14 +694,9 @@ void exploreMothers(ParticleObject& particle, MCCollisionObject& collision) /// \brief Accepts or not the passed generated particle /// \param track the particle of interest -/// \return the internal particle id, -1 if not accepted -/// TODO: the PID implementation -/// For the time being we keep the convention -/// - positive particle pid even -/// - negative particle pid odd -/// - charged hadron 0/1 +/// \return `true` if the particle is accepted, `false` otherwise template -inline int8_t AcceptParticle(ParticleObject& particle, MCCollisionObject const& collision) +inline bool AcceptParticle(ParticleObject& particle, MCCollisionObject const& collision) { float charge = (fPDG->GetParticle(particle.pdgCode())->Charge() / 3 >= 1) ? 1.0 : ((fPDG->GetParticle(particle.pdgCode())->Charge() / 3 <= -1) ? -1.0 : 0.0); @@ -733,23 +718,18 @@ inline int8_t AcceptParticle(ParticleObject& particle, MCCollisionObject const& exploreMothers(particle, collision); } - return -1; + return false; } } if (ptlow < particle.pt() && particle.pt() < ptup && etalow < particle.eta() && particle.eta() < etaup) { - if (charge > 0) { - return 0; - } - if (charge < 0) { - return 1; - } + return (charge != 0) ? true : false; } } else { if ((particle.mcCollisionId() == 0) && traceCollId0) { LOGF(info, "Particle %d NOT passed isPhysicalPrimary", particle.globalIndex()); } } - return -1; + return false; } } // namespace dptdptfilter diff --git a/PWGCF/Tasks/match-reco-gen.cxx b/PWGCF/Tasks/match-reco-gen.cxx index 30f7c723da5..10944ea4f38 100644 --- a/PWGCF/Tasks/match-reco-gen.cxx +++ b/PWGCF/Tasks/match-reco-gen.cxx @@ -303,9 +303,9 @@ struct CheckGeneratorLevelVsDetectorLevel { histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecomrphi"), track1.phi(), particle.phi()); histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("genrecomrpt"), track1.pt(), particle.pt()); if (particle.mcCollisionId() != colls.iteratorAt(track1.collisionId()).mcCollisionId()) { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollidmr"), kDONTMATCH + 0.5f); + histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollidmr"), static_cast(kDONTMATCH) + 0.5f); } else { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollidmr"), kMATCH + 0.5f); + histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollidmr"), static_cast(kMATCH) + 0.5f); } } } else if (nrec > 0) { @@ -330,9 +330,9 @@ struct CheckGeneratorLevelVsDetectorLevel { LOGF(info, " associated to track with index %d and label %d assigned to collision %d, with associated MC collision %d", track.globalIndex(), ixpart, track.collisionId(), colls.iteratorAt(track.collisionId()).mcCollisionId()); } - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollid"), kDONTMATCH + 0.5f); + histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollid"), static_cast(kDONTMATCH) + 0.5f); } else { - histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollid"), kMATCH + 0.5f); + histos.fill(HIST(dir[ba]) + HIST(colldir[collsign]) + HIST("matchcollid"), static_cast(kMATCH) + 0.5f); } } } @@ -436,16 +436,11 @@ struct CheckGeneratorLevelVsDetectorLevel { float centormult = -100.0f; if (IsEvtSelected(coll, centormult)) { /* TODO: AcceptTrack does not consider PID */ - int pid = AcceptTrack(track); - if ((pid == 0) || (pid == 1)) { + if (AcceptTrack(track)) { /* 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()); mclabelpos[kPOSITIVE][label].push_back(recix); - } else { - if (pid > 1) { - LOGF(fatal, "Task not prepared for PID"); - } } } } From 8adab0064fc7e3bc08727158cb316b050e2719d2 Mon Sep 17 00:00:00 2001 From: gmantzar <62671855+gmantzar@users.noreply.github.com> Date: Sun, 11 Feb 2024 14:40:45 +0100 Subject: [PATCH 10/26] PWGCF: Debug-task: Add optional THnSparse plots (#4659) Co-authored-by: Georgios Mantzaridis --- .../FemtoDream/Core/femtoDreamParticleHisto.h | 119 +++++++++++++----- .../FemtoDream/Tasks/femtoDreamDebugTrack.cxx | 15 ++- PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx | 13 +- .../Tasks/femtoDreamPairTaskTrackTrack.cxx | 8 +- .../Tasks/femtoDreamPairTaskTrackV0.cxx | 16 +-- .../femtoDreamTripletTaskTrackTrackTrack.cxx | 4 +- 6 files changed, 118 insertions(+), 57 deletions(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h index 6c3c8646c41..e34a3196b71 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h +++ b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h @@ -48,7 +48,7 @@ class FemtoDreamParticleHisto /// \param tempFitVarpTAxis axis object for the pT axis in the pT vs. tempFitVar plots /// \param tempFitVarAxis axis object for the tempFitVar axis template - void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& tempFitVarMomentumAxis, T& tempFitVarAxis, T& InvMassAxis) + void init_base(std::string folderName, std::string tempFitVarAxisTitle, T& pTAxis, T& tempFitVarAxis, T& InvMassAxis) { std::string folderSuffix = static_cast(o2::aod::femtodreamMCparticle::MCTypeName[mc]).c_str(); /// Histograms of the kinematic properties @@ -58,20 +58,20 @@ class FemtoDreamParticleHisto /// particle specific histogramms for the TempFitVar column in FemtoDreamParticles if constexpr (o2::aod::femtodreamMCparticle::MCType::kRecon == mc) { - mHistogramRegistry->add((folderName + folderSuffix + static_cast(o2::aod::femtodreamparticle::TempFitVarName[mParticleType])).c_str(), ("; #it{p}_{T} (GeV/#it{c}); " + tempFitVarAxisTitle).c_str(), kTH2F, {{tempFitVarMomentumAxis}, {tempFitVarAxis}}); + mHistogramRegistry->add((folderName + folderSuffix + static_cast(o2::aod::femtodreamparticle::TempFitVarName[mParticleType])).c_str(), ("; #it{p}_{T} (GeV/#it{c}); " + tempFitVarAxisTitle).c_str(), kTH2F, {{pTAxis}, {tempFitVarAxis}}); } if constexpr (mParticleType == o2::aod::femtodreamparticle::ParticleType::kV0 && mc == o2::aod::femtodreamMCparticle::MCType::kRecon) { mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassLambda").c_str(), "; M_{#Lambda}; Entries", kTH1F, {InvMassAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/hpTInvMassLambda").c_str(), "; p_{T} (GeV/#it{c{}); M_{#Lambda}", kTH2F, {tempFitVarMomentumAxis, InvMassAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/hpTInvMassLambda").c_str(), "; p_{T} (GeV/#it{c{}); M_{#Lambda}", kTH2F, {pTAxis, InvMassAxis}); mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassAntiLambda").c_str(), "; M_{#bar{#Lambda}}; Entries", kTH1F, {InvMassAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/hpTInvMassAntiLambda").c_str(), "; M_{#bar{#Lambda}}; Entries", kTH2F, {tempFitVarMomentumAxis, InvMassAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/hpTInvMassAntiLambda").c_str(), "; M_{#bar{#Lambda}}; Entries", kTH2F, {pTAxis, InvMassAxis}); mHistogramRegistry->add((folderName + folderSuffix + "/hInvMassLambdaAntiLambda").c_str(), "; M_{#Lambda}; M_{#bar{#Lambda}}", kTH2F, {InvMassAxis, InvMassAxis}); } } // comment template - void init_debug(std::string folderName, T& tempFitVarMomentumAxis, T& NsigmaTPCAxis, T& NsigmaTOFAxis, T& NsigmaTPCTOFAxis) + void init_debug(std::string folderName, T& multAxis, T& multPercentileAxis, T& pTAxis, T& etaAxis, T& phiAxis, T& tempFitVarAxis, T& dcaZAxis, T& NsigmaTPCAxis, T& NsigmaTOFAxis, T& NsigmaTPCTOFAxis, T& TPCclustersAxis, bool correlatedPlots) { std::string folderSuffix = static_cast(o2::aod::femtodreamMCparticle::MCTypeName[mc]).c_str(); @@ -92,24 +92,27 @@ class FemtoDreamParticleHisto mHistogramRegistry->add((folderName + folderSuffix + "/hTPCfoundVsShared").c_str(), ";TPC found clusters ; TPC shared clusters;", kTH2F, {{163, -0.5, 162.5}, {163, -0.5, 162.5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hITSclusters").c_str(), "; ITS clusters; Entries", kTH1F, {{10, -0.5, 9.5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hITSclustersIB").c_str(), "; ITS clusters in IB; Entries", kTH1F, {{10, -0.5, 9.5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/hDCAz").c_str(), "; #it{p} (GeV/#it{c}); DCA_{z} (cm)", kTH2F, {tempFitVarMomentumAxis, {500, -5, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/hDCA").c_str(), "; #it{p} (GeV/#it{c}); DCA (cm)", kTH2F, {tempFitVarMomentumAxis, {300, 0., 1.5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hDCAz").c_str(), "; #it{p} (GeV/#it{c}); DCA_{z} (cm)", kTH2F, {pTAxis, {500, -5, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hDCA").c_str(), "; #it{p} (GeV/#it{c}); DCA (cm)", kTH2F, {pTAxis, {300, 0., 1.5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hTPCdEdX").c_str(), "; #it{p} (GeV/#it{c}); TPC Signal", kTH2F, {{100, 0, 10}, {1000, 0, 1000}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_el").c_str(), "n#sigma_{TPC}^{e}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_pi").c_str(), "n#sigma_{TPC}^{#pi}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_K").c_str(), "n#sigma_{TPC}^{K}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_p").c_str(), "n#sigma_{TPC}^{p}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_d").c_str(), "n#sigma_{TPC}^{d}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_el").c_str(), "n#sigma_{TOF}^{e}", kTH2F, {tempFitVarMomentumAxis, NsigmaTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_pi").c_str(), "n#sigma_{TOF}^{#pi}", kTH2F, {tempFitVarMomentumAxis, NsigmaTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_K").c_str(), "n#sigma_{TOF}^{K}", kTH2F, {tempFitVarMomentumAxis, NsigmaTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_p").c_str(), "n#sigma_{TOF}^{p}", kTH2F, {tempFitVarMomentumAxis, NsigmaTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_d").c_str(), "n#sigma_{TOF}^{d}", kTH2F, {tempFitVarMomentumAxis, NsigmaTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_el").c_str(), "n#sigma_{comb}^{e}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_pi").c_str(), "n#sigma_{comb}^{#pi}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "n#sigma_{comb}^{K}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "n#sigma_{comb}^{p}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCTOFAxis}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "n#sigma_{comb}^{d}", kTH2F, {tempFitVarMomentumAxis, NsigmaTPCTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_el").c_str(), "n#sigma_{TPC}^{e}", kTH2F, {pTAxis, NsigmaTPCAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_pi").c_str(), "n#sigma_{TPC}^{#pi}", kTH2F, {pTAxis, NsigmaTPCAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_K").c_str(), "n#sigma_{TPC}^{K}", kTH2F, {pTAxis, NsigmaTPCAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_p").c_str(), "n#sigma_{TPC}^{p}", kTH2F, {pTAxis, NsigmaTPCAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_d").c_str(), "n#sigma_{TPC}^{d}", kTH2F, {pTAxis, NsigmaTPCAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_el").c_str(), "n#sigma_{TOF}^{e}", kTH2F, {pTAxis, NsigmaTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_pi").c_str(), "n#sigma_{TOF}^{#pi}", kTH2F, {pTAxis, NsigmaTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_K").c_str(), "n#sigma_{TOF}^{K}", kTH2F, {pTAxis, NsigmaTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_p").c_str(), "n#sigma_{TOF}^{p}", kTH2F, {pTAxis, NsigmaTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_d").c_str(), "n#sigma_{TOF}^{d}", kTH2F, {pTAxis, NsigmaTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_el").c_str(), "n#sigma_{comb}^{e}", kTH2F, {pTAxis, NsigmaTPCTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_pi").c_str(), "n#sigma_{comb}^{#pi}", kTH2F, {pTAxis, NsigmaTPCTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "n#sigma_{comb}^{K}", kTH2F, {pTAxis, NsigmaTPCTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "n#sigma_{comb}^{p}", kTH2F, {pTAxis, NsigmaTPCTOFAxis}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "n#sigma_{comb}^{d}", kTH2F, {pTAxis, NsigmaTPCTOFAxis}); + if (correlatedPlots) { + mHistogramRegistry->add((folderName + folderSuffix + "/HighDcorrelator").c_str(), "", kTHnSparseF, {multAxis, multPercentileAxis, pTAxis, etaAxis, phiAxis, tempFitVarAxis, tempFitVarAxis, NsigmaTPCAxis, NsigmaTOFAxis, TPCclustersAxis}); + } } else if constexpr (mParticleType == o2::aod::femtodreamparticle::ParticleType::kV0) { mHistogramRegistry->add((folderName + folderSuffix + "/hDaughDCA").c_str(), "; DCA^{daugh} (cm); Entries", kTH1F, {{1000, 0, 10}}); mHistogramRegistry->add((folderName + folderSuffix + "/hTransRadius").c_str(), "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); @@ -170,7 +173,7 @@ class FemtoDreamParticleHisto /// \param tempFitVarBins binning of the tempFitVar (DCA_xy in case of tracks, CPA in case of V0s, etc.) /// \param isMC add Monte Carlo truth histograms to the output file template - void init(HistogramRegistry* registry, T& MomentumBins, T& tempFitVarBins, T& NsigmaTPCBins, T& NsigmaTOFBins, T& NsigmaTPCTOFBins, T& InvMassBins, bool isMC, int pdgCode, bool isDebug = false) + void init(HistogramRegistry* registry, T& MultBins, T& PercentileBins, T& pTBins, T& etaBins, T& phiBins, T& tempFitVarBins, T& NsigmaTPCBins, T& NsigmaTOFBins, T& NsigmaTPCTOFBins, T& TPCclustersBins, T& InvMassBins, bool isMC, int pdgCode, bool isDebug = false, bool correlatedPlots = false) { mPDG = pdgCode; if (registry) { @@ -190,23 +193,29 @@ class FemtoDreamParticleHisto LOG(fatal) << "FemtoDreamParticleHisto: Histogramming for requested object not defined - quitting!"; } - framework::AxisSpec tempFitVarMomentumAxis = {MomentumBins, "p (#it{GeV/c})"}; + framework::AxisSpec multAxis = {MultBins, " Multiplicity"}; + framework::AxisSpec multPercentileAxis = {PercentileBins, "Multiplicity Percentile (%)"}; + framework::AxisSpec pTAxis = {pTBins, "#it{p}_{T} (GeV/#it{c})"}; + framework::AxisSpec etaAxis = {etaBins, "#eta"}; + framework::AxisSpec phiAxis = {phiBins, "#phi"}; framework::AxisSpec tempFitVarAxis = {tempFitVarBins, tempFitVarAxisTitle}; + framework::AxisSpec dcaZAxis = {tempFitVarBins, "DCA_{z} (cm)"}; framework::AxisSpec NsigmaTPCAxis = {NsigmaTPCBins, "n#sigma_{TPC}"}; framework::AxisSpec NsigmaTOFAxis = {NsigmaTOFBins, "n#sigma_{TOF}"}; framework::AxisSpec NsigmaTPCTOFAxis = {NsigmaTPCTOFBins, "n#sigma_{TPC+TOF}"}; + framework::AxisSpec TPCclustersAxis = {TPCclustersBins, "TPC found clusters"}; framework::AxisSpec InvMassAxis = {InvMassBins, "M_{inv} (GeV/#it{c}^{2})"}; std::string folderName = (static_cast(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]).c_str() + static_cast(mFolderSuffix[mFolderSuffixType])).c_str(); // Fill here the actual histogramms by calling init_base and init_MC - init_base(folderName, tempFitVarAxisTitle, tempFitVarMomentumAxis, tempFitVarAxis, InvMassAxis); + init_base(folderName, tempFitVarAxisTitle, pTAxis, tempFitVarAxis, InvMassAxis); if (isDebug) { - init_debug(folderName, tempFitVarMomentumAxis, NsigmaTPCAxis, NsigmaTOFAxis, NsigmaTPCTOFAxis); + init_debug(folderName, multAxis, multPercentileAxis, pTAxis, etaAxis, phiAxis, tempFitVarAxis, dcaZAxis, NsigmaTPCAxis, NsigmaTOFAxis, NsigmaTPCTOFAxis, TPCclustersAxis, correlatedPlots); } if (isMC) { - init_base(folderName, tempFitVarAxisTitle, tempFitVarMomentumAxis, tempFitVarAxis, InvMassAxis); - init_MC(folderName, tempFitVarAxisTitle, tempFitVarMomentumAxis, tempFitVarAxis); + init_base(folderName, tempFitVarAxisTitle, pTAxis, tempFitVarAxis, InvMassAxis); + init_MC(folderName, tempFitVarAxisTitle, pTAxis, tempFitVarAxis); } } } @@ -236,8 +245,8 @@ class FemtoDreamParticleHisto } } - template - void fillQA_debug(T const& part, aod::femtodreamparticle::MomentumType MomentumType) + template + void fillQA_debug(Tpart const& part, Tcoll const& col, aod::femtodreamparticle::MomentumType MomentumType, bool correlatedPlots) { float momentum; switch (MomentumType) { @@ -252,7 +261,7 @@ class FemtoDreamParticleHisto momentum = part.tpcInnerParam(); break; default: - LOG(warn) << "MomentumType " << MomentumType << " no implemented. Use pT of the Track for debug Histograms."; + LOG(warn) << "MomentumType " << MomentumType << " not implemented. Use pT of the Track for debug Histograms."; momentum = part.pt(); } @@ -291,6 +300,48 @@ class FemtoDreamParticleHisto mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_K"), momentum, std::sqrt(part.tpcNSigmaKa() * part.tpcNSigmaKa() + part.tofNSigmaKa() * part.tofNSigmaKa())); mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_p"), momentum, std::sqrt(part.tpcNSigmaPr() * part.tpcNSigmaPr() + part.tofNSigmaPr() * part.tofNSigmaPr())); mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/nSigmaComb_d"), momentum, std::sqrt(part.tpcNSigmaDe() * part.tpcNSigmaDe() + part.tofNSigmaDe() * part.tofNSigmaDe())); + + if (correlatedPlots) { + + float pidTPC = 0.; + float pidTOF = 0.; + + switch (abs(mPDG)) { + case 11: + pidTPC = part.tpcNSigmaEl(); + pidTOF = part.tofNSigmaEl(); + break; + case 211: + pidTPC = part.tpcNSigmaPi(); + pidTOF = part.tofNSigmaPi(); + break; + case 321: + pidTPC = part.tpcNSigmaKa(); + pidTOF = part.tofNSigmaKa(); + break; + case 2212: + pidTPC = part.tpcNSigmaPr(); + pidTOF = part.tofNSigmaPr(); + break; + case 1000010020: + pidTPC = part.tpcNSigmaDe(); + pidTOF = part.tofNSigmaDe(); + break; + default: + LOG(warn) << "PDG code " << mPDG << " not supported. No PID information will be used."; + } + + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/HighDcorrelator"), col.multNtr(), + col.multV0M(), + momentum, + part.eta(), + part.phi(), + part.dcaXY(), + part.dcaZ(), + pidTPC, + pidTOF, + part.tpcNClsFound()); + } } else if constexpr (mParticleType == o2::aod::femtodreamparticle::ParticleType::kV0) { mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/hDaughDCA"), part.daughDCA()); mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/hTransRadius"), part.transRadius()); @@ -384,14 +435,14 @@ class FemtoDreamParticleHisto /// \tparam T particle type /// \tparam isMC fills the additional histograms for Monte Carlo truth /// \param part particle for which the histograms should be filled - template - void fillQA(T const& part, aod::femtodreamparticle::MomentumType MomemtumType) + template + void fillQA(Tpart const& part, Tcoll const& coll, aod::femtodreamparticle::MomentumType MomemtumType, bool correlatedPlots = false) { std::string tempFitVarName; if (mHistogramRegistry) { fillQA_base(part); if constexpr (isDebug) { - fillQA_debug(part, MomemtumType); + fillQA_debug(part, coll, MomemtumType, correlatedPlots); } if constexpr (isMC) { if (part.has_fdMCParticle()) { diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamDebugTrack.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamDebugTrack.cxx index 25a4ec71c5a..c3024474e2e 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamDebugTrack.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamDebugTrack.cxx @@ -41,10 +41,19 @@ struct femtoDreamDebugTrack { Configurable ConfTrk1_TPCBit{"ConfTrk1_TPCBit", 1, "Particle 1 - Read from cutCulator"}; Configurable ConfTrk1_TPCTOFBit{"ConfTrk1_TPCTOFBit", 1, "Particle 1 - Read from cutCulator"}; Configurable ConfTrk1_PIDThres{"ConfTrk1_PIDThres", 0.75, "Particle 1 - Read from cutCulator"}; + + Configurable ConfOptCorrelatedPlots{"ConfOptCorrelatedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"}; + ConfigurableAxis ConfBinmult{"ConfBinmult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning"}; + ConfigurableAxis ConfBinmultPercentile{"ConfBinmultPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning"}; + ConfigurableAxis ConfBinpT{"ConfBinpT", {{240, 0, 6}}, "pT binning"}; + ConfigurableAxis ConfBineta{"ConfBineta", {{200, -1.5, 1.5}}, "eta binning"}; + ConfigurableAxis ConfBinphi{"ConfBinphi", {{200, 0, TMath::TwoPi()}}, "phi binning"}; + ConfigurableAxis ConfTempFitVarBins{"ConfTempFitVarBins", {300, -0.15, 0.15}, "Binning of the TempFitVar"}; ConfigurableAxis ConfNsigmaTPCBins{"ConfNsigmaTPCBins", {1600, -8, 8}, "Binning of Nsigma TPC plot"}; ConfigurableAxis ConfNsigmaTOFBins{"ConfNsigmaTOFBins", {3000, -15, 15}, "Binning of the Nsigma TOF plot"}; - ConfigurableAxis ConfNsigmaTPCTOFBins{"ConfNsigmaTPCTOFBins", {1000, 0, 10}, "Binning of the Nsigma TPC+TOF plot"}; + ConfigurableAxis ConfNsigmaTPCTOFBins{"ConfNsigmaTPCTOFBins", {3000, -15, 15}, "Binning of the Nsigma TPC+TOF plot"}; + ConfigurableAxis ConfTPCclustersBins{"ConfTPCClustersBins", {163, -0.5, 162.5}, "Binning of TPC found clusters plot"}; ConfigurableAxis ConfTempFitVarMomentumBins{"ConfMomentumBins", {20, 0.5, 4.05}, "pT/p_reco/p_tpc binning of the Momentum vs. TempFitVar/Nsigma plot"}; Configurable ConfTempFitVarMomentum{"ConfTempFitVarMomentum", 0, "Momentum used for binning: 0 -> pt; 1 -> preco; 2 -> ptpc"}; ConfigurableAxis ConfDummy{"ConfDummy", {1, 0, 1}, "Dummy axis for inv mass"}; @@ -74,7 +83,7 @@ struct femtoDreamDebugTrack { void init(InitContext&) { eventHisto.init(&qaRegistry); - trackHisto.init(&qaRegistry, ConfTempFitVarMomentumBins, ConfTempFitVarBins, ConfNsigmaTPCBins, ConfNsigmaTOFBins, ConfNsigmaTPCTOFBins, ConfDummy, ConfIsMC, ConfTrk1_PDGCode.value, true); + trackHisto.init(&qaRegistry, ConfBinmult, ConfBinmultPercentile, ConfBinpT, ConfBineta, ConfBinphi, ConfTempFitVarBins, ConfNsigmaTPCBins, ConfNsigmaTOFBins, ConfNsigmaTPCTOFBins, ConfTPCclustersBins, ConfDummy, ConfIsMC, ConfTrk1_PDGCode.value, true, ConfOptCorrelatedPlots); } /// Porduce QA plots for sigle track selection in FemtoDream framework @@ -83,7 +92,7 @@ struct femtoDreamDebugTrack { { eventHisto.fillQA(col); for (auto& part : groupPartsOne) { - trackHisto.fillQA(part, static_cast(ConfTempFitVarMomentum.value)); + trackHisto.fillQA(part, col, static_cast(ConfTempFitVarMomentum.value), ConfOptCorrelatedPlots); } } diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx index 83296131cde..9acee1d9508 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamDebugV0.cxx @@ -44,6 +44,7 @@ struct femtoDreamDebugV0 { Configurable ConfV01_CutBit{"ConfV01_CutBit", 338, "V0 - Selection bit from cutCulator"}; ConfigurableAxis ConfV0TempFitVarBins{"ConfV0TempFitVarBins", {300, 0.95, 1.}, "V0: binning of the TempFitVar in the pT vs. TempFitVar plot"}; ConfigurableAxis ConfV0TempFitVarMomentumBins{"ConfV0TempFitVarMomentumBins", {20, 0.5, 4.05}, "V0: pT binning of the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfDummy{"ConfDummy", {1, 0, 1}, "Dummy axis for inv mass"}; Configurable ConfV0TempFitVarMomentum{"ConfV0TempFitVarMomentum", 0, "Momentum used for binning: 0 -> pt; 1 -> preco; 2 -> ptpc"}; @@ -78,9 +79,9 @@ struct femtoDreamDebugV0 { void init(InitContext&) { eventHisto.init(&EventRegistry); - posChildHistos.init(&V0Registry, ConfV0ChildTempFitVarMomentumBins, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0InvMassBins, false, ConfV01_ChildPos_PDGCode.value, true); - negChildHistos.init(&V0Registry, ConfV0ChildTempFitVarMomentumBins, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0InvMassBins, false, ConfV01_ChildNeg_PDGCode, true); - V0Histos.init(&V0Registry, ConfV0TempFitVarMomentumBins, ConfV0TempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfV0InvMassBins, false, ConfV01_PDGCode.value, true); + posChildHistos.init(&V0Registry, ConfDummy, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfDummy, ConfV0InvMassBins, false, ConfV01_ChildPos_PDGCode.value, true); + negChildHistos.init(&V0Registry, ConfDummy, ConfDummy, ConfV0ChildTempFitVarMomentumBins, ConfDummy, ConfDummy, ConfChildTempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfDummy, ConfV0InvMassBins, false, ConfV01_ChildNeg_PDGCode, true); + V0Histos.init(&V0Registry, ConfDummy, ConfDummy, ConfV0TempFitVarMomentumBins, ConfDummy, ConfDummy, ConfV0TempFitVarBins, ConfV0ChildNsigmaTPCBins, ConfV0ChildNsigmaTOFBins, ConfV0ChildNsigmaTPCTOFBins, ConfDummy, ConfV0InvMassBins, false, ConfV01_PDGCode.value, true); } /// Porduce QA plots for V0 selection in FemtoDream framework @@ -109,9 +110,9 @@ struct femtoDreamDebugV0 { negChild.partType() == uint8_t(aod::femtodreamparticle::ParticleType::kV0Child) && (negChild.cut() & ConfV01_ChildNeg_CutBit) == ConfV01_ChildNeg_CutBit && (negChild.pidcut() & ConfV01_ChildNeg_TPCBit) == ConfV01_ChildNeg_TPCBit) { - V0Histos.fillQA(part, static_cast(ConfV0TempFitVarMomentum.value)); - posChildHistos.fillQA(posChild, static_cast(ConfV0TempFitVarMomentum.value)); - negChildHistos.fillQA(negChild, static_cast(ConfV0TempFitVarMomentum.value)); + V0Histos.fillQA(part, col, static_cast(ConfV0TempFitVarMomentum.value)); + posChildHistos.fillQA(posChild, col, static_cast(ConfV0TempFitVarMomentum.value)); + negChildHistos.fillQA(negChild, col, static_cast(ConfV0TempFitVarMomentum.value)); } } } diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx index ec5774ee379..b4e1efdebe6 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackTrack.cxx @@ -174,9 +174,9 @@ struct femtoDreamPairTaskTrackTrack { void init(InitContext& context) { eventHisto.init(&qaRegistry); - trackHistoPartOne.init(&qaRegistry, ConfBinTrackpT, ConfBinTempFitVar, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptIsMC, ConfTrk1_PDGCode); + trackHistoPartOne.init(&qaRegistry, ConfOptDummy, ConfOptDummy, ConfBinTrackpT, ConfOptDummy, ConfOptDummy, ConfBinTempFitVar, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptIsMC, ConfTrk1_PDGCode); if (!ConfOptSameSpecies) { - trackHistoPartTwo.init(&qaRegistry, ConfBinTrackpT, ConfBinTempFitVar, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptIsMC, ConfTrk2_PDGCode); + trackHistoPartTwo.init(&qaRegistry, ConfOptDummy, ConfOptDummy, ConfBinTrackpT, ConfOptDummy, ConfOptDummy, ConfBinTempFitVar, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptIsMC, ConfTrk2_PDGCode); } sameEventCont.init(&resultRegistry, @@ -257,12 +257,12 @@ struct femtoDreamPairTaskTrackTrack { void doSameEvent(PartitionType SliceTrk1, PartitionType SliceTrk2, PartType parts, Collision col) { for (auto& part : SliceTrk1) { - trackHistoPartOne.fillQA(part, aod::femtodreamparticle::kPt); + trackHistoPartOne.fillQA(part, col, aod::femtodreamparticle::kPt); } if (!ConfOptSameSpecies.value) { for (auto& part : SliceTrk2) { - trackHistoPartTwo.fillQA(part, aod::femtodreamparticle::kPt); + trackHistoPartTwo.fillQA(part, col, aod::femtodreamparticle::kPt); } } diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx index d746f217c5b..9723fe63af3 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskTrackV0.cxx @@ -186,10 +186,10 @@ struct femtoDreamPairTaskTrackV0 { // void init(HistogramRegistry* registry, // T& MomentumBins, T& tempFitVarBins, T& NsigmaTPCBins, T& NsigmaTOFBins, T& NsigmaTPCTOFBins, T& InvMassBins, // bool isMC, int pdgCode, bool isDebug = false) - trackHistoPartOne.init(&qaRegistry, ConfBinpTTrack, ConfBinTempFitVarTrack, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptIsMC, ConfTrk1_PDGCode); - trackHistoPartTwo.init(&qaRegistry, ConfBinpTV0, ConfBinTempFitVarV0, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfBinInvMass, ConfOptIsMC, ConfV02_PDGCode); - posChildHistos.init(&qaRegistry, ConfBinpTV0Child, ConfBinTempFitVarV0Child, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, false, false); - negChildHistos.init(&qaRegistry, ConfBinpTV0Child, ConfBinTempFitVarV0Child, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, false, false); + trackHistoPartOne.init(&qaRegistry, ConfOptDummy, ConfOptDummy, ConfBinpTTrack, ConfOptDummy, ConfOptDummy, ConfBinTempFitVarTrack, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptIsMC, ConfTrk1_PDGCode); + trackHistoPartTwo.init(&qaRegistry, ConfOptDummy, ConfOptDummy, ConfBinpTV0, ConfOptDummy, ConfOptDummy, ConfBinTempFitVarV0, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfBinInvMass, ConfOptIsMC, ConfV02_PDGCode); + posChildHistos.init(&qaRegistry, ConfOptDummy, ConfOptDummy, ConfBinpTV0Child, ConfOptDummy, ConfOptDummy, ConfBinTempFitVarV0Child, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, false, 0); + negChildHistos.init(&qaRegistry, ConfOptDummy, ConfOptDummy, ConfBinpTV0Child, ConfOptDummy, ConfOptDummy, ConfBinTempFitVarV0Child, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, ConfOptDummy, false, 0); sameEventCont.init(&resultRegistry, ConfBinkstar, ConfBinpT, ConfBinkT, ConfBinmT, ConfMixingBinMult, ConfMixingBinMultPercentile, @@ -261,7 +261,7 @@ struct femtoDreamPairTaskTrackV0 { { /// Histogramming same event for (auto& part : SliceTrk1) { - trackHistoPartOne.fillQA(part, aod::femtodreamparticle::kPt); + trackHistoPartOne.fillQA(part, col, aod::femtodreamparticle::kPt); } for (auto& v0 : SliceV02) { const auto& posChild = parts.iteratorAt(v0.index() - 2); @@ -277,9 +277,9 @@ struct femtoDreamPairTaskTrackV0 { ((posChild.pidcut() & ConfV02_ChildPos_TPCBit) == ConfV02_ChildPos_TPCBit) && ((negChild.cut() & ConfV02_ChildNeg_CutBit) == ConfV02_ChildNeg_CutBit) && ((negChild.pidcut() & ConfV02_ChildNeg_TPCBit) == ConfV02_ChildNeg_TPCBit)) { - trackHistoPartTwo.fillQA(v0, aod::femtodreamparticle::kPt); - posChildHistos.fillQA(posChild, aod::femtodreamparticle::kPt); - negChildHistos.fillQA(negChild, aod::femtodreamparticle::kPt); + trackHistoPartTwo.fillQA(v0, col, aod::femtodreamparticle::kPt); + posChildHistos.fillQA(posChild, col, aod::femtodreamparticle::kPt); + negChildHistos.fillQA(negChild, col, aod::femtodreamparticle::kPt); } } /// Now build particle combinations diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx index d2334dafcbf..ab614376447 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamTripletTaskTrackTrackTrack.cxx @@ -109,7 +109,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { { eventHisto.init(&qaRegistry); - trackHistoSelectedParts.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarBins, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfIsMC, ConfPDGCodePart); + trackHistoSelectedParts.init(&qaRegistry, ConfDummy, ConfDummy, ConfTempFitVarpTBins, ConfDummy, ConfDummy, ConfTempFitVarBins, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfDummy, ConfIsMC, ConfPDGCodePart); ThreeBodyQARegistry.add("TripletTaskQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); ThreeBodyQARegistry.add("TripletTaskQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}}); @@ -176,7 +176,7 @@ struct femtoDreamTripletTaskTrackTrackTrack { { /// Histogramming same event for (auto& part : groupSelectedParts) { - trackHistoSelectedParts.fillQA(part, aod::femtodreamparticle::kPt); + trackHistoSelectedParts.fillQA(part, multCol, aod::femtodreamparticle::kPt); } /// Now build the combinations From 0fc020511b4a38d0e87dd36f8b69533c531d17a9 Mon Sep 17 00:00:00 2001 From: rbailhac Date: Sun, 11 Feb 2024 18:53:35 +0100 Subject: [PATCH 11/26] More cuts (#4657) --- PWGDQ/Core/CutsLibrary.cxx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index 3622f2b052d..52afc69c79e 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -994,6 +994,13 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) // loop to define PID cuts with and without post calibration for (int icase = 0; icase < vecPIDcase.size(); icase++) { + if (!nameStr.compare(Form("ITSTPC_TPCPIDalone%s_PbPb", vecPIDcase.at(icase).Data()))) { + cut->AddCut(GetAnalysisCut("lmeeStandardKine")); + cut->AddCut(GetAnalysisCut("TightGlobalTrackRun3")); + cut->AddCut(GetAnalysisCut("standardPrimaryTrackDCAz")); + cut->AddCut(GetAnalysisCut(Form("electronPIDOnly%s", vecPIDcase.at(icase).Data()))); + return cut; + } if (!nameStr.compare(Form("ITSTPC_TPCPID%s_prefilter", vecPIDcase.at(icase).Data()))) { cut->AddCut(GetAnalysisCut("lmeePrefilterKine")); cut->AddCut(GetAnalysisCut("electronStandardQualityITSOnly")); @@ -1268,6 +1275,14 @@ AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) return cut; } + if (!nameStr.compare(Form("lmee_TOFreqRun3%s_strongNSigEPbPb_rejBadTOF_pt04", vecPIDcase.at(icase).Data()))) { + cut->AddCut(GetAnalysisCut("lmeeStandardKine_pt04")); + cut->AddCut(GetAnalysisCut("TightGlobalTrackRun3")); + cut->AddCut(GetAnalysisCut("standardPrimaryTrackDCAz")); + cut->AddCut(GetAnalysisCut(Form("electronPID_TOFreq%s_strongNSigEPbPb_rejBadTOF", vecPIDcase.at(icase).Data()))); + return cut; + } + // 4 cuts for QC if (!nameStr.compare(Form("lmee_posNSigmaRun3_posEta%s_strongNSigEPbPb_rejBadTOF", vecPIDcase.at(icase).Data()))) { cut->AddCut(GetAnalysisCut("posTrack")); @@ -3744,6 +3759,19 @@ AnalysisCut* o2::aod::dqcuts::GetAnalysisCut(const char* cutName) return cut; } + if (!nameStr.compare(Form("electronPID_TOFreq%s_strongNSigEPbPb_rejBadTOF", vecPIDcase.at(icase).Data()))) { + if (icase == 0) { + cut->AddCut(VarManager::kTPCnSigmaEl, -1., 2., false, VarManager::kPin, 0.0, 1e+10, false); + cut->AddCut(VarManager::kTPCnSigmaPi, -3., 4., true, VarManager::kPin, 0.0, 1e+10, false); + cut->AddCut(VarManager::kTOFnSigmaEl, -2., 2., false, VarManager::kPin, 0.0, 1e+10, false); + } else if (icase == 1 || icase == 2) { + cut->AddCut(VarManager::kTPCnSigmaEl_Corr, -1., 2., false, VarManager::kPin, 0.0, 1e+10, false); + cut->AddCut(VarManager::kTPCnSigmaPi_Corr, -3., 4., true, VarManager::kPin, 0.0, 1e+10, false); + cut->AddCut(VarManager::kTOFnSigmaEl, -2., 2., false, VarManager::kPin, 0.0, 1e+10, false); + } + return cut; + } + if (!nameStr.compare(Form("lmee_pp_502TeV_TOF%s", vecPIDcase.at(icase).Data()))) { if (icase == 0) { cut->AddCut(VarManager::kTPCnSigmaEl, -3., 3., false, VarManager::kPin, 0.0, 1e+10, false); From 3693c23d179314f92466310fab462449ab3f1b39 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sun, 11 Feb 2024 20:57:32 +0100 Subject: [PATCH 12/26] Second step towards identified analysis (#4668) Also collisions within ITS read out frame border are rejected Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 2 +- PWGCF/TableProducer/dptdptfilter.h | 2 +- PWGCF/Tasks/dptdptcorrelations.cxx | 117 ++++++++++++++++----------- 3 files changed, 71 insertions(+), 50 deletions(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index cd3c4c83664..37ac1c8fd85 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -666,7 +666,7 @@ struct DptDptFilterTracks { template int8_t whichTruthSpecies(ParticleObject part) { - int pdgcode = abs(part.pdgCode()); + int pdgcode = std::abs(part.pdgCode()); /* let's first check the exclusion from the analysis */ for (uint8_t ix = 0; ix < configexclude.size(); ++ix) { if (pdgcode == pdgcodes[speciesexclude[ix]]) { diff --git a/PWGCF/TableProducer/dptdptfilter.h b/PWGCF/TableProducer/dptdptfilter.h index cb6ee2ffbe1..2f69f134417 100644 --- a/PWGCF/TableProducer/dptdptfilter.h +++ b/PWGCF/TableProducer/dptdptfilter.h @@ -350,7 +350,7 @@ inline bool triggerSelectionReco(CollisionObject const& collision) case kPbPbRun3: switch (fTriggerSelection) { case kMB: - if (collision.sel8()) { + if (collision.sel8() && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { trigsel = true; } break; diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index b2a162c2261..3539ffe7a82 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -68,7 +68,9 @@ PairCuts fPairCuts; // pair suppression engine bool fUseConversionCuts = false; // suppress resonances and conversions bool fUseTwoTrackCut = false; // suppress too close tracks -std::vector tname = {"O", "T"}; ///< the track names +std::vector poinames; ///< the species of interest names +std::vector tnames; ///< the track names +std::vector> trackPairsNames; ///< the track pairs names } // namespace correlationstask // Task for building correlations @@ -77,8 +79,7 @@ struct DptDptCorrelationsTask { /* the data collecting engine */ template struct DataCollectingEngine { - int nspecies = 1; /* for the time being just hadrons */ - size_t nch = nspecies * 2; + size_t nch = correlationstask::tnames.size(); //============================================================================================ // The DptDptCorrelationsAnalysisTask output objects @@ -111,7 +112,6 @@ struct DptDptCorrelationsTask { std::vector> fhSum2PtPtnw_vsC{nch, {nch, nullptr}}; //!> fhSum2DptDptnw_vsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations - std::vector> trackPairsNames = {{"OO", "OT"}, {"TO", "TT"}}; bool ccdbstored = false; float isCCDBstored() @@ -475,28 +475,28 @@ struct DptDptCorrelationsTask { fOutputList->Add(fhVertexZA); for (uint i = 0; i < nch; ++i) { /* histograms for each track, one and two */ - fhN1_vsPt[i] = new TH1F(TString::Format("n1_%s_vsPt", tname[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;p_{t,%s} (GeV/c);#LT n_{1} #GT", tname[i].c_str()).Data(), + fhN1_vsPt[i] = new TH1F(TString::Format("n1_%s_vsPt", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;p_{t,%s} (GeV/c);#LT n_{1} #GT", tnames[i].c_str()).Data(), ptbins, ptlow, ptup); /* we don't want the Sumw2 structure being created here */ bool defSumw2 = TH1::GetDefaultSumw2(); if constexpr (smallsingles) { - fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tname[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tname[i].c_str(), tname[i].c_str()).Data(), + fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), etabins, etalow, etaup, phibins, philow, phiup); - fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tname[i].c_str()).Data(), + fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", - tname[i].c_str(), tname[i].c_str(), tname[i].c_str(), tname[i].c_str()) + tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) .Data(), etabins, etalow, etaup, phibins, philow, phiup); } else { TH1::SetDefaultSumw2(false); fhN1_vsZEtaPhiPt[i] = new TH3F( - TString::Format("n1_%s_vsZ_vsEtaPhi_vsPt", tname[i].c_str()).Data(), + TString::Format("n1_%s_vsZ_vsEtaPhi_vsPt", tnames[i].c_str()).Data(), TString::Format("#LT n_{1} #GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)", - tname[i].c_str(), - tname[i].c_str(), - tname[i].c_str()) + tnames[i].c_str(), + tnames[i].c_str(), + tnames[i].c_str()) .Data(), zvtxbins, zvtxlow, @@ -508,13 +508,13 @@ struct DptDptCorrelationsTask { ptlow, ptup); fhSum1Pt_vsZEtaPhiPt[i] = new TH3F( - TString::Format("sumPt1_%s_vsZ_vsEtaPhi_vsPt", tname[i].c_str()).Data(), + TString::Format("sumPt1_%s_vsZ_vsEtaPhi_vsPt", tnames[i].c_str()).Data(), TString::Format( "#LT #Sigma p_{t,%s}#GT;vtx_{z};#eta_{%s}#times#varphi_{%s};p_{t,%s} (GeV/c)", - tname[i].c_str(), - tname[i].c_str(), - tname[i].c_str(), - tname[i].c_str()) + tnames[i].c_str(), + tnames[i].c_str(), + tnames[i].c_str(), + tnames[i].c_str()) .Data(), zvtxbins, zvtxlow, @@ -556,25 +556,25 @@ struct DptDptCorrelationsTask { } else { for (uint i = 0; i < nch; ++i) { /* histograms for each track species */ - fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tname[i].c_str()).Data(), - TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tname[i].c_str(), tname[i].c_str()).Data(), + fhN1_vsEtaPhi[i] = new TH2F(TString::Format("n1_%s_vsEtaPhi", tnames[i].c_str()).Data(), + TString::Format("#LT n_{1} #GT;#eta_{%s};#varphi_{%s} (radian);#LT n_{1} #GT", tnames[i].c_str(), tnames[i].c_str()).Data(), etabins, etalow, etaup, phibins, philow, phiup); - fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tname[i].c_str()).Data(), + fhSum1Pt_vsEtaPhi[i] = new TH2F(TString::Format("sumPt_%s_vsEtaPhi", tnames[i].c_str()).Data(), TString::Format("#LT #Sigma p_{t,%s} #GT;#eta_{%s};#varphi_{%s} (radian);#LT #Sigma p_{t,%s} #GT (GeV/c)", - tname[i].c_str(), tname[i].c_str(), tname[i].c_str(), tname[i].c_str()) + tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str(), tnames[i].c_str()) .Data(), etabins, etalow, etaup, phibins, philow, phiup); - fhN1_vsC[i] = new TProfile(TString::Format("n1_%s_vsM", tname[i].c_str()).Data(), + fhN1_vsC[i] = new TProfile(TString::Format("n1_%s_vsM", tnames[i].c_str()).Data(), TString::Format("#LT n_{1} #GT (weighted);Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), 100, 0.0, 100.0); - fhSum1Pt_vsC[i] = new TProfile(TString::Format("sumPt_%s_vsM", tname[i].c_str()), - TString::Format("#LT #Sigma p_{t,%s} #GT (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tname[i].c_str(), tname[i].c_str()).Data(), + fhSum1Pt_vsC[i] = new TProfile(TString::Format("sumPt_%s_vsM", tnames[i].c_str()), + TString::Format("#LT #Sigma p_{t,%s} #GT (weighted);Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); - fhN1nw_vsC[i] = new TProfile(TString::Format("n1Nw_%s_vsM", tname[i].c_str()).Data(), + fhN1nw_vsC[i] = new TProfile(TString::Format("n1Nw_%s_vsM", tnames[i].c_str()).Data(), TString::Format("#LT n_{1} #GT;Centrality/Multiplicity (%%);#LT n_{1} #GT").Data(), 100, 0.0, 100.0); - fhSum1Ptnw_vsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tname[i].c_str()).Data(), - TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tname[i].c_str(), tname[i].c_str()).Data(), 100, 0.0, 100.0); + fhSum1Ptnw_vsC[i] = new TProfile(TString::Format("sumPtNw_%s_vsM", tnames[i].c_str()).Data(), + TString::Format("#LT #Sigma p_{t,%s} #GT;Centrality/Multiplicity (%%);#LT #Sigma p_{t,%s} #GT (GeV/c)", tnames[i].c_str(), tnames[i].c_str()).Data(), 100, 0.0, 100.0); fhNuaNue_vsZEtaPhiPt[i] = nullptr; fhPtAvg_vsEtaPhi[i] = nullptr; fOutputList->Add(fhN1_vsEtaPhi[i]); @@ -675,6 +675,7 @@ struct DptDptCorrelationsTask { Configurable cfgTwoTrackCut{"twotrackcut", -1, "Two-tracks cut: -1 = off; >0 otherwise distance value (suggested: 0.02"}; Configurable cfgTwoTrackCutMinRadius{"twotrackcutminradius", 0.8f, "Two-tracks cut: radius in m from which two-tracks cut is applied"}; + Configurable cfgSpecies{"species", "Ha", "The species to analyze: Ha, Pi, Ka, Pr, separated by commas. Default: Ha"}; Configurable cfgSmallDCE{"smalldce", true, "Use small data collecting engine for singles processing, true = yes. Default = true"}; Configurable cfgProcessPairs{"processpairs", false, "Process pairs: false = no, just singles, true = yes, process pairs"}; Configurable cfgProcessME{"processmixedevents", false, "Process mixed events: false = no, just same event, true = yes, also process mixed events"}; @@ -756,7 +757,27 @@ struct DptDptCorrelationsTask { /* create the data collecting engine instances according to the configured centrality/multiplicity ranges */ { - TObjArray* tokens = TString(cfgCentSpec.value.c_str()).Tokenize(","); + /* configuring the desired species */ + TObjArray* tokens = TString(cfgSpecies.value.c_str()).Tokenize(","); + int nspecies = tokens->GetEntries(); + for (int isp = 0; isp < nspecies; ++isp) { + poinames.push_back(std::string(tokens->At(isp)->GetName())); + tnames.push_back(std::string(TString::Format("%sP", tokens->At(isp)->GetName()).Data())); + tnames.push_back(std::string(TString::Format("%sM", tokens->At(isp)->GetName()).Data())); + LOGF(info, "Incorporated species %s to the analysis", poinames[isp].c_str()); + } + delete tokens; + uint ntracknames = tnames.size(); + for (uint isp = 0; isp < ntracknames; ++isp) { + trackPairsNames.push_back(std::vector()); + for (uint jsp = 0; jsp < ntracknames; ++jsp) { + trackPairsNames[isp].push_back(tnames[isp] + tnames[jsp]); + LOGF(info, "Incorporated the pair %s", (tnames[isp] + tnames[jsp]).c_str()); + } + } + + /* the centrality/multiplicity ranges */ + tokens = TString(cfgCentSpec.value.c_str()).Tokenize(","); ncmranges = tokens->GetEntries(); fCentMultMin = new float[ncmranges]; fCentMultMax = new float[ncmranges]; @@ -905,13 +926,13 @@ struct DptDptCorrelationsTask { if (!(ixDCE < 0)) { if (ccdblst != nullptr && !(dataCE[ixDCE]->isCCDBstored())) { if constexpr (gen) { - std::vector ptavgs{tname.size(), nullptr}; - for (uint isp = 0; isp < tname.size(); ++isp) { + std::vector ptavgs{tnames.size(), nullptr}; + for (uint isp = 0; isp < tnames.size(); ++isp) { ptavgs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("trueptavgetaphi_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), - tname[isp].c_str()) + tnames[isp].c_str()) .Data())); } if (cfgSmallDCE.value) { @@ -920,13 +941,13 @@ struct DptDptCorrelationsTask { dataCE[ixDCE]->storePtAverages(ptavgs); } } else { - std::vector corrs{tname.size(), nullptr}; - for (uint isp = 0; isp < tname.size(); ++isp) { + std::vector corrs{tnames.size(), nullptr}; + for (uint isp = 0; isp < tnames.size(); ++isp) { corrs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("correction_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), - tname[isp].c_str()) + tnames[isp].c_str()) .Data())); } if (cfgSmallDCE.value) { @@ -935,13 +956,13 @@ struct DptDptCorrelationsTask { dataCE[ixDCE]->storeTrackCorrections(corrs); } - std::vector ptavgs{tname.size(), nullptr}; - for (uint isp = 0; isp < tname.size(); ++isp) { + std::vector ptavgs{tnames.size(), nullptr}; + for (uint isp = 0; isp < tnames.size(); ++isp) { ptavgs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("ptavgetaphi_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), - tname[isp].c_str()) + tnames[isp].c_str()) .Data())); } if (cfgSmallDCE.value) { @@ -992,35 +1013,35 @@ struct DptDptCorrelationsTask { if (!(ixDCE < 0)) { if (ccdblst != nullptr && !(dataCEME[ixDCE]->isCCDBstored())) { if constexpr (gen) { - std::vector ptavgs{tname.size(), nullptr}; - for (uint isp = 0; isp < tname.size(); ++isp) { + std::vector ptavgs{tnames.size(), nullptr}; + for (uint isp = 0; isp < tnames.size(); ++isp) { ptavgs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("trueptavgetaphi_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), - tname[isp].c_str()) + tnames[isp].c_str()) .Data())); } dataCEME[ixDCE]->storePtAverages(ptavgs); } else { - std::vector corrs{tname.size(), nullptr}; - for (uint isp = 0; isp < tname.size(); ++isp) { + std::vector corrs{tnames.size(), nullptr}; + for (uint isp = 0; isp < tnames.size(); ++isp) { corrs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("correction_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), - tname[isp].c_str()) + tnames[isp].c_str()) .Data())); } dataCEME[ixDCE]->storeTrackCorrections(corrs); - std::vector ptavgs{tname.size(), nullptr}; - for (uint isp = 0; isp < tname.size(); ++isp) { + std::vector ptavgs{tnames.size(), nullptr}; + for (uint isp = 0; isp < tnames.size(); ++isp) { ptavgs[isp] = reinterpret_cast(ccdblst->FindObject( TString::Format("ptavgetaphi_%02d-%02d_%s", static_cast(fCentMultMin[ixDCE]), static_cast(fCentMultMax[ixDCE]), - tname[isp].c_str()) + tnames[isp].c_str()) .Data())); } dataCEME[ixDCE]->storePtAverages(ptavgs); From 818483ba93b8814ca44116b9c8a5204a098f5aa7 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 11 Feb 2024 21:21:11 +0100 Subject: [PATCH 13/26] PWGLF: adjust TPC conditions in detail (#4664) --- .../derivedlambdakzeroanalysis.cxx | 89 +++++++++---------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index ee2616a1fb7..fbe39075746 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -129,10 +129,6 @@ struct derivedlambdakzeroanalysis { ConfigurableAxis axisTPCrows{"axisTPCrows", {160, 0.0f, 160.0f}, "N TPC rows"}; ConfigurableAxis axisITSclus{"axisITSclus", {7, 0.0f, 7.0f}, "N ITS Clusters"}; - enum species { spK0Short = 0, - spLambda, - spAntiLambda }; - enum selection { selCosPA = 0, selRadius, selDCANegToPV, @@ -140,9 +136,10 @@ struct derivedlambdakzeroanalysis { selDCAV0Dau, selK0ShortRapidity, selLambdaRapidity, - selK0ShortTPC, - selLambdaTPC, - selAntiLambdaTPC, + selTPCPIDPositivePion, + selTPCPIDNegativePion, + selTPCPIDPositiveProton, + selTPCPIDNegativeProton, selK0ShortCTau, selLambdaCTau, selK0ShortArmenteros, @@ -164,7 +161,7 @@ struct derivedlambdakzeroanalysis { uint32_t maskTopoNoDCAPosToPV; uint32_t maskTopoNoCosPA; uint32_t maskTopoNoDCAV0Dau; - uint32_t maskTrackTypes; + uint32_t maskTrackProperties; uint32_t maskK0ShortSpecific; uint32_t maskLambdaSpecific; @@ -187,30 +184,40 @@ struct derivedlambdakzeroanalysis { maskTopoNoCosPA = (1 << selRadius) | (1 << selDCANegToPV) | (1 << selDCAPosToPV) | (1 << selDCAV0Dau); maskTopoNoDCAV0Dau = (1 << selCosPA) | (1 << selRadius) | (1 << selDCANegToPV) | (1 << selDCAPosToPV); - maskTrackTypes = 0; + maskK0ShortSpecific = (1 << selK0ShortRapidity) | (1 << selK0ShortCTau) | (1 << selK0ShortArmenteros) | (1 << selConsiderK0Short); + maskLambdaSpecific = (1 << selLambdaRapidity) | (1 << selLambdaCTau) | (1 << selConsiderLambda); + maskAntiLambdaSpecific = (1 << selLambdaRapidity) | (1 << selLambdaCTau) | (1 << selConsiderAntiLambda); + + // ask for specific TPC PID selections + + maskTrackProperties = 0; if (requirePosITSonly) { - maskTrackTypes = (1 << selPosItsOnly); + maskTrackProperties = (1 << selPosItsOnly); } else { - maskTrackTypes = (1 << selPosGoodTPCTrack); + maskTrackProperties = (1 << selPosGoodTPCTrack); + // TPC signal is available: ask for positive track PID + maskK0ShortSpecific = maskK0ShortSpecific | (1 << selTPCPIDPositivePion); + maskLambdaSpecific = maskLambdaSpecific | (1 << selTPCPIDPositiveProton); + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (1 << selTPCPIDPositivePion); } if (requireNegITSonly) { - maskTrackTypes = (1 << selNegItsOnly); + maskTrackProperties = (1 << selNegItsOnly); } else { - maskTrackTypes = (1 << selNegGoodTPCTrack); + maskTrackProperties = (1 << selNegGoodTPCTrack); + // TPC signal is available: ask for negative track PID + maskK0ShortSpecific = maskK0ShortSpecific | (1 << selTPCPIDNegativePion); + maskLambdaSpecific = maskLambdaSpecific | (1 << selTPCPIDNegativeProton); + maskAntiLambdaSpecific = maskAntiLambdaSpecific | (1 << selTPCPIDNegativePion); } - maskK0ShortSpecific = (1 << selK0ShortRapidity) | (1 << selK0ShortTPC) | (1 << selK0ShortCTau) | (1 << selK0ShortArmenteros) | (1 << selConsiderK0Short); - maskLambdaSpecific = (1 << selLambdaRapidity) | (1 << selLambdaTPC) | (1 << selLambdaCTau) | (1 << selConsiderLambda); - maskAntiLambdaSpecific = (1 << selLambdaRapidity) | (1 << selAntiLambdaTPC) | (1 << selLambdaCTau) | (1 << selConsiderAntiLambda); - // Primary particle selection, central to analysis - maskSelectionK0Short = maskTopological | maskTrackTypes | maskK0ShortSpecific | (1 << selPhysPrimK0Short); - maskSelectionLambda = maskTopological | maskTrackTypes | maskLambdaSpecific | (1 << selPhysPrimLambda); - maskSelectionAntiLambda = maskTopological | maskTrackTypes | maskAntiLambdaSpecific | (1 << selPhysPrimAntiLambda); + maskSelectionK0Short = maskTopological | maskTrackProperties | maskK0ShortSpecific | (1 << selPhysPrimK0Short); + maskSelectionLambda = maskTopological | maskTrackProperties | maskLambdaSpecific | (1 << selPhysPrimLambda); + maskSelectionAntiLambda = maskTopological | maskTrackProperties | maskAntiLambdaSpecific | (1 << selPhysPrimAntiLambda); // No primary requirement for feeddown matrix - secondaryMaskSelectionLambda = maskTopological | maskTrackTypes | maskLambdaSpecific; - secondaryMaskSelectionAntiLambda = maskTopological | maskTrackTypes | maskAntiLambdaSpecific; + secondaryMaskSelectionLambda = maskTopological | maskTrackProperties | maskLambdaSpecific; + secondaryMaskSelectionAntiLambda = maskTopological | maskTrackProperties | maskAntiLambdaSpecific; // Event Counters histos.add("hEventSelection", "hEventSelection", kTH1F, {{3, -0.5f, +2.5f}}); @@ -314,24 +321,6 @@ struct derivedlambdakzeroanalysis { histos.add("GeneralQA/h2dArmenterosSelected", "h2dArmenterosSelected", kTH2F, {axisAPAlpha, axisAPQt}); } - template - bool compatibleTPC(TV0 v0, int sp) - { - float pidPos = TMath::Abs(v0.template posTrackExtra_as().tpcNSigmaPi()); - float pidNeg = TMath::Abs(v0.template negTrackExtra_as().tpcNSigmaPi()); - - if (sp == spLambda) - pidPos = TMath::Abs(v0.template posTrackExtra_as().tpcNSigmaPr()); - if (sp == spAntiLambda) - pidNeg = TMath::Abs(v0.template negTrackExtra_as().tpcNSigmaPr()); - - if (pidPos < TpcPidNsigmaCut && pidNeg < TpcPidNsigmaCut) - return true; - - // if not, then not - return false; - } - template uint32_t computeReconstructionBitmap(TV0 v0, TCollision collision) // precalculate this information so that a check is one mask operation, not many @@ -355,23 +344,25 @@ struct derivedlambdakzeroanalysis { if (TMath::Abs(v0.yK0Short()) < rapidityCut) bitset(bitMap, selK0ShortRapidity); - // TPC PID - if (compatibleTPC(v0, spK0Short)) - bitset(bitMap, selK0ShortTPC); - if (compatibleTPC(v0, spLambda)) - bitset(bitMap, selLambdaTPC); - if (compatibleTPC(v0, spAntiLambda)) - bitset(bitMap, selAntiLambdaTPC); - auto posTrackExtra = v0.template posTrackExtra_as(); auto negTrackExtra = v0.template negTrackExtra_as(); - // TPC quality + // TPC quality flags if (posTrackExtra.tpcCrossedRows() >= minTPCrows) bitset(bitMap, selPosGoodTPCTrack); if (negTrackExtra.tpcCrossedRows() >= minTPCrows) bitset(bitMap, selNegGoodTPCTrack); + // TPC PID + if (fabs(posTrackExtra.tpcNSigmaPi()) < TpcPidNsigmaCut) + bitset(bitMap, selTPCPIDPositivePion); + if (fabs(posTrackExtra.tpcNSigmaPr()) < TpcPidNsigmaCut) + bitset(bitMap, selTPCPIDPositiveProton); + if (fabs(negTrackExtra.tpcNSigmaPi()) < TpcPidNsigmaCut) + bitset(bitMap, selTPCPIDNegativePion); + if (fabs(negTrackExtra.tpcNSigmaPr()) < TpcPidNsigmaCut) + bitset(bitMap, selTPCPIDNegativeProton); + // ITS only tag if (posTrackExtra.tpcCrossedRows() < 1) bitset(bitMap, selPosItsOnly); From 58d413a27e4f52f19d6d56bdbf34cb3680492e60 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sun, 11 Feb 2024 21:22:10 +0100 Subject: [PATCH 14/26] PWGLF: extra event info for debug tests (#4662) * PWGLF: extra event info for debug tests * Please consider the following formatting changes (#236) --------- Co-authored-by: ALICE Builder --- PWGLF/DataModel/LFStrangenessTables.h | 3 ++- PWGLF/TableProducer/strangederivedbuilder.cxx | 25 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index feef92ac70a..1f3349e2b69 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -32,7 +32,8 @@ DECLARE_SOA_TABLE(StraCents, "AOD", "STRACENTS", //! centrality percentiles cent::CentFT0M, cent::CentFT0A, cent::CentFT0C, cent::CentFV0A); DECLARE_SOA_TABLE(StraRawCents, "AOD", "STRARAWCENTS", //! debug information - mult::MultFT0A, mult::MultFT0C, mult::MultFV0A, mult::MultNTracksPVeta1); + mult::MultFT0A, mult::MultFT0C, mult::MultFV0A, mult::MultNTracksPVeta1, + mult::MultZNA, mult::MultZNC, mult::MultZEM1, mult::MultZEM2, mult::MultZPA, mult::MultZPC); DECLARE_SOA_TABLE(StraEvSels, "AOD", "STRAEVSELS", //! event selection: sel8 evsel::Sel8); DECLARE_SOA_TABLE(StraFT0AQVs, "AOD", "STRAFT0AQVS", //! t0a Qvec diff --git a/PWGLF/TableProducer/strangederivedbuilder.cxx b/PWGLF/TableProducer/strangederivedbuilder.cxx index e890ffc030b..64a28bf61e4 100644 --- a/PWGLF/TableProducer/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/strangederivedbuilder.cxx @@ -144,6 +144,7 @@ struct strangederivedbuilder { Configurable fillRawFT0A{"fillRawFT0A", false, "Fill raw FT0A information for debug"}; Configurable fillRawFT0C{"fillRawFT0C", true, "Fill raw FT0C information for debug"}; Configurable fillRawFV0A{"fillRawFV0A", false, "Fill raw FV0A information for debug"}; + Configurable fillRawZDC{"fillRawZDC", false, "Fill raw ZDC information for debug"}; Configurable fillRawNTracksEta1{"fillRawNTracksEta1", true, "Fill raw NTracks |eta|<1 information for debug"}; Configurable qaCentrality{"qaCentrality", false, "qa centrality flag: check base raw values"}; @@ -194,7 +195,7 @@ struct strangederivedbuilder { } } - void processCollisionsV0sOnly(soa::Join const& collisions, aod::V0Datas const& V0s, aod::BCsWithTimestamps const&) + void processCollisionsV0sOnly(soa::Join const& collisions, aod::V0Datas const& V0s, aod::BCsWithTimestamps const&) { for (const auto& collision : collisions) { const uint64_t collIdx = collision.globalIndex(); @@ -209,11 +210,17 @@ struct strangederivedbuilder { auto bc = collision.bc_as(); strangeStamps(bc.runNumber(), bc.timestamp()); - if (fillRawFT0C || fillRawFT0C || fillRawFV0A || fillRawNTracksEta1) { + if (fillRawFT0C || fillRawFT0C || fillRawFV0A || fillRawNTracksEta1 || fillRawZDC) { strangeRawCents(collision.multFT0A() * static_cast(fillRawFT0A), collision.multFT0C() * static_cast(fillRawFT0C), collision.multFT0A() * static_cast(fillRawFV0A), - collision.multNTracksPVeta1() * static_cast(fillRawNTracksEta1)); + collision.multNTracksPVeta1() * static_cast(fillRawNTracksEta1), + collision.multZNA() * static_cast(fillRawZDC), + collision.multZNC() * static_cast(fillRawZDC), + collision.multZEM1() * static_cast(fillRawZDC), + collision.multZEM2() * static_cast(fillRawZDC), + collision.multZPA() * static_cast(fillRawZDC), + collision.multZPC() * static_cast(fillRawZDC)); } } for (int i = 0; i < V0Table_thisColl.size(); i++) @@ -221,7 +228,7 @@ struct strangederivedbuilder { } } - void processCollisions(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const&) + void processCollisions(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const&) { for (const auto& collision : collisions) { const uint64_t collIdx = collision.globalIndex(); @@ -249,11 +256,17 @@ struct strangederivedbuilder { auto bc = collision.bc_as(); strangeStamps(bc.runNumber(), bc.timestamp()); - if (fillRawFT0C || fillRawFT0C || fillRawFV0A || fillRawNTracksEta1) { + if (fillRawFT0C || fillRawFT0C || fillRawFV0A || fillRawNTracksEta1 || fillRawZDC) { strangeRawCents(collision.multFT0A() * static_cast(fillRawFT0A), collision.multFT0C() * static_cast(fillRawFT0C), collision.multFT0A() * static_cast(fillRawFV0A), - collision.multNTracksPVeta1() * static_cast(fillRawNTracksEta1)); + collision.multNTracksPVeta1() * static_cast(fillRawNTracksEta1), + collision.multZNA() * static_cast(fillRawZDC), + collision.multZNC() * static_cast(fillRawZDC), + collision.multZEM1() * static_cast(fillRawZDC), + collision.multZEM2() * static_cast(fillRawZDC), + collision.multZPA() * static_cast(fillRawZDC), + collision.multZPC() * static_cast(fillRawZDC)); } } for (int i = 0; i < V0Table_thisColl.size(); i++) From ac57ad58fddae4212280c3322e0b774b0f4d308d Mon Sep 17 00:00:00 2001 From: Rafael Manhart <56776511+RafRaf11@users.noreply.github.com> Date: Sun, 11 Feb 2024 21:22:31 +0100 Subject: [PATCH 15/26] Update QAHistTask.cxx (#4655) Update: Added comparison for tpcinnerparam with global pT --- PWGLF/Tasks/Nuspex/QAHistTask.cxx | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/QAHistTask.cxx b/PWGLF/Tasks/Nuspex/QAHistTask.cxx index 614e3962054..89aa57a7241 100644 --- a/PWGLF/Tasks/Nuspex/QAHistTask.cxx +++ b/PWGLF/Tasks/Nuspex/QAHistTask.cxx @@ -43,6 +43,7 @@ struct QAHistTask { // Data HistogramRegistry QA_reg{"data_all_species", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry QA_species{"data_species", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry QA_species_pos{"data_positive", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry QA_species_neg{"data_negative", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry MC_truth_reg{"MC_particles", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -124,7 +125,10 @@ struct QAHistTask { QA_reg.add("histTrackLength", "Track length", HistType::kTH1F, {{350, 0., 700., "length (cm)"}}); QA_reg.add("histDcaVsPID", "DCA XY vs PID hypothesis", HistType::kTH2F, {{1000, -2.0, 2.0, "dca XY"}, {10, 0.0, 10.0, "PID ID"}}); QA_reg.add("histDcaZVsPID", "DCA Z vs PID hypothesis", HistType::kTH2F, {{1000, -2.0, 2.0, "dca Z"}, {10, 0.0, 10.0, "PID ID"}}); - QA_reg.add("histpTCorralation", "global pT vs ITS-TPC pT", HistType::kTH2F, {ptAxis_short, ptAxisITS_TPC}); + QA_reg.add("histpTCorralation", "TPC-glo pT vs glo pT", HistType::kTH2F, {{100, -5.0, 5.0, "#it{p}^{global} (GeV/#it{c})"}, {80, -4.0, 4.0, "#it{p}^{TPC} - #it{p}^{global} (GeV/#it{c})"}}); + + // QA choosen species (all charges) + QA_species.add("histpTCorralation", "TPC-glo pT vs glo pT", HistType::kTH2F, {{100, -5.0, 5.0, "#it{p}^{global} (GeV/#it{c})"}, {80, -4.0, 4.0, "#it{p}^{TPC} - #it{p}^{global} (GeV/#it{c})"}}); // QA choosen species (positive) QA_species_pos.add("histTpcSignalData", Form("Specific energy loss (%s)", species.c_str()), HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {5000, 0, 5000, "d#it{E} / d#it{X} (a. u.)"}}); @@ -152,7 +156,7 @@ struct QAHistTask { QA_species_pos.add("histEta", Form("Pseudorapidity with centrality cut (%s)", species.c_str()), HistType::kTH1F, {etaAxis}); QA_species_pos.add("histEta_cent", Form("Pseudorapidity vs Centrality (%s)", species.c_str()), HistType::kTH2F, {centralityAxis_extended, etaAxis}); QA_species_pos.add("histTrackLength", Form("Track length (%s)", species.c_str()), HistType::kTH1F, {{350, 0., 700., "length (cm)"}}); - QA_species_pos.add("histpTCorralation", "global pT vs ITS-TPC pT", HistType::kTH2F, {ptAxis_short, ptAxisITS_TPC}); + QA_species_pos.add("histpTCorralation", "TPC-glo pT vs glo pT", HistType::kTH2F, {{100, -5.0, 5.0, "#it{p}^{global} (GeV/#it{c})"}, {80, -4.0, 4.0, "#it{p}^{TPC} - #it{p}^{global} (GeV/#it{c})"}}); // QA choosen species (negative) QA_species_neg.add("histTpcSignalData", Form("Specific energy loss (anti-%s)", species.c_str()), HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {5000, 0, 5000, "d#it{E} / d#it{X} (a. u.)"}}); @@ -180,7 +184,7 @@ struct QAHistTask { QA_species_neg.add("histEta", Form("Pseudorapidity with centrality cut (%s)", species.c_str()), HistType::kTH1F, {etaAxis}); QA_species_neg.add("histEta_cent", Form("Pseudorapidity vs Centrality (%s)", species.c_str()), HistType::kTH2F, {centralityAxis_extended, etaAxis}); QA_species_neg.add("histTrackLength", Form("Track length (%s)", species.c_str()), HistType::kTH1F, {{350, 0., 700., "length (cm)"}}); - QA_species_neg.add("histpTCorralation", "global pT vs ITS-TPC pT", HistType::kTH2F, {ptAxis_short, ptAxisITS_TPC}); + QA_species_neg.add("histpTCorralation", "TPC-glo pT vs glo pT", HistType::kTH2F, {{100, -5.0, 5.0, "#it{p}^{global} (GeV/#it{c})"}, {80, -4.0, 4.0, "#it{p}^{TPC} - #it{p}^{global} (GeV/#it{c})"}}); // MC truth MC_truth_reg.add("histPhi", "#phi", HistType::kTH2F, {{100, 0., 2. * TMath::Pi()}, PDGBINNING}); @@ -214,7 +218,8 @@ struct QAHistTask { MC_recon_reg.add("histChi2TOF", "chi^2 TOF vs Pt", HistType::kTH3F, {ptAxis, {75, 0.0, 15.0, "chi^2"}, PDGBINNING}); MC_recon_reg.add("histTrackLength", "Track length", HistType::kTH2F, {{350, 0., 700., "length (cm)"}, PDGBINNING}); MC_recon_reg.add("histTPCFractionSharedCls", "Fraction of shared TPC clusters", HistType::kTH2F, {{100, -2.0, 2.0, "Shared Cls"}, PDGBINNING}); - MC_recon_reg.add("histpTCorralation", "global pT vs ITS-TPC pT", HistType::kTH2F, {ptAxis_short, ptAxisITS_TPC}); + MC_recon_reg.add("histpTCorralation", "TPC-glo pT vs glo pT", HistType::kTH2F, {{100, -5.0, 5.0, "#it{p}^{global} (GeV/#it{c})"}, {80, -4.0, 4.0, "#it{p}^{TPC} - #it{p}^{global} (GeV/#it{c})"}}); + MC_recon_reg.add("histpTCorralation_PDG", "TPC-glo pT vs glo pT", HistType::kTH3F, {{100, -5.0, 5.0, "#it{p}^{global} (GeV/#it{c})"}, {80, -4.0, 4.0, "#it{p}^{TPC} - #it{p}^{global} (GeV/#it{c})"}, PDGBINNING}); // MC diff (truth - reconstructed) MC_recon_diff_reg.add("histPhiDiff", "MC t", HistType::kTH2F, {ptAxis_diff, PDGBINNING}); @@ -282,7 +287,7 @@ struct QAHistTask { QA_reg.fill(HIST("histDcaVsPID"), track.dcaXY(), track.pidForTracking()); QA_reg.fill(HIST("histDcaZVsPID"), track.dcaZ(), track.pidForTracking()); - QA_reg.fill(HIST("histpTCorralation"), track.pt(), track.tpcInnerParam()); + QA_reg.fill(HIST("histpTCorralation"), track.sign() * track.pt(), track.tpcInnerParam() - track.pt()); float nSigmaSpecies = 999.0; @@ -401,6 +406,9 @@ struct QAHistTask { // fill QA histograms if (TMath::Abs(nSigmaSpecies) < nsigmacut) { + + QA_species.fill(HIST("histpTCorralation"), track.sign() * track.pt(), track.tpcInnerParam() - track.pt()); + if (track.sign() > 0) { QA_species_pos.fill(HIST("histDcaVsPtData"), track.pt(), track.dcaXY()); QA_species_pos.fill(HIST("histDcaZVsPtData"), track.pt(), track.dcaZ()); @@ -423,7 +431,7 @@ struct QAHistTask { QA_species_pos.fill(HIST("histTPCCrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); QA_species_pos.fill(HIST("histTPCFoundOverFindable"), track.tpcFoundOverFindableCls()); QA_species_pos.fill(HIST("histTPCFractionSharedCls"), track.tpcFractionSharedCls()); - QA_species_pos.fill(HIST("histpTCorralation"), track.pt(), track.tpcInnerParam()); + QA_species_pos.fill(HIST("histpTCorralation"), track.sign() * track.pt(), track.tpcInnerParam() - track.pt()); if (track.hasTOF()) { @@ -468,7 +476,7 @@ struct QAHistTask { QA_species_neg.fill(HIST("histTPCCrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); QA_species_neg.fill(HIST("histTPCFoundOverFindable"), track.tpcFoundOverFindableCls()); QA_species_neg.fill(HIST("histTPCFractionSharedCls"), track.tpcFractionSharedCls()); - QA_species_neg.fill(HIST("histpTCorralation"), track.pt(), track.tpcInnerParam()); + QA_species_neg.fill(HIST("histpTCorralation"), track.sign() * track.pt(), track.tpcInnerParam() - track.pt()); if (track.hasTOF()) { @@ -595,7 +603,8 @@ struct QAHistTask { MC_recon_reg.fill(HIST("histChi2TOF"), track.pt(), track.tofChi2(), pdgbin); MC_recon_reg.fill(HIST("histTrackLength"), track.length(), pdgbin); MC_recon_reg.fill(HIST("histTPCFractionSharedCls"), track.tpcFractionSharedCls(), pdgbin); - MC_recon_reg.fill(HIST("histpTCorralation"), track.pt(), track.tpcInnerParam()); + MC_recon_reg.fill(HIST("histpTCorralation"), track.sign() * track.pt(), track.tpcInnerParam() - track.pt()); + MC_recon_reg.fill(HIST("histpTCorralation_PDG"), track.sign() * track.pt(), track.tpcInnerParam() - track.pt(), pdgbin); if (track.hasTOF()) { Float_t TOFmass2 = ((track.mass()) * (track.mass())); From b6b1367eec4461c9d3771878f4bef0fa018f24f7 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore <89481844+giovannimalfattore@users.noreply.github.com> Date: Sun, 11 Feb 2024 21:22:48 +0100 Subject: [PATCH 16/26] [DGP] AOTTrack - Fix De PID in qaEfficiency (#4654) --- DPG/Tasks/AOTTrack/qaEfficiency.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/DPG/Tasks/AOTTrack/qaEfficiency.cxx b/DPG/Tasks/AOTTrack/qaEfficiency.cxx index 49ee3432789..2f2b7fc8a11 100644 --- a/DPG/Tasks/AOTTrack/qaEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/qaEfficiency.cxx @@ -68,6 +68,7 @@ struct QaEfficiency { Configurable noFakesHits{"noFakesHits", false, "Flag to reject tracks that have fake hits"}; Configurable skipEventsWithoutTPCTracks{"skipEventsWithoutTPCTracks", false, "Flag to reject events that have no tracks reconstructed in the TPC"}; Configurable maxProdRadius{"maxProdRadius", 9999.f, "Maximum production radius of the particle under study"}; + Configurable nsigmaTPCDe{"nsigmaTPCDe", 3.f, "Value of the Nsigma TPC cut for deuterons PID"}; // Charge selection Configurable doPositivePDG{"doPositivePDG", false, "Flag to fill histograms for positive PDG codes."}; Configurable doNegativePDG{"doNegativePDG", false, "Flag to fill histograms for negative PDG codes."}; @@ -820,10 +821,14 @@ struct QaEfficiency { void initData(const AxisSpec& axisSel) { - if (!doprocessData) { + if (!doprocessData && !doprocessDataWithPID) { return; } + if (doprocessData == true && doprocessDataWithPID == true) { + LOG(fatal) << "Can't enable processData and doprocessDataWithPID in the same time, pick one!"; + } + auto h = histos.add("Data/trackSelection", "Track Selection", kTH1F, {axisSel}); h->GetXaxis()->SetBinLabel(trkCutIdxTrkRead, "Tracks read"); h->GetXaxis()->SetBinLabel(trkCutIdxHasMcPart, ""); @@ -1932,7 +1937,7 @@ struct QaEfficiency { if (!isTrackSelected(track, HIST("Data/trackSelection"))) { continue; } - if (abs(track.tpcNSigmaDe()) > 3.f) { + if (abs(track.tpcNSigmaDe()) > nsigmaTPCDe) { continue; } histos.fill(HIST("Data/trackLength"), track.length()); @@ -2043,7 +2048,7 @@ struct QaEfficiency { } } } - PROCESS_SWITCH(QaEfficiency, processHmpid, "process HMPID matching", true); + PROCESS_SWITCH(QaEfficiency, processHmpid, "process HMPID matching", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From bf4411a23a198b7c3c3ba87458a1dc1b32c05374 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Mon, 12 Feb 2024 00:04:38 +0100 Subject: [PATCH 17/26] Fix particle selection (#4670) Co-authored-by: Victor --- PWGCF/TableProducer/dptdptfilter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/TableProducer/dptdptfilter.cxx b/PWGCF/TableProducer/dptdptfilter.cxx index 37ac1c8fd85..a0eba43dd12 100644 --- a/PWGCF/TableProducer/dptdptfilter.cxx +++ b/PWGCF/TableProducer/dptdptfilter.cxx @@ -1373,7 +1373,7 @@ inline int8_t DptDptFilterTracks::selectParticle(ParticleObject const& particle, if (AcceptParticle(particle, mccollision)) { /* the particle has been accepted */ /* let's identify the particle */ - int8_t sp = identifyParticle(particle); + sp = identifyParticle(particle); if (!(sp < 0)) { /* fill the species histograms */ fillParticleHistosAfterSelection(particle, mccollision, charge, sp); From 9f2e3e5db21eea8ac5afd597e028960e783142e1 Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Mon, 12 Feb 2024 17:29:03 +0900 Subject: [PATCH 18/26] PWGEM/PhotonMeson: revert mean ITS cluster size cut (#4671) --- PWGEM/PhotonMeson/Core/CutsLibrary.cxx | 26 +++++++++---------- .../TableProducer/photonconversionbuilder.cxx | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index c27f608fd1f..58002c233c9 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -28,7 +28,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -48,7 +48,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -70,7 +70,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetIsWithinBeamPipe(true); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetRequireITSTPC(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -89,7 +89,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetRequireITSonly(true); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(4, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); // for v0 cut->SetV0PtRange(0.1f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); @@ -129,7 +129,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetNClustersITS(2, 4); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); // cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -152,7 +152,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetNClustersITS(2, 4); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); // cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -175,7 +175,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetNClustersITS(0, 2); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 2); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); // cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -199,7 +199,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.05f, 1e10f); @@ -220,7 +220,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(true); cut->SetRequireITSTPC(true); // for v0 @@ -240,7 +240,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetRequireITSonly(true); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(4, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); // for v0 cut->SetV0PtRange(0.05f, 1e10f); cut->SetV0EtaRange(-0.9, +0.9); @@ -279,7 +279,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetChi2PerClusterTPC(0.0, 4.0); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(true); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -300,7 +300,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(false); // for v0 cut->SetV0PtRange(0.1f, 1e10f); @@ -321,7 +321,7 @@ V0PhotonCut* o2::aod::pcmcuts::GetCut(const char* cutName) cut->SetTPCNsigmaElRange(-3, +3); cut->SetChi2PerClusterITS(-1e+10, 5.0); cut->SetNClustersITS(2, 4); - cut->SetMeanClusterSizeITS(0.0, 3.0); + cut->SetMeanClusterSizeITS(0.0, 16.0); cut->SetIsWithinBeamPipe(true); cut->SetRequireITSTPC(true); // for v0 diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 8b0ff4b1b96..badd8d3c536 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -87,7 +87,7 @@ struct PhotonConversionBuilder { Configurable dcanegtopv{"dcanegtopv", 0.1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", 0.1, "DCA Pos To PV"}; Configurable min_pt_leg{"min_pt_leg", 0.04, "min pT for v0 legs at SV"}; - Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 4.f, "max. x cos(lambda) for ITSonly tracks"}; // this is to suppress random combination for V0s with ITSonly tracks. default 3 + 1 for skimming. + Configurable max_mean_its_cluster_size{"max_mean_its_cluster_size", 16.f, "max. x cos(lambda) for ITSonly tracks"}; // this is to suppress random combination for V0s with ITSonly tracks. default 3 + 1 for skimming. Configurable maxX{"maxX", 83.1, "max X for track IU"}; // v0 cuts From 61a44cceecb67a935564ce18da83fc371fa31120 Mon Sep 17 00:00:00 2001 From: rolavick Date: Mon, 12 Feb 2024 09:35:35 +0100 Subject: [PATCH 19/26] [PWGUD] Updating my task (#4613) * bug fix * including TOF and ITS selection histos again after the messed rebase * adding forgotten TOF counter * TOF counter bug fix * small reshuffle * increasing precision of axis * MegaLinter fixes * adding function which mimics GlobatTracks flag using UD tables * MegaLinter fixes * fixing redeclaration --------- Co-authored-by: ALICE Action Bot --- PWGUD/Core/UPCTauCentralBarrelHelperRL.h | 30 ++++++ PWGUD/Tasks/upcTauCentralBarrelRL.cxx | 132 +++++++++++++++++++++-- 2 files changed, 154 insertions(+), 8 deletions(-) diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index 7c19cb98164..e5c53f19aee 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -175,4 +175,34 @@ double calculateAcoplanarity(double phi_trk1, double phi_trk2) return (o2::constants::math::TwoPI - aco); } +template +float getAvgITSClSize(T const& track) +{ + float sum = 0.0; + for (int iL = 0; iL < 6; iL++) { + sum += (track.itsClusterSizes() >> (iL * 4)) & 0xf; + } + return sum / track.itsNCls(); +} + +template +float getCosLambda(T const& track) +{ + // lambda is track inclination + // tan(lambda) = track.tgl() + // track.pz() = track.pt() * track.tgl + float lambda = std::atan(track.pz() / track.pt()); + return std::cos(lambda); +} + +template +bool passITSAvgClsSizesLowMomCut(T const& track, double itscut = 3.5, double ptcut = 0.7) +{ + if (getAvgITSClSize(track) * getCosLambda(track) < itscut && track.pt() < ptcut) { + return false; + } else { + return true; + } +} + #endif // PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ diff --git a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx index 9345e99c514..4bd93abef2e 100644 --- a/PWGUD/Tasks/upcTauCentralBarrelRL.cxx +++ b/PWGUD/Tasks/upcTauCentralBarrelRL.cxx @@ -23,16 +23,15 @@ #include "Framework/runDataProcessing.h" // O2Physics headers -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/EventSelection.h" #include "Common/CCDB/EventSelectionParams.h" -#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include "PWGUD/DataModel/UDTables.h" - #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" #include "Common/Core/trackUtilities.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" +#include "PWGUD/DataModel/UDTables.h" // ROOT headers #include "TLorentzVector.h" @@ -130,6 +129,22 @@ struct UpcTauCentralBarrelRL { Configurable verboseInfo{"verboseInfo", true, {"Print general info to terminal; default it true."}}; Configurable verboseDebug{"verboseDebug", false, {"Print debug info to terminal; default it false."}}; Configurable whichGapSide{"whichGapSide", 2, {"0 for side A, 1 for side C, 2 for both sides"}}; + Configurable cutAvgITSclusterSize{"cutAvgITSclusterSize", 3.5, {"specific study"}}; + Configurable cutPtAvgITSclusterSize{"cutPtAvgITSclusterSize", 0.7, {"specific study"}}; + Configurable cutMyGlobalTracksOnly{"cutGlobalTracksOnly", false, {"Applies cut on here defined global tracks"}}; + Configurable cutMyGTptMin{"cutMyGTptMin", 0.1f, {"MyGlobalTrack cut"}}; + Configurable cutMyGTptMax{"cutMyGTptMax", 1e10f, {"MyGlobalTrack cut"}}; + Configurable cutMyGTetaMin{"cutMyGTetaMin", -0.8, {"MyGlobalTrack cut"}}; + Configurable cutMyGTetaMax{"cutMyGTetaMax", 0.8, {"MyGlobalTrack cut"}}; + Configurable cutMyGTdcaZmax{"cutMyGTdcaZmax", 2.f, {"MyGlobalTrack cut"}}; + Configurable cutMyGTdcaXYmax{"cutMyGTdcaXYmax", 1e10f, {"MyGlobalTrack cut"}}; + Configurable cutMyGTdcaXYusePt{"cutMyGTdcaXYusePt", false, {"MyGlobalTrack cut"}}; + Configurable cutMyGTitsNClsMin{"cutMyGTitsNClsMin", 1, {"MyGlobalTrack cut"}}; + Configurable cutMyGTitsChi2NclMax{"cutMyGTitsChi2NclMax", 36.f, {"MyGlobalTrack cut"}}; + Configurable cutMyGTtpcNClsMin{"cutMyGTtpcNClsMin", 1, {"MyGlobalTrack cut"}}; + Configurable cutMyGTtpcNClsCrossedRowsMin{"cutMyGTtpcNClsCrossedRows", 70, {"MyGlobalTrack cut"}}; + Configurable cutMyGTtpcNClsCrossedRowsOverNClsMin{"cutMyGTtpcNClsCrossedRowsOverNClsMin", 0.8f, {"MyGlobalTrack cut"}}; + Configurable cutMyGTtpcChi2NclMax{"cutMyGTtpcChi2NclMax", 4.f, {"MyGlobalTrack cut"}}; using FullUDTracks = soa::Join; using FullUDCollision = soa::Join::iterator; @@ -147,12 +162,14 @@ struct UpcTauCentralBarrelRL { const AxisSpec axisInvMass{400, 1., 5.}; const AxisSpec axisInvMassWide{500, 0., 10.}; const AxisSpec axisMom{40, 0., 2.}; + const AxisSpec axisMomSigned{80, -2., 2.}; const AxisSpec axisMomWide{100, 0., 10.}; const AxisSpec axisPt{40, 0., 2.}; const AxisSpec axisPhi{64, -2 * TMath::Pi(), 2 * TMath::Pi()}; const AxisSpec axisEta{50, -1.2, 1.2}; const AxisSpec axisRap{50, -1.2, 1.2}; const AxisSpec axisAcoplanarity{32, 0.0, o2::constants::math::PI}; + const AxisSpec axisAvgITSclsSizes{500, 0., 10.}; histos.add("Tracks/raw/hTrackZ", ";Track z-vertex (cm);Number of events (-)", HistType::kTH1D, {axisZvtx}); histos.add("Tracks/raw/hTrackP", ";Track #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); @@ -171,6 +188,9 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/hInvariantMassWideNoMothers", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/hInvariantMassWideAllPionMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/hInvariantMassWideAllPionMassPtCutITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); histos.add("EventTwoTracks/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); histos.add("EventTwoTracks/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); @@ -182,6 +202,8 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); histos.add("EventTwoTracks/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); histos.add("EventTwoTracks/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); + histos.add("EventTwoTracks/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); + histos.add("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); histos.add("EventTwoTracks/TwoElectrons/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); histos.add("EventTwoTracks/TwoElectrons/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); @@ -309,10 +331,16 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/PionsSelection/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); histos.add("EventTwoTracks/PionsSelection/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/PionsSelection/hInvariantMassWideTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/PionsSelection/hInvariantMassWideITS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/PionsSelection/hInvariantMassPtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLS", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLSTOF", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); + histos.add("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLSITScut", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); histos.add("EventTwoTracks/PionsSelection/hAcoplanarity", ";#Delta#phi (rad);Number of events (-)", HistType::kTH1D, {axisAcoplanarity}); histos.add("EventTwoTracks/PionsSelection/hMotherP", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMom}); histos.add("EventTwoTracks/PionsSelection/hMotherPwide", ";Mother #it{p} (GeV/c);Number of events (-)", HistType::kTH1D, {axisMomWide}); @@ -324,6 +352,8 @@ struct UpcTauCentralBarrelRL { histos.add("EventTwoTracks/PionsSelection/hDaughtersPt", ";Daughter 1 #it{p_{T}} (GeV/c);Daughter 2 #it{p_{T}} (GeV/c)", HistType::kTH2D, {axisPt, axisPt}); histos.add("EventTwoTracks/PionsSelection/hDaughtersPhi", ";Daughter 1 #phi (rad);Daughter 2 #phi (rad)", HistType::kTH2D, {axisPhi, axisPhi}); histos.add("EventTwoTracks/PionsSelection/hDaughtersRapidity", ";Daughter 1 #it{y} (-);Daughter 2 #it{y} (-)", HistType::kTH2D, {axisRap, axisRap}); + histos.add("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSize", ";Average ITS cluster size;Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); + histos.add("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSizeXcos", ";Average ITS cluster size x cos(#lambda);Daughter #it{p} (GeV/c)", HistType::kTH2D, {axisAvgITSclsSizes, axisMomSigned}); histos.add("EventFourTracks/hInvariantMass", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMass}); histos.add("EventFourTracks/hInvariantMassWide", ";Invariant mass (GeV/c^{2});Number of events (-)", HistType::kTH1D, {axisInvMassWide}); @@ -388,7 +418,50 @@ struct UpcTauCentralBarrelRL { } // end run - // process + template + bool isGlobalTrackReinstallment(T const& track) + { + // kInAcceptance copy + if (track.pt() < cutMyGTptMin || track.pt() > cutMyGTptMax) + return false; + if (eta(track.px(), track.py(), track.pz()) < cutMyGTetaMin || eta(track.px(), track.py(), track.pz()) > cutMyGTetaMax) + return false; + // kPrimaryTracks + // GoldenChi2 cut is only for Run 2 + if (track.dcaZ() > cutMyGTdcaZmax) + return false; + if (cutMyGTdcaXYusePt) { + float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f); // ? not sure yet if will be used + if (track.dcaXY() > maxDCA) + return false; + } else { + if (track.dcaXY() > cutMyGTdcaXYmax) + return false; + } + // kQualityTrack + // TrackType is always 1 as per definition of processed Run3 AO2Ds + // ITS + if (!track.hasITS()) + return false; // ITS refit + if (track.itsNCls() < cutMyGTitsNClsMin) + return false; + if (track.itsChi2NCl() > cutMyGTitsChi2NclMax) + return false; + // if (!FulfillsITSHitRequirements(track.itsClusterSizes())) return false; <---- to complicated to implement now + // TPC + if (!track.hasTPC()) + return false; // TPC refit + if (track.tpcNClsFindable() - track.tpcNClsFindableMinusFound() < cutMyGTtpcNClsMin) + return false; // tpcNClsFound() + if (track.tpcNClsCrossedRows() < cutMyGTtpcNClsCrossedRowsMin) + return false; + if ((track.tpcNClsCrossedRows() / track.tpcNClsFindable()) < cutMyGTtpcNClsCrossedRowsOverNClsMin) + return false; + if (track.tpcChi2NCl() > cutMyGTtpcChi2NclMax) + return false; // TPC chi2 + + return true; + } template void fillHistograms(C reconstructedCollision, Ts reconstructedBarrelTracks) @@ -443,11 +516,17 @@ struct UpcTauCentralBarrelRL { int countPVGTpions = 0; int countPVGTothers = 0; int countPVGTpionsSelection = 0; + int countTOFtracks = 0; std::vector vecPVidx; // Loop over tracks with selections for (auto& track : reconstructedBarrelTracks) { if (track.isPVContributor() != 1) continue; + if (cutMyGlobalTracksOnly) { + if (isGlobalTrackReinstallment(track) != 1) + continue; + } + countPVGT++; float trkPx = track.px(); float trkPy = track.py(); float trkPz = track.pz(); @@ -478,7 +557,8 @@ struct UpcTauCentralBarrelRL { printMediumMessage("Track has no charge"); } } - countPVGT++; + if (track.hasTOF()) + countTOFtracks++; int hypothesisID = testPIDhypothesis(track); if (hypothesisID == P_ELECTRON || hypothesisID == P_MUON || hypothesisID == P_PION) { countPVGTselected++; @@ -537,6 +617,7 @@ struct UpcTauCentralBarrelRL { motherOfPions = pion[0] + pion[1]; auto acoplanarity = calculateAcoplanarity(daug[0].Phi(), daug[1].Phi()); auto sign = trkDaug1.sign() * trkDaug2.sign(); + bool passAvgITSclsSizesCut = passITSAvgClsSizesLowMomCut(trkDaug1, cutAvgITSclusterSize, cutPtAvgITSclusterSize) && passITSAvgClsSizesLowMomCut(trkDaug2, cutAvgITSclusterSize, cutPtAvgITSclusterSize); if (trkDaug1.hasTPC()) { histosPID.get(HIST("EventTwoTracks/PID/hTPCsignalVsP"))->Fill(daug[0].P(), trkDaug1.tpcSignal()); @@ -585,7 +666,20 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/hDaughtersRapidity"))->Fill(daug[0].Rapidity(), daug[1].Rapidity()); if (motherOfPions.Pt() < 0.2) { histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassPtCut"))->Fill(motherOfPions.M()); + if (passAvgITSclsSizesCut) { + histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassPtCutITScut"))->Fill(motherOfPions.M()); + } + } + if (countTOFtracks == 2) { + histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassTOF"))->Fill(motherOfPions.M()); + } + if (passAvgITSclsSizesCut) { + histos.get(HIST("EventTwoTracks/hInvariantMassWideAllPionMassITScut"))->Fill(motherOfPions.M()); } + histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug1), trkDaug1.sign() * daug[0].P()); + histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug2), trkDaug2.sign() * daug[1].P()); + histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug1) * getCosLambda(trkDaug1), trkDaug1.sign() * daug[0].P()); + histos.get(HIST("EventTwoTracks/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug2) * getCosLambda(trkDaug2), trkDaug2.sign() * daug[1].P()); // ee, mm, em, pp, ep, mp, pppp, eppp, mppp, pppppp if (countPVGTelectrons == 2) { @@ -805,7 +899,29 @@ struct UpcTauCentralBarrelRL { histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUS"))->Fill(motherOfPions.M()); if (sign > 0) histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLS"))->Fill(motherOfPions.M()); + if (countTOFtracks == 2) { + if (sign < 0) + histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSTOF"))->Fill(motherOfPions.M()); + if (sign > 0) + histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLSTOF"))->Fill(motherOfPions.M()); + } + if (passAvgITSclsSizesCut) { + if (sign < 0) + histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutUSITScut"))->Fill(motherOfPions.M()); + if (sign > 0) + histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWidePtCutLSITScut"))->Fill(motherOfPions.M()); + } + } + if (countTOFtracks == 2) { + histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWideTOF"))->Fill(motherOfPions.M()); + } + if (passAvgITSclsSizesCut) { + histos.get(HIST("EventTwoTracks/PionsSelection/hInvariantMassWideITS"))->Fill(motherOfPions.M()); } + histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug1), trkDaug1.sign() * daug[0].P()); + histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSize"))->Fill(getAvgITSClSize(trkDaug2), trkDaug2.sign() * daug[1].P()); + histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug1) * getCosLambda(trkDaug1), trkDaug1.sign() * daug[0].P()); + histos.get(HIST("EventTwoTracks/PionsSelection/hDaughtersPvsITSclusterSizeXcos"))->Fill(getAvgITSClSize(trkDaug2) * getCosLambda(trkDaug2), trkDaug2.sign() * daug[1].P()); } } else if (countPVGTselected == 4) { From 2eccc1208deb79b3243937c2f602194f1695281d Mon Sep 17 00:00:00 2001 From: Anisa Khatun Date: Mon, 12 Feb 2024 10:16:58 +0100 Subject: [PATCH 20/26] PWGUD/AQC (#4660) * Change cmake * updated tasks with modification * Fixed compilation errors * modifying task * Updated task for new checks and removed unrequired parts for AQC * bug fixed CMakeList.txt * fixed format * fixed formatting and megalinter issue * Macro to test FIT signal for UPC * Updated for inclusive UPC event selection * Updated Task PWGUD/AQC * resolving commit issue * resolving formatting for Cmakelist * New Tasks to study FIT veto and ZDC for UPC --------- Co-authored-by: akhatun Co-authored-by: akhatun --- PWGUD/AQC/CMakeLists.txt | 10 + PWGUD/AQC/FITtest.cxx | 1309 ++++++++++++++++++++++++++++++++++++++ PWGUD/AQC/udQCmidRap.cxx | 454 +++++++++++++ 3 files changed, 1773 insertions(+) create mode 100644 PWGUD/AQC/FITtest.cxx create mode 100644 PWGUD/AQC/udQCmidRap.cxx diff --git a/PWGUD/AQC/CMakeLists.txt b/PWGUD/AQC/CMakeLists.txt index daeb5b592cc..d7574e1bcb1 100644 --- a/PWGUD/AQC/CMakeLists.txt +++ b/PWGUD/AQC/CMakeLists.txt @@ -13,3 +13,13 @@ o2physics_add_dpl_workflow(udqc SOURCES udQC.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGCutparHolder COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(fittest + SOURCES FITtest.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGCutparHolder + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(udqcmidrap + SOURCES udQCmidRap.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::DGCutparHolder + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGUD/AQC/FITtest.cxx b/PWGUD/AQC/FITtest.cxx new file mode 100644 index 00000000000..56d7d87b6e2 --- /dev/null +++ b/PWGUD/AQC/FITtest.cxx @@ -0,0 +1,1309 @@ +// 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. +/// +/// \brief A task for testing FIT selection for Ultra-perimpheral Collisions +/// \author Anisa Khatun, anisa.khatun@cern.ch +/// \since 04.08.2023 + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "ReconstructionDataFormats/BCRange.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/PIDResponse.h" +#include "CommonConstants/LHCConstants.h" + +#include "Framework/StaticFor.h" +#include "TLorentzVector.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace std; + +struct FITtest { + + // inivinitialize HistogramRegistry + HistogramRegistry registry{ + "registry", + {}}; + + // define abbreviations + using CCs = soa::Join; + using CC = CCs::iterator; + using BCs = soa::Join; + using TCs = soa::Join; + using FWs = aod::FwdTracks; + using ATs = aod::AmbiguousTracks; + using AFTs = aod::AmbiguousFwdTracks; + + void init(InitContext& context) + { + // add histograms for the different process functions + if (context.mOptions.get("processMain")) { + + // collisions + registry.add("All/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{20, -0.5, 20.5}}}); + registry.add("All/AllRelBC", "Total Relative BC number; Relative BC; Collisions", {HistType::kTH1F, {{3564, -0.5, 3563.5}}}); + registry.add("All/RelativeBC", "Relative BC number; Relative BC; Collisions", {HistType::kTH1F, {{3564, -0.5, 3563.5}}}); + registry.add("All/trkmultiplicity", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("All/PVCFIT", "PV contributors with FIT; PV contributors; Tracks", {HistType::kTH1F, {{100, -0.5, 99.5}}}); + registry.add("All/PVTracks", "Number of PV tracks; Number of PV tracks; Collisions", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("All/etapt", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("All/dEdxTPC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("All/dEdxTOF", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + registry.add("All/trketa", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("All/trkpt", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + + // FV0 + registry.add("All/FV0/hV0A", "Time FV0A; Time (ns); Collisions", {HistType::kTH1F, {{500, -50.0, 50.0}}}); + registry.add("All/FV0/FV0Amp", "FV0A Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/FV0/FV0A", "#FV0A; Channel; FV0A Amplitude", {HistType::kTH2F, {{48, -0.5, 47.5}, {2000, 0., 2000.}}}); + + // FT0 + registry.add("All/FT0/hT0AC", "Time Correlation FT0; FT0A Time (ns) ; FT0C Time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("All/FT0/FT0Aamp", "#FT0A Amplitude; FT0A Amplitude", {HistType::kTH1F, {{2000, -4.5, 1995.5}}}); + registry.add("All/FT0/FT0Camp", "#FT0C Amplitude; FT0C Amplitude", {HistType::kTH1F, {{2000, -4.5, 1995.5}}}); + registry.add("All/FT0/FT0A", "#FT0A; Channel; FT0A Amplitude", {HistType::kTH2F, {{96, -0.5, 95.5}, {1000, 0., 1000.}}}); + registry.add("All/FT0/FT0C", "#FT0C; Channel; FT0C Amplitude", {HistType::kTH2F, {{112, -0.5, 111.5}, {1000, 0., 1000.}}}); + registry.add("All/FT0/FT0ACCorr", "FT0 amp correlation; FT0A Amplitude; FT0C Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // FDD + registry.add("All/FDD/hFDDAC", "Time Correlation FDD; FDDA time (ns); FDDC time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("All/FDD/FDDAamp", "#FDDA Amplitude; FDDA Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("All/FDD/FDDCamp", "#FDDC Amplitude; FDDC Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("All/FDD/FDDA", "#FDDA; Channel; FDDA Amplitude", {HistType::kTH2F, {{8, -0.5, 7.5}, {1000, 0., 1000.}}}); + registry.add("All/FDD/FDDC", "#FDDC; Channel; FDDC Amplitude", {HistType::kTH2F, {{8, -0.5, 7.5}, {1000, 0., 1000.}}}); + registry.add("All/FDD/FDDACCorr", "#FDD amp correlation; FDDA Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // FIT + registry.add("All/FITAamp", "#FIT A side; FITA Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("All/FITCamp", "#FIT C side; FITC Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("All/FITACCorr", "FIT amp correlation; FT0A Amplitude; FT0C Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // ZDC + + registry.add("All/ZDC/hZNAC", "Time Correlation ZN; ZNA Time (ns) ; ZNC Time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("All/ZDC/hZPAC", "Time Correlation ZP; ZPA Time (ns) ; ZPC Time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("All/ZDC/hZEM12", "Time Correlation ZEM; ZEM1 Time (ns) ; ZEM2 Time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + + registry.add("All/ZDC/ZNAamp", "ZNA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/ZDC/ZNCamp", "ZNC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/ZDC/ZNACCorr", "ZDC amp correlation; ZNA Amplitude; ZNC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/ZDC/ZPAamp", "ZPA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/ZDC/ZPCamp", "ZPC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/ZDC/ZPACCorr", "ZDC amp correlation; ZPA Amplitude; ZPC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + registry.add("All/ZDC/ZEM1amp", "ZEM1 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/ZDC/ZEM2amp", "ZEM2 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("All/ZDC/ZEM12Corr", "ZDC amp correlation; ZEM1 Amplitude; ZEM2 Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/ZDC/ZDCACorr", "ZDC amp correlation; ZDCA Amplitude; ZDCC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // Correlation plots + registry.add("All/FV0T0ACorr", "Correlation FV0 vs FT0; FT0A Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FV0T0CCorr", "Correlation FV0 vs FT0; FT0C Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FT0DDACorr", "Correlation FT0 vs FDD; FT0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FT0DDCCorr", "Correlation FT0 vs FDD; FT0C Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FT0AFDDC", "Correlation FT0 vs FDD; FT0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FT0CFDDA", "Correlation FT0 vs FDD; FT0C Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FV0AFDDA", "Correlation FV0 vs FDD; FV0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("All/FV0AFDDC", "Correlation FV0 vs FDD; FV0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + } + + if (context.mOptions.get("processHadronic")) { + registry.add("collHadronic/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{20, -0.5, 20.5}}}); + registry.add("collHadronic/RelBC", "Relative BC number; Relative BC; Collisions", {HistType::kTH1F, {{3564, -0.5, 3563.5}}}); + registry.add("collHadronic/trkmult", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("collHadronic/PVTrk", "Number of PV tracks; Number of PV tracks; Collisions", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("collHadronic/etapt", "Eta vs pT; eta of track; pT of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("collHadronic/dEdxTPC", "TPC signal vs signed track pt; Signed track pt [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("collHadronic/dEdxTOF", "TOF signal vs signed track pt; Signed track pt [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + registry.add("collHadronic/trketa", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("collHadronic/trkpt", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + + registry.add("collHadronic/trketaZDC", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("collHadronic/trkptZDC", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + registry.add("collHadronic/trkmultZDC", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("collHadronic/PVTrkZDC", "Number of PV tracks; Number of PV tracks; Collisions", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("collHadronic/etaptZDC", "Eta vs pT; eta of track; pT of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("collHadronic/dEdxTPCZDC", "TPC signal vs signed track pt; Signed track pt [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("collHadronic/dEdxTOFZDC", "TOF signal vs signed track pt; Signed track pt [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + // FV0 + registry.add("collHadronic/FV0/hV0A", "Time FV0A; Time (ns); Collisions", {HistType::kTH1F, {{500, -50.0, 50.0}}}); + registry.add("collHadronic/FV0/FV0Amp", "FV0A Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + + // FT0 + registry.add("collHadronic/FT0/hT0AC", "Time Correlation FT0; FT0A Time (ns) ; FT0C Time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("collHadronic/FT0/FT0Aamp", "#FT0A Amplitude; FT0A Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("collHadronic/FT0/FT0Camp", "#FT0C Amplitude; FT0C Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("collHadronic/FT0/FT0ACCorr", "FT0 amp correlation; FT0A Amplitude; FT0C Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // FDD + registry.add("collHadronic/FDD/hFDDAC", "Time Correlation FDD; FDDA time (ns); FDDC time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("collHadronic/FDD/FDDAamp", "#FDDA Amplitude; FDDA Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("collHadronic/FDD/FDDCamp", "#FDDC Amplitude; FDDC Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("collHadronic/FDD/FDDACCorr", "#FDD amp correlation;FDDA Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // ZDC + registry.add("collHadronic/ZDC/ZNAamp", "ZNA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("collHadronic/ZDC/ZNCamp", "ZNC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("collHadronic/ZDC/ZNACCorr", "ZDC amp correlation; ZNA Amplitude; ZNC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/ZDC/ZPAamp", "ZPA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("collHadronic/ZDC/ZPCamp", "ZPC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("collHadronic/ZDC/ZPACCorr", "ZDC amp correlation; ZPA Amplitude; ZPC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + registry.add("collHadronic/ZDC/ZEM1amp", "ZEM1 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("collHadronic/ZDC/ZEM2amp", "ZEM2 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("collHadronic/ZDC/ZEM12Corr", "ZDC amp correlation; ZEM1 Amplitude; ZEM2 Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // Correlation plots + registry.add("collHadronic/FV0T0ACorr", "Correlation FV0 vs FT0 A side; FT0A Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FV0T0CCorr", "Correlation FV0 vs FT0 C side; FT0C Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FT0DDACorr", "Correlation FT0 vs FDD A side; FT0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FT0DDCCorr", "Correlation FT0 vs FDD C side; FT0C Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FT0AFDDC", "Correlation FT0 vs FDD AC side; FT0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FT0CFDDA", "Correlation FT0 vs FDD CA side; FT0C Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FV0AFDDA", "Correlation FV0 vs FDD A side; FV0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("collHadronic/FV0AFDDC", "Correlation FV0 vs FDD C side; FV0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + } + + if (context.mOptions.get("processInclusiveA")) { + + registry.add("colInclusiveA/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{20, -0.5, 20.5}}}); + registry.add("colInclusiveA/RelativeBC", "Relative BC number; Relative BC; Collisions", {HistType::kTH1F, {{3564, -0.5, 3563.5}}}); + registry.add("colInclusiveA/trkmultiplicity", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveA/PVTracks", "Number of PV tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveA/etapt", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("colInclusiveA/dEdxTPC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("colInclusiveA/dEdxTOF", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + registry.add("colInclusiveA/trketa", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("colInclusiveA/trkpt", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + registry.add("colInclusiveA/trketaZDC", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("colInclusiveA/trkptZDC", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + registry.add("colInclusiveA/trkmultZDC", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveA/PVTracksZDC", "Number of PV tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveA/etaptZDC", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("colInclusiveA/dEdxTPCZDC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("colInclusiveA/dEdxTOFZDC", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + // FV0 + registry.add("colInclusiveA/FV0/FV0Amp", "FV0A Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + // FT0 + registry.add("colInclusiveA/FT0/hT0AC", "Time Correlation FT0; FT0A Time (ns) ; FT0C Time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("colInclusiveA/FT0/FT0Aamp", "#FT0A Amplitude; FT0A Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveA/FT0/FT0Camp", "#FT0C Amplitude; FT0C Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveA/FT0/FT0ACCorr", "FT0 amp correlation; FT0A Amplitude; FT0C Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + // FDD + registry.add("colInclusiveA/FDD/FDDAamp", "#FDDA Amplitude; FDDA Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveA/FDD/FDDCamp", "#FDDC Amplitude; FDDC Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveA/FDD/hFDDAC", "Time Correlation FDD; FDDA time (ns); FDDC time (ns)", {HistType::kTH2F, {{500, -50.0, 50.0}, {500, -50.0, 50.0}}}); + registry.add("colInclusiveA/FDD/FDDACCorr", "#FDD amp correlation; FDDA Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // ZDC + registry.add("colInclusiveA/ZDC/ZNAamp", "ZNA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveA/ZDC/ZNCamp", "ZNC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveA/ZDC/ZNACCorr", "ZDC amp correlation; ZNA Amplitude; ZNC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/ZDC/ZPAamp", "ZPA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveA/ZDC/ZPCamp", "ZPC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveA/ZDC/ZPACCorr", "ZDC amp correlation; ZPA Amplitude; ZPC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + registry.add("colInclusiveA/ZDC/ZEM1amp", "ZEM1 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveA/ZDC/ZEM2amp", "ZEM2 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveA/ZDC/ZEM12Corr", "ZDC amp correlation; ZEM1 Amplitude; ZEM2 Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // Correlation plots + registry.add("colInclusiveA/FV0T0ACorr", "Correlation FV0 vs FT0 A side; FT0A Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FV0T0CCorr", "Correlation FV0 vs FT0 C side; FT0C Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FT0DDACorr", "Correlation FT0 vs FDD A side; FT0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FT0DDCCorr", "Correlation FT0 vs FDD C side; FT0C Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FT0AFDDC", "Correlation FT0 vs FDD AC side; FT0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FT0CFDDA", "Correlation FT0 vs FDD CA side; FT0C Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FV0AFDDA", "Correlation FV0 vs FDD A side; FV0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveA/FV0AFDDC", "Correlation FV0 vs FDD C side; FV0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + } + + if (context.mOptions.get("processInclusiveC")) { + registry.add("colInclusiveC/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{20, -0.5, 20.5}}}); + registry.add("colInclusiveC/RelativeBC", "Relative BC number; Relative BC; Collisions", {HistType::kTH1F, {{3564, -0.5, 3563.5}}}); + registry.add("colInclusiveC/trkmultiplicity", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveC/PVTracks", "Number of PV tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveC/etapt", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("colInclusiveC/dEdxTPC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("colInclusiveC/dEdxTOF", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + registry.add("colInclusiveC/trketa", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("colInclusiveC/trkpt", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + + registry.add("colInclusiveC/trketaZDC", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("colInclusiveC/trkptZDC", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + registry.add("colInclusiveC/trkmultZDC", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveC/PVTracksZDC", "Number of PV tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("colInclusiveC/etaptZDC", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("colInclusiveC/dEdxTPCZDC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("colInclusiveC/dEdxTOFZDC", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + // FV0 + registry.add("colInclusiveC/FV0/FV0Amp", "FV0A Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + // FT0 + registry.add("colInclusiveC/FT0/FT0Aamp", "#FT0A Amplitude; FT0A Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveC/FT0/FT0Camp", "#FT0C Amplitude; FT0C Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveC/FT0/FT0ACCorr", "FT0 amp correlation; FT0A Amplitude; FT0C Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + // FDD + registry.add("colInclusiveC/FDD/FDDAamp", "#FDDA Amplitude; FDDA Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveC/FDD/FDDCamp", "#FDDC Amplitude; FDDC Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("colInclusiveC/FDD/FDDACCorr", "#FDD amp correlation; FDDA Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // ZDC + registry.add("colInclusiveC/ZDC/ZNAamp", "ZNA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveC/ZDC/ZNCamp", "ZNC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveC/ZDC/ZNACCorr", "ZDC amp correlation; ZNA Amplitude; ZNC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/ZDC/ZPAamp", "ZPA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveC/ZDC/ZPCamp", "ZPC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveC/ZDC/ZPACCorr", "ZDC amp correlation; ZPA Amplitude; ZPC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + registry.add("colInclusiveC/ZDC/ZEM1amp", "ZEM1 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveC/ZDC/ZEM2amp", "ZEM2 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("colInclusiveC/ZDC/ZEM12Corr", "ZDC amp correlation; ZEM1 Amplitude; ZEM2 Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // Correlation plots + registry.add("colInclusiveC/FV0T0ACorr", "Correlation FV0 vs FT0 A side; FT0A Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FV0T0CCorr", "Correlation FV0 vs FT0 C side; FT0C Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FT0DDACorr", "Correlation FT0 vs FDD A side; FT0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FT0DDCCorr", "Correlation FT0 vs FDD C side; FT0C Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FT0AFDDC", "Correlation FT0 vs FDD AC side; FT0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FT0CFDDA", "Correlation FT0 vs FDD CA side; FT0C Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FV0AFDDA", "Correlation FV0 vs FDD A side; FV0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("colInclusiveC/FV0AFDDC", "Correlation FV0 vs FDD C side; FV0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + } + + if (context.mOptions.get("processExclusive")) { + registry.add("exclusive/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{20, -0.5, 20.5}}}); + registry.add("exclusive/RelativeBC", "Relative BC number; Relative BC; Collisions", {HistType::kTH1F, {{3564, -0.5, 3563.5}}}); + registry.add("exclusive/trkmultiplicity", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("exclusive/PVTracks", "Number of PV tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("exclusive/etapt", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("exclusive/dEdxTPC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("exclusive/dEdxTOF", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + registry.add("exclusive/trketa", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("exclusive/trkpt", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + + registry.add("exclusive/trketaZDC", "Eta distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{80, -2., 2.}}}); + registry.add("exclusive/trkptZDC", "Pt distribution of tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{100, 0., 5.}}}); + registry.add("exclusive/trkmultZDC", "Multiplicity of all tracks; Multiplicity; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("exclusive/PVTracksZDC", "Number of PV tracks; Number of PV tracks; Tracks", {HistType::kTH1F, {{300, -0.5, 299.5}}}); + registry.add("exclusive/etaptZDC", "eta versus pT of all tracks; eta of track; p_T of track [MeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("exclusive/dEdxTPCZDC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("exclusive/dEdxTOFZDC", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + // FV0 + registry.add("exclusive/FV0/FV0Amp", "FV0A Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + + // FT0 + registry.add("exclusive/FT0/FT0Aamp", "#FT0A Amplitude; FT0A Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("exclusive/FT0/FT0Camp", "#FT0C Amplitude; FT0C Amplitude", {HistType::kTH1F, {{2000, -0.5, 1999.5}}}); + registry.add("exclusive/FT0/FT0ACCorr", "FT0 amp correlation; FT0A Amplitude; FT0C Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + // FDD + registry.add("exclusive/FDD/FDDACCorr", "#FDD amp correlation; FDDA Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // ZDC + registry.add("exclusive/ZDC/ZNAamp", "ZNA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("exclusive/ZDC/ZNCamp", "ZNC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("exclusive/ZDC/ZNACCorr", "ZDC amp correlation; ZNA Amplitude; ZNC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/ZDC/ZPAamp", "ZPA Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("exclusive/ZDC/ZPCamp", "ZPC Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("exclusive/ZDC/ZPACCorr", "ZDC amp correlation; ZPA Amplitude; ZPC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + registry.add("exclusive/ZDC/ZEM1amp", "ZEM1 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("exclusive/ZDC/ZEM2amp", "ZEM2 Amplitude", {HistType::kTH1F, {{2000, 0., 2000.}}}); + registry.add("exclusive/ZDC/ZEM12Corr", "ZDC amp correlation; ZEM1 Amplitude; ZEM2 Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + + // Correlation plots + registry.add("exclusive/FV0T0ACorr", "Correlation FV0 vs FT0 A side; FT0A Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FV0T0CCorr", "Correlation FV0 vs FT0 C side; FT0C Amplitude; FV0A Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FT0DDACorr", "Correlation FT0 vs FDD A side; FT0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FT0DDCCorr", "Correlation FT0 vs FDD C side; FT0C Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FT0AFDDC", "Correlation FT0 vs FDD AC side; FT0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FT0CFDDA", "Correlation FT0 vs FDD CA side; FT0C Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FV0AFDDA", "Correlation FV0 vs FDD A side; FV0A Amplitude; FDDA Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + registry.add("exclusive/FV0AFDDC", "Correlation FV0 vs FDD C side; FV0A Amplitude; FDDC Amplitude", {HistType::kTH2F, {{2000, -4.5, 1995.5}, {2000, -4.5, 1995.5}}}); + } + } + + //............................................................................................................... + void processMain(CC const& collision, BCs const& bct0s, TCs const& tracks, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, aod::Zdcs& zdcs, aod::V0s const& v0s) + { + uint64_t bcnum = 0; + LOGF(debug, "(HIST("All/Stat"))->Fill(0.); + + if (collision.has_foundBC()) { + auto collbc = collision.foundBC_as(); + bcnum = collbc.globalBC() % o2::constants::lhc::LHCMaxBunches; + } + + registry.get(HIST("All/AllRelBC"))->Fill(bcnum, 1.); + if (!collision.has_foundBC()) + return; + + registry.get(HIST("All/Stat"))->Fill(1.); + + if (collision.has_foundFT0()) { + + auto ft0 = collision.foundFT0(); + // side A + for (size_t ind = 0; ind < ft0.channelA().size(); ind++) { + registry.get(HIST("All/FT0/FT0A"))->Fill((ft0.channelA())[ind], (ft0.amplitudeA())[ind]); + } + + // side C + for (size_t ind = 0; ind < ft0.channelC().size(); ind++) { + registry.get(HIST("All/FT0/FT0C"))->Fill((ft0.channelC())[ind], (ft0.amplitudeC())[ind]); + } + + for (auto ampa : ft0.amplitudeA()) { + totAmplitudeA += ampa; + } + + for (auto ampc : ft0.amplitudeC()) { + totAmplitudeC += ampc; + } + + registry.get(HIST("All/Stat"))->Fill(2.); + registry.get(HIST("All/FT0/hT0AC"))->Fill(ft0.timeA(), ft0.timeC()); + + } else { + if (!collision.has_foundFT0()) { + totAmplitudeA = 0; + totAmplitudeC = 0; + } + } // ends FT0 + + // FV0 information + if (collision.has_foundFV0()) { + auto fv0 = collision.foundFV0(); + registry.get(HIST("All/Stat"))->Fill(3.); + registry.get(HIST("All/FV0/hV0A"))->Fill(fv0.time()); + + for (size_t ind = 0; ind < fv0.channel().size(); ind++) { + registry.get(HIST("All/FV0/FV0A"))->Fill((fv0.channel())[ind], (fv0.amplitude())[ind]); + } + + for (auto ampfv0a : fv0.amplitude()) { + totalAmplitudefv0 += ampfv0a; + } + + } else { + if (!collision.has_foundFV0()) { + totalAmplitudefv0 = 0; + } + } + + // FDD information + if (collision.has_foundFDD()) { + auto fdd = collision.foundFDD(); + registry.get(HIST("All/Stat"))->Fill(4.); + registry.get(HIST("All/FDD/hFDDAC"))->Fill(fdd.timeA(), fdd.timeC()); + + // side A + for (auto ind = 0; ind < 8; ind++) { + registry.get(HIST("All/FDD/FDDA"))->Fill(ind, (fdd.chargeA())[ind]); + } + + // side C + for (auto ind = 0; ind < 8; ind++) { + registry.get(HIST("All/FDD/FDDC"))->Fill(ind, (fdd.chargeC())[ind]); + } + + for (auto ampfdd : fdd.chargeA()) { + totAmpFddA += ampfdd; + } + + for (auto ampfddc : fdd.chargeC()) { + totAmpFddC += ampfddc; + } + } else { + if (!collision.has_foundFDD()) { + totAmpFddA = 0; + totAmpFddC = 0; + } + } // fdd + + // ZDC information + if (collision.has_foundZDC()) { + auto zdc = collision.foundZDC(); + registry.get(HIST("All/ZDC/hZNAC"))->Fill(zdc.timeZNA(), zdc.timeZNC()); + registry.get(HIST("All/ZDC/hZPAC"))->Fill(zdc.timeZPA(), zdc.timeZPC()); + registry.get(HIST("All/ZDC/hZEM12"))->Fill(zdc.timeZEM1(), zdc.timeZEM2()); + + totAmpZNA = zdc.amplitudeZNA(); + totAmpZNC = zdc.amplitudeZNC(); + totAmpZPA = zdc.amplitudeZPA(); + totAmpZPC = zdc.amplitudeZPC(); + totAmpZEM1 = zdc.amplitudeZEM1(); + totAmpZEM2 = zdc.amplitudeZEM2(); + } + + auto FITA = totalAmplitudefv0 > 0. || totAmplitudeA > 0. || totAmpFddA > 0.; + auto FITC = totAmplitudeC > 0. || totAmpFddC > 0.; + auto ZDCA = (totAmpZNA > 0. || totAmpZPA > 0. || totAmpZEM1 > 0. || totAmpZEM2 > 0.); + auto ZDCC = (totAmpZNC > 0. || totAmpZPC > 0.); + + registry.get(HIST("All/RelativeBC"))->Fill(bcnum, 1.); + registry.get(HIST("All/FITAamp"))->Fill(FITA); + registry.get(HIST("All/FITCamp"))->Fill(FITC); + registry.get(HIST("All/FITACCorr"))->Fill(FITA, FITC); + + registry.get(HIST("All/ZDC/ZNAamp"))->Fill(totAmpZNA); + registry.get(HIST("All/ZDC/ZNCamp"))->Fill(totAmpZNC); + registry.get(HIST("All/ZDC/ZNACCorr"))->Fill(totAmpZNA, totAmpZNC); + registry.get(HIST("All/ZDC/ZDCACorr"))->Fill(ZDCA, ZDCC); + + registry.get(HIST("All/ZDC/ZPAamp"))->Fill(totAmpZPA); + registry.get(HIST("All/ZDC/ZPCamp"))->Fill(totAmpZPC); + registry.get(HIST("All/ZDC/ZPACCorr"))->Fill(totAmpZPA, totAmpZPC); + + registry.get(HIST("All/ZDC/ZEM1amp"))->Fill(totAmpZEM1); + registry.get(HIST("All/ZDC/ZEM2amp"))->Fill(totAmpZEM2); + registry.get(HIST("All/ZDC/ZEM12Corr"))->Fill(totAmpZEM1, totAmpZEM2); + + registry.get(HIST("All/FV0/FV0Amp"))->Fill(totalAmplitudefv0); + registry.get(HIST("All/FT0/FT0Aamp"))->Fill(totAmplitudeA); + registry.get(HIST("All/FT0/FT0Camp"))->Fill(totAmplitudeC); + registry.get(HIST("All/FT0/FT0ACCorr"))->Fill(totAmplitudeA, totAmplitudeC); + registry.get(HIST("All/FDD/FDDAamp"))->Fill(totAmpFddA); + registry.get(HIST("All/FDD/FDDCamp"))->Fill(totAmpFddC); + registry.get(HIST("All/FDD/FDDACCorr"))->Fill(totAmpFddA, totAmpFddC); + + // Correlation FV0 vs FT0 + registry.get(HIST("All/FV0T0ACorr"))->Fill(totAmplitudeA, totalAmplitudefv0); + registry.get(HIST("All/FV0T0CCorr"))->Fill(totAmplitudeC, totalAmplitudefv0); + + // Correlation FDD vs FT0 + registry.get(HIST("All/FT0DDACorr"))->Fill(totAmplitudeA, totAmpFddA); + registry.get(HIST("All/FT0DDCCorr"))->Fill(totAmplitudeC, totAmpFddC); + registry.get(HIST("All/FT0CFDDA"))->Fill(totAmplitudeC, totAmpFddA); + registry.get(HIST("All/FT0AFDDC"))->Fill(totAmplitudeA, totAmpFddC); + + // Correlation FDD vs FV0 + registry.get(HIST("All/FV0AFDDA"))->Fill(totalAmplitudefv0, totAmpFddA); + registry.get(HIST("All/FV0AFDDC"))->Fill(totalAmplitudefv0, totAmpFddC); + // } + + // PV contributors + int nPVcont = 0; + int nCount = 0; + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.isPVContributor()) { + nPVcont++; + registry.get(HIST("All/trketa"))->Fill(trk.eta()); + registry.get(HIST("All/trkpt"))->Fill(trk.pt()); + } + nCount++; + registry.get(HIST("All/etapt"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("All/dEdxTPC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + + if (trk.hasTOF()) { + registry.get(HIST("All/dEdxTOF"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } // track loop + + registry.get(HIST("All/trkmultiplicity"))->Fill(nCount); // all tracks + registry.get(HIST("All/PVTracks"))->Fill(nPVcont); // PVtracks + + if (collision.has_foundFT0() || collision.has_foundFDD() || collision.has_foundFV0() || collision.has_foundZDC()) { + registry.get(HIST("All/PVCFIT"))->Fill(nPVcont); + } + } + + PROCESS_SWITCH(FITtest, processMain, "Process Main", true); + //............................................................................................................... + void processHadronic(CC const& collision, BCs const& bct0s, TCs const& tracks, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, aod::Zdcs& zdcs, aod::V0s const& v0s) + { + LOGF(debug, "(HIST("collHadronic/Stat"))->Fill(0.); + + if (collision.has_foundBC()) { + auto collbc = collision.foundBC_as(); + bcnum = collbc.globalBC() % o2::constants::lhc::LHCMaxBunches; + } + + if (!collision.has_foundBC()) + return; + registry.get(HIST("collHadronic/Stat"))->Fill(1.); + + if (collision.numContrib() < 10) + return; + registry.get(HIST("collHadronic/Stat"))->Fill(2.); + + // FIT signal + if (collision.has_foundFT0()) { + registry.get(HIST("collHadronic/Stat"))->Fill(3.); + auto ft0 = collision.foundFT0(); + + for (auto ampa : ft0.amplitudeA()) { + totAmplitudeA += ampa; + } + + for (auto ampc : ft0.amplitudeC()) { + totAmplitudeC += ampc; + } + registry.get(HIST("collHadronic/FT0/hT0AC"))->Fill(ft0.timeA(), ft0.timeC()); + + } else { + if (!collision.has_foundFT0()) { + totAmplitudeA = totAmplitudeC = -999; + } + } // ends FT0 collsion + + // FV0 information + if (collision.has_foundFV0()) { + registry.get(HIST("collHadronic/Stat"))->Fill(4.); + + auto fv0 = collision.foundFV0(); + registry.get(HIST("collHadronic/FV0/hV0A"))->Fill(fv0.time()); + + for (auto ampfv0a : fv0.amplitude()) { + totalAmplitudefv0 += ampfv0a; + } + + } else { + if (!collision.has_foundFV0()) { + totalAmplitudefv0 = -999; + } + } // FV0 collisions + + // FDD information + if (collision.has_foundFDD()) { + auto fdd = collision.foundFDD(); + registry.get(HIST("collHadronic/Stat"))->Fill(5.); + registry.get(HIST("collHadronic/FDD/hFDDAC"))->Fill(fdd.timeA(), fdd.timeC()); + + for (auto ampfdd : fdd.chargeA()) { + totAmpFddA += ampfdd; + } + + for (auto ampfddc : fdd.chargeC()) { + totAmpFddC += ampfddc; + } + } else { + if (!collision.has_foundFDD()) { + totAmpFddA = totAmpFddC = -999; + } + } // fdd + + // ZDC information + if (collision.has_foundZDC()) { + auto zdc = collision.foundZDC(); + totAmpZNA = zdc.amplitudeZNA(); + totAmpZNC = zdc.amplitudeZNC(); + totAmpZPA = zdc.amplitudeZPA(); + totAmpZPC = zdc.amplitudeZPC(); + totAmpZEM1 = zdc.amplitudeZEM1(); + totAmpZEM2 = zdc.amplitudeZEM2(); + } + + auto FITA = totalAmplitudefv0 > 0. || totAmplitudeA > 0. || totAmpFddA > 0.; + auto FITC = totAmplitudeC > 0. || totAmpFddC > 0.; + auto ZDCA = (totAmpZNA > 0. || totAmpZPA > 0. || totAmpZEM1 > 0. || totAmpZEM2 > 0.); + auto ZDCC = (totAmpZNC > 0. || totAmpZPC > 0.); + + if (!ZDCA || !ZDCC) + return; // investigate events with ZDC signal on both sides + + registry.get(HIST("collHadronic/Stat"))->Fill(6.); + registry.get(HIST("collHadronic/RelBC"))->Fill(bcnum, 1.); + + registry.get(HIST("collHadronic/FV0/FV0Amp"))->Fill(totalAmplitudefv0); + registry.get(HIST("collHadronic/FT0/FT0Aamp"))->Fill(totAmplitudeA); + registry.get(HIST("collHadronic/FT0/FT0Camp"))->Fill(totAmplitudeC); + registry.get(HIST("collHadronic/FT0/FT0ACCorr"))->Fill(totAmplitudeA, totAmplitudeC); + registry.get(HIST("collHadronic/FDD/FDDAamp"))->Fill(totAmpFddA); + registry.get(HIST("collHadronic/FDD/FDDCamp"))->Fill(totAmpFddC); + registry.get(HIST("collHadronic/FDD/FDDACCorr"))->Fill(totAmpFddA, totAmpFddC); + + // Correlation FV0 vs FT0 + registry.get(HIST("collHadronic/FV0T0ACorr"))->Fill(totAmplitudeA, totalAmplitudefv0); + registry.get(HIST("collHadronic/FV0T0CCorr"))->Fill(totAmplitudeC, totalAmplitudefv0); + + // Correlation FDD vs FT0 + registry.get(HIST("collHadronic/FT0DDACorr"))->Fill(totAmplitudeA, totAmpFddA); + registry.get(HIST("collHadronic/FT0DDCCorr"))->Fill(totAmplitudeC, totAmpFddC); + registry.get(HIST("collHadronic/FT0CFDDA"))->Fill(totAmplitudeC, totAmpFddA); + registry.get(HIST("collHadronic/FT0AFDDC"))->Fill(totAmplitudeA, totAmpFddC); + + // Correlation FDD vs FV0 + registry.get(HIST("collHadronic/FV0AFDDA"))->Fill(totalAmplitudefv0, totAmpFddA); + registry.get(HIST("collHadronic/FV0AFDDC"))->Fill(totalAmplitudefv0, totAmpFddC); + + // PV contributors + int nPVcont = 0; + int nCont = 0; + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() > 1) { + if (trk.isPVContributor()) { + nPVcont++; + registry.get(HIST("collHadronic/trketa"))->Fill(trk.eta()); + registry.get(HIST("collHadronic/trkpt"))->Fill(trk.pt()); + } + nCont++; + registry.get(HIST("collHadronic/etapt"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("collHadronic/dEdxTPC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("collHadronic/dEdxTOF"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } // tracks + + registry.get(HIST("collHadronic/PVTrk"))->Fill(nPVcont); + registry.get(HIST("collHadronic/trkmult"))->Fill(nCont); + + if (!FITA || !FITC) + return; // investigate events with FIT signal on both sides + + registry.get(HIST("collHadronic/ZDC/ZNAamp"))->Fill(totAmpZNA); + registry.get(HIST("collHadronic/ZDC/ZNCamp"))->Fill(totAmpZNC); + registry.get(HIST("collHadronic/ZDC/ZNACCorr"))->Fill(totAmpZNA, totAmpZNC); + + registry.get(HIST("collHadronic/ZDC/ZPAamp"))->Fill(totAmpZPA); + registry.get(HIST("collHadronic/ZDC/ZPCamp"))->Fill(totAmpZPC); + registry.get(HIST("collHadronic/ZDC/ZPACCorr"))->Fill(totAmpZPA, totAmpZPC); + + registry.get(HIST("collHadronic/ZDC/ZEM1amp"))->Fill(totAmpZEM1); + registry.get(HIST("collHadronic/ZDC/ZEM2amp"))->Fill(totAmpZEM2); + registry.get(HIST("collHadronic/ZDC/ZEM12Corr"))->Fill(totAmpZEM1, totAmpZEM2); + + // PV contributors + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() > 1) { + if (trk.isPVContributor()) { + registry.get(HIST("collHadronic/trketaZDC"))->Fill(trk.eta()); + registry.get(HIST("collHadronic/trkptZDC"))->Fill(trk.pt()); + } + registry.get(HIST("collHadronic/etaptZDC"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("collHadronic/dEdxTPCZDC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("collHadronic/dEdxTOFZDC"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } // tracks + + registry.get(HIST("collHadronic/PVTrkZDC"))->Fill(nPVcont); + registry.get(HIST("collHadronic/trkmultZDC"))->Fill(nCont); + } + + PROCESS_SWITCH(FITtest, processHadronic, "Process for hadroniclike events", true); + //............................................................................................................... + void processInclusiveA(CC const& collision, BCs const& bct0s, TCs const& tracks, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, aod::Zdcs& zdcs, aod::V0s const& v0s) + { + uint64_t bcnum = 0; + float totAmplitudeA = 0; + float totAmplitudeC = 0; + float totalAmplitudefv0 = 0; + float totAmpFddA = 0; + float totAmpFddC = 0; + auto totAmpZNA = 0; + auto totAmpZNC = 0; + auto totAmpZPA = 0; + auto totAmpZPC = 0; + auto totAmpZEM1 = 0; + auto totAmpZEM2 = 0; + + LOGF(debug, "(HIST("colInclusiveA/Stat"))->Fill(0.); + + if (collision.has_foundBC()) { + auto collbc = collision.foundBC_as(); + bcnum = collbc.globalBC() % o2::constants::lhc::LHCMaxBunches; + } + + if (!collision.has_foundBC()) + return; + registry.get(HIST("colInclusiveA/Stat"))->Fill(1.); + + if (collision.numContrib() > 50) + return; + registry.get(HIST("colInclusiveA/Stat"))->Fill(2.); + + // FT0 information + if (collision.has_foundFT0()) { + registry.get(HIST("colInclusiveA/Stat"))->Fill(3.); + auto ft0 = collision.foundFT0(); + + for (auto ampa : ft0.amplitudeA()) { + totAmplitudeA += ampa; + } + + for (auto ampc : ft0.amplitudeC()) { + totAmplitudeC += ampc; + } + registry.get(HIST("colInclusiveA/FT0/hT0AC"))->Fill(ft0.timeA(), ft0.timeC()); + + } else { + if (!collision.has_foundFT0()) { + totAmplitudeA = 0; + totAmplitudeC = 0; + } + } // ends collsion + + // FV0 information + if (collision.has_foundFV0()) { + registry.get(HIST("colInclusiveA/Stat"))->Fill(4.); + + auto fv0 = collision.foundFV0(); + + for (auto ampfv0a : fv0.amplitude()) { + totalAmplitudefv0 += ampfv0a; + } + + } else { + if (!collision.has_foundFV0()) { + totalAmplitudefv0 = 0; + } + } + + // FDD information + if (collision.has_foundFDD()) { + auto fdd = collision.foundFDD(); + registry.get(HIST("colInclusiveA/Stat"))->Fill(5.); + registry.get(HIST("colInclusiveA/FDD/hFDDAC"))->Fill(fdd.timeA(), fdd.timeC()); + + for (auto ampfdd : fdd.chargeA()) { + totAmpFddA += ampfdd; + } + + for (auto ampfddc : fdd.chargeC()) { + totAmpFddC += ampfddc; + } + } else { + if (!collision.has_foundFDD()) { + totAmpFddA = 0; + totAmpFddC = 0; + } + } // fdd + + // ZDC + if (collision.has_foundZDC()) { + auto zdc = collision.foundZDC(); + totAmpZNA = zdc.amplitudeZNA(); + totAmpZNC = zdc.amplitudeZNC(); + totAmpZPA = zdc.amplitudeZPA(); + totAmpZPC = zdc.amplitudeZPC(); + totAmpZEM1 = zdc.amplitudeZEM1(); + totAmpZEM2 = zdc.amplitudeZEM2(); + } + + auto FITA = (totalAmplitudefv0 > 0. || totAmplitudeA > 0. || totAmpFddA > 0.); + auto FITC = (totAmplitudeC > 0. || totAmpFddC > 0.); + auto ZDCA = (totAmpZNA > 0. || totAmpZPA > 0. || totAmpZEM1 > 0. || totAmpZEM2 > 0.); + auto ZDCC = (totAmpZNC > 0. || totAmpZPC > 0.); + + if (!ZDCA || ZDCC) + return; + registry.get(HIST("colInclusiveA/RelativeBC"))->Fill(bcnum, 1.); + registry.get(HIST("colInclusiveA/Stat"))->Fill(6.); + + registry.get(HIST("colInclusiveA/FV0/FV0Amp"))->Fill(totalAmplitudefv0); + registry.get(HIST("colInclusiveA/FT0/FT0Aamp"))->Fill(totAmplitudeA); + registry.get(HIST("colInclusiveA/FT0/FT0Camp"))->Fill(totAmplitudeC); + registry.get(HIST("colInclusiveA/FT0/FT0ACCorr"))->Fill(totAmplitudeA, totAmplitudeC); + registry.get(HIST("colInclusiveA/FDD/FDDACCorr"))->Fill(totAmpFddA, totAmpFddC); + registry.get(HIST("colInclusiveA/FDD/FDDAamp"))->Fill(totAmpFddA); + registry.get(HIST("colInclusiveA/FDD/FDDCamp"))->Fill(totAmpFddC); + + // Correlation FV0 vs FT0 + registry.get(HIST("colInclusiveA/FV0T0ACorr"))->Fill(totAmplitudeA, totalAmplitudefv0); + registry.get(HIST("colInclusiveA/FV0T0CCorr"))->Fill(totAmplitudeC, totalAmplitudefv0); + + // Correlation FDD vs FT0 + registry.get(HIST("colInclusiveA/FT0DDACorr"))->Fill(totAmplitudeA, totAmpFddA); + registry.get(HIST("colInclusiveA/FT0DDCCorr"))->Fill(totAmplitudeC, totAmpFddC); + registry.get(HIST("colInclusiveA/FT0CFDDA"))->Fill(totAmplitudeC, totAmpFddA); + registry.get(HIST("colInclusiveA/FT0AFDDC"))->Fill(totAmplitudeA, totAmpFddC); + + // Correlation FDD vs FV0 + registry.get(HIST("colInclusiveA/FV0AFDDA"))->Fill(totalAmplitudefv0, totAmpFddA); + registry.get(HIST("colInclusiveA/FV0AFDDC"))->Fill(totalAmplitudefv0, totAmpFddC); + + // PV contributors + int nPVcont = 0; + int ntrks = 0; + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() < 10) { + if (trk.isPVContributor()) { + nPVcont++; + registry.get(HIST("colInclusiveA/trketa"))->Fill(trk.eta()); + registry.get(HIST("colInclusiveA/trkpt"))->Fill(trk.pt()); + } + + ntrks++; + registry.get(HIST("colInclusiveA/etapt"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("colInclusiveA/dEdxTPC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("colInclusiveA/dEdxTOF"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } // trk loop + registry.get(HIST("colInclusiveA/PVTracks"))->Fill(nPVcont); + registry.get(HIST("colInclusiveA/trkmultiplicity"))->Fill(ntrks); + + if (!FITA || FITC) + return; + registry.get(HIST("colInclusiveA/Stat"))->Fill(7.); + + registry.get(HIST("colInclusiveA/ZDC/ZNAamp"))->Fill(totAmpZNA); + registry.get(HIST("colInclusiveA/ZDC/ZNCamp"))->Fill(totAmpZNC); + registry.get(HIST("colInclusiveA/ZDC/ZNACCorr"))->Fill(totAmpZNA, totAmpZNC); + + registry.get(HIST("colInclusiveA/ZDC/ZPAamp"))->Fill(totAmpZPA); + registry.get(HIST("colInclusiveA/ZDC/ZPCamp"))->Fill(totAmpZPC); + registry.get(HIST("colInclusiveA/ZDC/ZPACCorr"))->Fill(totAmpZPA, totAmpZPC); + + registry.get(HIST("colInclusiveA/ZDC/ZEM1amp"))->Fill(totAmpZEM1); + registry.get(HIST("colInclusiveA/ZDC/ZEM2amp"))->Fill(totAmpZEM2); + registry.get(HIST("colInclusiveA/ZDC/ZEM12Corr"))->Fill(totAmpZEM1, totAmpZEM2); + + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() < 10) { + if (trk.isPVContributor()) { + registry.get(HIST("colInclusiveA/trketaZDC"))->Fill(trk.eta()); + registry.get(HIST("colInclusiveA/trkptZDC"))->Fill(trk.pt()); + } + registry.get(HIST("colInclusiveA/etaptZDC"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("colInclusiveA/dEdxTPCZDC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("colInclusiveA/dEdxTOFZDC"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } // trk loop + + registry.get(HIST("colInclusiveA/PVTracksZDC"))->Fill(nPVcont); + registry.get(HIST("colInclusiveA/trkmultZDC"))->Fill(ntrks); + } + + PROCESS_SWITCH(FITtest, processInclusiveA, "Process Inclusive veto A side", true); + //.................................................................................................................................. + void processInclusiveC(CC const& collision, BCs const& bct0s, TCs const& tracks, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, aod::Zdcs& zdcs, aod::V0s const& v0s) + { + uint64_t bcnum = 0; + float totAmplitudeA = 0; + float totAmplitudeC = 0; + float totalAmplitudefv0 = 0; + float totAmpFddA = 0; + float totAmpFddC = 0; + auto totAmpZNA = 0; + auto totAmpZNC = 0; + auto totAmpZPA = 0; + auto totAmpZPC = 0; + auto totAmpZEM1 = 0; + auto totAmpZEM2 = 0; + + LOGF(debug, "(HIST("colInclusiveC/Stat"))->Fill(0.); + + if (collision.has_foundBC()) { + auto collbc = collision.foundBC_as(); + bcnum = collbc.globalBC() % o2::constants::lhc::LHCMaxBunches; + } + + if (!collision.has_foundBC()) + return; + registry.get(HIST("colInclusiveC/Stat"))->Fill(1.); + + if (collision.numContrib() > 50) + return; + registry.get(HIST("colInclusiveC/Stat"))->Fill(2.); + + // FT0 information + if (collision.has_foundFT0()) { + registry.get(HIST("colInclusiveC/Stat"))->Fill(3.); + auto ft0 = collision.foundFT0(); + + for (auto ampa : ft0.amplitudeA()) { + totAmplitudeA += ampa; + } + + for (auto ampc : ft0.amplitudeC()) { + totAmplitudeC += ampc; + } + + } else { + if (!collision.has_foundFT0()) { + totAmplitudeA = 0; + totAmplitudeC = 0; + } + } // ends collsion + + // FV0 information + if (collision.has_foundFV0()) { + registry.get(HIST("colInclusiveC/Stat"))->Fill(4.); + + auto fv0 = collision.foundFV0(); + for (auto ampfv0a : fv0.amplitude()) { + totalAmplitudefv0 += ampfv0a; + } + + } else { + if (!collision.has_foundFV0()) { + totalAmplitudefv0 = 0; + } + } + + // FDD information + if (collision.has_foundFDD()) { + auto fdd = collision.foundFDD(); + registry.get(HIST("colInclusiveC/Stat"))->Fill(5.); + + for (auto ampfdd : fdd.chargeA()) { + totAmpFddA += ampfdd; + } + + for (auto ampfddc : fdd.chargeC()) { + totAmpFddC += ampfddc; + } + } else { + if (!collision.has_foundFDD()) { + totAmpFddA = 0; + totAmpFddC = 0; + } + } // fdd + + // ZDC + if (collision.has_foundZDC()) { + auto zdc = collision.foundZDC(); + totAmpZNA = zdc.amplitudeZNA(); + totAmpZNC = zdc.amplitudeZNC(); + totAmpZPA = zdc.amplitudeZPA(); + totAmpZPC = zdc.amplitudeZPC(); + totAmpZEM1 = zdc.amplitudeZEM1(); + totAmpZEM2 = zdc.amplitudeZEM2(); + } + + auto FITA = totalAmplitudefv0 > 0. || totAmplitudeA > 0. || totAmpFddA > 0.; + auto FITC = totAmplitudeC > 0. || totAmpFddC > 0.; + auto ZDCA = (totAmpZNA > 0. || totAmpZPA > 0. || totAmpZEM1 > 0. || totAmpZEM2 > 0.); + auto ZDCC = (totAmpZNC > 0. || totAmpZPC > 0.); + + if (ZDCA || !ZDCC) + return; + registry.get(HIST("colInclusiveC/Stat"))->Fill(6.); + registry.get(HIST("colInclusiveC/RelativeBC"))->Fill(bcnum, 1.); + + registry.get(HIST("colInclusiveC/FV0/FV0Amp"))->Fill(totalAmplitudefv0); + registry.get(HIST("colInclusiveC/FT0/FT0Aamp"))->Fill(totAmplitudeA); + registry.get(HIST("colInclusiveC/FT0/FT0Camp"))->Fill(totAmplitudeC); + registry.get(HIST("colInclusiveC/FT0/FT0ACCorr"))->Fill(totAmplitudeA, totAmplitudeC); + registry.get(HIST("colInclusiveC/FDD/FDDACCorr"))->Fill(totAmpFddA, totAmpFddC); + registry.get(HIST("colInclusiveC/FDD/FDDAamp"))->Fill(totAmpFddA); + registry.get(HIST("colInclusiveC/FDD/FDDCamp"))->Fill(totAmpFddC); + + // Correlation FV0 vs FT0 + registry.get(HIST("colInclusiveC/FV0T0ACorr"))->Fill(totAmplitudeA, totalAmplitudefv0); + registry.get(HIST("colInclusiveC/FV0T0CCorr"))->Fill(totAmplitudeC, totalAmplitudefv0); + + // Correlation FDD vs FT0 + registry.get(HIST("colInclusiveC/FT0DDACorr"))->Fill(totAmplitudeA, totAmpFddA); + registry.get(HIST("colInclusiveC/FT0DDCCorr"))->Fill(totAmplitudeC, totAmpFddC); + registry.get(HIST("colInclusiveC/FT0CFDDA"))->Fill(totAmplitudeC, totAmpFddA); + registry.get(HIST("colInclusiveC/FT0AFDDC"))->Fill(totAmplitudeA, totAmpFddC); + + // Correlation FDD vs FV0 + registry.get(HIST("colInclusiveC/FV0AFDDA"))->Fill(totalAmplitudefv0, totAmpFddA); + registry.get(HIST("colInclusiveC/FV0AFDDC"))->Fill(totalAmplitudefv0, totAmpFddC); + + // PV contributors + int nPVcont = 0; + int ntrks = 0; + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() < 10) { + if (trk.isPVContributor()) { + nPVcont++; + registry.get(HIST("colInclusiveC/trketa"))->Fill(trk.eta()); + registry.get(HIST("colInclusiveC/trkpt"))->Fill(trk.pt()); + } + ntrks++; + registry.get(HIST("colInclusiveC/etapt"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("colInclusiveC/dEdxTPC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("colInclusiveC/dEdxTOF"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } + registry.get(HIST("colInclusiveC/PVTracks"))->Fill(nPVcont); + registry.get(HIST("colInclusiveC/trkmultiplicity"))->Fill(ntrks); + + if (FITA || !FITC) + return; + registry.get(HIST("colInclusiveC/Stat"))->Fill(7.); + + registry.get(HIST("colInclusiveC/ZDC/ZNAamp"))->Fill(totAmpZNA); + registry.get(HIST("colInclusiveC/ZDC/ZNCamp"))->Fill(totAmpZNC); + registry.get(HIST("colInclusiveC/ZDC/ZNACCorr"))->Fill(totAmpZNA, totAmpZNC); + + registry.get(HIST("colInclusiveC/ZDC/ZPAamp"))->Fill(totAmpZPA); + registry.get(HIST("colInclusiveC/ZDC/ZPCamp"))->Fill(totAmpZPC); + registry.get(HIST("colInclusiveC/ZDC/ZPACCorr"))->Fill(totAmpZPA, totAmpZPC); + + registry.get(HIST("colInclusiveC/ZDC/ZEM1amp"))->Fill(totAmpZEM1); + registry.get(HIST("colInclusiveC/ZDC/ZEM2amp"))->Fill(totAmpZEM2); + registry.get(HIST("colInclusiveC/ZDC/ZEM12Corr"))->Fill(totAmpZEM1, totAmpZEM2); + + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() < 10) { + if (trk.isPVContributor()) { + registry.get(HIST("colInclusiveC/trketaZDC"))->Fill(trk.eta()); + registry.get(HIST("colInclusiveC/trkptZDC"))->Fill(trk.pt()); + } + registry.get(HIST("colInclusiveC/etaptZDC"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("colInclusiveC/dEdxTPCZDC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("colInclusiveC/dEdxTOFZDC"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } // trk loop + + registry.get(HIST("colInclusiveC/PVTracksZDC"))->Fill(nPVcont); + registry.get(HIST("colInclusiveC/trkmultZDC"))->Fill(ntrks); + } + + PROCESS_SWITCH(FITtest, processInclusiveC, "Process Inclusive veto C side", true); + //.................................................................................................................................. + void processExclusive(CC const& collision, BCs const& bct0s, TCs const& tracks, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, aod::Zdcs& zdcs, aod::V0s const& v0s) + { + float totAmplitudeA = 0; + float totAmplitudeC = 0; + float totalAmplitudefv0 = 0; + float totAmpFddA = 0; + float totAmpFddC = 0; + auto totAmpZNA = 0; + auto totAmpZNC = 0; + auto totAmpZPA = 0; + auto totAmpZPC = 0; + auto totAmpZEM1 = 0; + auto totAmpZEM2 = 0; + + uint64_t bcnum = 0; + // auto bc = collision.foundBC_as(); + registry.get(HIST("exclusive/Stat"))->Fill(0.); + if (collision.has_foundBC()) { + auto collbc = collision.foundBC_as(); + bcnum = collbc.globalBC() % o2::constants::lhc::LHCMaxBunches; + } + + if (!collision.has_foundBC()) + return; + if (collision.numContrib() > 10) + return; + + registry.get(HIST("exclusive/Stat"))->Fill(1.); + registry.get(HIST("exclusive/trkmultiplicity"))->Fill(tracks.size(), 1.); + + if (collision.has_foundFT0()) { + + registry.get(HIST("exclusive/Stat"))->Fill(2.); + auto ft0 = collision.foundFT0(); + + for (auto ampa : ft0.amplitudeA()) { + totAmplitudeA += ampa; + } + + for (auto ampc : ft0.amplitudeC()) { + totAmplitudeC += ampc; + } + + } else { + if (!collision.has_foundFT0()) { + totAmplitudeA = 0; + totAmplitudeC = 0; + } + } // ends collsion + + // FV0 information + if (collision.has_foundFV0()) { + registry.get(HIST("exclusive/Stat"))->Fill(3.); + + auto fv0 = collision.foundFV0(); + for (auto ampfv0a : fv0.amplitude()) { + totalAmplitudefv0 += ampfv0a; + } + + } else { + if (!collision.has_foundFV0()) { + totalAmplitudefv0 = 0; + } + } + + // FDD information + if (collision.has_foundFDD()) { + auto fdd = collision.foundFDD(); + registry.get(HIST("exclusive/Stat"))->Fill(4.); + + for (auto ampfdd : fdd.chargeA()) { + totAmpFddA += ampfdd; + } + + for (auto ampfddc : fdd.chargeC()) { + totAmpFddC += ampfddc; + } + } else { + if (!collision.has_foundFDD()) { + totAmpFddA = 0; + totAmpFddC = 0; + } + } // fdd + + // ZDC + if (collision.has_foundZDC()) { + auto zdc = collision.foundZDC(); + totAmpZNA = zdc.amplitudeZNA(); + totAmpZNC = zdc.amplitudeZNC(); + totAmpZPA = zdc.amplitudeZPA(); + totAmpZPC = zdc.amplitudeZPC(); + totAmpZEM1 = zdc.amplitudeZEM1(); + totAmpZEM2 = zdc.amplitudeZEM2(); + } + + auto FITA = totalAmplitudefv0 > 0. || totAmplitudeA > 0. || totAmpFddA > 0.; + auto FITC = totAmplitudeC > 0. || totAmpFddC > 0.; + auto ZDCA = (totAmpZNA > 0. || totAmpZPA > 0. || totAmpZEM1 > 0. || totAmpZEM2 > 0.); + auto ZDCC = (totAmpZNC > 0. || totAmpZPC > 0.); + + if (ZDCA || ZDCC) + return; + + registry.get(HIST("exclusive/FT0/FT0Aamp"))->Fill(totAmplitudeA); + registry.get(HIST("exclusive/FT0/FT0Camp"))->Fill(totAmplitudeC); + registry.get(HIST("exclusive/FT0/FT0ACCorr"))->Fill(totAmplitudeA, totAmplitudeC); + + registry.get(HIST("exclusive/FV0/FV0Amp"))->Fill(totalAmplitudefv0); + registry.get(HIST("exclusive/FDD/FDDACCorr"))->Fill(totAmpFddA, totAmpFddC); + + registry.get(HIST("exclusive/FV0T0ACorr"))->Fill(totAmplitudeA, totalAmplitudefv0); + registry.get(HIST("exclusive/FV0T0CCorr"))->Fill(totAmplitudeC, totalAmplitudefv0); + + registry.get(HIST("exclusive/FT0DDACorr"))->Fill(totAmplitudeA, totAmpFddA); + registry.get(HIST("exclusive/FT0DDCCorr"))->Fill(totAmplitudeC, totAmpFddC); + registry.get(HIST("exclusive/FT0CFDDA"))->Fill(totAmplitudeC, totAmpFddA); + registry.get(HIST("exclusive/FT0AFDDC"))->Fill(totAmplitudeA, totAmpFddC); + registry.get(HIST("exclusive/FV0AFDDA"))->Fill(totalAmplitudefv0, totAmpFddA); + registry.get(HIST("exclusive/FV0AFDDC"))->Fill(totalAmplitudefv0, totAmpFddC); + + // PV contributors + int nPVcont = 0; + int ntrks = 0; + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() < 10) { + if (trk.isPVContributor()) { + nPVcont++; + registry.get(HIST("exclusive/trketa"))->Fill(trk.eta()); + registry.get(HIST("exclusive/trkpt"))->Fill(trk.pt()); + } + ntrks++; + registry.get(HIST("exclusive/etapt"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("exclusive/dEdxTPC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("exclusive/dEdxTOF"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } + + registry.get(HIST("exclusive/PVTracks"))->Fill(nPVcont); + + if (FITA || FITC) + return; + registry.get(HIST("exclusive/ZDC/ZNAamp"))->Fill(totAmpZNA); + registry.get(HIST("exclusive/ZDC/ZNCamp"))->Fill(totAmpZNC); + registry.get(HIST("exclusive/ZDC/ZNACCorr"))->Fill(totAmpZNA, totAmpZNC); + + registry.get(HIST("exclusive/ZDC/ZPAamp"))->Fill(totAmpZPA); + registry.get(HIST("exclusive/ZDC/ZPCamp"))->Fill(totAmpZPC); + registry.get(HIST("exclusive/ZDC/ZPACCorr"))->Fill(totAmpZPA, totAmpZPC); + + registry.get(HIST("exclusive/ZDC/ZEM1amp"))->Fill(totAmpZEM1); + registry.get(HIST("exclusive/ZDC/ZEM2amp"))->Fill(totAmpZEM2); + registry.get(HIST("exclusive/ZDC/ZEM12Corr"))->Fill(totAmpZEM1, totAmpZEM2); + + // PV contributors + for (auto const& trk : tracks) { + if (trk.eta() > -1.5 && trk.eta() < 1.5) { + if (trk.pt() < 10) { + if (trk.isPVContributor()) { + registry.get(HIST("exclusive/trketaZDC"))->Fill(trk.eta()); + registry.get(HIST("exclusive/trkptZDC"))->Fill(trk.pt()); + } + registry.get(HIST("exclusive/etaptZDC"))->Fill(trk.eta(), trk.pt(), 1.); + registry.get(HIST("exclusive/dEdxTPCZDC"))->Fill(trk.tpcInnerParam() / trk.sign(), trk.tpcSignal()); + if (trk.hasTOF()) { + registry.get(HIST("exclusive/dEdxTOFZDC"))->Fill(trk.p() / trk.sign(), trk.beta()); + } + } + } + } // trk loop + + registry.get(HIST("exclusive/PVTracksZDC"))->Fill(nPVcont); + registry.get(HIST("exclusive/RelativeBC"))->Fill(bcnum, 1.); + registry.get(HIST("exclusive/trkmultZDC"))->Fill(ntrks); + } + + PROCESS_SWITCH(FITtest, processExclusive, "Process exclusiveUPC veto A and C sides", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"fittest"}), + }; +} diff --git a/PWGUD/AQC/udQCmidRap.cxx b/PWGUD/AQC/udQCmidRap.cxx new file mode 100644 index 00000000000..8a075e95323 --- /dev/null +++ b/PWGUD/AQC/udQCmidRap.cxx @@ -0,0 +1,454 @@ +// 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. +/// +/// \brief A task for Asynchronus Quality Control for Ultra-perimpheral and Diffraction (AQC-UD) two pion candidates in midrapidity +/// \author +/// \since + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "ReconstructionDataFormats/BCRange.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Common/DataModel/FT0Corrected.h" +#include "PWGUD/Core/UDHelpers.h" +#include "Framework/StaticFor.h" +#include "TLorentzVector.h" +#include "TMath.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct UDQCmid { + + SliceCache cache; + Preslice perBCzdc = aod::zdc::bcId; + Preslice perBCcalo = aod::calo::bcId; + + // global variables + float maxdEdxTPC; + float maxdEdxTOF; + + // get a DGCutparHolder + DGCutparHolder diffCuts = DGCutparHolder(); + Configurable DGCuts{"DGCuts", {}, "DG event cuts"}; + Configurable withAmbTrackAnalysis{"ambiguousTracks", false, "with ambiguous tracks analysis"}; + Configurable withAmbFwdTrackAnalysis{"ambiguousFwdTracks", false, "with ambiguous forward tracks analysis"}; + Configurable doCleanFITBC{"doCleanFITBC", false, "Require cleanFIT in compatible BCs"}; + + // structures to hold information about the possible BCs the ambiguous tracks/FwdTracks belong to + o2::dataformats::bcRanges abcrs = o2::dataformats::bcRanges("ambiguous_tracks"); + o2::dataformats::bcRanges afbcrs = o2::dataformats::bcRanges("ambiguous_fwdtracks"); + + // inivinitialize HistogramRegistry + HistogramRegistry registry{ + "registry", + {}}; + + // define abbreviations + using CCs = soa::Join; + using CC = CCs::iterator; + using BCs = soa::Join; + using TCs = soa::Join; + using FWs = aod::FwdTracks; + using ATs = aod::AmbiguousTracks; + using AFTs = aod::AmbiguousFwdTracks; + + void init(InitContext& context) + { + // initialize global variables + maxdEdxTPC = 0.; + maxdEdxTOF = 0.; + diffCuts = (DGCutparHolder)DGCuts; + + // add histograms for the different process functions + if (context.mOptions.get("processMain")) { + // collisions + registry.add("collisions/Stat", "Cut statistics; Selection criterion; Collisions", {HistType::kTH1F, {{20, -0.5, 19.5}}}); + registry.add("collisions/Tracks", "Number of tracks; Number of tracks; Collisions", {HistType::kTH1F, {{300, 0.5, 300.5}}}); + registry.add("collisions/vtxTracks", "Number of vertex tracks; Number of contributors; Collisions", {HistType::kTH1F, {{300, 0.5, 300.5}}}); + registry.add("collisions/globalTracks", "Number of global tracks; Number of global tracks; Collisions", {HistType::kTH1F, {{300, 0.5, 300.5}}}); + registry.add("collisions/tResvsrTOFTracks", "Number of PV tracks with TOF hit versus collision time resolution; Collision time resolution [ns]; Fraction of PV tracks with TOF hit; Collisions", {HistType::kTH2F, {{1000, 0., 1.E3}, {101, -0.01, 1.01}}}); + registry.add("collisions/tResvsTOFTrkNoPV", "Number of No PV tracks with TOF hit versus collision time resolution; Collision time resolution [ns]; Fraction of No PV tracks with TOF hit; Collisions", {HistType::kTH2F, {{1000, 0., 1.E3}, {101, -0.01, 1.01}}}); + + // tracks + registry.add("tracks/dEdxTPC", "TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("tracks/dEdxTOF", "TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + // DG + registry.add("DG/etapt", "DG: eta versus pT of all tracks; eta of track; p_T of track [GeV/c^2]; Tracks", {HistType::kTH2F, {{80, -2., 2.}, {100, 0., 5.}}}); + registry.add("DG/dEdxTPC", "DG: TPC signal versus signed track momentum; Signed track momentum [GeV/c]; TPC signal; Tracks", {HistType::kTH2F, {{120, -6., 6.}, {1000, 0., 1000.}}}); + registry.add("DG/dEdxTOF", "DG: TOF signal versus signed track momentum; Signed track momentum [GeV/c]; TOF signal; Tracks", {HistType::kTH2F, {{1000, 0., 10.}, {1000, 0., 10.}}}); + + registry.add("DG/hMassAll", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + registry.add("DG/hMassFIT", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + + registry.add("DG/hMassZDC", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + registry.add("DG/hMassTOF", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + registry.add("DG/hMassFWD", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + registry.add("DG/hMassGlobalTrk", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + registry.add("DG/hMassAmbigous", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + registry.add("DG/hMassAmbigousFWD", "DG: Invariant mass of pions; Invarian mass [GeV/c^2]", {HistType::kTH1F, {{2000, 0., 20.}}}); + + registry.add("DG/etaphi", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi1", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi2", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi3", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi4", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi5", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi6", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + registry.add("DG/etaphi7", "DG: Eta versus Phi; eta ; #phi ", {HistType::kTH2F, {{80, -2., 2.}, {120, 0., 6.28}}}); + + registry.add("DG/IVMptSys2PVtrk", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + registry.add("DG/IVMptSys2PVtrk1", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + registry.add("DG/IVMptSys2PVtrk2", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + registry.add("DG/IVMptSys2PVtrk3", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + + registry.add("DG/IVMptSys2PVtrk4", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + registry.add("DG/IVMptSys2PVtrk5", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + registry.add("DG/IVMptSys2PVtrk6", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + registry.add("DG/IVMptSys2PVtrk7", "DG: Invariant mass versus p_{T, system}; Invarian mass [GeV/c^2]; p_{T, system} [GeV/c]; DG collisions 2 PV tracks", {HistType::kTH2F, {{2000, 0., 20.}, {2000, 0., 20.0}}}); + } + + if (context.mOptions.get("processFewProng")) { + registry.add("fpStat", "#fpStat", {HistType::kTH1F, {{2, 0.5, 2.5}}}); + registry.add("allPVC", "#allPVC", {HistType::kTH1F, {{200, 0.5, 200.5}}}); + registry.add("fpPVC", "#fpPVC", {HistType::kTH1F, {{200, 0.5, 200.5}}}); + } + } + + // ............................................................................................................................................... + void processMain(CC const& collision, BCs const& bct0s, + TCs const& tracks, FWs const& fwdtracks, ATs const& ambtracks, AFTs const& ambfwdtracks, + aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, + aod::Zdcs& zdcs) + { + LOGF(debug, " Start %i", abcrs.size()); + + bool isDGcandidate = true; + registry.get(HIST("collisions/Stat"))->Fill(0., isDGcandidate * 1.); + + // update collision histograms + // tracks + registry.get(HIST("collisions/Tracks"))->Fill(tracks.size()); + // vertex tracks normally gives PV contributors from collisions + registry.get(HIST("collisions/vtxTracks"))->Fill(collision.numContrib()); + // global tracks + Partition goodTracks = requireGlobalTrackInFilter(); + goodTracks.bindTable(tracks); + registry.get(HIST("collisions/globalTracks"))->Fill(goodTracks.size()); + + // 12. net charge and invariant mass + bool goodetas = true; + bool goodpts = true; + bool ispipiCand = true; + auto netCharge = 0; + auto lvtmp = TLorentzVector(); + auto ivm = TLorentzVector(); + if (isDGcandidate) { + + // which particle hypothesis? // Pion hypothesis has been used currently + auto mass2Use = constants::physics::MassPionCharged; + if (diffCuts.pidHypothesis() == 321) { + mass2Use = constants::physics::MassKaonCharged; + } + + // check also pt and eta of tracks + for (auto const& track : tracks) { + + // define Lorentz vector to create invariant mass + lvtmp.SetPtEtaPhiM(track.pt(), track.eta(), track.phi(), mass2Use); + LOGF(debug, "mass %f track pt %f/%f eta %f/%f", mass2Use, track.pt(), lvtmp.Perp(), track.eta(), lvtmp.Eta()); + if (track.pt() <= diffCuts.minPt() || track.pt() >= diffCuts.maxPt()) { + goodpts = false; + } + if (track.eta() <= diffCuts.minEta() || track.eta() >= diffCuts.maxEta()) { + goodetas = false; + } + netCharge += track.sign(); + ivm += lvtmp; + } + + if (collision.numContrib() == 2) { + for (auto const& track : tracks) { + if (track.isPVContributor()) { + if (std::abs(track.tpcNSigmaPi()) > diffCuts.maxNSigmaTPC()) { + ispipiCand = false; + } + } + } // trks + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi"))->Fill(ivm.Eta(), ivm.Phi()); + registry.get(HIST("DG/hMassAll"))->Fill(ivm.M()); + } + } // coll + } // dgcand + + // loop over all tracks + float rgtrwTOF = 0.; + float norgtrwTOF = 0.; + for (auto const& track : tracks) { + // update PV track stats + if (track.isPVContributor()) { + // update dEdx histograms + registry.get(HIST("tracks/dEdxTPC"))->Fill(track.tpcInnerParam() / track.sign(), track.tpcSignal()); + + if (track.tpcSignal() > maxdEdxTPC) { + maxdEdxTPC = track.tpcSignal(); + // LOGF(debug, " New maxdEdx TPC %f", maxdEdxTPC); + } + + // TOF hit? + if (track.hasTOF()) { + registry.get(HIST("tracks/dEdxTOF"))->Fill(track.p() / track.sign(), track.beta()); + if (track.tofSignal() > maxdEdxTOF) { + maxdEdxTOF = track.tofSignal(); + // LOGF(debug, " New maxdEdx TOF %f", maxdEdxTOF); + } + + // No vertex track with TOF hit? + if (!track.isPVContributor()) { + norgtrwTOF += 1.; + } + + // vertex track with TOF hit? + if (track.isPVContributor()) { + rgtrwTOF += 1.; + } + } + } + } // closing track loop + + // fraction of No PV tracks with TOF hit + if (collision.numContrib() > 0) { + norgtrwTOF /= collision.numContrib(); + } + + // fraction of PV tracks with TOF hit + if (collision.numContrib() > 0) { + rgtrwTOF /= collision.numContrib(); + } + // LOGF(debug, " PV tracks with TOF: %f [1]", rgtrwTOF); + registry.get(HIST("collisions/tResvsrTOFTracks"))->Fill(collision.collisionTimeRes(), rgtrwTOF); + registry.get(HIST("collisions/tResvsTOFTrkNoPV"))->Fill(collision.collisionTimeRes(), norgtrwTOF); + + // is it a DG candidate? + // 1. DG = no FIT signal in compatible BCs + // 2. & no ZDC signal in compatible BCs + // 3. & number of forward tracks = 0 + // 4. Check for global tracks which are no vtx tracks + // 5. check a given bc for possible ambiguous Tracks + // 6. check a given bc for possible ambiguous FwdTracks + // 7. fraction of PV tracks with TOF hit + isDGcandidate = true; + + // get BCrange to test for FIT signals + auto bcSlice = udhelpers::compatibleBCs(collision, diffCuts.NDtcoll(), bct0s, diffCuts.minNBCs()); + + // 1. no FIT signal in bcSlice / collision + if (doCleanFITBC) { + for (auto const& bc : bcSlice) { + if (!udhelpers::cleanFIT(bc, diffCuts.maxFITtime(), diffCuts.FITAmpLimits())) { + isDGcandidate = false; + break; + } + } + } else { + if (!udhelpers::cleanFITCollision(collision, diffCuts.maxFITtime(), diffCuts.FITAmpLimits())) { + isDGcandidate = false; + } + } + registry.get(HIST("collisions/Stat"))->Fill(1., isDGcandidate * 1.); + + // Invariant mass with 2 PV contributors and all contributors + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk1"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi1"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassFIT"))->Fill(ivm.M()); + } + } + + for (auto const& track : tracks) { + if (track.isPVContributor()) { + registry.get(HIST("DG/etapt"))->Fill(track.eta(), track.pt(), 1.); + LOGF(debug, "dEdx TPC %f TOF %i %f", track.tpcSignal(), track.hasTOF(), track.hasTOF() ? track.tofSignal() : 0.); + registry.get(HIST("DG/dEdxTPC"))->Fill(track.tpcInnerParam() / track.sign(), track.tpcSignal()); + + if (track.hasTOF()) { + registry.get(HIST("DG/dEdxTOF"))->Fill(track.p() / track.sign(), track.beta()); + } // fill TOF + } // pb contributor + } + } + } // Inavariant mass after FIT + + // 2. no Zdc signal in bcSlice + std::vector lims(10, 0.); + for (auto const& bc : bcSlice) { + if (!udhelpers::cleanZDC(bc, zdcs, lims, cache)) { + isDGcandidate = false; + break; + } + } + registry.get(HIST("collisions/Stat"))->Fill(2., isDGcandidate * 1.); + + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk2"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi2"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassZDC"))->Fill(ivm.M()); + } + } + } + } // Invariant mass after ZDC + + // 3. number of forward tracks = 0 + isDGcandidate &= (fwdtracks.size() == 0); + registry.get(HIST("collisions/Stat"))->Fill(3., isDGcandidate * 1.); + + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk3"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi3"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassFWD"))->Fill(ivm.M()); + } + } + } + } + + // 4. Check for global tracks which are no vtx tracks + bool globalAndVtx = isDGcandidate; + bool vtxAndGlobal = isDGcandidate; + for (auto const& track : tracks) { + if (track.isGlobalTrack() && !track.isPVContributor()) { + globalAndVtx = false; + } + if (track.isPVContributor() && !track.isGlobalTrack()) { + vtxAndGlobal = false; + } + } + registry.get(HIST("collisions/Stat"))->Fill(4., globalAndVtx * 1.); + registry.get(HIST("collisions/Stat"))->Fill(5., vtxAndGlobal * 1.); + + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk4"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi4"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassGlobalTrk"))->Fill(ivm.M()); + } + } + } + } + + // 5. check a given bc for possible ambiguous Tracks + auto noAmbTracks = isDGcandidate; + for (auto const& bc : bcSlice) { + if (abcrs.isInRange(bc.globalIndex())) { + noAmbTracks = false; + break; + } + } + + registry.get(HIST("collisions/Stat"))->Fill(6., noAmbTracks * 1.); // noAmbTracks + + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk5"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi5"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassAmbigous"))->Fill(ivm.M()); + } + } + } + } + + // 6. check a given bc for possible ambiguous FwdTracks + auto noAmbFwdTracks = isDGcandidate; + for (auto const& bc : bcSlice) { + if (afbcrs.isInRange(bc.globalIndex())) { + noAmbFwdTracks = false; + break; + } + } + + registry.get(HIST("collisions/Stat"))->Fill(7., noAmbFwdTracks * 1.); // noAmbFwdTracks + + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk6"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi6"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassAmbigousFWD"))->Fill(ivm.M()); + } + } + } + } + + // 7. fraction of PV tracks with TOF hit + isDGcandidate &= (rgtrwTOF >= diffCuts.minRgtrwTOF()); + registry.get(HIST("collisions/Stat"))->Fill(8., isDGcandidate * 1.); + + if (isDGcandidate) { + if (collision.numContrib() == 2) { + if (ispipiCand) { + registry.get(HIST("DG/IVMptSys2PVtrk7"))->Fill(ivm.M(), ivm.Pt()); + registry.get(HIST("DG/etaphi7"))->Fill(ivm.Eta(), ivm.Phi()); + if (ivm.Pt() < 0.2) { + registry.get(HIST("DG/hMassTOF"))->Fill(ivm.M()); + } + } + } + } + } + PROCESS_SWITCH(UDQCmid, processMain, "Process Main", true); + + //..................................................................................................................... + // Distribution of number of PV contributors for all collisions and those with empty FT0 + void processFewProng(CC const& collision, BCs const& bct0s, + aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) + { + // count collisions + registry.get(HIST("fpStat"))->Fill(1., 1.); + registry.get(HIST("allPVC"))->Fill(collision.numContrib(), 1.); + + // check FT0 to be empty + auto bc = collision.foundBC_as(); + if (udhelpers::cleanFT0(bc, diffCuts.maxFITtime(), 0., 0.)) { + // only collisions with empty FT0 arrive here + registry.get(HIST("fpStat"))->Fill(2., 1.); + + // update #PV contributors in collisions with empty FT0 + registry.get(HIST("fpPVC"))->Fill(collision.numContrib(), 1.); + } + } + PROCESS_SWITCH(UDQCmid, processFewProng, "Process FewProng", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc, TaskName{"udQCmidRap"}), + }; +} From e6381d9adda0aeed19b1e8117c0d290d1e2cfacd Mon Sep 17 00:00:00 2001 From: Jeremy Wilkinson Date: Mon, 12 Feb 2024 11:09:52 +0100 Subject: [PATCH 21/26] Add configurable axes for THnSparses in TPC PID QC (#4669) * fix axes for sparse * titles on THnSparse axes * title definitions for TOF sparse * obligatory whitespace --- DPG/Tasks/AOTTrack/PID/qaPIDTPC.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/DPG/Tasks/AOTTrack/PID/qaPIDTPC.cxx b/DPG/Tasks/AOTTrack/PID/qaPIDTPC.cxx index 4f805808110..8f3dcce3e8d 100644 --- a/DPG/Tasks/AOTTrack/PID/qaPIDTPC.cxx +++ b/DPG/Tasks/AOTTrack/PID/qaPIDTPC.cxx @@ -90,19 +90,23 @@ struct tpcPidQa { Configurable minP{"minP", 0.01, "Minimum momentum in range"}; Configurable maxP{"maxP", 20, "Maximum momentum in range"}; ConfigurableAxis etaBins{"etaBins", {100, -1.f, 1.f}, "Binning in eta"}; - ConfigurableAxis phiBins{"phiBins", {100, 0, TMath::TwoPi()}, "Binning in eta"}; + ConfigurableAxis phiBins{"phiBins", {100, 0, TMath::TwoPi()}, "Binning in phi"}; ConfigurableAxis trackLengthBins{"trackLengthBins", {100, 0, 1000.f}, "Binning in track length plot"}; ConfigurableAxis deltaBins{"deltaBins", {200, -1000.f, 1000.f}, "Binning in Delta (dEdx - expected dEdx)"}; ConfigurableAxis expSigmaBins{"expSigmaBins", {200, 0.f, 200.f}, "Binning in expected Sigma"}; ConfigurableAxis nSigmaBins{"nSigmaBins", {401, -10.025f, 10.025f}, "Binning in NSigma"}; ConfigurableAxis dEdxBins{"dEdxBins", {5000, 0.f, 5000.f}, "Binning in dE/dx"}; + // Axes for optional THnSparse + ConfigurableAxis binsPForSparse{"binsPForSparse", {200, 0.f, 20.f}, "Binning in momentum for optional THnSparse"}; + ConfigurableAxis binsEtaForSparse{"binsEtaForSparse", {50, -1.f, 1.f}, "Binning in eta for optional THnSparse"}; + ConfigurableAxis binsnSigmaForSparse{"binsnSigmaForSparse", {101, -7.575, 7.575}, "Binning in nsigma for optional THnSparse"}; Configurable applyEvSel{"applyEvSel", 2, "Flag to apply event selection cut: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection"}; Configurable trackSelection{"trackSelection", 1, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; Configurable applyRapidityCut{"applyRapidityCut", false, "Flag to apply rapidity cut"}; Configurable splitSignalPerCharge{"splitSignalPerCharge", true, "Split the signal per charge (reduces memory footprint if off)"}; Configurable enableDeDxPlot{"enableDeDxPlot", true, "Enables the dEdx plot (reduces memory footprint if off)"}; Configurable minTPCNcls{"minTPCNcls", 0, "Minimum number or TPC Clusters for tracks"}; - ConfigurableAxis tpcNclsBins{"tpcNclsBins", {16, 0, 160}, "Bining in number of cluster in TPC"}; + ConfigurableAxis tpcNclsBins{"tpcNclsBins", {16, 0, 160}, "Binning in number of clusters in TPC"}; Configurable fillTHnSparses{"fillTHnSparses", false, "Flag to fill multidimensional histograms for nsigma vs pt, eta, Ncls"}; template @@ -185,8 +189,10 @@ struct tpcPidQa { const AxisSpec etaAxis{etaBins, "#it{#eta}"}; const AxisSpec tpcnclsAxis{tpcNclsBins, "TPC #cls"}; - - HistogramConfigSpec particleSparseHists{HistType::kTHnSparseF, {pAxis, etaAxis, nSigmaAxis, tpcnclsAxis}}; + const AxisSpec sparseMomentumAxis{binsPForSparse, "#it{p} (GeV/#it{c})"}; + const AxisSpec sparseEtaAxis{binsEtaForSparse, "#eta"}; + const AxisSpec sparseNSigmaAxis{binsnSigmaForSparse, "#n_{#sigma}^{TPC}"}; + HistogramConfigSpec particleSparseHists{HistType::kTHnSparseF, {sparseMomentumAxis, sparseEtaAxis, sparseNSigmaAxis, tpcnclsAxis}}; if (fillTHnSparses) { histos.add(hnsigma_p_eta_Ncl[id].data(), axisTitle, particleSparseHists); } @@ -202,7 +208,7 @@ struct tpcPidQa { histos.add(hexpsigma_wTOF[id].data(), "With TOF", kTH2F, {pAxis, expSigmaAxis}); histos.add(hnsigma_wTOF[id].data(), Form("With TOF %s", axisTitle), kTH2F, {pAxis, nSigmaAxis}); - HistogramConfigSpec particleSparseHists_wTOF{HistType::kTHnSparseF, {pAxis, etaAxis, nSigmaAxis, tpcnclsAxis}}; + HistogramConfigSpec particleSparseHists_wTOF{HistType::kTHnSparseF, {sparseMomentumAxis, sparseEtaAxis, sparseNSigmaAxis, tpcnclsAxis}}; if (fillTHnSparses) { histos.add(hnsigma_p_eta_Ncl_wTOF[id].data(), Form("With TOF %s", axisTitle), particleSparseHists_wTOF); } From ff8da3f16d8b70a5b8defc615690f3379bd1c093 Mon Sep 17 00:00:00 2001 From: Federica Zanone <94552525+ZFederica@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:55:35 +0100 Subject: [PATCH 22/26] PWGHF: save info isGlobalTrakWoDca for pion (#4672) * Add info globalTrakWoDca * Remove new variable from candidateCreator * Update PWGHF/TableProducer/treeCreatorToXiPi.cxx Co-authored-by: Fabio Catalano * Update PWGHF/TableProducer/treeCreatorToXiPi.cxx Co-authored-by: Fabio Catalano * Update PWGHF/TableProducer/treeCreatorToXiPi.cxx Co-authored-by: Fabio Catalano * Update PWGHF/TableProducer/treeCreatorToXiPi.cxx Co-authored-by: Fabio Catalano --------- Co-authored-by: Fabio Catalano --- PWGHF/TableProducer/treeCreatorToXiPi.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/treeCreatorToXiPi.cxx b/PWGHF/TableProducer/treeCreatorToXiPi.cxx index 709ab76196f..90914eda143 100644 --- a/PWGHF/TableProducer/treeCreatorToXiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorToXiPi.cxx @@ -111,6 +111,7 @@ DECLARE_SOA_COLUMN(ErrorDecayLengthXYCharmBaryon, errorDecayLengthXYCharmBaryon, DECLARE_SOA_COLUMN(NormImpParCascade, normImpParCascade, double); DECLARE_SOA_COLUMN(NormImpParPiFromCharmBar, normImpParPiFromCharmBar, double); DECLARE_SOA_COLUMN(NormDecayLenCharmBar, normDecayLenCharmBar, double); +DECLARE_SOA_COLUMN(IsPionGlbTrkWoDca, isPionGlbTrkWoDca, bool); // from creator - MC DECLARE_SOA_COLUMN(FlagMcMatchRec, flagMcMatchRec, int8_t); // reconstruction level DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level @@ -162,7 +163,7 @@ DECLARE_SOA_TABLE(HfToXiPiFulls, "AOD", "HFTOXIPIFULL", full::DcaZToPvV0Dau0, full::DcaZToPvV0Dau1, full::DcaZToPvCascDau, full::DcaCascDau, full::DcaV0Dau, full::DcaCharmBaryonDau, full::DecLenCharmBaryon, full::DecLenCascade, full::DecLenV0, full::ErrorDecayLengthCharmBaryon, full::ErrorDecayLengthXYCharmBaryon, - full::NormImpParCascade, full::NormImpParPiFromCharmBar, full::NormDecayLenCharmBar, + full::NormImpParCascade, full::NormImpParPiFromCharmBar, full::NormDecayLenCharmBar, full::IsPionGlbTrkWoDca, full::StatusPidLambda, full::StatusPidCascade, full::StatusPidCharmBaryon, full::StatusInvMassLambda, full::StatusInvMassCascade, full::StatusInvMassCharmBaryon, full::ResultSelections, full::PidTpcInfoStored, full::PidTofInfoStored, full::TpcNSigmaPiFromCharmBaryon, full::TpcNSigmaPiFromCasc, full::TpcNSigmaPiFromLambda, full::TpcNSigmaPrFromLambda, @@ -266,6 +267,7 @@ struct HfTreeCreatorToXiPi { candidate.impactParCascXY() / candidate.errImpactParCascXY(), candidate.impactParPiFromCharmBaryonXY() / candidate.errImpactParPiFromCharmBaryonXY(), candidate.decLenCharmBaryon() / candidate.errorDecayLengthCharmBaryon(), + candidate.template piFromCharmBaryon_as().isGlobalTrackWoDCA(), candidate.statusPidLambda(), candidate.statusPidCascade(), candidate.statusPidCharmBaryon(), @@ -288,7 +290,7 @@ struct HfTreeCreatorToXiPi { originMc); } - void processData(aod::Collisions const& collisions, + void processData(aod::Collisions const& collisions, aod::TrackSelection const&, soa::Join const& candidates) { // Filling candidate properties From c8f6b8505fcda37a90970b356f43f9c900fe38f2 Mon Sep 17 00:00:00 2001 From: Francesco Mazzaschi <43742195+fmazzasc@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:18:10 +0100 Subject: [PATCH 23/26] Fix bc() access (#4674) --- PWGLF/Tasks/Strangeness/kinkAnalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/kinkAnalysis.cxx b/PWGLF/Tasks/Strangeness/kinkAnalysis.cxx index 5e4433d6bd0..72ff251694b 100644 --- a/PWGLF/Tasks/Strangeness/kinkAnalysis.cxx +++ b/PWGLF/Tasks/Strangeness/kinkAnalysis.cxx @@ -415,11 +415,11 @@ struct kinkAnalysis { } else { for (const auto& ambTrack : ambiTracks) { if (ambTrack.trackId() == track.globalIndex()) { - if (!ambTrack.has_bc() || ambTrack.bc().size() == 0) { + if (!ambTrack.has_bc() || ambTrack.bc_as().size() == 0) { globalBCvector.push_back(-1); break; } - globalBCvector.push_back(ambTrack.bc().begin().globalBC()); + globalBCvector.push_back(ambTrack.bc_as().begin().globalBC()); break; } } From 4e741fa6e5571f2077143e1e8df5021b21b6a6d8 Mon Sep 17 00:00:00 2001 From: arossi81 Date: Mon, 12 Feb 2024 13:36:54 +0100 Subject: [PATCH 24/26] Adding possibilty to study D0 reflections. (#4666) Co-authored-by: Andrea --- DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx | 100 +++++++++++++++++++--- 1 file changed, 89 insertions(+), 11 deletions(-) diff --git a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx index e5cd93a3357..adeffc41da9 100644 --- a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx +++ b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx @@ -42,6 +42,7 @@ enum TagChannels : uint8_t { DsOrDplusToKKPi, DstarPlusToDzeroPi, DstarMinusToDzeroBarPi, + DstarToDzeroToKK, NTagChannels }; @@ -123,6 +124,7 @@ struct TagTwoProngDisplacedVertices { SliceCache cache; Configurable applyTofPid{"applyTofPid", true, "flag to enable TOF PID selection"}; + Configurable studyDzeroReflections{"studyDzeroReflections", false, "flag to study Dzero reflections"}; Configurable trackNumSigmaTof{"trackNumSigmaTof", 3.f, "number of sigma for TOF PID compatibility"}; Configurable trackNumSigmaTpc{"trackNumSigmaTpc", 3.f, "number of sigma for TOF PID compatibility"}; Configurable trackDcaXyMin{"trackDcaXyMin", 0.002f, "minimum DCAxy for tracks with pT < 2 GeV/c"}; @@ -131,10 +133,12 @@ struct TagTwoProngDisplacedVertices { Configurable> binsPtPiPiFromDplus{"binsPtPiPiFromDplus", std::vector{aod::tagandprobe::vecBinsPt}, "pT bin limits for pipi pairs from D+ decays"}; Configurable> binsKaKaFromDsOrDplus{"binsKaKaFromDsOrDplus", std::vector{aod::tagandprobe::vecBinsPt}, "pT bin limits for KK pairs from Ds or D+ decays"}; Configurable> binsPtDzeroFromDstar{"binsPtDzeroFromDstar", std::vector{aod::tagandprobe::vecBinsPt}, "pT bin limits for Kpi pairs from D0 <- D*+ decays"}; + Configurable> binsPtDzeroKaKaFromDstar{"binsPtDzeroKaKaFromDstar", std::vector{aod::tagandprobe::vecBinsPt}, "pT bin limits for KK pairs from D0 <- D*+ decays"}; Configurable> cutsPiPiFromDplus{"cutsPiPiFromDplus", {aod::tagandprobe::cuts[0], aod::tagandprobe::nBinsPt, aod::tagandprobe::nCutVars, aod::tagandprobe::labelsPt, aod::tagandprobe::labelsCutVar}, "Selections for pipi pairs from D+ decays"}; Configurable> cutsKaKaFromDsOrDplus{"cutsKaKaFromDsOrDplus", {aod::tagandprobe::cuts[0], aod::tagandprobe::nBinsPt, aod::tagandprobe::nCutVars, aod::tagandprobe::labelsPt, aod::tagandprobe::labelsCutVar}, "Selections for KK pairs from Ds or D+ decays"}; Configurable> cutsDzeroFromDstar{"cutsDzeroFromDstar", {aod::tagandprobe::cutsDzero[0], aod::tagandprobe::nBinsPt, aod::tagandprobe::nCutVarsDzero, aod::tagandprobe::labelsPt, aod::tagandprobe::labelsCutVarDzero}, "Selections for Kpi pairs from D0 <- D*+ decays"}; + Configurable> cutsDzeroKaKaFromDstar{"cutsDzeroKaKaFromDstar", {aod::tagandprobe::cutsDzero[0], aod::tagandprobe::nBinsPt, aod::tagandprobe::nCutVarsDzero, aod::tagandprobe::labelsPt, aod::tagandprobe::labelsCutVarDzero}, "Selections for Kpi pairs from D0 <- D*+ decays"}; using TracksWithSelAndDca = soa::Join; using CollisionsWithEvSel = soa::Join; @@ -160,7 +164,8 @@ struct TagTwoProngDisplacedVertices { std::array, aod::tagandprobe::TagChannels::NTagChannels> masses = {std::array{constants::physics::MassPionCharged, constants::physics::MassPionCharged}, std::array{constants::physics::MassKaonCharged, constants::physics::MassKaonCharged}, std::array{constants::physics::MassPionCharged, constants::physics::MassKaonCharged}, - std::array{constants::physics::MassKaonCharged, constants::physics::MassPionCharged}}; + std::array{constants::physics::MassKaonCharged, constants::physics::MassPionCharged}, + std::array{constants::physics::MassKaonCharged, constants::physics::MassKaonCharged}}; std::array, aod::tagandprobe::TagChannels::NTagChannels> topologicalCuts{}; std::array, aod::tagandprobe::TagChannels::NTagChannels> ptBinsForTopologicalCuts{}; @@ -184,11 +189,12 @@ struct TagTwoProngDisplacedVertices { vertexer.setMinRelChi2Change(0.9f); vertexer.setUseAbsDCA(false); - topologicalCuts = {cutsPiPiFromDplus, cutsKaKaFromDsOrDplus, cutsDzeroFromDstar, cutsDzeroFromDstar}; - ptBinsForTopologicalCuts = {binsPtPiPiFromDplus, binsKaKaFromDsOrDplus, binsPtDzeroFromDstar, binsPtDzeroFromDstar}; + topologicalCuts = {cutsPiPiFromDplus, cutsKaKaFromDsOrDplus, cutsDzeroFromDstar, cutsDzeroFromDstar, cutsDzeroKaKaFromDstar}; + ptBinsForTopologicalCuts = {binsPtPiPiFromDplus, binsKaKaFromDsOrDplus, binsPtDzeroFromDstar, binsPtDzeroFromDstar, binsPtDzeroKaKaFromDstar}; const AxisSpec axisPt{250, 0.f, 50.f}; const AxisSpec axisMassPiPi{250, 0.f, 2.5f}; + const AxisSpec axisReflFlag{3, 0.5f, 3.5f}; const AxisSpec axisMassKaKa{200, constants::physics::MassPhi - 0.05f, constants::physics::MassPhi + 0.05f}; const AxisSpec axisMassKaPi{400, constants::physics::MassD0 - 0.2f, constants::physics::MassD0 + 0.2f}; @@ -199,7 +205,14 @@ struct TagTwoProngDisplacedVertices { registry.add("hMassKaKaVsPt", ";#it{p}_{T}(KK) (GeV/#it{c}); #it{M}(KK) (GeV/#it{c}^{2})", HistType::kTH2D, {axisPt, axisMassKaKa}); } if (doprocessKaPiFromDstar) { - registry.add("hMassKaPiVsPt", ";#it{p}_{T}(K#pi) (GeV/#it{c}); #it{M}(K#pi) (GeV/#it{c}^{2})", HistType::kTH2D, {axisPt, axisMassKaPi}); + if (!studyDzeroReflections) { + registry.add("hMassKaPiVsPt", ";#it{p}_{T}(K#pi) (GeV/#it{c}); #it{M}(K#pi) (GeV/#it{c}^{2})", HistType::kTH2D, {axisPt, axisMassKaPi}); + } else { + registry.add("hMassKaPiVsPt", ";#it{p}_{T}(K#pi) (GeV/#it{c}); #it{M}(K#pi) (GeV/#it{c}^{2}); #it{M}(#piK) (GeV/#it{c}^{2}); ReflFag", HistType::kTHnF, {axisPt, axisMassKaPi, axisMassKaPi, axisReflFlag}); + } + } + if (doprocessKaKaFromDzero) { + registry.add("hMassDzeroKaKaVsPt", ";#it{p}_{T}(K#pi) (GeV/#it{c}); #it{M}(K#pi) (GeV/#it{c}^{2})", HistType::kTH2D, {axisPt, axisMassKaPi}); } } @@ -270,6 +283,11 @@ struct TagTwoProngDisplacedVertices { return true; } } + case aod::tagandprobe::TagChannels::DstarToDzeroToKK: { + if (std::abs(track.tofNSigmaKa()) < trackNumSigmaTof) { + return true; + } + } } return false; } @@ -314,7 +332,7 @@ struct TagTwoProngDisplacedVertices { } // only for D0 meson - if (channel == aod::tagandprobe::TagChannels::DstarPlusToDzeroPi || channel == aod::tagandprobe::TagChannels::DstarMinusToDzeroBarPi) { + if (channel == aod::tagandprobe::TagChannels::DstarPlusToDzeroPi || channel == aod::tagandprobe::TagChannels::DstarMinusToDzeroBarPi || channel == aod::tagandprobe::TagChannels::DstarToDzeroToKK) { if (trackDcaXy[0] * trackDcaXy[1] > topologicalCuts[channel].get(ptBin, 6u)) { return false; } @@ -439,11 +457,47 @@ struct TagTwoProngDisplacedVertices { registry.fill(HIST("hMassKaKaVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2)); tagKaKaTable(trackPos.collisionId(), trackPos.globalIndex(), trackNeg.globalIndex()); } else if (channel == aod::tagandprobe::TagChannels::DstarPlusToDzeroPi) { - registry.fill(HIST("hMassKaPiVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2)); + if (!studyDzeroReflections) { + registry.fill(HIST("hMassKaPiVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2)); + } else { + float invMassrefl{0.f}; + int isDzero = 1; + if (std::abs(trackPos.tpcNSigmaKa()) < trackNumSigmaTpc && (std::abs(trackNeg.tpcNSigmaPi()) < trackNumSigmaTpc)) { + isDzero = 3; + if (applyTofPid) { + if (!isSelectedPidTof(trackNeg, aod::tagandprobe::TagChannels::DstarMinusToDzeroBarPi) || !isSelectedPidTof(trackPos, aod::tagandprobe::TagChannels::DstarMinusToDzeroBarPi)) + isDzero = 1; + } + } + if (isDzero == 3) { + auto arrMomentum = std::array{pVecTrackNeg, pVecTrackPos}; + invMassrefl = std::sqrt(RecoDecay::m2(arrMomentum, masses[channel])); + } + registry.fill(HIST("hMassKaPiVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2), invMassrefl, isDzero); + } tagPiKaTable(trackPos.collisionId(), trackPos.globalIndex(), trackNeg.globalIndex()); } else if (channel == aod::tagandprobe::TagChannels::DstarMinusToDzeroBarPi) { - registry.fill(HIST("hMassKaPiVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2)); + if (!studyDzeroReflections) { + registry.fill(HIST("hMassKaPiVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2)); + } else { + float invMassrefl{0.f}; + int isDzero = 2; + if (std::abs(trackNeg.tpcNSigmaKa()) < trackNumSigmaTpc && (std::abs(trackPos.tpcNSigmaPi()) < trackNumSigmaTpc)) { + isDzero = 3; + if (applyTofPid) { + if (!isSelectedPidTof(trackNeg, aod::tagandprobe::TagChannels::DstarPlusToDzeroPi) || !isSelectedPidTof(trackPos, aod::tagandprobe::TagChannels::DstarPlusToDzeroPi)) + isDzero = 2; + } + } + if (isDzero == 3) { + auto arrMomentum = std::array{pVecTrackNeg, pVecTrackPos}; + invMassrefl = std::sqrt(RecoDecay::m2(arrMomentum, masses[channel])); + } + registry.fill(HIST("hMassKaPiVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2), invMassrefl, isDzero); + } tagKaPiTable(trackPos.collisionId(), trackPos.globalIndex(), trackNeg.globalIndex()); + } else if (channel == aod::tagandprobe::TagChannels::DstarToDzeroToKK) { + registry.fill(HIST("hMassDzeroKaKaVsPt"), RecoDecay::pt(pVec), std::sqrt(invMass2)); } } } @@ -497,6 +551,29 @@ struct TagTwoProngDisplacedVertices { } PROCESS_SWITCH(TagTwoProngDisplacedVertices, processKaKaFromDsOrDplus, "Process KK combinatorial to tag kaon pairs from Ds+/D+ decays", false); + void processKaKaFromDzero(CollisionsFiltered::iterator const& collision, + TracksWithSelAndDcaFiltered const& tracks, + aod::BCsWithTimestamps const&) + { + auto bc = collision.bc_as(); + float bz{0}; + if (runNumber != bc.runNumber()) { + parameters::GRPMagField* grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", bc.timestamp()); + if (grpo != nullptr) { + base::Propagator::initFieldFromGRP(grpo); + bz = base::Propagator::Instance()->getNominalBz(); + } else { + LOGF(fatal, "GRP object is not available in CCDB for run=%d at timestamp=%llu", bc.runNumber(), bc.timestamp()); + } + runNumber = bc.runNumber(); + } + + auto groupPositive = positiveKaons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto groupNegative = negativeKaons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + computeCombinatorialOppositeCharge(collision, groupPositive, groupNegative, aod::tagandprobe::TagChannels::DstarToDzeroToKK, bz); + } + PROCESS_SWITCH(TagTwoProngDisplacedVertices, processKaKaFromDzero, "Process KK combinatorial to tag kaon pairs from Dzero decays", false); + void processKaPiFromDstar(CollisionsFiltered::iterator const& collision, TracksWithSelAndDcaFiltered const& tracks, aod::BCsWithTimestamps const&) @@ -538,7 +615,8 @@ struct ProbeThirdTrack { std::array, aod::tagandprobe::TagChannels::NTagChannels> masses = {std::array{constants::physics::MassPionCharged, constants::physics::MassPionCharged, constants::physics::MassKaonCharged}, std::array{constants::physics::MassKaonCharged, constants::physics::MassKaonCharged, constants::physics::MassPionCharged}, std::array{constants::physics::MassPionCharged, constants::physics::MassKaonCharged, constants::physics::MassPionCharged}, - std::array{constants::physics::MassKaonCharged, constants::physics::MassPionCharged, constants::physics::MassPionCharged}}; + std::array{constants::physics::MassKaonCharged, constants::physics::MassPionCharged, constants::physics::MassPionCharged}, + std::array{constants::physics::MassKaonCharged, constants::physics::MassKaonCharged, constants::physics::MassPionCharged}}; std::array trackSelector{}; // define the track selectors @@ -594,11 +672,11 @@ struct ProbeThirdTrack { const AxisSpec axisNumCrossRowTpc{51, 49.5f, 100.5f}; const AxisSpec axisTpcChi2PerClus{8, 2.f, 10.f}; const AxisSpec axisNumCluIts{5, 2.5f, 7.5f}; - std::array axisMass = {AxisSpec{225, 1.65f, 2.10f}, AxisSpec{225, 1.65f, 2.10f}, AxisSpec{350, 0.135f, 0.17f}, AxisSpec{350, 0.135f, 0.17f}}; - std::array axisMassTag = {AxisSpec{125, 0.f, 2.5f}, AxisSpec{100, constants::physics::MassPhi - 0.05f, constants::physics::MassPhi + 0.05f}, AxisSpec{200, constants::physics::MassD0 - 0.2f, constants::physics::MassD0 + 0.2f}, AxisSpec{200, constants::physics::MassD0 - 0.2f, constants::physics::MassD0 + 0.2f}}; + std::array axisMass = {AxisSpec{225, 1.65f, 2.10f}, AxisSpec{225, 1.65f, 2.10f}, AxisSpec{350, 0.135f, 0.17f}, AxisSpec{350, 0.135f, 0.17f}, AxisSpec{350, 0.135f, 0.17f}}; + std::array axisMassTag = {AxisSpec{125, 0.f, 2.5f}, AxisSpec{100, constants::physics::MassPhi - 0.05f, constants::physics::MassPhi + 0.05f}, AxisSpec{200, constants::physics::MassD0 - 0.2f, constants::physics::MassD0 + 0.2f}, AxisSpec{200, constants::physics::MassD0 - 0.2f, constants::physics::MassD0 + 0.2f}, AxisSpec{200, constants::physics::MassD0 - 0.2f, constants::physics::MassD0 + 0.2f}}; std::string trackTypes[aod::tagandprobe::TrackTypes::NTrackTypes] = {"ItsTpc", "ItsTpcNoIb", "Tpc", "Its"}; - std::string tagChannels[aod::tagandprobe::TagChannels::NTagChannels] = {"DplusToKPiPi", "DsOrDplusToKKPi", "DstarPlusToDzeroPi", "DstarMinusToDzeroBarPi"}; + std::string tagChannels[aod::tagandprobe::TagChannels::NTagChannels] = {"DplusToKPiPi", "DsOrDplusToKKPi", "DstarPlusToDzeroPi", "DstarMinusToDzeroBarPi", "DstarChargedToDzeroToKK"}; for (int iChannel{0}; iChannel < aod::tagandprobe::TagChannels::NTagChannels; ++iChannel) { for (int iTrackType{0}; iTrackType < aod::tagandprobe::TrackTypes::NTrackTypes; ++iTrackType) { From 0ad674501c1027b94ac2743ee3d82242f2d3e375 Mon Sep 17 00:00:00 2001 From: sawan <124118453+sawankumawat@users.noreply.github.com> Date: Mon, 12 Feb 2024 20:33:25 +0530 Subject: [PATCH 25/26] kshort kshort analysis (#4675) * added code for kshort kshort * changed the name from KshortKshort to kshortkshort since the name of the executabel cannot contain capital letters --- PWGLF/Tasks/Resonances/CMakeLists.txt | 5 + PWGLF/Tasks/Resonances/KshortKshort.cxx | 460 ++++++++++++++++++++++++ 2 files changed, 465 insertions(+) create mode 100644 PWGLF/Tasks/Resonances/KshortKshort.cxx diff --git a/PWGLF/Tasks/Resonances/CMakeLists.txt b/PWGLF/Tasks/Resonances/CMakeLists.txt index faae0fcac1e..3eee8ad364e 100644 --- a/PWGLF/Tasks/Resonances/CMakeLists.txt +++ b/PWGLF/Tasks/Resonances/CMakeLists.txt @@ -83,3 +83,8 @@ o2physics_add_dpl_workflow(lambda1520-pbpb SOURCES lambda1520_PbPb.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(kshortkshort + SOURCES KshortKshort.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Resonances/KshortKshort.cxx b/PWGLF/Tasks/Resonances/KshortKshort.cxx new file mode 100644 index 00000000000..a1f9fd45506 --- /dev/null +++ b/PWGLF/Tasks/Resonances/KshortKshort.cxx @@ -0,0 +1,460 @@ +// 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. +/// +/// \brief glueball resonance +/// \author Sawan (sawan.sawan@cern.ch) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/StepTHn.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" // +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponse.h" // +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" // +#include "Framework/runDataProcessing.h" // +#include "PWGLF/DataModel/LFStrangenessTables.h" // +// #include "CommonConstants/PhysicsConstants.h" +// #include "Framework/HistogramRegistry.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::soa; +// using namespace o2::constants::physics; +using std::array; + +struct strangeness_tutorial { + SliceCache cache; + + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hglue{"hglueball", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable cfgETAcut{"cfgETAcut", 0.8f, "Track ETA cut"}; + + // Configurable parameters for V0 selection + Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; + Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; + Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; + Configurable ConfV0PtMin{"ConfV0PtMin", 0.f, "Minimum transverse momentum of V0"}; + Configurable ConfV0DCADaughMax{"ConfV0DCADaughMax", 1.0f, "Maximum DCA between the V0 daughters"}; + Configurable ConfV0CPAMin{"ConfV0CPAMin", 0.97f, "Minimum CPA of V0"}; + Configurable ConfV0TranRadV0Min{"ConfV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; + Configurable ConfV0TranRadV0Max{"ConfV0TranRadV0Max", 200.f, "Maximum transverse radius"}; + Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 15, "Maximum V0 life time"}; + Configurable cMaxV0DCA{"cMaxV0DCA", 0.3, "DCA V0 to PV"}; + Configurable cSigmaMassKs0{"cSigmaMassKs0", 4, "n Sigma cut on KS0 mass"}; + Configurable cWidthKs0{"cWidthKs0", 0.005, "Width of KS0"}; + Configurable ConfDaughEta{"ConfDaughEta", 0.8f, "V0 Daugh sel: max eta"}; + Configurable ConfDaughTPCnclsMin{"ConfDaughTPCnclsMin", 70.f, "V0 Daugh sel: Min. nCls TPC"}; + Configurable ConfDaughDCAMin{"ConfDaughDCAMin", 0.06f, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; + Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 4, "PID selections for KS0 daughters"}; + + // Configurable parameters for PID selection + // Configurable NSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; + + // Configurable for track selection + Configurable cfgTrackDCAxy{"cfgTrackDCAxy", 2.0f, "Track DCAxy"}; + Configurable cfgTrackDCAz{"cfgTrackDCAz", 2.0f, "Track DCAz"}; + Configurable cfgPTcut{"cfgPTcut", 0.2f, "Track PT cut"}; + Configurable cfgnSigmaTPCcut{"cfgnSigmaTPCcut", 3.0f, "Track nSigma TPC cut"}; + Configurable cfgnSigmaTOFcut{"cfgnSigmaTOFcut", 3.0f, "Track nSigma TOF cut"}; + Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0f, "Track nSigma Combined cut"}; + Configurable cfgNmixedEvents{"cfgNmixedEvents", 5, "Number of mixed events"}; + Configurable cfgMultFT0{"cfgMultFT0", false, "Use FT0 multiplicity"}; + Configurable cfgMultFOTM{"cfgMultFOTM", false, "Use FOTM multiplicity"}; + Configurable cfgMultFT0C{"cfgMultFT0C", true, "Use FT0C multiplicity"}; + ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; + + void init(InitContext const&) + { + // Axes + AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec glueballMassAxis = {150, 0.9f, 2.4f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {100, -15.f, 15.f, "vrtx_{Z} [cm]"}; // for histogram + AxisSpec ptAxis = {150, 0.0f, 15.0f, "#it{p}_{T} (GeV/#it{c})"}; + // AxisSpec multiplicityAxis = {110, 0.0f, 150.0f, "Multiplicity Axis"}; + AxisSpec multiplicityAxis = {binsCent, "Multiplicity Axis"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + rEventSelection.add("hmultiplicity", "hmultiplicity", {HistType::kTH1F, {{150, 0.0f, 150.0f}}}); + + // Invariant Mass + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); + hglue.add("h1glueInvMassDS", "h1glueInvMassDS", kTH1F, {glueballMassAxis}); + hglue.add("h1glueInvMassME", "h1glueInvMassME", kTH1F, {glueballMassAxis}); + hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTH3F, {multiplicityAxis, ptAxis, glueballMassAxis}); + hglue.add("h3glueInvMassME", "h3glueInvMassME", kTH3F, {multiplicityAxis, ptAxis, glueballMassAxis}); + + // K0s topological/PID cuts + rKzeroShort.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); + rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); + rKzeroShort.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); + rKzeroShort.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{ptAxis}, {100, -5.f, 5.f}}}); + } + + template + bool SelectionV0(Collision const& collision, V0 const& candidate, + float multiplicity) + { + if (fabs(candidate.dcav0topv()) > cMaxV0DCA) { + return false; + } + + if (TMath::Abs(candidate.yK0Short()) > 0.5) { + return false; + } + + const float qtarm = candidate.qtarm(); + const float alph = candidate.alpha(); + float arm = qtarm / alph; + const float pT = candidate.pt(); + const float tranRad = candidate.v0radius(); + const float dcaDaughv0 = candidate.dcaV0daughters(); + const float cpav0 = candidate.v0cosPA(); + + float CtauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); // FIXME: Get from the common header + float lowmasscutks0 = 0.497 - cWidthKs0 * cSigmaMassKs0; + float highmasscutks0 = 0.497 + cWidthKs0 * cSigmaMassKs0; + // float decayLength = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(candidate.px(), candidate.py(), candidate.pz()); + + if (pT < ConfV0PtMin) { + return false; + } + if (dcaDaughv0 > ConfV0DCADaughMax) { + return false; + } + if (cpav0 < ConfV0CPAMin) { + return false; + } + if (tranRad < ConfV0TranRadV0Min) { + return false; + } + if (tranRad > ConfV0TranRadV0Max) { + return false; + } + if (fabs(CtauK0s) > cMaxV0LifeTime || + candidate.mK0Short() < lowmasscutks0 || + candidate.mK0Short() > highmasscutks0) { + return false; + } + if (arm < 0.2) { + return false; + } + + // if (QAv0) { + // histos.fill(HIST("hLT"), CtauK0s); + // histos.fill(HIST("hMassvsptvsmult"), candidate.mK0Short(), candidate.pt(), + // multiplicity); + // histos.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); + // histos.fill(HIST("hV0CosPA"), candidate.v0cosPA()); + // } + return true; + } + + template + bool isSelectedV0Daughter(T const& track, float charge, + double nsigmaV0Daughter) + { + const auto eta = track.eta(); + const auto tpcNClsF = track.tpcNClsFound(); + const auto dcaXY = track.dcaXY(); // for this we need TrackDCA table + const auto sign = track.sign(); + + if (!track.hasTPC()) + return false; + if (track.tpcNClsCrossedRows() < 70) + return false; + if (track.tpcCrossedRowsOverFindableCls() < 0.8) + return false; + + if (charge < 0 && sign > 0) { + return false; + } + if (charge > 0 && sign < 0) { + return false; + } + if (std::abs(eta) > ConfDaughEta) { + return false; + } + if (tpcNClsF < ConfDaughTPCnclsMin) { + return false; + } + if (std::abs(dcaXY) < ConfDaughDCAMin) { + return false; + } + // v0 PID selection + if (std::abs(nsigmaV0Daughter) > ConfDaughPIDCuts) { + return false; + } + + return true; + } + + template + bool PIDselection(T const& candidate) + { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (nsigmaCutCombined * nsigmaCutCombined)) { + return true; + } + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < cfgnSigmaTPCcut) { + return true; + } + return false; + } + + // Defining filters for events (event selection) + // Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); + Filter AcceptenceFilter = (nabs(aod::track::eta) < cfgETAcut && nabs(aod::track::pt) > cfgPTcut); + Filter DCAcutFilter = (nabs(aod::track::dcaXY) < cfgTrackDCAxy) && (nabs(aod::track::dcaZ) < cfgTrackDCAz); + + // Filters on V0s + // Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + // nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + // aod::v0data::dcaV0daughters < v0setting_dcav0dau); + + // Defining the type of the daughter tracks + using DaughterTracks = soa::Join; + using EventCandidates = soa::Filtered>; + using TrackCandidates = soa::Filtered>; + using V0TrackCandidate = aod::V0Datas; + + // void processSE(soa::Filtered>::iterator const& collision, + // soa::Filtered const& V0s, + // DaughterTracks const&) + + void processSE(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::V0Datas const& V0s) + { + const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + if (!collision.sel8()) { + return; + } + float multiplicity = 0.0f; + if (cfgMultFT0) + multiplicity = collision.multZeqFT0A() + collision.multZeqFT0C(); + else if (cfgMultFOTM) + multiplicity = collision.centFT0M(); + else if (cfgMultFT0C) + multiplicity = collision.centFT0C(); + + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); + rEventSelection.fill(HIST("hmultiplicity"), multiplicity); + + for (auto& [v1, v2] : combinations(CombinationsStrictlyUpperIndexPolicy(V0s, V0s))) { + if (v1.size() == 0 || v2.size() == 0) { + continue; + } + auto postrack1 = v1.template posTrack_as(); + auto negtrack1 = v1.template negTrack_as(); + auto postrack2 = v2.template posTrack_as(); + auto negtrack2 = v2.template negTrack_as(); + if (postrack1.globalIndex() == postrack2.globalIndex()) { + continue; + } + if (negtrack1.globalIndex() == negtrack2.globalIndex()) { + continue; + } + double nTPCSigmaPos1[1]{postrack1.tpcNSigmaPi()}; + double nTPCSigmaNeg1[1]{negtrack1.tpcNSigmaPi()}; + double nTPCSigmaPos2[1]{postrack2.tpcNSigmaPi()}; + double nTPCSigmaNeg2[1]{negtrack2.tpcNSigmaPi()}; + + if (!isSelectedV0Daughter(postrack1, 1, nTPCSigmaPos1[0])) { + continue; + } + if (!isSelectedV0Daughter(postrack2, 1, nTPCSigmaPos2[0])) { + continue; + } + if (!isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNeg1[0])) { + continue; + } + if (!isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNeg2[0])) { + continue; + } + + if (!SelectionV0(collision, v1, multiplicity)) { + continue; + } + if (!SelectionV0(collision, v2, multiplicity)) { + continue; + } + + // if (!PIDselection(postrack1)) { + // continue; + // } + // if (!PIDselection(postrack2)) { + // continue; + // } + // if (!PIDselection(negtrack1)) { + // continue; + // } + // if (!PIDselection(negtrack2)) { + // continue; + // } + + TLorentzVector lv1, lv2, lv3; + lv1.SetPtEtaPhiM(v1.pt(), v1.eta(), v1.phi(), massK0s); + lv2.SetPtEtaPhiM(v2.pt(), v2.eta(), v2.phi(), massK0s); + lv3 = lv1 + lv2; + + if (TMath::Abs(lv3.Rapidity() < 0.5)) { + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, lv3.Pt(), lv3.M()); + hglue.fill(HIST("h1glueInvMassDS"), lv3.M()); + rKzeroShort.fill(HIST("hMassK0ShortSelected"), v1.mK0Short()); + rKzeroShort.fill(HIST("hMassK0ShortSelected"), v2.mK0Short()); + rKzeroShort.fill(HIST("hDCAV0Daughters"), v1.dcaV0daughters()); + rKzeroShort.fill(HIST("hDCAV0Daughters"), v2.dcaV0daughters()); + rKzeroShort.fill(HIST("hV0CosPA"), v1.v0cosPA()); + rKzeroShort.fill(HIST("hV0CosPA"), v2.v0cosPA()); + } + + // Filling the PID of the V0 daughters in the region of the K0 peak. + // tpcInnerParam is the momentum at the inner wall of TPC. So momentum of tpc vs nsigma of tpc is plotted. + if ((0.45 < v1.mK0Short() || 0.45 < v2.mK0Short()) && (v1.mK0Short() < 0.55 || v2.mK0Short() < 0.55)) { + rKzeroShort.fill(HIST("hNSigmaPosPionFromK0s"), postrack1.tpcInnerParam(), postrack1.tpcNSigmaPi()); + rKzeroShort.fill(HIST("hNSigmaPosPionFromK0s"), postrack2.tpcInnerParam(), postrack2.tpcNSigmaPi()); + rKzeroShort.fill(HIST("hNSigmaNegPionFromK0s"), negtrack1.tpcInnerParam(), negtrack1.tpcNSigmaPi()); + rKzeroShort.fill(HIST("hNSigmaNegPionFromK0s"), negtrack2.tpcInnerParam(), negtrack2.tpcNSigmaPi()); + } + } + } + + PROCESS_SWITCH(strangeness_tutorial, processSE, "same event process", true); + + // use any one of 3 alias depending on the dataset. If pp then FT0M and if pbpb then FTOC + using BinningTypeTPCMultiplicity = ColumnBinningPolicy; + using BinningTypeCentralityM = ColumnBinningPolicy; + using BinningTypeVertexContributor = ColumnBinningPolicy; + ConfigurableAxis mevz = {"mevz", {10, -10., 10.}, "mixed event vertex z binning"}; + ConfigurableAxis memult = {"memult", {2, 0., 110.}, "mixed event multiplicity binning"}; + BinningTypeVertexContributor binningOnPositions1{{mevz, memult}, true}; + BinningTypeCentralityM binningOnPositions2{{mevz, memult}, true}; + + SameKindPair pair1{binningOnPositions1, cfgNmixedEvents, -1, &cache}; // for PbPb + SameKindPair pair2{binningOnPositions2, cfgNmixedEvents, -1, &cache}; // for pp + + void processME(EventCandidates const& collisions, TrackCandidates const& tracks, V0TrackCandidate const& v0s) + { + const double massK0s = TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(); + + for (auto& [c1, tracks1, c2, tracks2] : pair1) // two different centrality c1 and c2 and tracks corresponding to them + { + + if (!c1.sel8()) { + continue; + } + if (!c2.sel8()) { + continue; + } + + float multiplicity = 0.0f; + if (cfgMultFT0) + multiplicity = c1.multZeqFT0A() + c1.multZeqFT0C(); + else if (cfgMultFOTM) + multiplicity = c1.centFT0M(); + else if (cfgMultFT0C) + multiplicity = c1.centFT0C(); + + for (auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(tracks1, tracks2))) { + if (t1.size() == 0 || t2.size() == 0) { + continue; + } + + if (!SelectionV0(c1, t1, multiplicity)) + continue; + if (!SelectionV0(c2, t2, multiplicity)) + continue; + + auto postrack1 = t1.template posTrack_as(); + auto negtrack1 = t1.template negTrack_as(); + auto postrack2 = t2.template posTrack_as(); + auto negtrack2 = t2.template negTrack_as(); + if (postrack1.globalIndex() == postrack2.globalIndex()) { + continue; + } + if (negtrack1.globalIndex() == negtrack2.globalIndex()) { + continue; + } + double nTPCSigmaPos1[1]{postrack1.tpcNSigmaPi()}; + double nTPCSigmaNeg1[1]{negtrack1.tpcNSigmaPi()}; + double nTPCSigmaPos2[1]{postrack2.tpcNSigmaPi()}; + double nTPCSigmaNeg2[1]{negtrack2.tpcNSigmaPi()}; + + if (!isSelectedV0Daughter(postrack1, 1, nTPCSigmaPos1[0])) { + continue; + } + if (!isSelectedV0Daughter(postrack2, 1, nTPCSigmaPos2[0])) { + continue; + } + if (!isSelectedV0Daughter(negtrack1, -1, nTPCSigmaNeg1[0])) { + continue; + } + if (!isSelectedV0Daughter(negtrack2, -1, nTPCSigmaNeg2[0])) { + continue; + } + + // if (!PIDselection(postrack1)) { + // continue; + // } + // if (!PIDselection(postrack2)) { + // continue; + // } + // if (!PIDselection(negtrack1)) { + // continue; + // } + // if (!PIDselection(negtrack2)) { + // continue; + // } + + TLorentzVector lv1, lv2, lv3; + lv1.SetPtEtaPhiM(t1.pt(), t1.eta(), t1.phi(), massK0s); + lv2.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massK0s); + lv3 = lv1 + lv2; + if (TMath::Abs(lv3.Rapidity() < 0.5)) { + hglue.fill(HIST("h1glueInvMassME"), lv3.M()); + hglue.fill(HIST("h3glueInvMassME"), multiplicity, lv3.Pt(), lv3.M()); + } + } + } + } + PROCESS_SWITCH(strangeness_tutorial, processME, "mixed event process", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 0c2f6937056d2699976f9de7485a76002b76b70d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 12 Feb 2024 15:23:36 +0000 Subject: [PATCH 26/26] MegaLinter fixes --- PWGHF/Core/HfMlResponseB0ToDPi.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/Core/HfMlResponseB0ToDPi.h b/PWGHF/Core/HfMlResponseB0ToDPi.h index 08853a21eac..9a8855a6b11 100644 --- a/PWGHF/Core/HfMlResponseB0ToDPi.h +++ b/PWGHF/Core/HfMlResponseB0ToDPi.h @@ -25,9 +25,9 @@ // Fill the map of available input features // the key is the feature's name (std::string) // the value is the corresponding value in EnumInputFeatures -#define FILL_MAP_B0(FEATURE) \ - { \ -#FEATURE, static_cast < uint8_t>(InputFeaturesB0ToDPi::FEATURE) \ +#define FILL_MAP_B0(FEATURE) \ + { \ + #FEATURE, static_cast(InputFeaturesB0ToDPi::FEATURE) \ } // Check if the index of mCachedIndices (index associated to a FEATURE)