From 193664338505df350e78399f9684d6b8ce86082d Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Fri, 19 Sep 2025 19:21:56 +0200 Subject: [PATCH 01/21] move HistogramRegistry filling into init() --- PWGHF/D2H/Tasks/taskLc.cxx | 180 ++++++++++++++++++------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index f1fdc7ef961..ede95fdd43f 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -113,96 +113,7 @@ struct HfTaskLc { ConfigurableAxis thnConfigAxisOccupancy{"thnConfigAxisOccupancy", {14, 0, 14000}, "axis for centrality"}; ConfigurableAxis thnConfigAxisProperLifetime{"thnConfigAxisProperLifetime", {200, 0, 2}, "Proper lifetime, ps"}; - HistogramRegistry registry{ - "registry", - {/// mass candidate - {"Data/hMass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}}, - {"MC/reconstructed/signal/hMassRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}}, - {"MC/reconstructed/prompt/hMassRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}}, - {"MC/reconstructed/nonprompt/hMassRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}}, - /// pT - {"Data/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/signal/hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/prompt/hPtRecSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/nonprompt/hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/generated/signal/hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/generated/prompt/hPtGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/generated/nonprompt/hPtGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/generated/signal/hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"Data/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/signal/hPtRecProng0Sig", "3-prong candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/prompt/hPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"Data/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/signal/hPtRecProng1Sig", "3-prong candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/prompt/hPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"Data/hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/signal/hPtRecProng2Sig", "3-prong candidates (matched);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/prompt/hPtRecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - {"MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}}, - /// DCAxy to prim. vertex prongs - {"Data/hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/signal/hd0RecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/prompt/hd0RecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"Data/hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/signal/hd0RecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/prompt/hd0RecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"Data/hd0Prong2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/signal/hd0RecProng2Sig", "3-prong candidates (matched);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/prompt/hd0RecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - {"MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}}, - /// decay length candidate - {"Data/hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - {"MC/reconstructed/signal/hDecLengthRecSig", "3-prong candidates (matched);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - {"MC/reconstructed/prompt/hDecLengthRecSigPrompt", "3-prong candidates (matched, prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - {"MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - /// decay length xy candidate - {"Data/hDecLengthxy", "3-prong candidates;decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - {"MC/reconstructed/signal/hDecLengthxyRecSig", "3-prong candidates (matched);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - {"MC/reconstructed/prompt/hDecLengthxyRecSigPrompt", "3-prong candidates (matched, prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - {"MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}}, - /// proper lifetime - {"Data/hCt", "3-prong candidates;proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}}, - {"MC/reconstructed/signal/hCtRecSig", "3-prong candidates (matched);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}}, - {"MC/reconstructed/prompt/hCtRecSigPrompt", "3-prong candidates (matched, prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}}, - {"MC/reconstructed/nonprompt/hCtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}}, - /// cosine of pointing angle - {"Data/hCPA", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"MC/reconstructed/signal/hCPARecSig", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"MC/reconstructed/prompt/hCPARecSigPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"MC/reconstructed/nonprompt/hCPARecSigNonPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - /// cosine of pointing angle xy - {"Data/hCPAxy", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"MC/reconstructed/signal/hCPAxyRecSig", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"MC/reconstructed/prompt/hCPAxyRecSigPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - {"MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}}, - /// Chi 2 PCA to sec. vertex - {"Data/hDca2", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}}, - {"MC/reconstructed/signal/hDca2RecSig", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}}, - {"MC/reconstructed/prompt/hDca2RecSigPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}}, - {"MC/reconstructed/nonprompt/hDca2RecSigNonPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}}, - /// eta - {"Data/hEta", "3-prong candidates;#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/reconstructed/signal/hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/reconstructed/prompt/hEtaRecSigPrompt", "3-prong candidates (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/reconstructed/nonprompt/hEtaRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/generated/signal/hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/generated/prompt/hEtaGenPrompt", "MC particles (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/generated/nonprompt/hEtaGenNonPrompt", "MC particles (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/generated/signal/hYGen", "MC particles (matched);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/generated/prompt/hYGenPrompt", "MC particles (matched, prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - {"MC/generated/nonprompt/hYGenNonPrompt", "MC particles (matched, non-prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}}, - /// phi - {"Data/hPhi", "3-prong candidates;#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, - {"MC/reconstructed/signal/hPhiRecSig", "3-prong candidates (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, - {"MC/reconstructed/prompt/hPhiRecSigPrompt", "3-prong candidates (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, - {"MC/reconstructed/nonprompt/hPhiRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, - {"MC/generated/signal/hPhiGen", "MC particles (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, - {"MC/generated/prompt/hPhiGenPrompt", "MC particles (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}, - {"MC/generated/nonprompt/hPhiGenNonPrompt", "MC particles (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}}}}; + HistogramRegistry registry{"registry", {}}; void init(InitContext&) { @@ -211,6 +122,95 @@ struct HfTaskLc { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } + /// mass candidate + registry.add("Data/hMass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + registry.add("MC/reconstructed/signal/hMassRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + registry.add("MC/reconstructed/prompt/hMassRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + registry.add("MC/reconstructed/nonprompt/hMassRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + /// pT + registry.add("Data/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/signal/hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/prompt/hPtRecSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/nonprompt/hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/generated/signal/hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/generated/prompt/hPtGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/generated/nonprompt/hPtGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/generated/signal/hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("Data/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/signal/hPtRecProng0Sig", "3-prong candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/prompt/hPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("Data/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/signal/hPtRecProng1Sig", "3-prong candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/prompt/hPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("Data/hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/signal/hPtRecProng2Sig", "3-prong candidates (matched);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/prompt/hPtRecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + registry.add("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + /// DCAxy to prim. vertex prongs + registry.add("Data/hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/signal/hd0RecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/prompt/hd0RecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("Data/hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/signal/hd0RecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/prompt/hd0RecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("Data/hd0Prong2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/signal/hd0RecProng2Sig", "3-prong candidates (matched);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/prompt/hd0RecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + registry.add("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + /// decay length candidate + registry.add("Data/hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + registry.add("MC/reconstructed/signal/hDecLengthRecSig", "3-prong candidates (matched);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + registry.add("MC/reconstructed/prompt/hDecLengthRecSigPrompt", "3-prong candidates (matched, prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + registry.add("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + /// decay length xy candidate + registry.add("Data/hDecLengthxy", "3-prong candidates;decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + registry.add("MC/reconstructed/signal/hDecLengthxyRecSig", "3-prong candidates (matched);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + registry.add("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt", "3-prong candidates (matched, prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + registry.add("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + /// proper lifetime + registry.add("Data/hCt", "3-prong candidates;proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + registry.add("MC/reconstructed/signal/hCtRecSig", "3-prong candidates (matched);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + registry.add("MC/reconstructed/prompt/hCtRecSigPrompt", "3-prong candidates (matched, prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + registry.add("MC/reconstructed/nonprompt/hCtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + /// cosine of pointing angle + registry.add("Data/hCPA", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add("MC/reconstructed/signal/hCPARecSig", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add("MC/reconstructed/prompt/hCPARecSigPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add("MC/reconstructed/nonprompt/hCPARecSigNonPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + /// cosine of pointing angle xy + registry.add("Data/hCPAxy", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add("MC/reconstructed/signal/hCPAxyRecSig", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add("MC/reconstructed/prompt/hCPAxyRecSigPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + registry.add("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + /// Chi 2 PCA to sec. vertex + registry.add("Data/hDca2", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + registry.add("MC/reconstructed/signal/hDca2RecSig", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + registry.add("MC/reconstructed/prompt/hDca2RecSigPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + registry.add("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + /// eta + registry.add("Data/hEta", "3-prong candidates;#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/reconstructed/signal/hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/reconstructed/prompt/hEtaRecSigPrompt", "3-prong candidates (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/generated/signal/hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/generated/prompt/hEtaGenPrompt", "MC particles (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/generated/nonprompt/hEtaGenNonPrompt", "MC particles (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/generated/signal/hYGen", "MC particles (matched);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/generated/prompt/hYGenPrompt", "MC particles (matched, prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + registry.add("MC/generated/nonprompt/hYGenNonPrompt", "MC particles (matched, non-prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + /// phi + registry.add("Data/hPhi", "3-prong candidates;#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + registry.add("MC/reconstructed/signal/hPhiRecSig", "3-prong candidates (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + registry.add("MC/reconstructed/prompt/hPhiRecSigPrompt", "3-prong candidates (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + registry.add("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + registry.add("MC/generated/signal/hPhiGen", "MC particles (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + registry.add("MC/generated/prompt/hPhiGenPrompt", "MC particles (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + registry.add("MC/generated/nonprompt/hPhiGenNonPrompt", "MC particles (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + auto vbins = (std::vector)binsPt; /// mass candidate registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); From c3c3057d36ce9cdbb96296a3cda85b7887b621c9 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Fri, 19 Sep 2025 23:23:07 +0200 Subject: [PATCH 02/21] implement addHistograms[Rec,Gen] lambda-functions, start replace duplicated registry.add --- PWGHF/D2H/Tasks/taskLc.cxx | 204 ++++++++++++++++++++++--------------- 1 file changed, 120 insertions(+), 84 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ede95fdd43f..ee190a8f6a8 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -46,6 +46,7 @@ #include #include +#include #include // std::vector using namespace o2; @@ -122,107 +123,142 @@ struct HfTaskLc { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } + auto addHistogramsRec = [&](const std::string& histoName, const std::string& xAxisTitle, const std::string& yAxisTitle, const HistogramConfigSpec& configSpec) { + registry.add(("Data/" + histoName).c_str(), ("3-prong candidates;" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/reconstructed/signal/" + histoName + "RecSig").c_str(), ("3-prong candidates (matched);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/reconstructed/prompt/" + histoName + "RecSigPrompt").c_str(), ("3-prong candidates (matched, prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/reconstructed/nonprompt/" + histoName + "RecSigNonPrompt").c_str(), ("3-prong candidates (matched, non-prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + }; + + auto addHistogramsGen = [&](const std::string& histoName, const std::string& xAxisTitle, const std::string& yAxisTitle, const HistogramConfigSpec& configSpec) { + registry.add(("MC/generated/signal/" + histoName + "Gen").c_str(), ("MC particles (matched);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/generated/prompt/" + histoName + "GenPrompt").c_str(), ("MC particles (matched, prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/generated/nonprompt/" + histoName + "GenNonPrompt").c_str(), ("MC particles (matched, non-prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + }; + /// mass candidate - registry.add("Data/hMass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); - registry.add("MC/reconstructed/signal/hMassRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); - registry.add("MC/reconstructed/prompt/hMassRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); - registry.add("MC/reconstructed/nonprompt/hMassRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + // registry.add("Data/hMass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + // registry.add("MC/reconstructed/signal/hMassRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + // registry.add("MC/reconstructed/prompt/hMassRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + // registry.add("MC/reconstructed/nonprompt/hMassRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); + addHistogramsRec("hMass", "inv. mass (p K #pi) (GeV/#it{c}^{2})", "", {HistType::kTH1F, {{600, 1.98, 2.58}}}); /// pT - registry.add("Data/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/signal/hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/prompt/hPtRecSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/nonprompt/hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/generated/signal/hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/generated/prompt/hPtGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/generated/nonprompt/hPtGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("Data/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/signal/hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/prompt/hPtRecSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/nonprompt/hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + addHistogramsRec("hPt", "#it{p}_{T}^{rec.} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/generated/signal/hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/generated/prompt/hPtGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/generated/nonprompt/hPtGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + addHistogramsGen("hPt", "#it{p}_{T}^{gen.} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("MC/generated/signal/hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("Data/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/signal/hPtRecProng0Sig", "3-prong candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/prompt/hPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("Data/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/signal/hPtRecProng1Sig", "3-prong candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/prompt/hPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("Data/hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/signal/hPtRecProng2Sig", "3-prong candidates (matched);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/prompt/hPtRecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("Data/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/signal/hPtRecProng0Sig", "3-prong candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/prompt/hPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + addHistogramsRec("hPtProng0", "prong 0 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("Data/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/signal/hPtRecProng1Sig", "3-prong candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/prompt/hPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + addHistogramsRec("hPtProng1", "prong 1 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("Data/hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/signal/hPtRecProng2Sig", "3-prong candidates (matched);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/prompt/hPtRecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + // registry.add("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + addHistogramsRec("hPtProng2", "prong 2 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); /// DCAxy to prim. vertex prongs - registry.add("Data/hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/signal/hd0RecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/prompt/hd0RecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("Data/hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/signal/hd0RecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/prompt/hd0RecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("Data/hd0Prong2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/signal/hd0RecProng2Sig", "3-prong candidates (matched);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/prompt/hd0RecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - registry.add("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("Data/hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/signal/hd0RecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/prompt/hd0RecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + addHistogramsRec("hd0Prong0", "prong 0 DCAxy to prim. vertex (cm)", "entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("Data/hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/signal/hd0RecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/prompt/hd0RecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + addHistogramsRec("hd0Prong1", "prong 1 DCAxy to prim. vertex (cm)", "entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("Data/hd0Prong2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/signal/hd0RecProng2Sig", "3-prong candidates (matched);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/prompt/hd0RecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + // registry.add("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); + addHistogramsRec("hd0Prong2", "prong 2 DCAxy to prim. vertex (cm)", "entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); /// decay length candidate - registry.add("Data/hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - registry.add("MC/reconstructed/signal/hDecLengthRecSig", "3-prong candidates (matched);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - registry.add("MC/reconstructed/prompt/hDecLengthRecSigPrompt", "3-prong candidates (matched, prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - registry.add("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("Data/hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("MC/reconstructed/signal/hDecLengthRecSig", "3-prong candidates (matched);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("MC/reconstructed/prompt/hDecLengthRecSigPrompt", "3-prong candidates (matched, prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + addHistogramsRec("hDecLength", "decay length (cm)", "entries", {HistType::kTH1F, {{400, 0., 1.}}}); /// decay length xy candidate - registry.add("Data/hDecLengthxy", "3-prong candidates;decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - registry.add("MC/reconstructed/signal/hDecLengthxyRecSig", "3-prong candidates (matched);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - registry.add("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt", "3-prong candidates (matched, prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - registry.add("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("Data/hDecLengthxy", "3-prong candidates;decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("MC/reconstructed/signal/hDecLengthxyRecSig", "3-prong candidates (matched);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt", "3-prong candidates (matched, prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + // registry.add("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); + addHistogramsRec("hDecLengthxy", "decay length xy (cm)", "entries", {HistType::kTH1F, {{400, 0., 1.}}}); /// proper lifetime - registry.add("Data/hCt", "3-prong candidates;proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - registry.add("MC/reconstructed/signal/hCtRecSig", "3-prong candidates (matched);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - registry.add("MC/reconstructed/prompt/hCtRecSigPrompt", "3-prong candidates (matched, prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - registry.add("MC/reconstructed/nonprompt/hCtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + // registry.add("Data/hCt", "3-prong candidates;proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + // registry.add("MC/reconstructed/signal/hCtRecSig", "3-prong candidates (matched);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + // registry.add("MC/reconstructed/prompt/hCtRecSigPrompt", "3-prong candidates (matched, prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + // registry.add("MC/reconstructed/nonprompt/hCtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); + addHistogramsRec("hCt", "proper lifetime (#Lambda_{c}) * #it{c} (cm)", "entries", {HistType::kTH1F, {{100, 0., 0.2}}}); /// cosine of pointing angle - registry.add("Data/hCPA", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - registry.add("MC/reconstructed/signal/hCPARecSig", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - registry.add("MC/reconstructed/prompt/hCPARecSigPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - registry.add("MC/reconstructed/nonprompt/hCPARecSigNonPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("Data/hCPA", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("MC/reconstructed/signal/hCPARecSig", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("MC/reconstructed/prompt/hCPARecSigPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("MC/reconstructed/nonprompt/hCPARecSigNonPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + addHistogramsRec("hCPA", "cosine of pointing angle", "entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); /// cosine of pointing angle xy - registry.add("Data/hCPAxy", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - registry.add("MC/reconstructed/signal/hCPAxyRecSig", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - registry.add("MC/reconstructed/prompt/hCPAxyRecSigPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - registry.add("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("Data/hCPAxy", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("MC/reconstructed/signal/hCPAxyRecSig", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("MC/reconstructed/prompt/hCPAxyRecSigPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + // registry.add("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); + addHistogramsRec("hCPAxy", "cosine of pointing angle xy", "entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); /// Chi 2 PCA to sec. vertex - registry.add("Data/hDca2", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); - registry.add("MC/reconstructed/signal/hDca2RecSig", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); - registry.add("MC/reconstructed/prompt/hDca2RecSigPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); - registry.add("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + // registry.add("Data/hDca2", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + // registry.add("MC/reconstructed/signal/hDca2RecSig", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + // registry.add("MC/reconstructed/prompt/hDca2RecSigPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + // registry.add("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); + addHistogramsRec("hDca2", "prong Chi2PCA to sec. vertex (cm)", "entries", {HistType::kTH1F, {{400, 0., 20.}}}); /// eta - registry.add("Data/hEta", "3-prong candidates;#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/reconstructed/signal/hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/reconstructed/prompt/hEtaRecSigPrompt", "3-prong candidates (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/generated/signal/hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/generated/prompt/hEtaGenPrompt", "MC particles (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/generated/nonprompt/hEtaGenNonPrompt", "MC particles (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/generated/signal/hYGen", "MC particles (matched);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/generated/prompt/hYGenPrompt", "MC particles (matched, prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - registry.add("MC/generated/nonprompt/hYGenNonPrompt", "MC particles (matched, non-prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("Data/hEta", "3-prong candidates;#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/reconstructed/signal/hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/reconstructed/prompt/hEtaRecSigPrompt", "3-prong candidates (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + addHistogramsRec("hEta", "#it{#eta}", "entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/generated/signal/hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/generated/prompt/hEtaGenPrompt", "MC particles (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/generated/nonprompt/hEtaGenNonPrompt", "MC particles (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + addHistogramsGen("hEta", "#it{#eta}", "entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/generated/signal/hYGen", "MC particles (matched);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/generated/prompt/hYGenPrompt", "MC particles (matched, prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + // registry.add("MC/generated/nonprompt/hYGenNonPrompt", "MC particles (matched, non-prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); + addHistogramsGen("hY", "#it{y}", "entries", {HistType::kTH1F, {{100, -2., 2.}}}); /// phi - registry.add("Data/hPhi", "3-prong candidates;#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - registry.add("MC/reconstructed/signal/hPhiRecSig", "3-prong candidates (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - registry.add("MC/reconstructed/prompt/hPhiRecSigPrompt", "3-prong candidates (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - registry.add("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - registry.add("MC/generated/signal/hPhiGen", "MC particles (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - registry.add("MC/generated/prompt/hPhiGenPrompt", "MC particles (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - registry.add("MC/generated/nonprompt/hPhiGenNonPrompt", "MC particles (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("Data/hPhi", "3-prong candidates;#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("MC/reconstructed/signal/hPhiRecSig", "3-prong candidates (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("MC/reconstructed/prompt/hPhiRecSigPrompt", "3-prong candidates (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + addHistogramsRec("hPhi", "#it{#Phi}", "entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("MC/generated/signal/hPhiGen", "MC particles (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("MC/generated/prompt/hPhiGenPrompt", "MC particles (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + // registry.add("MC/generated/nonprompt/hPhiGenNonPrompt", "MC particles (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + addHistogramsRec("hPhi", "#it{#Phi}", "entries", {HistType::kTH1F, {{100, 0., 6.3}}}); auto vbins = (std::vector)binsPt; /// mass candidate registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); - registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hMassVsPtRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hMassVsPtRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("MC/reconstructed/signal/hMassVsPtRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("MC/reconstructed/prompt/hMassVsPtRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hMassVsPt", "inv. mass (p K #pi) (GeV/#it{c}^{2})", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins}}}); /// DCAxy to prim. vertex prongs - registry.add("Data/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hd0VsPtRecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hd0VsPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hd0VsPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("Data/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("MC/reconstructed/signal/hd0VsPtRecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("MC/reconstructed/prompt/hd0VsPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // registry.add("MC/reconstructed/nonprompt/hd0VsPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hd0VsPtProng0", "prong 0 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}}); registry.add("Data/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("MC/reconstructed/signal/hd0VsPtRecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); registry.add("MC/reconstructed/prompt/hd0VsPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); From 8a1299c464b99b278992b5c19d4941ecee144b76 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sat, 20 Sep 2025 22:42:29 +0200 Subject: [PATCH 03/21] finalize replace duplicated registry.add, rename some histos --- PWGHF/D2H/Tasks/taskLc.cxx | 274 ++++++++++--------------------------- 1 file changed, 71 insertions(+), 203 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ee190a8f6a8..da815524229 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -137,215 +137,83 @@ struct HfTaskLc { }; /// mass candidate - // registry.add("Data/hMass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); - // registry.add("MC/reconstructed/signal/hMassRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); - // registry.add("MC/reconstructed/prompt/hMassRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); - // registry.add("MC/reconstructed/nonprompt/hMassRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2})", {HistType::kTH1F, {{600, 1.98, 2.58}}}); addHistogramsRec("hMass", "inv. mass (p K #pi) (GeV/#it{c}^{2})", "", {HistType::kTH1F, {{600, 1.98, 2.58}}}); /// pT - // registry.add("Data/hPt", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/signal/hPtRecSig", "3-prong candidates (matched);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/prompt/hPtRecSigPrompt", "3-prong candidates (matched, prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/nonprompt/hPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{p}_{T}^{rec.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsRec("hPt", "#it{p}_{T}^{rec.} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/generated/signal/hPtGen", "MC particles (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/generated/prompt/hPtGenPrompt", "MC particles (matched, prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/generated/nonprompt/hPtGenNonPrompt", "MC particles (matched, non-prompt);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsGen("hPt", "#it{p}_{T}^{gen.} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); registry.add("MC/generated/signal/hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("Data/hPtProng0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/signal/hPtRecProng0Sig", "3-prong candidates (matched);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/prompt/hPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsRec("hPtProng0", "prong 0 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("Data/hPtProng1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/signal/hPtRecProng1Sig", "3-prong candidates (matched);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/prompt/hPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsRec("hPtProng1", "prong 1 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("Data/hPtProng2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/signal/hPtRecProng2Sig", "3-prong candidates (matched);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/prompt/hPtRecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); - // registry.add("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsRec("hPtProng2", "prong 2 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); /// DCAxy to prim. vertex prongs - // registry.add("Data/hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/signal/hd0RecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/prompt/hd0RecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); addHistogramsRec("hd0Prong0", "prong 0 DCAxy to prim. vertex (cm)", "entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("Data/hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/signal/hd0RecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/prompt/hd0RecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); addHistogramsRec("hd0Prong1", "prong 1 DCAxy to prim. vertex (cm)", "entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("Data/hd0Prong2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/signal/hd0RecProng2Sig", "3-prong candidates (matched);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/prompt/hd0RecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); - // registry.add("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); addHistogramsRec("hd0Prong2", "prong 2 DCAxy to prim. vertex (cm)", "entries", {HistType::kTH1F, {{600, -0.4, 0.4}}}); /// decay length candidate - // registry.add("Data/hDecLength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - // registry.add("MC/reconstructed/signal/hDecLengthRecSig", "3-prong candidates (matched);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - // registry.add("MC/reconstructed/prompt/hDecLengthRecSigPrompt", "3-prong candidates (matched, prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - // registry.add("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); addHistogramsRec("hDecLength", "decay length (cm)", "entries", {HistType::kTH1F, {{400, 0., 1.}}}); /// decay length xy candidate - // registry.add("Data/hDecLengthxy", "3-prong candidates;decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - // registry.add("MC/reconstructed/signal/hDecLengthxyRecSig", "3-prong candidates (matched);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - // registry.add("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt", "3-prong candidates (matched, prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); - // registry.add("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length xy (cm);entries", {HistType::kTH1F, {{400, 0., 1.}}}); addHistogramsRec("hDecLengthxy", "decay length xy (cm)", "entries", {HistType::kTH1F, {{400, 0., 1.}}}); /// proper lifetime - // registry.add("Data/hCt", "3-prong candidates;proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - // registry.add("MC/reconstructed/signal/hCtRecSig", "3-prong candidates (matched);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - // registry.add("MC/reconstructed/prompt/hCtRecSigPrompt", "3-prong candidates (matched, prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); - // registry.add("MC/reconstructed/nonprompt/hCtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH1F, {{100, 0., 0.2}}}); addHistogramsRec("hCt", "proper lifetime (#Lambda_{c}) * #it{c} (cm)", "entries", {HistType::kTH1F, {{100, 0., 0.2}}}); /// cosine of pointing angle - // registry.add("Data/hCPA", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - // registry.add("MC/reconstructed/signal/hCPARecSig", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - // registry.add("MC/reconstructed/prompt/hCPARecSigPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - // registry.add("MC/reconstructed/nonprompt/hCPARecSigNonPrompt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); addHistogramsRec("hCPA", "cosine of pointing angle", "entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); /// cosine of pointing angle xy - // registry.add("Data/hCPAxy", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - // registry.add("MC/reconstructed/signal/hCPAxyRecSig", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - // registry.add("MC/reconstructed/prompt/hCPAxyRecSigPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); - // registry.add("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); addHistogramsRec("hCPAxy", "cosine of pointing angle xy", "entries", {HistType::kTH1F, {{110, -1.1, 1.1}}}); /// Chi 2 PCA to sec. vertex - // registry.add("Data/hDca2", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); - // registry.add("MC/reconstructed/signal/hDca2RecSig", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); - // registry.add("MC/reconstructed/prompt/hDca2RecSigPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); - // registry.add("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH1F, {{400, 0., 20.}}}); addHistogramsRec("hDca2", "prong Chi2PCA to sec. vertex (cm)", "entries", {HistType::kTH1F, {{400, 0., 20.}}}); /// eta - // registry.add("Data/hEta", "3-prong candidates;#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/reconstructed/signal/hEtaRecSig", "3-prong candidates (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/reconstructed/prompt/hEtaRecSigPrompt", "3-prong candidates (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); addHistogramsRec("hEta", "#it{#eta}", "entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/generated/signal/hEtaGen", "MC particles (matched);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/generated/prompt/hEtaGenPrompt", "MC particles (matched, prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/generated/nonprompt/hEtaGenNonPrompt", "MC particles (matched, non-prompt);#it{#eta};entries", {HistType::kTH1F, {{100, -2., 2.}}}); addHistogramsGen("hEta", "#it{#eta}", "entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/generated/signal/hYGen", "MC particles (matched);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/generated/prompt/hYGenPrompt", "MC particles (matched, prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); - // registry.add("MC/generated/nonprompt/hYGenNonPrompt", "MC particles (matched, non-prompt);#it{y};entries", {HistType::kTH1F, {{100, -2., 2.}}}); addHistogramsGen("hY", "#it{y}", "entries", {HistType::kTH1F, {{100, -2., 2.}}}); /// phi - // registry.add("Data/hPhi", "3-prong candidates;#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - // registry.add("MC/reconstructed/signal/hPhiRecSig", "3-prong candidates (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - // registry.add("MC/reconstructed/prompt/hPhiRecSigPrompt", "3-prong candidates (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - // registry.add("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt", "3-prong candidates (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - addHistogramsRec("hPhi", "#it{#Phi}", "entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - // registry.add("MC/generated/signal/hPhiGen", "MC particles (matched);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - // registry.add("MC/generated/prompt/hPhiGenPrompt", "MC particles (matched, prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); - // registry.add("MC/generated/nonprompt/hPhiGenNonPrompt", "MC particles (matched, non-prompt);#it{#Phi};entries", {HistType::kTH1F, {{100, 0., 6.3}}}); addHistogramsRec("hPhi", "#it{#Phi}", "entries", {HistType::kTH1F, {{100, 0., 6.3}}}); + addHistogramsGen("hPhi", "#it{#Phi}", "entries", {HistType::kTH1F, {{100, 0., 6.3}}}); auto vbins = (std::vector)binsPt; /// mass candidate registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); - // registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // registry.add("MC/reconstructed/signal/hMassVsPtRecSig", "3-prong candidates (matched);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // registry.add("MC/reconstructed/prompt/hMassVsPtRecSigPrompt", "3-prong candidates (matched, prompt);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // registry.add("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); addHistogramsRec("hMassVsPt", "inv. mass (p K #pi) (GeV/#it{c}^{2})", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins}}}); /// DCAxy to prim. vertex prongs - // registry.add("Data/hd0VsPtProng0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // registry.add("MC/reconstructed/signal/hd0VsPtRecProng0Sig", "3-prong candidates (matched);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // registry.add("MC/reconstructed/prompt/hd0VsPtRecProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // registry.add("MC/reconstructed/nonprompt/hd0VsPtRecProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); addHistogramsRec("hd0VsPtProng0", "prong 0 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}}); - registry.add("Data/hd0VsPtProng1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hd0VsPtRecProng1Sig", "3-prong candidates (matched);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hd0VsPtRecProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hd0VsPtRecProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hd0VsPtProng2", "3-prong candidates;prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hd0VsPtRecProng2Sig", "3-prong candidates (matched);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hd0VsPtRecProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hd0VsPtRecProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 DCAxy to prim. vertex (cm);entries", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hd0VsPtProng1", "prong 1 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}}); + addHistogramsRec("hd0VsPtProng2", "prong 2 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}}); /// decay length candidate - registry.add("Data/hDecLengthVsPt", "3-prong candidates;decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hDecLengthVsPtRecSig", "3-prong candidates (matched);decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hDecLengthVsPtRecSigPrompt", "3-prong candidates (matched, prompt);decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hDecLengthVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length (cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hDecLengthVsPt", "decay length (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{400, 0., 1.}, {vbins}}}); /// decay length xy candidate - registry.add("Data/hDecLengthxyVsPt", "3-prong candidates;decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hDecLengthxyVsPtRecSig", "3-prong candidates (matched);decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hDecLengthxyVsPtRecSigPrompt", "3-prong candidates (matched, prompt);decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hDecLengthxyVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length xy(cm);entries", {HistType::kTH2F, {{400, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hDecLengthxyVsPt", "decay length xy (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{400, 0., 1.}, {vbins}}}); /// proper lifetime - registry.add("Data/hCtVsPt", "3-prong candidates;proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH2F, {{100, 0., 0.2}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hCtVsPtRecSig", "3-prong candidates (matched);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH2F, {{100, 0., 0.2}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hCtVsPtRecSigPrompt", "3-prong candidates (matched, prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH2F, {{100, 0., 0.2}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hCtVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);proper lifetime (#Lambda_{c}) * #it{c} (cm);entries", {HistType::kTH2F, {{100, 0., 0.2}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hCtVsPt", "proper lifetime (#Lambda_{c}) * #it{c} (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 0.2}, {vbins}}}); /// cosine of pointing angle - registry.add("Data/hCPAVsPt", "3-prong candidates;cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hCPAVsPtRecSig", "3-prong candidates (matched);cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hCPAVsPtRecSigPrompt", "3-prong candidates (matched, prompt);cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hCPAVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);cosine of pointing angle;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hCPAVsPt", "cosine of pointing angle", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins}}}); /// cosine of pointing angle xy - registry.add("Data/hCPAxyVsPt", "3-prong candidates;cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hCPAxyVsPtRecSig", "3-prong candidates (matched);cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hCPAxyVsPtRecSigPrompt", "3-prong candidates (matched, prompt);cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hCPAxyVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);cosine of pointing angle xy;entries", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hCPAxyVsPt", "cosine of pointing angle xy", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{110, -1.1, 1.1}, {vbins}}}); /// Chi 2 PCA to sec. vertex - registry.add("Data/hDca2VsPt", "3-prong candidates;prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hDca2VsPtRecSig", "3-prong candidates (matched);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hDca2VsPtRecSigPrompt", "3-prong candidates (matched, prompt);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hDca2VsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);prong Chi2PCA to sec. vertex (cm);entries", {HistType::kTH2F, {{400, 0., 20.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hDca2VsPt", "prong Chi2PCA to sec. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{400, 0., 20.}, {vbins}}}); /// eta - registry.add("Data/hEtaVsPt", "3-prong candidates;candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hEtaVsPtRecSig", "3-prong candidates (matched);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hEtaVsPtRecSigPrompt", "3-prong candidates (matched, prompt);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hEtaVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/signal/hEtaVsPtGenSig", "3-prong candidates (matched);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/prompt/hEtaVsPtGenSigPrompt", "3-prong candidates (matched, prompt);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/nonprompt/hEtaVsPtGenSigNonPrompt", "3-prong candidates (matched, non-prompt);candidate #it{#eta};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hEtaVsPt", "candidate #it{#eta}", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -2., 2.}, {vbins}}}); + addHistogramsGen("hEtaVsPt", "#it{#eta}", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -2., 2.}, {vbins}}}); /// y - registry.add("MC/generated/signal/hYVsPtGenSig", "3-prong candidates (matched);candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/prompt/hYVsPtGenSigPrompt", "3-prong candidates (matched, prompt);candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/nonprompt/hYVsPtGenSigNonPrompt", "3-prong candidates (matched, non-prompt);candidate #it{y};entries", {HistType::kTH2F, {{100, -2., 2.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsGen("hYVsPt", "#it{y}", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -2., 2.}, {vbins}}}); /// phi - registry.add("Data/hPhiVsPt", "3-prong candidates;candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hPhiVsPtRecSig", "3-prong candidates (matched);candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hPhiVsPtRecSigPrompt", "3-prong candidates (matched, prompt);candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hPhiVsPtRecSigNonPrompt", "3-prong candidates (matched, non-prompt);candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/signal/hPhiVsPtGenSig", "3-prong candidates (matched);candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/prompt/hPhiVsPtGenSigPrompt", "3-prong candidates (matched, prompt);candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/generated/nonprompt/hPhiVsPtGenSigNonPrompt", "3-prong candidates (matched, non-prompt);candidate #it{#Phi};entries", {HistType::kTH2F, {{100, 0., 6.3}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hPhiVsPt", "candidate #it{#Phi}", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 6.3}, {vbins}}}); + addHistogramsGen("hPhiVsPt", "#it{#Phi}", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 6.3}, {vbins}}}); /// selection status registry.add("hSelectionStatus", "3-prong candidates;selection status;entries", {HistType::kTH2F, {{5, -0.5, 4.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); /// impact parameter error - registry.add("Data/hImpParErrProng0", "3-prong candidates;prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hImpParErrProng1", "3-prong candidates;prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("Data/hImpParErrProng2", "3-prong candidates;prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hImpParErrProng0Sig", "3-prong candidates (matched);prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hImpParErrProng0SigPrompt", "3-prong candidates (matched, prompt);prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hImpParErrProng0SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 0 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hImpParErrProng1Sig", "3-prong candidates (matched);prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hImpParErrProng1SigPrompt", "3-prong candidates (matched, prompt);prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hImpParErrProng1SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 1 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hImpParErrProng2Sig", "3-prong candidates (matched);prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hImpParErrProng2SigPrompt", "3-prong candidates (matched, prompt);prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hImpParErrProng2SigNonPrompt", "3-prong candidates (matched, non-prompt);prong 2 impact parameter error (cm);entries", {HistType::kTH2F, {{100, -1., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hImpParErrProng0VsPt", "prong 0 impact parameter error (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -1., 1.}, {vbins}}}); + addHistogramsRec("hImpParErrProng1VsPt", "prong 1 impact parameter error (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -1., 1.}, {vbins}}}); + addHistogramsRec("hImpParErrProng2VsPt", "prong 2 impact parameter error (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, -1., 1.}, {vbins}}}); /// decay length error - registry.add("Data/hDecLenErr", "3-prong candidates;decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/signal/hDecLenErrSig", "3-prong candidates (matched);decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/prompt/hDecLenErrSigPrompt", "3-prong candidates (matched, prompt);decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("MC/reconstructed/nonprompt/hDecLenErrSigNonPrompt", "3-prong candidates (matched, non-prompt);decay length error (cm);entries", {HistType::kTH2F, {{100, 0., 1.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + addHistogramsRec("hDecLenErrVsPt", "decay length error (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 1.}, {vbins}}}); if (fillTHn) { const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; @@ -478,16 +346,16 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPiKP(candidate), pt); } registry.fill(HIST("MC/reconstructed/signal/hPtRecSig"), pt); - registry.fill(HIST("MC/reconstructed/signal/hPtRecProng0Sig"), ptProng0); - registry.fill(HIST("MC/reconstructed/signal/hPtRecProng1Sig"), ptProng1); - registry.fill(HIST("MC/reconstructed/signal/hPtRecProng2Sig"), ptProng2); - - registry.fill(HIST("MC/reconstructed/signal/hd0RecProng0Sig"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/signal/hd0RecProng1Sig"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/signal/hd0RecProng2Sig"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng0Sig"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng1Sig"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng2Sig"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/signal/hPtProng0RecSig"), ptProng0); + registry.fill(HIST("MC/reconstructed/signal/hPtProng1RecSig"), ptProng1); + registry.fill(HIST("MC/reconstructed/signal/hPtProng2RecSig"), ptProng2); + + registry.fill(HIST("MC/reconstructed/signal/hd0Prong0RecSig"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/signal/hd0Prong1RecSig"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/signal/hd0Prong2RecSig"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng0RecSig"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng1RecSig"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng2RecSig"), candidate.impactParameter2(), pt); registry.fill(HIST("MC/reconstructed/signal/hDecLengthRecSig"), decayLength); registry.fill(HIST("MC/reconstructed/signal/hDecLengthVsPtRecSig"), decayLength, pt); registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyRecSig"), decayLengthXY); @@ -504,10 +372,10 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), pt); registry.fill(HIST("MC/reconstructed/signal/hPhiRecSig"), candidate.phi()); registry.fill(HIST("MC/reconstructed/signal/hPhiVsPtRecSig"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0Sig"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1Sig"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2Sig"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLenErrSig"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0VsPtRecSig"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1VsPtRecSig"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2VsPtRecSig"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/signal/hDecLenErrVsPtRecSig"), candidate.errorDecayLength(), pt); /// reconstructed signal prompt if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { @@ -520,15 +388,15 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); } registry.fill(HIST("MC/reconstructed/prompt/hPtRecSigPrompt"), pt); - registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng0SigPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng1SigPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng2SigPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng0SigPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng1SigPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng2SigPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng0SigPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng1SigPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng2SigPrompt"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hPtProng0RecSigPrompt"), ptProng0); + registry.fill(HIST("MC/reconstructed/prompt/hPtProng1RecSigPrompt"), ptProng1); + registry.fill(HIST("MC/reconstructed/prompt/hPtProng2RecSigPrompt"), ptProng2); + registry.fill(HIST("MC/reconstructed/prompt/hd0Prong0RecSigPrompt"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/prompt/hd0Prong1RecSigPrompt"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/prompt/hd0Prong2RecSigPrompt"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng0RecSigPrompt"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng1RecSigPrompt"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng2RecSigPrompt"), candidate.impactParameter2(), pt); registry.fill(HIST("MC/reconstructed/prompt/hDecLengthRecSigPrompt"), decayLength); registry.fill(HIST("MC/reconstructed/prompt/hDecLengthVsPtRecSigPrompt"), decayLength, pt); registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt"), decayLengthXY); @@ -545,10 +413,10 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/prompt/hEtaVsPtRecSigPrompt"), candidate.eta(), pt); registry.fill(HIST("MC/reconstructed/prompt/hPhiRecSigPrompt"), candidate.phi()); registry.fill(HIST("MC/reconstructed/prompt/hPhiVsPtRecSigPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0SigPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1SigPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2SigPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrSigPrompt"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0VsPtRecSigPrompt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1VsPtRecSigPrompt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2VsPtRecSigPrompt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrVsPtRecSigPrompt"), candidate.errorDecayLength(), pt); } else { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate)); @@ -559,15 +427,15 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); } registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecSigNonPrompt"), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng0SigNonPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng1SigNonPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng2SigNonPrompt"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng0RecSigNonPrompt"), ptProng0); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng1RecSigNonPrompt"), ptProng1); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng2RecSigNonPrompt"), ptProng2); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong0RecSigNonPrompt"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong1RecSigNonPrompt"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong2RecSigNonPrompt"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng0RecSigNonPrompt"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng1RecSigNonPrompt"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng2RecSigNonPrompt"), candidate.impactParameter2(), pt); registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt"), decayLength); registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthVsPtRecSigNonPrompt"), decayLength, pt); registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt"), decayLengthXY); @@ -584,10 +452,10 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/nonprompt/hEtaVsPtRecSigNonPrompt"), candidate.eta(), pt); registry.fill(HIST("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt"), candidate.phi()); registry.fill(HIST("MC/reconstructed/nonprompt/hPhiVsPtRecSigNonPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0SigNonPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1SigNonPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2SigNonPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrSigNonPrompt"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0VsPtRecSigNonPrompt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1VsPtRecSigNonPrompt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2VsPtRecSigNonPrompt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrVsPtRecSigNonPrompt"), candidate.errorDecayLength(), pt); } if (fillTHn) { float cent = evaluateCentralityColl(collision); @@ -696,9 +564,9 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/signal/hEtaGen"), particle.eta()); registry.fill(HIST("MC/generated/signal/hYGen"), yGen); registry.fill(HIST("MC/generated/signal/hPhiGen"), particle.phi()); - registry.fill(HIST("MC/generated/signal/hEtaVsPtGenSig"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/signal/hYVsPtGenSig"), yGen, ptGen); - registry.fill(HIST("MC/generated/signal/hPhiVsPtGenSig"), particle.phi(), ptGen); + registry.fill(HIST("MC/generated/signal/hEtaVsPtGen"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/signal/hYVsPtGen"), yGen, ptGen); + registry.fill(HIST("MC/generated/signal/hPhiVsPtGen"), particle.phi(), ptGen); if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { if (fillTHn) { @@ -715,9 +583,9 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/prompt/hEtaGenPrompt"), particle.eta()); registry.fill(HIST("MC/generated/prompt/hYGenPrompt"), yGen); registry.fill(HIST("MC/generated/prompt/hPhiGenPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenSigPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/prompt/hYVsPtGenSigPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenSigPrompt"), particle.phi(), ptGen); + registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenPrompt"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/prompt/hYVsPtGenPrompt"), yGen, ptGen); + registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenPrompt"), particle.phi(), ptGen); } if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); @@ -735,9 +603,9 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/nonprompt/hEtaGenNonPrompt"), particle.eta()); registry.fill(HIST("MC/generated/nonprompt/hYGenNonPrompt"), yGen); registry.fill(HIST("MC/generated/nonprompt/hPhiGenNonPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenSigNonPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenSigNonPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenSigNonPrompt"), particle.phi(), ptGen); + registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenNonPrompt"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenNonPrompt"), yGen, ptGen); + registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenNonPrompt"), particle.phi(), ptGen); } } } @@ -807,10 +675,10 @@ struct HfTaskLc { registry.fill(HIST("Data/hPhiVsPt"), candidate.phi(), pt); registry.fill(HIST("hSelectionStatus"), candidate.isSelLcToPKPi(), pt); registry.fill(HIST("hSelectionStatus"), candidate.isSelLcToPiKP(), pt); - registry.fill(HIST("Data/hImpParErrProng0"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("Data/hImpParErrProng1"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("Data/hImpParErrProng2"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("Data/hDecLenErr"), candidate.errorDecayLength(), pt); + registry.fill(HIST("Data/hImpParErrProng0VsPt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("Data/hImpParErrProng1VsPt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("Data/hImpParErrProng2VsPt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("Data/hDecLenErrVsPt"), candidate.errorDecayLength(), pt); if (fillTHn) { float cent = evaluateCentralityColl(collision); From 480d99f4968e03c06079b563aa13711e5bf02d95 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sun, 21 Sep 2025 15:20:20 +0200 Subject: [PATCH 04/21] incapsulate fill RecSig histograms into function --- PWGHF/D2H/Tasks/taskLc.cxx | 162 +++++++++++-------------------------- 1 file changed, 46 insertions(+), 116 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index da815524229..dbe87ae77e1 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -336,127 +336,57 @@ struct HfTaskLc { auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - /// MC reconstructed signal - if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPKPi(candidate), pt); - } - if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/signal/hPtRecSig"), pt); - registry.fill(HIST("MC/reconstructed/signal/hPtProng0RecSig"), ptProng0); - registry.fill(HIST("MC/reconstructed/signal/hPtProng1RecSig"), ptProng1); - registry.fill(HIST("MC/reconstructed/signal/hPtProng2RecSig"), ptProng2); - - registry.fill(HIST("MC/reconstructed/signal/hd0Prong0RecSig"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/signal/hd0Prong1RecSig"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/signal/hd0Prong2RecSig"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng0RecSig"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng1RecSig"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng2RecSig"), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthRecSig"), decayLength); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthVsPtRecSig"), decayLength, pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyRecSig"), decayLengthXY); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyVsPtRecSig"), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/signal/hCtRecSig"), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/signal/hCtVsPtRecSig"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/signal/hCPARecSig"), cpa); - registry.fill(HIST("MC/reconstructed/signal/hCPAVsPtRecSig"), cpa, pt); - registry.fill(HIST("MC/reconstructed/signal/hCPAxyRecSig"), cpaXY); - registry.fill(HIST("MC/reconstructed/signal/hCPAxyVsPtRecSig"), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/signal/hDca2RecSig"), chi2PCA); - registry.fill(HIST("MC/reconstructed/signal/hDca2VsPtRecSig"), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/signal/hEtaRecSig"), candidate.eta()); - registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/signal/hPhiRecSig"), candidate.phi()); - registry.fill(HIST("MC/reconstructed/signal/hPhiVsPtRecSig"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0VsPtRecSig"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1VsPtRecSig"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2VsPtRecSig"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLenErrVsPtRecSig"), candidate.errorDecayLength(), pt); - - /// reconstructed signal prompt - if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + auto fillHistogramsRecSig = [&](const std::string& signalFolder, const std::string& signalSuffix) { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPKPi(candidate), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPKPi(candidate), pt); } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/prompt/hPtRecSigPrompt"), pt); - registry.fill(HIST("MC/reconstructed/prompt/hPtProng0RecSigPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/prompt/hPtProng1RecSigPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/prompt/hPtProng2RecSigPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/prompt/hd0Prong0RecSigPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/prompt/hd0Prong1RecSigPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/prompt/hd0Prong2RecSigPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng0RecSigPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng1RecSigPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng2RecSigPrompt"), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthRecSigPrompt"), decayLength); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthVsPtRecSigPrompt"), decayLength, pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt"), decayLengthXY); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyVsPtRecSigPrompt"), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/prompt/hCtRecSigPrompt"), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/prompt/hCtVsPtRecSigPrompt"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/prompt/hCPARecSigPrompt"), cpa); - registry.fill(HIST("MC/reconstructed/prompt/hCPAVsPtRecSigPrompt"), cpa, pt); - registry.fill(HIST("MC/reconstructed/prompt/hCPAxyRecSigPrompt"), cpaXY); - registry.fill(HIST("MC/reconstructed/prompt/hCPAxyVsPtRecSigPrompt"), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/prompt/hDca2RecSigPrompt"), chi2PCA); - registry.fill(HIST("MC/reconstructed/prompt/hDca2VsPtRecSigPrompt"), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/prompt/hEtaRecSigPrompt"), candidate.eta()); - registry.fill(HIST("MC/reconstructed/prompt/hEtaVsPtRecSigPrompt"), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hPhiRecSigPrompt"), candidate.phi()); - registry.fill(HIST("MC/reconstructed/prompt/hPhiVsPtRecSigPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0VsPtRecSigPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1VsPtRecSigPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2VsPtRecSigPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrVsPtRecSigPrompt"), candidate.errorDecayLength(), pt); - } else { - if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPiKP(candidate), pt); } - if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecSigNonPrompt"), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng0RecSigNonPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng1RecSigNonPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng2RecSigNonPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong0RecSigNonPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong1RecSigNonPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong2RecSigNonPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng0RecSigNonPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng1RecSigNonPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng2RecSigNonPrompt"), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt"), decayLength); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthVsPtRecSigNonPrompt"), decayLength, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt"), decayLengthXY); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyVsPtRecSigNonPrompt"), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hCtRecSigNonPrompt"), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/nonprompt/hCtVsPtRecSigNonPrompt"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPARecSigNonPrompt"), cpa); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPAVsPtRecSigNonPrompt"), cpa, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt"), cpaXY); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPAxyVsPtRecSigNonPrompt"), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt"), chi2PCA); - registry.fill(HIST("MC/reconstructed/nonprompt/hDca2VsPtRecSigNonPrompt"), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt"), candidate.eta()); - registry.fill(HIST("MC/reconstructed/nonprompt/hEtaVsPtRecSigNonPrompt"), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt"), candidate.phi()); - registry.fill(HIST("MC/reconstructed/nonprompt/hPhiVsPtRecSigNonPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0VsPtRecSigNonPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1VsPtRecSigNonPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2VsPtRecSigNonPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrVsPtRecSigNonPrompt"), candidate.errorDecayLength(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtRecSig" + signalSuffix)).c_str(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng0RecSig" + signalSuffix)).c_str(), ptProng0); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng1RecSig" + signalSuffix)).c_str(), ptProng1); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng2RecSig" + signalSuffix)).c_str(), ptProng2); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong0RecSig" + signalSuffix)).c_str(), candidate.impactParameter0()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong1RecSig" + signalSuffix)).c_str(), candidate.impactParameter1()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong2RecSig" + signalSuffix)).c_str(), candidate.impactParameter2()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng0RecSig" + signalSuffix)).c_str(), candidate.impactParameter0(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng1RecSig" + signalSuffix)).c_str(), candidate.impactParameter1(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng2RecSig" + signalSuffix)).c_str(), candidate.impactParameter2(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthRecSig" + signalSuffix)).c_str(), decayLength); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthVsPtRecSig" + signalSuffix)).c_str(), decayLength, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyRecSig" + signalSuffix)).c_str(), decayLengthXY); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyVsPtRecSig" + signalSuffix)).c_str(), decayLengthXY, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtRecSig" + signalSuffix)).c_str(), hfHelper.ctLc(candidate)); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtVsPtRecSig" + signalSuffix)).c_str(), hfHelper.ctLc(candidate), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPARecSig" + signalSuffix)).c_str(), cpa); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAVsPtRecSig" + signalSuffix)).c_str(), cpa, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyRecSig" + signalSuffix)).c_str(), cpaXY); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyVsPtRecSig" + signalSuffix)).c_str(), cpaXY, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2RecSig" + signalSuffix)).c_str(), chi2PCA); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2VsPtRecSig" + signalSuffix)).c_str(), chi2PCA, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaRecSig" + signalSuffix)).c_str(), candidate.eta()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaVsPtRecSig" + signalSuffix)).c_str(), candidate.eta(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiRecSig" + signalSuffix)).c_str(), candidate.phi()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiVsPtRecSig" + signalSuffix)).c_str(), candidate.phi(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng0VsPtRecSig" + signalSuffix)).c_str(), candidate.errorImpactParameter0(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng1VsPtRecSig" + signalSuffix)).c_str(), candidate.errorImpactParameter1(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng2VsPtRecSig" + signalSuffix)).c_str(), candidate.errorImpactParameter2(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLenErrVsPtRecSig" + signalSuffix)).c_str(), candidate.errorDecayLength(), pt); + }; + + /// MC reconstructed signal + fillHistogramsRecSig("signal", ""); + /// reconstructed signal prompt + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + fillHistogramsRecSig("prompt", "Prompt"); + /// reconstructed signal nonprompt + } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { + fillHistogramsRecSig("nonprompt", "NonPrompt"); } + if (fillTHn) { float cent = evaluateCentralityColl(collision); float occ{-1.}; From 07a9d2b23b36b9c3796079d0a72c54ea64a0a706 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sun, 21 Sep 2025 15:37:31 +0200 Subject: [PATCH 05/21] incapsulate fill RecSig THns into function --- PWGHF/D2H/Tasks/taskLc.cxx | 43 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index dbe87ae77e1..daa7273c31e 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -396,14 +396,15 @@ struct HfTaskLc { double massLc(-1); double outputBkg(-1), outputPrompt(-1), outputFD(-1); const float properLifetime = hfHelper.ctLc(candidate) * CtToProperLifetimePs; - if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - massLc = hfHelper.invMassLcToPKPi(candidate); + + auto fillTHnRecSig = [&](bool isPKPi) { + massLc = isPKPi ? hfHelper.invMassLcToPKPi(candidate) : hfHelper.invMassLcToPiKP(candidate); if constexpr (fillMl) { if (candidate.mlProbLcToPKPi().size() == NumberOfMlClasses) { - outputBkg = candidate.mlProbLcToPKPi()[MlClassBackground]; /// bkg score - outputPrompt = candidate.mlProbLcToPKPi()[MlClassPrompt]; /// prompt score - outputFD = candidate.mlProbLcToPKPi()[MlClassNonPrompt]; /// non-prompt score + outputBkg = isPKPi ? candidate.mlProbLcToPKPi()[MlClassBackground] : candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score + outputPrompt = isPKPi ? candidate.mlProbLcToPKPi()[MlClassPrompt] : candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score + outputFD = isPKPi ? candidate.mlProbLcToPKPi()[MlClassNonPrompt] : candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate std::vector valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), ptRecB, static_cast(originType)}; @@ -424,35 +425,13 @@ struct HfTaskLc { } registry.get(HIST("hnLcVars"))->Fill(valuesToFill.data()); } + }; + + if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { + fillTHnRecSig(true); } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - massLc = hfHelper.invMassLcToPiKP(candidate); - - if constexpr (fillMl) { - if (candidate.mlProbLcToPiKP().size() == NumberOfMlClasses) { - outputBkg = candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score - outputPrompt = candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score - outputFD = candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score - } - /// Fill the ML outputScores and variables of candidate (todo: add multiplicity) - std::vector valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), ptRecB, static_cast(originType)}; - if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { - valuesToFill.push_back(occ); - } - if (storeProperLifetime) { - valuesToFill.push_back(properLifetime); - } - registry.get(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data()); - } else { - std::vector valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), ptRecB, static_cast(originType)}; - if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { - valuesToFill.push_back(occ); - } - if (storeProperLifetime) { - valuesToFill.push_back(properLifetime); - } - registry.get(HIST("hnLcVars"))->Fill(valuesToFill.data()); - } + fillTHnRecSig(false); } } } From d773c16ac04bbb37f476d13d26b88c2c9f95e663 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sun, 21 Sep 2025 16:02:05 +0200 Subject: [PATCH 06/21] incapsulate fill Gen THns and histograms into function --- PWGHF/D2H/Tasks/taskLc.cxx | 58 +++++++++++++++----------------------- 1 file changed, 23 insertions(+), 35 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index daa7273c31e..208cc818b69 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -469,35 +469,23 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time - registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); - registry.fill(HIST("MC/generated/signal/hEtaGen"), particle.eta()); - registry.fill(HIST("MC/generated/signal/hYGen"), yGen); - registry.fill(HIST("MC/generated/signal/hPhiGen"), particle.phi()); - registry.fill(HIST("MC/generated/signal/hEtaVsPtGen"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/signal/hYVsPtGen"), yGen, ptGen); - registry.fill(HIST("MC/generated/signal/hPhiVsPtGen"), particle.phi(), ptGen); + auto fillHistogramsGen = [&](const std::string& signalFolder, const std::string& signalSuffix) { + registry.fill(HIST(("MC/generated/" + signalFolder + "/hPtGen" + signalSuffix).c_str()), ptGen); + registry.fill(HIST(("MC/generated/" + signalFolder + "/hEtaGen" + signalSuffix).c_str()), particle.eta()); + registry.fill(HIST(("MC/generated/" + signalFolder + "/hYGen" + signalSuffix).c_str()), yGen); + registry.fill(HIST(("MC/generated/" + signalFolder + "/hPhiGen" + signalSuffix).c_str()), particle.phi()); + registry.fill(HIST(("MC/generated/" + signalFolder + "/hEtaVsPtGen" + signalSuffix).c_str()), particle.eta(), ptGen); + registry.fill(HIST(("MC/generated/" + signalFolder + "/hYVsPtGen" + signalSuffix).c_str()), yGen, ptGen); + registry.fill(HIST(("MC/generated/" + signalFolder + "/hPhiVsPtGen" + signalSuffix).c_str()), particle.phi(), ptGen); + }; + + fillHistogramsGen("signal", ""); + + auto fillHistogramsAndTHnGen = [&](bool isPrompt) { + ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); + const std::string signalFolder = isPrompt ? "prompt" : "nonprompt"; + const std::string signalSuffix = isPrompt ? "Prompt" : "NonPrompt"; - if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { - if (fillTHn) { - std::vector valuesToFill{ptGen, cent, yGen, static_cast(numPvContributors), ptGenB, static_cast(originType)}; - if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { - valuesToFill.push_back(occ); - } - if (storeProperLifetime) { - valuesToFill.push_back(properLifetime); - } - registry.get(HIST("hnLcVarsGen"))->Fill(valuesToFill.data()); - } - registry.fill(HIST("MC/generated/prompt/hPtGenPrompt"), ptGen); - registry.fill(HIST("MC/generated/prompt/hEtaGenPrompt"), particle.eta()); - registry.fill(HIST("MC/generated/prompt/hYGenPrompt"), yGen); - registry.fill(HIST("MC/generated/prompt/hPhiGenPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/prompt/hYVsPtGenPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenPrompt"), particle.phi(), ptGen); - } - if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { - ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); if (fillTHn) { std::vector valuesToFill{ptGen, cent, yGen, static_cast(numPvContributors), ptGenB, static_cast(originType)}; if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { @@ -508,13 +496,13 @@ struct HfTaskLc { } registry.get(HIST("hnLcVarsGen"))->Fill(valuesToFill.data()); } - registry.fill(HIST("MC/generated/nonprompt/hPtGenNonPrompt"), ptGen); - registry.fill(HIST("MC/generated/nonprompt/hEtaGenNonPrompt"), particle.eta()); - registry.fill(HIST("MC/generated/nonprompt/hYGenNonPrompt"), yGen); - registry.fill(HIST("MC/generated/nonprompt/hPhiGenNonPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenNonPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenNonPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenNonPrompt"), particle.phi(), ptGen); + fillHistogramsGen(signalFolder, signalSuffix); + }; + + if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { + fillHistogramsAndTHnGen(true); + } else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { + fillHistogramsAndTHnGen(false); } } } From a26f71f6744cd2e89547a6f66ff7191e1ade3711 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sun, 21 Sep 2025 16:14:02 +0200 Subject: [PATCH 07/21] incapsulate fill Data THns into function --- PWGHF/D2H/Tasks/taskLc.cxx | 43 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 208cc818b69..9dac7765b8d 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -586,14 +586,15 @@ struct HfTaskLc { double massLc(-1); double outputBkg(-1), outputPrompt(-1), outputFD(-1); const float properLifetime = hfHelper.ctLc(candidate) * CtToProperLifetimePs; - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - massLc = hfHelper.invMassLcToPKPi(candidate); + + auto fillTHnData = [&](bool isPKPi) { + massLc = isPKPi ? hfHelper.invMassLcToPKPi(candidate) : hfHelper.invMassLcToPiKP(candidate); if constexpr (fillMl) { if (candidate.mlProbLcToPKPi().size() == NumberOfMlClasses) { - outputBkg = candidate.mlProbLcToPKPi()[MlClassBackground]; /// bkg score - outputPrompt = candidate.mlProbLcToPKPi()[MlClassPrompt]; /// prompt score - outputFD = candidate.mlProbLcToPKPi()[MlClassNonPrompt]; /// non-prompt score + outputBkg = isPKPi ? candidate.mlProbLcToPKPi()[MlClassBackground] : candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score + outputPrompt = isPKPi ? candidate.mlProbLcToPKPi()[MlClassPrompt] : candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score + outputFD = isPKPi ? candidate.mlProbLcToPKPi()[MlClassNonPrompt] : candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score } /// Fill the ML outputScores and variables of candidate std::vector valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors)}; @@ -614,35 +615,13 @@ struct HfTaskLc { } registry.get(HIST("hnLcVars"))->Fill(valuesToFill.data()); } + }; + + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + fillTHnData(true); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - massLc = hfHelper.invMassLcToPiKP(candidate); - - if constexpr (fillMl) { - if (candidate.mlProbLcToPiKP().size() == NumberOfMlClasses) { - outputBkg = candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score - outputPrompt = candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score - outputFD = candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score - } - /// Fill the ML outputScores and variables of candidate - std::vector valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors)}; - if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { - valuesToFill.push_back(occ); - } - if (storeProperLifetime) { - valuesToFill.push_back(properLifetime); - } - registry.get(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data()); - } else { - std::vector valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors)}; - if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) { - valuesToFill.push_back(occ); - } - if (storeProperLifetime) { - valuesToFill.push_back(properLifetime); - } - registry.get(HIST("hnLcVars"))->Fill(valuesToFill.data()); - } + fillTHnData(false); } } } From 45eb3b65c5cbebf17be41fa6b53f43a05c2058fa Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sun, 21 Sep 2025 16:16:18 +0200 Subject: [PATCH 08/21] fix typo in fillHistogramsRecSig --- PWGHF/D2H/Tasks/taskLc.cxx | 68 +++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 9dac7765b8d..509f38e9fdf 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -338,43 +338,43 @@ struct HfTaskLc { auto fillHistogramsRecSig = [&](const std::string& signalFolder, const std::string& signalSuffix) { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPKPi(candidate), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPKPi(candidate), pt); } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix)).c_str(), hfHelper.invMassLcToPiKP(candidate), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPiKP(candidate), pt); } - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtRecSig" + signalSuffix)).c_str(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng0RecSig" + signalSuffix)).c_str(), ptProng0); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng1RecSig" + signalSuffix)).c_str(), ptProng1); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng2RecSig" + signalSuffix)).c_str(), ptProng2); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong0RecSig" + signalSuffix)).c_str(), candidate.impactParameter0()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong1RecSig" + signalSuffix)).c_str(), candidate.impactParameter1()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong2RecSig" + signalSuffix)).c_str(), candidate.impactParameter2()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng0RecSig" + signalSuffix)).c_str(), candidate.impactParameter0(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng1RecSig" + signalSuffix)).c_str(), candidate.impactParameter1(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng2RecSig" + signalSuffix)).c_str(), candidate.impactParameter2(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthRecSig" + signalSuffix)).c_str(), decayLength); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthVsPtRecSig" + signalSuffix)).c_str(), decayLength, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyRecSig" + signalSuffix)).c_str(), decayLengthXY); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyVsPtRecSig" + signalSuffix)).c_str(), decayLengthXY, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtRecSig" + signalSuffix)).c_str(), hfHelper.ctLc(candidate)); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtVsPtRecSig" + signalSuffix)).c_str(), hfHelper.ctLc(candidate), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPARecSig" + signalSuffix)).c_str(), cpa); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAVsPtRecSig" + signalSuffix)).c_str(), cpa, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyRecSig" + signalSuffix)).c_str(), cpaXY); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyVsPtRecSig" + signalSuffix)).c_str(), cpaXY, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2RecSig" + signalSuffix)).c_str(), chi2PCA); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2VsPtRecSig" + signalSuffix)).c_str(), chi2PCA, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaRecSig" + signalSuffix)).c_str(), candidate.eta()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaVsPtRecSig" + signalSuffix)).c_str(), candidate.eta(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiRecSig" + signalSuffix)).c_str(), candidate.phi()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiVsPtRecSig" + signalSuffix)).c_str(), candidate.phi(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng0VsPtRecSig" + signalSuffix)).c_str(), candidate.errorImpactParameter0(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng1VsPtRecSig" + signalSuffix)).c_str(), candidate.errorImpactParameter1(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng2VsPtRecSig" + signalSuffix)).c_str(), candidate.errorImpactParameter2(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLenErrVsPtRecSig" + signalSuffix)).c_str(), candidate.errorDecayLength(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtRecSig" + signalSuffix).c_str()), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng0RecSig" + signalSuffix).c_str()), ptProng0); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng1RecSig" + signalSuffix).c_str()), ptProng1); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng2RecSig" + signalSuffix).c_str()), ptProng2); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong0RecSig" + signalSuffix).c_str()), candidate.impactParameter0()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong1RecSig" + signalSuffix).c_str()), candidate.impactParameter1()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong2RecSig" + signalSuffix).c_str()), candidate.impactParameter2()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng0RecSig" + signalSuffix).c_str()), candidate.impactParameter0(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng1RecSig" + signalSuffix).c_str()), candidate.impactParameter1(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng2RecSig" + signalSuffix).c_str()), candidate.impactParameter2(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthRecSig" + signalSuffix).c_str()), decayLength); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthVsPtRecSig" + signalSuffix).c_str()), decayLength, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyRecSig" + signalSuffix).c_str()), decayLengthXY); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyVsPtRecSig" + signalSuffix).c_str()), decayLengthXY, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtRecSig" + signalSuffix).c_str()), hfHelper.ctLc(candidate)); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtVsPtRecSig" + signalSuffix).c_str()), hfHelper.ctLc(candidate), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPARecSig" + signalSuffix).c_str()), cpa); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAVsPtRecSig" + signalSuffix).c_str()), cpa, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyRecSig" + signalSuffix).c_str()), cpaXY); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyVsPtRecSig" + signalSuffix).c_str()), cpaXY, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2RecSig" + signalSuffix).c_str()), chi2PCA); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2VsPtRecSig" + signalSuffix).c_str()), chi2PCA, pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaRecSig" + signalSuffix).c_str()), candidate.eta()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaVsPtRecSig" + signalSuffix).c_str()), candidate.eta(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiRecSig" + signalSuffix).c_str()), candidate.phi()); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiVsPtRecSig" + signalSuffix).c_str()), candidate.phi(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng0VsPtRecSig" + signalSuffix).c_str()), candidate.errorImpactParameter0(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng1VsPtRecSig" + signalSuffix).c_str()), candidate.errorImpactParameter1(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng2VsPtRecSig" + signalSuffix).c_str()), candidate.errorImpactParameter2(), pt); + registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLenErrVsPtRecSig" + signalSuffix).c_str()), candidate.errorDecayLength(), pt); }; /// MC reconstructed signal From 97afdfefed1e2af02e5e7dbc8dc91fdff6b45618 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Mon, 22 Sep 2025 00:31:29 +0200 Subject: [PATCH 09/21] bugfix: do not pass runtime string into HIST() --- PWGHF/D2H/Tasks/taskLc.cxx | 196 ++++++++++++++++++++++++++----------- 1 file changed, 137 insertions(+), 59 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 509f38e9fdf..adf03c98343 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -336,55 +336,126 @@ struct HfTaskLc { auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - auto fillHistogramsRecSig = [&](const std::string& signalFolder, const std::string& signalSuffix) { + /// MC reconstructed signal + if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { + registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPKPi(candidate), pt); + } + if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { + registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPiKP(candidate), pt); + } + registry.fill(HIST("MC/reconstructed/signal/hPtRecSig"), pt); + registry.fill(HIST("MC/reconstructed/signal/hPtRecProng0Sig"), ptProng0); + registry.fill(HIST("MC/reconstructed/signal/hPtRecProng1Sig"), ptProng1); + registry.fill(HIST("MC/reconstructed/signal/hPtRecProng2Sig"), ptProng2); + + registry.fill(HIST("MC/reconstructed/signal/hd0RecProng0Sig"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/signal/hd0RecProng1Sig"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/signal/hd0RecProng2Sig"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng0Sig"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng1Sig"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng2Sig"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/signal/hDecLengthRecSig"), decayLength); + registry.fill(HIST("MC/reconstructed/signal/hDecLengthVsPtRecSig"), decayLength, pt); + registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyRecSig"), decayLengthXY); + registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyVsPtRecSig"), decayLengthXY, pt); + registry.fill(HIST("MC/reconstructed/signal/hCtRecSig"), hfHelper.ctLc(candidate)); + registry.fill(HIST("MC/reconstructed/signal/hCtVsPtRecSig"), hfHelper.ctLc(candidate), pt); + registry.fill(HIST("MC/reconstructed/signal/hCPARecSig"), cpa); + registry.fill(HIST("MC/reconstructed/signal/hCPAVsPtRecSig"), cpa, pt); + registry.fill(HIST("MC/reconstructed/signal/hCPAxyRecSig"), cpaXY); + registry.fill(HIST("MC/reconstructed/signal/hCPAxyVsPtRecSig"), cpaXY, pt); + registry.fill(HIST("MC/reconstructed/signal/hDca2RecSig"), chi2PCA); + registry.fill(HIST("MC/reconstructed/signal/hDca2VsPtRecSig"), chi2PCA, pt); + registry.fill(HIST("MC/reconstructed/signal/hEtaRecSig"), candidate.eta()); + registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), pt); + registry.fill(HIST("MC/reconstructed/signal/hPhiRecSig"), candidate.phi()); + registry.fill(HIST("MC/reconstructed/signal/hPhiVsPtRecSig"), candidate.phi(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0Sig"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1Sig"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2Sig"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/signal/hDecLenErrSig"), candidate.errorDecayLength(), pt); + + /// reconstructed signal prompt + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPKPi(candidate), pt); + registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPKPi(candidate), pt); } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hMassVsPtRecSig" + signalSuffix).c_str()), hfHelper.invMassLcToPiKP(candidate), pt); + registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); } - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtRecSig" + signalSuffix).c_str()), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng0RecSig" + signalSuffix).c_str()), ptProng0); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng1RecSig" + signalSuffix).c_str()), ptProng1); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPtProng2RecSig" + signalSuffix).c_str()), ptProng2); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong0RecSig" + signalSuffix).c_str()), candidate.impactParameter0()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong1RecSig" + signalSuffix).c_str()), candidate.impactParameter1()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0Prong2RecSig" + signalSuffix).c_str()), candidate.impactParameter2()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng0RecSig" + signalSuffix).c_str()), candidate.impactParameter0(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng1RecSig" + signalSuffix).c_str()), candidate.impactParameter1(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hd0VsPtProng2RecSig" + signalSuffix).c_str()), candidate.impactParameter2(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthRecSig" + signalSuffix).c_str()), decayLength); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthVsPtRecSig" + signalSuffix).c_str()), decayLength, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyRecSig" + signalSuffix).c_str()), decayLengthXY); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLengthxyVsPtRecSig" + signalSuffix).c_str()), decayLengthXY, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtRecSig" + signalSuffix).c_str()), hfHelper.ctLc(candidate)); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCtVsPtRecSig" + signalSuffix).c_str()), hfHelper.ctLc(candidate), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPARecSig" + signalSuffix).c_str()), cpa); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAVsPtRecSig" + signalSuffix).c_str()), cpa, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyRecSig" + signalSuffix).c_str()), cpaXY); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hCPAxyVsPtRecSig" + signalSuffix).c_str()), cpaXY, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2RecSig" + signalSuffix).c_str()), chi2PCA); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDca2VsPtRecSig" + signalSuffix).c_str()), chi2PCA, pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaRecSig" + signalSuffix).c_str()), candidate.eta()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hEtaVsPtRecSig" + signalSuffix).c_str()), candidate.eta(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiRecSig" + signalSuffix).c_str()), candidate.phi()); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hPhiVsPtRecSig" + signalSuffix).c_str()), candidate.phi(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng0VsPtRecSig" + signalSuffix).c_str()), candidate.errorImpactParameter0(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng1VsPtRecSig" + signalSuffix).c_str()), candidate.errorImpactParameter1(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hImpParErrProng2VsPtRecSig" + signalSuffix).c_str()), candidate.errorImpactParameter2(), pt); - registry.fill(HIST(("MC/reconstructed/" + signalFolder + "/hDecLenErrVsPtRecSig" + signalSuffix).c_str()), candidate.errorDecayLength(), pt); - }; - - /// MC reconstructed signal - fillHistogramsRecSig("signal", ""); - /// reconstructed signal prompt - if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { - fillHistogramsRecSig("prompt", "Prompt"); - /// reconstructed signal nonprompt - } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { - fillHistogramsRecSig("nonprompt", "NonPrompt"); + registry.fill(HIST("MC/reconstructed/prompt/hPtRecSigPrompt"), pt); + registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng0SigPrompt"), ptProng0); + registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng1SigPrompt"), ptProng1); + registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng2SigPrompt"), ptProng2); + registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng0SigPrompt"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng1SigPrompt"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng2SigPrompt"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng0SigPrompt"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng1SigPrompt"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng2SigPrompt"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hDecLengthRecSigPrompt"), decayLength); + registry.fill(HIST("MC/reconstructed/prompt/hDecLengthVsPtRecSigPrompt"), decayLength, pt); + registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt"), decayLengthXY); + registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyVsPtRecSigPrompt"), decayLengthXY, pt); + registry.fill(HIST("MC/reconstructed/prompt/hCtRecSigPrompt"), hfHelper.ctLc(candidate)); + registry.fill(HIST("MC/reconstructed/prompt/hCtVsPtRecSigPrompt"), hfHelper.ctLc(candidate), pt); + registry.fill(HIST("MC/reconstructed/prompt/hCPARecSigPrompt"), cpa); + registry.fill(HIST("MC/reconstructed/prompt/hCPAVsPtRecSigPrompt"), cpa, pt); + registry.fill(HIST("MC/reconstructed/prompt/hCPAxyRecSigPrompt"), cpaXY); + registry.fill(HIST("MC/reconstructed/prompt/hCPAxyVsPtRecSigPrompt"), cpaXY, pt); + registry.fill(HIST("MC/reconstructed/prompt/hDca2RecSigPrompt"), chi2PCA); + registry.fill(HIST("MC/reconstructed/prompt/hDca2VsPtRecSigPrompt"), chi2PCA, pt); + registry.fill(HIST("MC/reconstructed/prompt/hEtaRecSigPrompt"), candidate.eta()); + registry.fill(HIST("MC/reconstructed/prompt/hEtaVsPtRecSigPrompt"), candidate.eta(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hPhiRecSigPrompt"), candidate.phi()); + registry.fill(HIST("MC/reconstructed/prompt/hPhiVsPtRecSigPrompt"), candidate.phi(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0SigPrompt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1SigPrompt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2SigPrompt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrSigPrompt"), candidate.errorDecayLength(), pt); + } else { + if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { + registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate), pt); + } + if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { + registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); + } + registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecSigNonPrompt"), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt"), ptProng0); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt"), ptProng1); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt"), ptProng2); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng0SigNonPrompt"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng1SigNonPrompt"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng2SigNonPrompt"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt"), decayLength); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthVsPtRecSigNonPrompt"), decayLength, pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt"), decayLengthXY); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyVsPtRecSigNonPrompt"), decayLengthXY, pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hCtRecSigNonPrompt"), hfHelper.ctLc(candidate)); + registry.fill(HIST("MC/reconstructed/nonprompt/hCtVsPtRecSigNonPrompt"), hfHelper.ctLc(candidate), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hCPARecSigNonPrompt"), cpa); + registry.fill(HIST("MC/reconstructed/nonprompt/hCPAVsPtRecSigNonPrompt"), cpa, pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt"), cpaXY); + registry.fill(HIST("MC/reconstructed/nonprompt/hCPAxyVsPtRecSigNonPrompt"), cpaXY, pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt"), chi2PCA); + registry.fill(HIST("MC/reconstructed/nonprompt/hDca2VsPtRecSigNonPrompt"), chi2PCA, pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt"), candidate.eta()); + registry.fill(HIST("MC/reconstructed/nonprompt/hEtaVsPtRecSigNonPrompt"), candidate.eta(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt"), candidate.phi()); + registry.fill(HIST("MC/reconstructed/nonprompt/hPhiVsPtRecSigNonPrompt"), candidate.phi(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0SigNonPrompt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1SigNonPrompt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2SigNonPrompt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrSigNonPrompt"), candidate.errorDecayLength(), pt); } if (fillTHn) { @@ -469,22 +540,16 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time - auto fillHistogramsGen = [&](const std::string& signalFolder, const std::string& signalSuffix) { - registry.fill(HIST(("MC/generated/" + signalFolder + "/hPtGen" + signalSuffix).c_str()), ptGen); - registry.fill(HIST(("MC/generated/" + signalFolder + "/hEtaGen" + signalSuffix).c_str()), particle.eta()); - registry.fill(HIST(("MC/generated/" + signalFolder + "/hYGen" + signalSuffix).c_str()), yGen); - registry.fill(HIST(("MC/generated/" + signalFolder + "/hPhiGen" + signalSuffix).c_str()), particle.phi()); - registry.fill(HIST(("MC/generated/" + signalFolder + "/hEtaVsPtGen" + signalSuffix).c_str()), particle.eta(), ptGen); - registry.fill(HIST(("MC/generated/" + signalFolder + "/hYVsPtGen" + signalSuffix).c_str()), yGen, ptGen); - registry.fill(HIST(("MC/generated/" + signalFolder + "/hPhiVsPtGen" + signalSuffix).c_str()), particle.phi(), ptGen); - }; - - fillHistogramsGen("signal", ""); + registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); + registry.fill(HIST("MC/generated/signal/hEtaGen"), particle.eta()); + registry.fill(HIST("MC/generated/signal/hYGen"), yGen); + registry.fill(HIST("MC/generated/signal/hPhiGen"), particle.phi()); + registry.fill(HIST("MC/generated/signal/hEtaVsPtGenSig"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/signal/hYVsPtGenSig"), yGen, ptGen); + registry.fill(HIST("MC/generated/signal/hPhiVsPtGenSig"), particle.phi(), ptGen); auto fillHistogramsAndTHnGen = [&](bool isPrompt) { ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); - const std::string signalFolder = isPrompt ? "prompt" : "nonprompt"; - const std::string signalSuffix = isPrompt ? "Prompt" : "NonPrompt"; if (fillTHn) { std::vector valuesToFill{ptGen, cent, yGen, static_cast(numPvContributors), ptGenB, static_cast(originType)}; @@ -496,13 +561,26 @@ struct HfTaskLc { } registry.get(HIST("hnLcVarsGen"))->Fill(valuesToFill.data()); } - fillHistogramsGen(signalFolder, signalSuffix); }; if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { fillHistogramsAndTHnGen(true); + registry.fill(HIST("MC/generated/prompt/hPtGenPrompt"), ptGen); + registry.fill(HIST("MC/generated/prompt/hEtaGenPrompt"), particle.eta()); + registry.fill(HIST("MC/generated/prompt/hYGenPrompt"), yGen); + registry.fill(HIST("MC/generated/prompt/hPhiGenPrompt"), particle.phi()); + registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenSigPrompt"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/prompt/hYVsPtGenSigPrompt"), yGen, ptGen); + registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenSigPrompt"), particle.phi(), ptGen); } else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { fillHistogramsAndTHnGen(false); + registry.fill(HIST("MC/generated/nonprompt/hPtGenNonPrompt"), ptGen); + registry.fill(HIST("MC/generated/nonprompt/hEtaGenNonPrompt"), particle.eta()); + registry.fill(HIST("MC/generated/nonprompt/hYGenNonPrompt"), yGen); + registry.fill(HIST("MC/generated/nonprompt/hPhiGenNonPrompt"), particle.phi()); + registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenSigNonPrompt"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenSigNonPrompt"), yGen, ptGen); + registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenSigNonPrompt"), particle.phi(), ptGen); } } } From c2029ee486dd2e18ba66cfd6052bbf56f6e59137 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Mon, 22 Sep 2025 13:27:53 +0200 Subject: [PATCH 10/21] rename some histograms for uniform naming --- PWGHF/D2H/Tasks/taskLc.cxx | 98 +++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index adf03c98343..7738c702fb6 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -346,16 +346,16 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPiKP(candidate), pt); } registry.fill(HIST("MC/reconstructed/signal/hPtRecSig"), pt); - registry.fill(HIST("MC/reconstructed/signal/hPtRecProng0Sig"), ptProng0); - registry.fill(HIST("MC/reconstructed/signal/hPtRecProng1Sig"), ptProng1); - registry.fill(HIST("MC/reconstructed/signal/hPtRecProng2Sig"), ptProng2); - - registry.fill(HIST("MC/reconstructed/signal/hd0RecProng0Sig"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/signal/hd0RecProng1Sig"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/signal/hd0RecProng2Sig"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng0Sig"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng1Sig"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtRecProng2Sig"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/signal/hPtProng0RecSig"), ptProng0); + registry.fill(HIST("MC/reconstructed/signal/hPtProng1RecSig"), ptProng1); + registry.fill(HIST("MC/reconstructed/signal/hPtProng2RecSig"), ptProng2); + + registry.fill(HIST("MC/reconstructed/signal/hd0Prong0RecSig"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/signal/hd0Prong1RecSig"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/signal/hd0Prong2RecSig"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng0RecSig"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng1RecSig"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng2RecSig"), candidate.impactParameter2(), pt); registry.fill(HIST("MC/reconstructed/signal/hDecLengthRecSig"), decayLength); registry.fill(HIST("MC/reconstructed/signal/hDecLengthVsPtRecSig"), decayLength, pt); registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyRecSig"), decayLengthXY); @@ -372,10 +372,10 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), pt); registry.fill(HIST("MC/reconstructed/signal/hPhiRecSig"), candidate.phi()); registry.fill(HIST("MC/reconstructed/signal/hPhiVsPtRecSig"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0Sig"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1Sig"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2Sig"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLenErrSig"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0VsPtRecSig"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1VsPtRecSig"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2VsPtRecSig"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/signal/hDecLenErrVsPtRecSig"), candidate.errorDecayLength(), pt); /// reconstructed signal prompt if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { @@ -388,15 +388,15 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); } registry.fill(HIST("MC/reconstructed/prompt/hPtRecSigPrompt"), pt); - registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng0SigPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng1SigPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/prompt/hPtRecProng2SigPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng0SigPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng1SigPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/prompt/hd0RecProng2SigPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng0SigPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng1SigPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtRecProng2SigPrompt"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hPtProng0RecSigPrompt"), ptProng0); + registry.fill(HIST("MC/reconstructed/prompt/hPtProng1RecSigPrompt"), ptProng1); + registry.fill(HIST("MC/reconstructed/prompt/hPtProng2RecSigPrompt"), ptProng2); + registry.fill(HIST("MC/reconstructed/prompt/hd0Prong0RecSigPrompt"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/prompt/hd0Prong1RecSigPrompt"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/prompt/hd0Prong2RecSigPrompt"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng0RecSigPrompt"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng1RecSigPrompt"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng2RecSigPrompt"), candidate.impactParameter2(), pt); registry.fill(HIST("MC/reconstructed/prompt/hDecLengthRecSigPrompt"), decayLength); registry.fill(HIST("MC/reconstructed/prompt/hDecLengthVsPtRecSigPrompt"), decayLength, pt); registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt"), decayLengthXY); @@ -413,10 +413,10 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/prompt/hEtaVsPtRecSigPrompt"), candidate.eta(), pt); registry.fill(HIST("MC/reconstructed/prompt/hPhiRecSigPrompt"), candidate.phi()); registry.fill(HIST("MC/reconstructed/prompt/hPhiVsPtRecSigPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0SigPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1SigPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2SigPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrSigPrompt"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0VsPtRecSigPrompt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1VsPtRecSigPrompt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2VsPtRecSigPrompt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrVsPtRecSigPrompt"), candidate.errorDecayLength(), pt); } else { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate)); @@ -427,15 +427,15 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); } registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecSigNonPrompt"), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng0SigNonPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng1SigNonPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecProng2SigNonPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng0SigNonPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng1SigNonPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0RecProng2SigNonPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng0SigNonPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng1SigNonPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtRecProng2SigNonPrompt"), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng0RecSigNonPrompt"), ptProng0); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng1RecSigNonPrompt"), ptProng1); + registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng2RecSigNonPrompt"), ptProng2); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong0RecSigNonPrompt"), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong1RecSigNonPrompt"), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong2RecSigNonPrompt"), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng0RecSigNonPrompt"), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng1RecSigNonPrompt"), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng2RecSigNonPrompt"), candidate.impactParameter2(), pt); registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt"), decayLength); registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthVsPtRecSigNonPrompt"), decayLength, pt); registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt"), decayLengthXY); @@ -452,10 +452,10 @@ struct HfTaskLc { registry.fill(HIST("MC/reconstructed/nonprompt/hEtaVsPtRecSigNonPrompt"), candidate.eta(), pt); registry.fill(HIST("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt"), candidate.phi()); registry.fill(HIST("MC/reconstructed/nonprompt/hPhiVsPtRecSigNonPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0SigNonPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1SigNonPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2SigNonPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrSigNonPrompt"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0VsPtRecSigNonPrompt"), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1VsPtRecSigNonPrompt"), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2VsPtRecSigNonPrompt"), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrVsPtRecSigNonPrompt"), candidate.errorDecayLength(), pt); } if (fillTHn) { @@ -544,9 +544,9 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/signal/hEtaGen"), particle.eta()); registry.fill(HIST("MC/generated/signal/hYGen"), yGen); registry.fill(HIST("MC/generated/signal/hPhiGen"), particle.phi()); - registry.fill(HIST("MC/generated/signal/hEtaVsPtGenSig"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/signal/hYVsPtGenSig"), yGen, ptGen); - registry.fill(HIST("MC/generated/signal/hPhiVsPtGenSig"), particle.phi(), ptGen); + registry.fill(HIST("MC/generated/signal/hEtaVsPtGen"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/signal/hYVsPtGen"), yGen, ptGen); + registry.fill(HIST("MC/generated/signal/hPhiVsPtGen"), particle.phi(), ptGen); auto fillHistogramsAndTHnGen = [&](bool isPrompt) { ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); @@ -569,18 +569,18 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/prompt/hEtaGenPrompt"), particle.eta()); registry.fill(HIST("MC/generated/prompt/hYGenPrompt"), yGen); registry.fill(HIST("MC/generated/prompt/hPhiGenPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenSigPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/prompt/hYVsPtGenSigPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenSigPrompt"), particle.phi(), ptGen); + registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenPrompt"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/prompt/hYVsPtGenPrompt"), yGen, ptGen); + registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenPrompt"), particle.phi(), ptGen); } else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { fillHistogramsAndTHnGen(false); registry.fill(HIST("MC/generated/nonprompt/hPtGenNonPrompt"), ptGen); registry.fill(HIST("MC/generated/nonprompt/hEtaGenNonPrompt"), particle.eta()); registry.fill(HIST("MC/generated/nonprompt/hYGenNonPrompt"), yGen); registry.fill(HIST("MC/generated/nonprompt/hPhiGenNonPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenSigNonPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenSigNonPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenSigNonPrompt"), particle.phi(), ptGen); + registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenNonPrompt"), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenNonPrompt"), yGen, ptGen); + registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenNonPrompt"), particle.phi(), ptGen); } } } From 478b8c52c185a9f3ba33cee6a414ba5a0bf0ed00 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Mon, 22 Sep 2025 15:13:45 +0200 Subject: [PATCH 11/21] pass compile-time strings into HIST using template lambdas --- PWGHF/D2H/Tasks/taskLc.cxx | 212 +++++++++++++------------------------ 1 file changed, 72 insertions(+), 140 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 7738c702fb6..3e0c433b2cd 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -78,6 +78,15 @@ struct HfTaskLc { NumberOfMlClasses }; + enum SignalClasses : int { + Signal = 0, + Prompt, + NonPrompt + }; + + constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; + constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; + HfHelper hfHelper; SliceCache cache; @@ -336,126 +345,57 @@ struct HfTaskLc { auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - /// MC reconstructed signal - if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPKPi(candidate), pt); - } - if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/signal/hMassRecSig"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/signal/hMassVsPtRecSig"), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/signal/hPtRecSig"), pt); - registry.fill(HIST("MC/reconstructed/signal/hPtProng0RecSig"), ptProng0); - registry.fill(HIST("MC/reconstructed/signal/hPtProng1RecSig"), ptProng1); - registry.fill(HIST("MC/reconstructed/signal/hPtProng2RecSig"), ptProng2); - - registry.fill(HIST("MC/reconstructed/signal/hd0Prong0RecSig"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/signal/hd0Prong1RecSig"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/signal/hd0Prong2RecSig"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng0RecSig"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng1RecSig"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hd0VsPtProng2RecSig"), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthRecSig"), decayLength); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthVsPtRecSig"), decayLength, pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyRecSig"), decayLengthXY); - registry.fill(HIST("MC/reconstructed/signal/hDecLengthxyVsPtRecSig"), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/signal/hCtRecSig"), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/signal/hCtVsPtRecSig"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/signal/hCPARecSig"), cpa); - registry.fill(HIST("MC/reconstructed/signal/hCPAVsPtRecSig"), cpa, pt); - registry.fill(HIST("MC/reconstructed/signal/hCPAxyRecSig"), cpaXY); - registry.fill(HIST("MC/reconstructed/signal/hCPAxyVsPtRecSig"), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/signal/hDca2RecSig"), chi2PCA); - registry.fill(HIST("MC/reconstructed/signal/hDca2VsPtRecSig"), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/signal/hEtaRecSig"), candidate.eta()); - registry.fill(HIST("MC/reconstructed/signal/hEtaVsPtRecSig"), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/signal/hPhiRecSig"), candidate.phi()); - registry.fill(HIST("MC/reconstructed/signal/hPhiVsPtRecSig"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng0VsPtRecSig"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng1VsPtRecSig"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/signal/hImpParErrProng2VsPtRecSig"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/signal/hDecLenErrVsPtRecSig"), candidate.errorDecayLength(), pt); - - /// reconstructed signal prompt - if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + auto fillHistogramsRec = [&]() { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPKPi(candidate), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), pt); } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/prompt/hMassRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/prompt/hMassVsPtRecSigPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/prompt/hPtRecSigPrompt"), pt); - registry.fill(HIST("MC/reconstructed/prompt/hPtProng0RecSigPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/prompt/hPtProng1RecSigPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/prompt/hPtProng2RecSigPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/prompt/hd0Prong0RecSigPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/prompt/hd0Prong1RecSigPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/prompt/hd0Prong2RecSigPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng0RecSigPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng1RecSigPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hd0VsPtProng2RecSigPrompt"), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthRecSigPrompt"), decayLength); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthVsPtRecSigPrompt"), decayLength, pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyRecSigPrompt"), decayLengthXY); - registry.fill(HIST("MC/reconstructed/prompt/hDecLengthxyVsPtRecSigPrompt"), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/prompt/hCtRecSigPrompt"), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/prompt/hCtVsPtRecSigPrompt"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/prompt/hCPARecSigPrompt"), cpa); - registry.fill(HIST("MC/reconstructed/prompt/hCPAVsPtRecSigPrompt"), cpa, pt); - registry.fill(HIST("MC/reconstructed/prompt/hCPAxyRecSigPrompt"), cpaXY); - registry.fill(HIST("MC/reconstructed/prompt/hCPAxyVsPtRecSigPrompt"), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/prompt/hDca2RecSigPrompt"), chi2PCA); - registry.fill(HIST("MC/reconstructed/prompt/hDca2VsPtRecSigPrompt"), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/prompt/hEtaRecSigPrompt"), candidate.eta()); - registry.fill(HIST("MC/reconstructed/prompt/hEtaVsPtRecSigPrompt"), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hPhiRecSigPrompt"), candidate.phi()); - registry.fill(HIST("MC/reconstructed/prompt/hPhiVsPtRecSigPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng0VsPtRecSigPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng1VsPtRecSigPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hImpParErrProng2VsPtRecSigPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/prompt/hDecLenErrVsPtRecSigPrompt"), candidate.errorDecayLength(), pt); - } else { - if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPKPi(candidate), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate), pt); } - if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/nonprompt/hMassRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/nonprompt/hMassVsPtRecSigNonPrompt"), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/nonprompt/hPtRecSigNonPrompt"), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng0RecSigNonPrompt"), ptProng0); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng1RecSigNonPrompt"), ptProng1); - registry.fill(HIST("MC/reconstructed/nonprompt/hPtProng2RecSigNonPrompt"), ptProng2); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong0RecSigNonPrompt"), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong1RecSigNonPrompt"), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0Prong2RecSigNonPrompt"), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng0RecSigNonPrompt"), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng1RecSigNonPrompt"), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hd0VsPtProng2RecSigNonPrompt"), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthRecSigNonPrompt"), decayLength); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthVsPtRecSigNonPrompt"), decayLength, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyRecSigNonPrompt"), decayLengthXY); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLengthxyVsPtRecSigNonPrompt"), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hCtRecSigNonPrompt"), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/nonprompt/hCtVsPtRecSigNonPrompt"), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPARecSigNonPrompt"), cpa); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPAVsPtRecSigNonPrompt"), cpa, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPAxyRecSigNonPrompt"), cpaXY); - registry.fill(HIST("MC/reconstructed/nonprompt/hCPAxyVsPtRecSigNonPrompt"), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDca2RecSigNonPrompt"), chi2PCA); - registry.fill(HIST("MC/reconstructed/nonprompt/hDca2VsPtRecSigNonPrompt"), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hEtaRecSigNonPrompt"), candidate.eta()); - registry.fill(HIST("MC/reconstructed/nonprompt/hEtaVsPtRecSigNonPrompt"), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hPhiRecSigNonPrompt"), candidate.phi()); - registry.fill(HIST("MC/reconstructed/nonprompt/hPhiVsPtRecSigNonPrompt"), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng0VsPtRecSigNonPrompt"), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng1VsPtRecSigNonPrompt"), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hImpParErrProng2VsPtRecSigNonPrompt"), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/nonprompt/hDecLenErrVsPtRecSigNonPrompt"), candidate.errorDecayLength(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtRecSig") + HIST(SignalSuffixes[signalType]), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng0RecSig") + HIST(SignalSuffixes[signalType]), ptProng0); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng1RecSig") + HIST(SignalSuffixes[signalType]), ptProng1); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng2RecSig") + HIST(SignalSuffixes[signalType]), ptProng2); + + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthRecSig") + HIST(SignalSuffixes[signalType]), decayLength); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthVsPtRecSig") + HIST(SignalSuffixes[signalType]), decayLength, pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyRecSig") + HIST(SignalSuffixes[signalType]), decayLengthXY); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), decayLengthXY, pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPARecSig") + HIST(SignalSuffixes[signalType]), cpa); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAVsPtRecSig") + HIST(SignalSuffixes[signalType]), cpa, pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyRecSig") + HIST(SignalSuffixes[signalType]), cpaXY); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), cpaXY, pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2RecSig") + HIST(SignalSuffixes[signalType]), chi2PCA); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2VsPtRecSig") + HIST(SignalSuffixes[signalType]), chi2PCA, pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng0VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter0(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng1VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter1(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng2VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter2(), pt); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLenErrVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorDecayLength(), pt); + }; + + /// MC reconstructed signal + fillHistogramsRec.template operator()(); + + /// reconstructed signal prompt + if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { + fillHistogramsRec.template operator()(); + /// reconstructed signal nonprompt + } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { + fillHistogramsRec.template operator()(); } if (fillTHn) { @@ -540,15 +480,19 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time - registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); - registry.fill(HIST("MC/generated/signal/hEtaGen"), particle.eta()); - registry.fill(HIST("MC/generated/signal/hYGen"), yGen); - registry.fill(HIST("MC/generated/signal/hPhiGen"), particle.phi()); - registry.fill(HIST("MC/generated/signal/hEtaVsPtGen"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/signal/hYVsPtGen"), yGen, ptGen); - registry.fill(HIST("MC/generated/signal/hPhiVsPtGen"), particle.phi(), ptGen); + auto fillHistogramsGen = [&]() { + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), ptGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), yGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiGen") + HIST(SignalSuffixes[signalType]), particle.phi()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtGen") + HIST(SignalSuffixes[signalType]), particle.eta(), ptGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYVsPtGen") + HIST(SignalSuffixes[signalType]), yGen, ptGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtGen") + HIST(SignalSuffixes[signalType]), particle.phi(), ptGen); + }; + + fillHistogramsGen.template operator()(); - auto fillHistogramsAndTHnGen = [&](bool isPrompt) { + auto fillTHnGen = [&](bool isPrompt) { ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); if (fillTHn) { @@ -564,23 +508,11 @@ struct HfTaskLc { }; if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { - fillHistogramsAndTHnGen(true); - registry.fill(HIST("MC/generated/prompt/hPtGenPrompt"), ptGen); - registry.fill(HIST("MC/generated/prompt/hEtaGenPrompt"), particle.eta()); - registry.fill(HIST("MC/generated/prompt/hYGenPrompt"), yGen); - registry.fill(HIST("MC/generated/prompt/hPhiGenPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/prompt/hEtaVsPtGenPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/prompt/hYVsPtGenPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/prompt/hPhiVsPtGenPrompt"), particle.phi(), ptGen); + fillTHnGen(true); + fillHistogramsGen.template operator()(); } else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { - fillHistogramsAndTHnGen(false); - registry.fill(HIST("MC/generated/nonprompt/hPtGenNonPrompt"), ptGen); - registry.fill(HIST("MC/generated/nonprompt/hEtaGenNonPrompt"), particle.eta()); - registry.fill(HIST("MC/generated/nonprompt/hYGenNonPrompt"), yGen); - registry.fill(HIST("MC/generated/nonprompt/hPhiGenNonPrompt"), particle.phi()); - registry.fill(HIST("MC/generated/nonprompt/hEtaVsPtGenNonPrompt"), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/nonprompt/hYVsPtGenNonPrompt"), yGen, ptGen); - registry.fill(HIST("MC/generated/nonprompt/hPhiVsPtGenNonPrompt"), particle.phi(), ptGen); + fillTHnGen(false); + fillHistogramsGen.template operator()(); } } } From 79d5215943c2d4ec61ed665d57c04e33e8ab1384 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Thu, 25 Sep 2025 21:20:38 +0200 Subject: [PATCH 12/21] test various concatenations of the HIST macro --- PWGHF/D2H/Tasks/taskLc.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 3e0c433b2cd..bc1d23fad66 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -480,6 +480,18 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time + // ============================ for debug purposes only ============================ + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[Signal]) + HIST("/hPtGen") + HIST(SignalSuffixes[Signal]), ptGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[0]) + HIST("/hPtGen") + HIST(SignalSuffixes[0]), ptGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[0]) + HIST("/hPtGen"), ptGen); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[0]) + HIST("/hPtGen") + HIST(""), ptGen); + registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen") + HIST(""), ptGen); + registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen") + HIST(SignalSuffixes[0]), ptGen); + registry.fill(HIST("MC/generated/signal/hPtGen") + HIST(SignalSuffixes[0]), ptGen); + registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen"), ptGen); + registry.fill(HIST("MC/generated/signal") + HIST("/hPtGen"), ptGen); + // ================================================================================= + auto fillHistogramsGen = [&]() { registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), ptGen); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); From af33a3dd8a12c7c674390102adca8e9eab0f717f Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Wed, 1 Oct 2025 16:10:59 +0200 Subject: [PATCH 13/21] mv static strings from struct members into functions --- PWGHF/D2H/Tasks/taskLc.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index bc1d23fad66..5fbd647ab85 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -84,9 +84,6 @@ struct HfTaskLc { NonPrompt }; - constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; - constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; - HfHelper hfHelper; SliceCache cache; @@ -310,6 +307,8 @@ struct HfTaskLc { template void fillHistosMcRec(CollType const& collision, CandLcMcRec const& candidates, CandLcMcGen const& mcParticles) { + static constexpr std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; + static constexpr std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; auto thisCollId = collision.globalIndex(); auto groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); @@ -454,6 +453,8 @@ struct HfTaskLc { template void fillHistosMcGen(CandLcMcGen const& mcParticles, Coll const& recoCollisions) { + static constexpr std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; + static constexpr std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { From c55a26c6180d524357872b7a1f13586cdcd44bbf Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Wed, 1 Oct 2025 16:20:58 +0200 Subject: [PATCH 14/21] dummy commit to re-initiate build check --- PWGHF/D2H/Tasks/taskLc.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 5fbd647ab85..ef3adc6e2b5 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -491,6 +491,7 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/signal/hPtGen") + HIST(SignalSuffixes[0]), ptGen); registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen"), ptGen); registry.fill(HIST("MC/generated/signal") + HIST("/hPtGen"), ptGen); + registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); // ================================================================================= auto fillHistogramsGen = [&]() { From 26da94696cdabb448d6366d69a8266e3d446ab6c Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Wed, 1 Oct 2025 17:23:36 +0200 Subject: [PATCH 15/21] capture SignalFolders, SignalSuffixes by value --- PWGHF/D2H/Tasks/taskLc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ef3adc6e2b5..7b6c354d85e 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -344,7 +344,7 @@ struct HfTaskLc { auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - auto fillHistogramsRec = [&]() { + auto fillHistogramsRec = [&, SignalFolders, SignalSuffixes]() { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), pt); @@ -494,7 +494,7 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); // ================================================================================= - auto fillHistogramsGen = [&]() { + auto fillHistogramsGen = [&, SignalFolders, SignalSuffixes]() { registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), ptGen); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), yGen); From 054aa99c99679da14b88d653d65e8a19ee35e913 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Wed, 1 Oct 2025 21:50:23 +0200 Subject: [PATCH 16/21] Revert last 4 commits (switch to 478b8c52c185a9f3ba33cee6a414ba5a0bf0ed00) --- PWGHF/D2H/Tasks/taskLc.cxx | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 7b6c354d85e..3e0c433b2cd 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -84,6 +84,9 @@ struct HfTaskLc { NonPrompt }; + constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; + constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; + HfHelper hfHelper; SliceCache cache; @@ -307,8 +310,6 @@ struct HfTaskLc { template void fillHistosMcRec(CollType const& collision, CandLcMcRec const& candidates, CandLcMcGen const& mcParticles) { - static constexpr std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; - static constexpr std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; auto thisCollId = collision.globalIndex(); auto groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); @@ -344,7 +345,7 @@ struct HfTaskLc { auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - auto fillHistogramsRec = [&, SignalFolders, SignalSuffixes]() { + auto fillHistogramsRec = [&]() { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), pt); @@ -453,8 +454,6 @@ struct HfTaskLc { template void fillHistosMcGen(CandLcMcGen const& mcParticles, Coll const& recoCollisions) { - static constexpr std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; - static constexpr std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; // MC gen. for (const auto& particle : mcParticles) { if (std::abs(particle.flagMcMatchGen()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { @@ -481,20 +480,7 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time - // ============================ for debug purposes only ============================ - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[Signal]) + HIST("/hPtGen") + HIST(SignalSuffixes[Signal]), ptGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[0]) + HIST("/hPtGen") + HIST(SignalSuffixes[0]), ptGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[0]) + HIST("/hPtGen"), ptGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[0]) + HIST("/hPtGen") + HIST(""), ptGen); - registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen") + HIST(""), ptGen); - registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen") + HIST(SignalSuffixes[0]), ptGen); - registry.fill(HIST("MC/generated/signal/hPtGen") + HIST(SignalSuffixes[0]), ptGen); - registry.fill(HIST("MC/generated/") + HIST("signal") + HIST("/hPtGen"), ptGen); - registry.fill(HIST("MC/generated/signal") + HIST("/hPtGen"), ptGen); - registry.fill(HIST("MC/generated/signal/hPtGen"), ptGen); - // ================================================================================= - - auto fillHistogramsGen = [&, SignalFolders, SignalSuffixes]() { + auto fillHistogramsGen = [&]() { registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), ptGen); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), yGen); From 4ae7350dc7fe459bb7083862dc82c6559baeaf9c Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Thu, 2 Oct 2025 00:27:09 +0200 Subject: [PATCH 17/21] do not capture 'this' by reference --- PWGHF/D2H/Tasks/taskLc.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 3e0c433b2cd..1967650660b 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -345,7 +345,7 @@ struct HfTaskLc { auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - auto fillHistogramsRec = [&]() { + auto fillHistogramsRec = [&candidate, pdgCodeProng0, pt, ptProng0, ptProng1, ptProng2, decayLength, decayLengthXY, chi2PCA, cpa, cpaXY](HistogramRegistry& registry, HfHelper& hfHelper, int selectionFlagLc) { if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), pt); @@ -388,14 +388,14 @@ struct HfTaskLc { }; /// MC reconstructed signal - fillHistogramsRec.template operator()(); + fillHistogramsRec.template operator()(registry, hfHelper, selectionFlagLc); /// reconstructed signal prompt if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { - fillHistogramsRec.template operator()(); + fillHistogramsRec.template operator()(registry, hfHelper, selectionFlagLc); /// reconstructed signal nonprompt } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { - fillHistogramsRec.template operator()(); + fillHistogramsRec.template operator()(registry, hfHelper, selectionFlagLc); } if (fillTHn) { @@ -480,7 +480,7 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time - auto fillHistogramsGen = [&]() { + auto fillHistogramsGen = [&particle, ptGen, yGen](HistogramRegistry& registry) { registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), ptGen); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), yGen); @@ -490,7 +490,7 @@ struct HfTaskLc { registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtGen") + HIST(SignalSuffixes[signalType]), particle.phi(), ptGen); }; - fillHistogramsGen.template operator()(); + fillHistogramsGen.template operator()(registry); auto fillTHnGen = [&](bool isPrompt) { ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); @@ -509,10 +509,10 @@ struct HfTaskLc { if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { fillTHnGen(true); - fillHistogramsGen.template operator()(); + fillHistogramsGen.template operator()(registry); } else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { fillTHnGen(false); - fillHistogramsGen.template operator()(); + fillHistogramsGen.template operator()(registry); } } } From 2b8b90fbaaaddf5aec26bc17079f41649b0d1cc9 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Thu, 2 Oct 2025 17:16:42 +0200 Subject: [PATCH 18/21] rewrite lambda-functions with HIST macro as usual functions --- PWGHF/D2H/Tasks/taskLc.cxx | 138 ++++++++++++++++++++----------------- 1 file changed, 73 insertions(+), 65 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 1967650660b..6573823f237 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -71,6 +71,9 @@ struct HfTaskLc { constexpr static float CtToProperLifetimePs = 1.f / o2::constants::physics::LightSpeedCm2PS; constexpr static float NanoToPico = 1000.f; + constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; + constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; + enum MlClasses : int { MlClassBackground = 0, MlClassPrompt, @@ -84,9 +87,6 @@ struct HfTaskLc { NonPrompt }; - constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; - constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; - HfHelper hfHelper; SliceCache cache; @@ -305,12 +305,60 @@ struct HfTaskLc { return o2::hf_centrality::getCentralityColl(collision); } + /// Helper function for filling MC reconstructed histograms for prompt, nonpromt and common (signal) + /// \param candidate is a reconstructed candidate + /// \tparam signalType is an enum defining which histogram in which folder (signal, prompt or nonpromt) to fill + template + void fillHistogramsRecSig(CandidateType const& candidate) + { + const auto& mcParticleProng0 = candidate.template prong0_as().template mcParticle_as>(); + const auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); + if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), candidate.pt()); + } + if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate), candidate.pt()); + } + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng0RecSig") + HIST(SignalSuffixes[signalType]), candidate.ptProng0()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng1RecSig") + HIST(SignalSuffixes[signalType]), candidate.ptProng1()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng2RecSig") + HIST(SignalSuffixes[signalType]), candidate.ptProng2()); + + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLength()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLengthXY()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPARecSig") + HIST(SignalSuffixes[signalType]), candidate.cpa()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.cpa(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyRecSig") + HIST(SignalSuffixes[signalType]), candidate.cpaXY()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.cpaXY(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2RecSig") + HIST(SignalSuffixes[signalType]), candidate.chi2PCA()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.chi2PCA(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng0VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng1VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng2VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter2(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLenErrVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorDecayLength(), candidate.pt()); + } + /// Fill MC histograms at reconstruction level /// \tparam fillMl switch to fill ML histograms template void fillHistosMcRec(CollType const& collision, CandLcMcRec const& candidates, CandLcMcGen const& mcParticles) { - auto thisCollId = collision.globalIndex(); auto groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); @@ -337,65 +385,21 @@ struct HfTaskLc { auto ptProng1 = candidate.ptProng1(); auto ptProng2 = candidate.ptProng2(); auto decayLength = candidate.decayLength(); - auto decayLengthXY = candidate.decayLengthXY(); auto chi2PCA = candidate.chi2PCA(); auto cpa = candidate.cpa(); - auto cpaXY = candidate.cpaXY(); auto originType = candidate.originMcRec(); auto numPvContributors = collision.numContrib(); auto ptRecB = candidate.ptBhadMotherPart(); - auto fillHistogramsRec = [&candidate, pdgCodeProng0, pt, ptProng0, ptProng1, ptProng2, decayLength, decayLengthXY, chi2PCA, cpa, cpaXY](HistogramRegistry& registry, HfHelper& hfHelper, int selectionFlagLc) { - if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), pt); - } - if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate), pt); - } - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtRecSig") + HIST(SignalSuffixes[signalType]), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng0RecSig") + HIST(SignalSuffixes[signalType]), ptProng0); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng1RecSig") + HIST(SignalSuffixes[signalType]), ptProng1); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng2RecSig") + HIST(SignalSuffixes[signalType]), ptProng2); - - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthRecSig") + HIST(SignalSuffixes[signalType]), decayLength); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthVsPtRecSig") + HIST(SignalSuffixes[signalType]), decayLength, pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyRecSig") + HIST(SignalSuffixes[signalType]), decayLengthXY); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), decayLengthXY, pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPARecSig") + HIST(SignalSuffixes[signalType]), cpa); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAVsPtRecSig") + HIST(SignalSuffixes[signalType]), cpa, pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyRecSig") + HIST(SignalSuffixes[signalType]), cpaXY); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), cpaXY, pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2RecSig") + HIST(SignalSuffixes[signalType]), chi2PCA); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2VsPtRecSig") + HIST(SignalSuffixes[signalType]), chi2PCA, pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng0VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter0(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng1VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter1(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng2VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter2(), pt); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLenErrVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorDecayLength(), pt); - }; - /// MC reconstructed signal - fillHistogramsRec.template operator()(registry, hfHelper, selectionFlagLc); + fillHistogramsRecSig(candidate); /// reconstructed signal prompt if (candidate.originMcRec() == RecoDecay::OriginType::Prompt) { - fillHistogramsRec.template operator()(registry, hfHelper, selectionFlagLc); + fillHistogramsRecSig(candidate); /// reconstructed signal nonprompt } else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { - fillHistogramsRec.template operator()(registry, hfHelper, selectionFlagLc); + fillHistogramsRecSig(candidate); } if (fillTHn) { @@ -449,8 +453,22 @@ struct HfTaskLc { } } + /// Helper function for filling MC generated histograms for prompt, nonpromt and common (signal) + /// \param particle is a generated particle + /// \tparam signalType is an enum defining which histogram in which folder (signal, prompt or nonpromt) to fill + template + void fillHistogramsGen(ParticleType const& particle) + { + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiGen") + HIST(SignalSuffixes[signalType]), particle.phi()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtGen") + HIST(SignalSuffixes[signalType]), particle.eta(), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYVsPtGen") + HIST(SignalSuffixes[signalType]), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtGen") + HIST(SignalSuffixes[signalType]), particle.phi(), particle.pt()); + } + /// Fill MC histograms at generated level - /// \tparam fillMl switch to fill ML histograms template void fillHistosMcGen(CandLcMcGen const& mcParticles, Coll const& recoCollisions) { @@ -480,17 +498,7 @@ struct HfTaskLc { const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time - auto fillHistogramsGen = [&particle, ptGen, yGen](HistogramRegistry& registry) { - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), ptGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), yGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiGen") + HIST(SignalSuffixes[signalType]), particle.phi()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtGen") + HIST(SignalSuffixes[signalType]), particle.eta(), ptGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYVsPtGen") + HIST(SignalSuffixes[signalType]), yGen, ptGen); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtGen") + HIST(SignalSuffixes[signalType]), particle.phi(), ptGen); - }; - - fillHistogramsGen.template operator()(registry); + fillHistogramsGen(particle); auto fillTHnGen = [&](bool isPrompt) { ptGenB = isPrompt ? -1. : mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); @@ -509,10 +517,10 @@ struct HfTaskLc { if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { fillTHnGen(true); - fillHistogramsGen.template operator()(registry); + fillHistogramsGen(particle); } else if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { fillTHnGen(false); - fillHistogramsGen.template operator()(registry); + fillHistogramsGen(particle); } } } From 70c79cbd59260052d86997453a2da4fefce50d16 Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Fri, 10 Oct 2025 17:37:45 +0200 Subject: [PATCH 19/21] create MC and Data directories only when needed --- PWGHF/D2H/Tasks/taskLc.cxx | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index f3da3c3cacd..40b4bd1ec59 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -133,17 +133,24 @@ struct HfTaskLc { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } + const bool isData = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M || doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M; + auto addHistogramsRec = [&](const std::string& histoName, const std::string& xAxisTitle, const std::string& yAxisTitle, const HistogramConfigSpec& configSpec) { - registry.add(("Data/" + histoName).c_str(), ("3-prong candidates;" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); - registry.add(("MC/reconstructed/signal/" + histoName + "RecSig").c_str(), ("3-prong candidates (matched);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); - registry.add(("MC/reconstructed/prompt/" + histoName + "RecSigPrompt").c_str(), ("3-prong candidates (matched, prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); - registry.add(("MC/reconstructed/nonprompt/" + histoName + "RecSigNonPrompt").c_str(), ("3-prong candidates (matched, non-prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + if (isData) { + registry.add(("Data/" + histoName).c_str(), ("3-prong candidates;" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + } else { + registry.add(("MC/reconstructed/signal/" + histoName + "RecSig").c_str(), ("3-prong candidates (matched);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/reconstructed/prompt/" + histoName + "RecSigPrompt").c_str(), ("3-prong candidates (matched, prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/reconstructed/nonprompt/" + histoName + "RecSigNonPrompt").c_str(), ("3-prong candidates (matched, non-prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + } }; auto addHistogramsGen = [&](const std::string& histoName, const std::string& xAxisTitle, const std::string& yAxisTitle, const HistogramConfigSpec& configSpec) { - registry.add(("MC/generated/signal/" + histoName + "Gen").c_str(), ("MC particles (matched);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); - registry.add(("MC/generated/prompt/" + histoName + "GenPrompt").c_str(), ("MC particles (matched, prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); - registry.add(("MC/generated/nonprompt/" + histoName + "GenNonPrompt").c_str(), ("MC particles (matched, non-prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + if (!isData) { + registry.add(("MC/generated/signal/" + histoName + "Gen").c_str(), ("MC particles (matched);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/generated/prompt/" + histoName + "GenPrompt").c_str(), ("MC particles (matched, prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + registry.add(("MC/generated/nonprompt/" + histoName + "GenNonPrompt").c_str(), ("MC particles (matched, non-prompt);" + xAxisTitle + ";" + yAxisTitle).c_str(), configSpec); + } }; /// mass candidate @@ -151,7 +158,9 @@ struct HfTaskLc { /// pT addHistogramsRec("hPt", "#it{p}_{T}^{rec.} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsGen("hPt", "#it{p}_{T}^{gen.} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); - registry.add("MC/generated/signal/hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + if (!isData) { + registry.add("MC/generated/signal/hPtGenSig", "3-prong candidates (matched);#it{p}_{T}^{gen.} (GeV/#it{c});entries", {HistType::kTH1F, {{360, 0., 36.}}}); + } addHistogramsRec("hPtProng0", "prong 0 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsRec("hPtProng1", "prong 1 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); addHistogramsRec("hPtProng2", "prong 2 #it{p}_{T} (GeV/#it{c})", "entries", {HistType::kTH1F, {{360, 0., 36.}}}); @@ -181,7 +190,9 @@ struct HfTaskLc { auto vbins = (std::vector)binsPt; /// mass candidate - registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); + if (isData) { + registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}}); + } addHistogramsRec("hMassVsPt", "inv. mass (p K #pi) (GeV/#it{c}^{2})", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins}}}); /// DCAxy to prim. vertex prongs addHistogramsRec("hd0VsPtProng0", "prong 0 DCAxy to prim. vertex (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{600, -0.4, 0.4}, {vbins}}}); From 6098733470ba87e4a19bfc316e7b8c0d827329de Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Fri, 10 Oct 2025 19:35:51 +0200 Subject: [PATCH 20/21] adapt to https://github.com/AliceO2Group/O2Physics/pull/13328 and https://github.com/AliceO2Group/O2Physics/pull/13330 add const and const& add author --- PWGHF/D2H/Tasks/taskLc.cxx | 90 ++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ac062b49724..7a60399681e 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -18,6 +18,7 @@ /// \author Annalena Kalteyer , GSI Darmstadt /// \author Biao Zhang , Heidelberg University /// \author Ran Tu , Fudan University +/// \author Oleksii Lubynets , Heidelberg University, GSI Darmstadt #include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannels.h" @@ -145,12 +146,13 @@ struct HfTaskLc { void init(InitContext&) { - std::array doprocess{doprocessDataStd, doprocessDataStdWithFT0C, doprocessDataStdWithFT0M, doprocessDataWithMl, doprocessDataWithMlWithFT0C, doprocessDataWithMlWithFT0M, doprocessMcStd, doprocessMcStdWithFT0C, doprocessMcStdWithFT0M, doprocessMcWithMl, doprocessMcWithMlWithFT0C, doprocessMcWithMlWithFT0M, doprocessDataWithMlWithUpc, doprocessDataStdWithUpc}; + const std::array doprocess{doprocessDataStd, doprocessDataStdWithFT0C, doprocessDataStdWithFT0M, doprocessDataWithMl, doprocessDataWithMlWithFT0C, doprocessDataWithMlWithFT0M, doprocessDataWithMlWithUpc, doprocessMcStd, doprocessMcStdWithFT0C, doprocessMcStdWithFT0M, doprocessMcWithMl, doprocessMcWithMlWithFT0C, doprocessMcWithMlWithFT0M, doprocessDataStdWithUpc}; if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) { LOGP(fatal, "no or more than one process function enabled! Please check your configuration!"); } - const bool isData = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M || doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M; + const bool isData = doprocessDataStd || doprocessDataStdWithFT0C || doprocessDataStdWithFT0M || doprocessDataWithMl || doprocessDataWithMlWithFT0C || doprocessDataWithMlWithFT0M || doprocessDataWithMlWithUpc; + const bool isUpc = doprocessDataWithMlWithUpc || doprocessDataStdWithUpc; auto addHistogramsRec = [&](const std::string& histoName, const std::string& xAxisTitle, const std::string& yAxisTitle, const HistogramConfigSpec& configSpec) { if (isData) { @@ -253,12 +255,14 @@ struct HfTaskLc { /// decay length error addHistogramsRec("hDecLenErrVsPt", "decay length error (cm)", "#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 1.}, {vbins}}}); - qaRegistry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); - qaRegistry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 20}, {200, 0., 20}}}); - qaRegistry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{3, -0.5, 2.5}}}); - qaRegistry.get(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast(GapType::GapA) + 1, "A"); - qaRegistry.get(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast(GapType::GapC) + 1, "C"); - qaRegistry.get(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast(GapType::DoubleGap) + 1, "Double"); + if (isUpc) { + qaRegistry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); + qaRegistry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 20}, {200, 0., 20}}}); + qaRegistry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{3, -0.5, 2.5}}}); + qaRegistry.get(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast(GapType::GapA) + 1, "A"); + qaRegistry.get(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast(GapType::GapC) + 1, "C"); + qaRegistry.get(HIST("Data/hUpcGapAfterSelection"))->GetXaxis()->SetBinLabel(static_cast(GapType::DoubleGap) + 1, "Double"); + } if (fillTHn) { const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; const AxisSpec thnAxisPt{thnConfigAxisPt, "#it{p}_{T}(#Lambda_{c}^{+}) (GeV/#it{c})"}; @@ -330,7 +334,9 @@ struct HfTaskLc { } } - hfEvSel.addHistograms(qaRegistry); // collision monitoring + if (isUpc) { + hfEvSel.addHistograms(qaRegistry); // collision monitoring + } ccdb->setURL(ccdbUrl); ccdb->setCaching(true); @@ -400,8 +406,8 @@ struct HfTaskLc { template void fillHistosMcRec(CollType const& collision, CandLcMcRec const& candidates, CandLcMcGen const& mcParticles) { - auto thisCollId = collision.globalIndex(); - auto groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); + const auto thisCollId = collision.globalIndex(); + const auto& groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); for (const auto& candidate : groupedLcCandidates) { /// Select Lc @@ -415,22 +421,22 @@ struct HfTaskLc { if (std::abs(candidate.flagMcMatchRec()) == hf_decay::hf_cand_3prong::DecayChannelMain::LcToPKPi) { // Get the corresponding MC particle. - auto mcParticleProng0 = candidate.template prong0_as().template mcParticle_as>(); - auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); - auto indexMother = RecoDecay::getMother(mcParticles, mcParticleProng0, o2::constants::physics::Pdg::kLambdaCPlus, true); - auto particleMother = mcParticles.rawIteratorAt(indexMother); + const auto& mcParticleProng0 = candidate.template prong0_as().template mcParticle_as>(); + const auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); + const auto indexMother = RecoDecay::getMother(mcParticles, mcParticleProng0, o2::constants::physics::Pdg::kLambdaCPlus, true); + const auto particleMother = mcParticles.rawIteratorAt(indexMother); registry.fill(HIST("MC/generated/signal/hPtGenSig"), particleMother.pt()); // gen. level pT - auto pt = candidate.pt(); - auto ptProng0 = candidate.ptProng0(); - auto ptProng1 = candidate.ptProng1(); - auto ptProng2 = candidate.ptProng2(); - auto decayLength = candidate.decayLength(); - auto chi2PCA = candidate.chi2PCA(); - auto cpa = candidate.cpa(); - auto originType = candidate.originMcRec(); - auto numPvContributors = collision.numContrib(); - auto ptRecB = candidate.ptBhadMotherPart(); + const auto pt = candidate.pt(); + const auto ptProng0 = candidate.ptProng0(); + const auto ptProng1 = candidate.ptProng1(); + const auto ptProng2 = candidate.ptProng2(); + const auto decayLength = candidate.decayLength(); + const auto chi2PCA = candidate.chi2PCA(); + const auto cpa = candidate.cpa(); + const auto originType = candidate.originMcRec(); + const auto numPvContributors = collision.numContrib(); + const auto ptRecB = candidate.ptBhadMotherPart(); /// MC reconstructed signal fillHistogramsRecSig(candidate); @@ -520,8 +526,8 @@ struct HfTaskLc { if (yCandGenMax >= 0. && std::abs(yGen) > yCandGenMax) { continue; } - auto ptGen = particle.pt(); - auto originType = particle.originMcGen(); + const auto ptGen = particle.pt(); + const auto originType = particle.originMcGen(); float ptGenB = -1.; unsigned int numPvContributors = 0; const auto& recoCollsPerMcColl = recoCollisions.sliceBy(colPerMcCollision, particle.mcCollision().globalIndex()); @@ -534,7 +540,7 @@ struct HfTaskLc { occ = o2::hf_occupancy::getOccupancyGenColl(recoCollsPerMcColl, occEstimator); } - const auto mcDaughter0 = particle.template daughters_as>().begin(); + const auto& mcDaughter0 = particle.template daughters_as>().begin(); const float p2m = particle.p() / o2::constants::physics::MassLambdaCPlus; const float gamma = std::sqrt(1 + p2m * p2m); // mother's particle Lorentz factor const float properLifetime = mcDaughter0.vt() * NanoToPico / gamma; // from ns to ps * from lab time to proper time @@ -572,9 +578,9 @@ struct HfTaskLc { template void fillHistosData(CollType const& collision, CandType const& candidates) { - auto thisCollId = collision.globalIndex(); - auto groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); - auto numPvContributors = collision.numContrib(); + const auto thisCollId = collision.globalIndex(); + const auto& groupedLcCandidates = candidates.sliceBy(candLcPerCollision, thisCollId); + const auto numPvContributors = collision.numContrib(); for (const auto& candidate : groupedLcCandidates) { if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::LcToPKPi)) { @@ -583,15 +589,15 @@ struct HfTaskLc { if (yCandRecoMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandRecoMax) { continue; } - auto pt = candidate.pt(); - auto ptProng0 = candidate.ptProng0(); - auto ptProng1 = candidate.ptProng1(); - auto ptProng2 = candidate.ptProng2(); - auto decayLength = candidate.decayLength(); - auto decayLengthXY = candidate.decayLengthXY(); - auto chi2PCA = candidate.chi2PCA(); - auto cpa = candidate.cpa(); - auto cpaXY = candidate.cpaXY(); + const auto pt = candidate.pt(); + const auto ptProng0 = candidate.ptProng0(); + const auto ptProng1 = candidate.ptProng1(); + const auto ptProng2 = candidate.ptProng2(); + const auto decayLength = candidate.decayLength(); + const auto decayLengthXY = candidate.decayLengthXY(); + const auto chi2PCA = candidate.chi2PCA(); + const auto cpa = candidate.cpa(); + const auto cpaXY = candidate.cpaXY(); if (candidate.isSelLcToPKPi() >= selectionFlagLc) { registry.fill(HIST("Data/hMass"), hfHelper.invMassLcToPKPi(candidate)); @@ -716,13 +722,13 @@ struct HfTaskLc { /// at least one event selection not satisfied --> reject the candidate continue; } - auto bc = collision.template bc_as(); + const auto& bc = collision.template bc_as(); upchelpers::FITInfo fitInfo{}; udhelpers::getFITinfo(fitInfo, bc, bcs, ft0s, fv0as, fdds); GapType gap = GapType::DoubleGap; if (bc.has_zdc()) { - auto zdc = bc.zdc(); + const auto zdc = bc.zdc(); qaRegistry.fill(HIST("Data/fitInfo/ampFT0A_vs_ampFT0C"), fitInfo.ampFT0A, fitInfo.ampFT0C); qaRegistry.fill(HIST("Data/zdc/energyZNA_vs_energyZNC"), zdc.energyCommonZNA(), zdc.energyCommonZNC()); gap = determineGapType(fitInfo.ampFT0A, fitInfo.ampFT0C, zdc.energyCommonZNA(), zdc.energyCommonZNC()); From 59dbc4ad97c1a664c308ec1ceb8ddb7bbc6d5faa Mon Sep 17 00:00:00 2001 From: Oleksii Lubynets Date: Sat, 11 Oct 2025 18:00:34 +0200 Subject: [PATCH 21/21] naming and code style, remove unused continue --- PWGHF/D2H/Tasks/taskLc.cxx | 167 ++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 85 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index 7a60399681e..12463440087 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -61,12 +61,6 @@ using namespace o2::hf_centrality; using namespace o2::hf_occupancy; using namespace o2::hf_evsel; -enum class GapType { - GapA = 0, - GapC = 1, - DoubleGap = 2, -}; - /// Λc± → p± K∓ π± analysis task struct HfTaskLc { Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; @@ -78,32 +72,13 @@ struct HfTaskLc { Configurable storeOccupancy{"storeOccupancy", true, "Flag to store occupancy information"}; Configurable occEstimator{"occEstimator", 2, "Occupancy estimation (None: 0, ITS: 1, FT0C: 2)"}; Configurable storeProperLifetime{"storeProperLifetime", false, "Flag to store proper lifetime"}; - - constexpr static float CtToProperLifetimePs = 1.f / o2::constants::physics::LightSpeedCm2PS; - constexpr static float NanoToPico = 1000.f; - - constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; - constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; - - enum MlClasses : int { - MlClassBackground = 0, - MlClassPrompt, - MlClassNonPrompt, - NumberOfMlClasses - }; + // CCDB configuration Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"}; Configurable ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"}; - HfEventSelection hfEvSel; // event selection and monitoring - - enum SignalClasses : int { - Signal = 0, - Prompt, - NonPrompt - }; - HfHelper hfHelper; + HfEventSelection hfEvSel; // event selection and monitoring SliceCache cache; Service ccdb; @@ -120,6 +95,7 @@ struct HfTaskLc { using LcCandidatesMc = soa::Filtered>; using LcCandidatesMlMc = soa::Filtered>; using McParticles3ProngMatched = soa::Join; + Filter filterSelectCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; Preslice candLcPerCollision = aod::hf_cand::collisionId; PresliceUnsorted colPerMcCollision = aod::mcparticle::mcCollisionId; @@ -141,9 +117,34 @@ struct HfTaskLc { ConfigurableAxis thnConfigAxisProperLifetime{"thnConfigAxisProperLifetime", {200, 0, 2}, "Proper lifetime, ps"}; HistogramRegistry registry{"registry", {}}; - HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // Factors for conversion between units + constexpr static float CtToProperLifetimePs = 1.f / o2::constants::physics::LightSpeedCm2PS; + constexpr static float NanoToPico = 1000.f; + // Names of folders and suffixes for MC signal histograms + constexpr static std::string_view SignalFolders[] = {"signal", "prompt", "nonprompt"}; + constexpr static std::string_view SignalSuffixes[] = {"", "Prompt", "NonPrompt"}; + + enum MlClasses : int { + MlClassBackground = 0, + MlClassPrompt, + MlClassNonPrompt, + NumberOfMlClasses + }; + + enum SignalClasses : int { + Signal = 0, + Prompt, + NonPrompt + }; + + enum class GapType { + GapA = 0, + GapC = 1, + DoubleGap = 2, + }; + void init(InitContext&) { const std::array doprocess{doprocessDataStd, doprocessDataStdWithFT0C, doprocessDataStdWithFT0M, doprocessDataWithMl, doprocessDataWithMlWithFT0C, doprocessDataWithMlWithFT0M, doprocessDataWithMlWithUpc, doprocessMcStd, doprocessMcStdWithFT0C, doprocessMcStdWithFT0M, doprocessMcWithMl, doprocessMcWithMlWithFT0C, doprocessMcWithMlWithFT0M, doprocessDataStdWithUpc}; @@ -344,7 +345,7 @@ struct HfTaskLc { } /// Evaluate centrality/multiplicity percentile (centrality estimator is automatically selected based on the used table) - /// \param candidate is candidate + /// \param collision is collision /// \return centrality/multiplicity percentile of the collision template float evaluateCentralityColl(const Coll& collision) @@ -354,55 +355,55 @@ struct HfTaskLc { /// Helper function for filling MC reconstructed histograms for prompt, nonpromt and common (signal) /// \param candidate is a reconstructed candidate - /// \tparam signalType is an enum defining which histogram in which folder (signal, prompt or nonpromt) to fill - template + /// \tparam SignalType is an enum defining which histogram in which folder (signal, prompt or nonpromt) to fill + template void fillHistogramsRecSig(CandidateType const& candidate) { const auto& mcParticleProng0 = candidate.template prong0_as().template mcParticle_as>(); const auto pdgCodeProng0 = std::abs(mcParticleProng0.pdgCode()); if ((candidate.isSelLcToPKPi() >= selectionFlagLc) && pdgCodeProng0 == kProton) { - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate)); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPKPi(candidate), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[SignalType]), hfHelper.invMassLcToPKPi(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[SignalType]), hfHelper.invMassLcToPKPi(candidate), candidate.pt()); } if ((candidate.isSelLcToPiKP() >= selectionFlagLc) && pdgCodeProng0 == kPiPlus) { - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate)); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.invMassLcToPiKP(candidate), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hMassRecSig") + HIST(SignalSuffixes[SignalType]), hfHelper.invMassLcToPiKP(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hMassVsPtRecSig") + HIST(SignalSuffixes[SignalType]), hfHelper.invMassLcToPiKP(candidate), candidate.pt()); } - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng0RecSig") + HIST(SignalSuffixes[signalType]), candidate.ptProng0()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng1RecSig") + HIST(SignalSuffixes[signalType]), candidate.ptProng1()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPtProng2RecSig") + HIST(SignalSuffixes[signalType]), candidate.ptProng2()); - - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0Prong2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng0RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter0(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng1RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter1(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hd0VsPtProng2RecSig") + HIST(SignalSuffixes[signalType]), candidate.impactParameter2(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLength()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLength(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLengthXY()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLengthxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.decayLengthXY(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate)); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCtVsPtRecSig") + HIST(SignalSuffixes[signalType]), hfHelper.ctLc(candidate), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPARecSig") + HIST(SignalSuffixes[signalType]), candidate.cpa()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.cpa(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyRecSig") + HIST(SignalSuffixes[signalType]), candidate.cpaXY()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hCPAxyVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.cpaXY(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2RecSig") + HIST(SignalSuffixes[signalType]), candidate.chi2PCA()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDca2VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.chi2PCA(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.eta(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.phi(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng0VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter0(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng1VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter1(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hImpParErrProng2VsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorImpactParameter2(), candidate.pt()); - registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[signalType]) + HIST("/hDecLenErrVsPtRecSig") + HIST(SignalSuffixes[signalType]), candidate.errorDecayLength(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hPtProng0RecSig") + HIST(SignalSuffixes[SignalType]), candidate.ptProng0()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hPtProng1RecSig") + HIST(SignalSuffixes[SignalType]), candidate.ptProng1()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hPtProng2RecSig") + HIST(SignalSuffixes[SignalType]), candidate.ptProng2()); + + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hd0Prong0RecSig") + HIST(SignalSuffixes[SignalType]), candidate.impactParameter0()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hd0Prong1RecSig") + HIST(SignalSuffixes[SignalType]), candidate.impactParameter1()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hd0Prong2RecSig") + HIST(SignalSuffixes[SignalType]), candidate.impactParameter2()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hd0VsPtProng0RecSig") + HIST(SignalSuffixes[SignalType]), candidate.impactParameter0(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hd0VsPtProng1RecSig") + HIST(SignalSuffixes[SignalType]), candidate.impactParameter1(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hd0VsPtProng2RecSig") + HIST(SignalSuffixes[SignalType]), candidate.impactParameter2(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDecLengthRecSig") + HIST(SignalSuffixes[SignalType]), candidate.decayLength()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDecLengthVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.decayLength(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDecLengthxyRecSig") + HIST(SignalSuffixes[SignalType]), candidate.decayLengthXY()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDecLengthxyVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.decayLengthXY(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hCtRecSig") + HIST(SignalSuffixes[SignalType]), hfHelper.ctLc(candidate)); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hCtVsPtRecSig") + HIST(SignalSuffixes[SignalType]), hfHelper.ctLc(candidate), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hCPARecSig") + HIST(SignalSuffixes[SignalType]), candidate.cpa()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hCPAVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.cpa(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hCPAxyRecSig") + HIST(SignalSuffixes[SignalType]), candidate.cpaXY()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hCPAxyVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.cpaXY(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDca2RecSig") + HIST(SignalSuffixes[SignalType]), candidate.chi2PCA()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDca2VsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.chi2PCA(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hEtaRecSig") + HIST(SignalSuffixes[SignalType]), candidate.eta()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hEtaVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.eta(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hPhiRecSig") + HIST(SignalSuffixes[SignalType]), candidate.phi()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hPhiVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.phi(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hImpParErrProng0VsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.errorImpactParameter0(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hImpParErrProng1VsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.errorImpactParameter1(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hImpParErrProng2VsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.errorImpactParameter2(), candidate.pt()); + registry.fill(HIST("MC/reconstructed/") + HIST(SignalFolders[SignalType]) + HIST("/hDecLenErrVsPtRecSig") + HIST(SignalSuffixes[SignalType]), candidate.errorDecayLength(), candidate.pt()); } /// Fill MC histograms at reconstruction level - /// \tparam fillMl switch to fill ML histograms + /// \tparam FillMl switch to fill ML histograms template void fillHistosMcRec(CollType const& collision, CandLcMcRec const& candidates, CandLcMcGen const& mcParticles) { @@ -502,17 +503,17 @@ struct HfTaskLc { /// Helper function for filling MC generated histograms for prompt, nonpromt and common (signal) /// \param particle is a generated particle - /// \tparam signalType is an enum defining which histogram in which folder (signal, prompt or nonpromt) to fill - template + /// \tparam SignalType is an enum defining which histogram in which folder (signal, prompt or nonpromt) to fill + template void fillHistogramsGen(ParticleType const& particle) { - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[signalType]), particle.pt()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[signalType]), particle.eta()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYGen") + HIST(SignalSuffixes[signalType]), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiGen") + HIST(SignalSuffixes[signalType]), particle.phi()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hEtaVsPtGen") + HIST(SignalSuffixes[signalType]), particle.eta(), particle.pt()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hYVsPtGen") + HIST(SignalSuffixes[signalType]), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus), particle.pt()); - registry.fill(HIST("MC/generated/") + HIST(SignalFolders[signalType]) + HIST("/hPhiVsPtGen") + HIST(SignalSuffixes[signalType]), particle.phi(), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hPtGen") + HIST(SignalSuffixes[SignalType]), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hEtaGen") + HIST(SignalSuffixes[SignalType]), particle.eta()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hYGen") + HIST(SignalSuffixes[SignalType]), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus)); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hPhiGen") + HIST(SignalSuffixes[SignalType]), particle.phi()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hEtaVsPtGen") + HIST(SignalSuffixes[SignalType]), particle.eta(), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hYVsPtGen") + HIST(SignalSuffixes[SignalType]), RecoDecay::y(particle.pVector(), o2::constants::physics::MassLambdaCPlus), particle.pt()); + registry.fill(HIST("MC/generated/") + HIST(SignalFolders[SignalType]) + HIST("/hPhiVsPtGen") + HIST(SignalSuffixes[SignalType]), particle.phi(), particle.pt()); } /// Fill MC histograms at generated level @@ -574,7 +575,7 @@ struct HfTaskLc { } /// Fill histograms for real data - /// \tparam fillMl switch to fill ML histograms + /// \tparam FillMl switch to fill ML histograms template void fillHistosData(CollType const& collision, CandType const& candidates) { @@ -692,7 +693,7 @@ struct HfTaskLc { } } /// Run the analysis on real data - /// \tparam fillMl switch to fill ML histograms + /// \tparam FillMl switch to fill ML histograms template void runAnalysisPerCollisionData(CollType const& collisions, CandType const& candidates) @@ -703,7 +704,7 @@ struct HfTaskLc { } } - template + template void runAnalysisPerCollisionDataWithUpc(CollType const& collisions, CandType const& candidates, BCsType const& bcs, @@ -713,9 +714,7 @@ struct HfTaskLc { ) { - for (const auto& collision : collisions) { - float centrality{-1.f}; const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, qaRegistry, bcs); if (rejectionMask != 0) { @@ -735,9 +734,7 @@ struct HfTaskLc { qaRegistry.fill(HIST("Data/hUpcGapAfterSelection"), static_cast(gap)); } if (gap == GapType::GapA || gap == GapType::GapC) { - fillHistosData(collision, candidates); - } else { - continue; + fillHistosData(collision, candidates); } } } @@ -757,7 +754,7 @@ struct HfTaskLc { } /// Run the analysis on MC data - /// \tparam fillMl switch to fill ML histograms + /// \tparam FillMl switch to fill ML histograms template void runAnalysisPerCollisionMc(CollType const& collisions, CandType const& candidates,