From 28373c922cd8411eb5251b569e7c07a273bfba12 Mon Sep 17 00:00:00 2001 From: DelloStritto <47105254+DelloStritto@users.noreply.github.com> Date: Sat, 16 Jan 2021 19:37:31 +0100 Subject: [PATCH] PWHF: fix of the histogram registry in the Lc task (#5150) Co-authored-by: Luigi --- Tasks/PWGHF/taskD0.cxx | 54 +++++++++++++++++----------------- Tasks/PWGHF/taskDPlus.cxx | 48 +++++++++++++++--------------- Tasks/PWGHF/taskLc.cxx | 62 +++++++++++++++++++-------------------- 3 files changed, 81 insertions(+), 83 deletions(-) diff --git a/Tasks/PWGHF/taskD0.cxx b/Tasks/PWGHF/taskD0.cxx index 6089c4bf2d6aa..54ae5fcb5afa6 100644 --- a/Tasks/PWGHF/taskD0.cxx +++ b/Tasks/PWGHF/taskD0.cxx @@ -69,28 +69,28 @@ struct TaskD0 { continue; } if (candidate.isSelD0() >= d_selectionFlagD0) { - registry.get(HIST("hmass"))->Fill(InvMassD0(candidate)); + registry.fill(HIST("hmass"), InvMassD0(candidate)); } if (candidate.isSelD0bar() >= d_selectionFlagD0bar) { - registry.get(HIST("hmass"))->Fill(InvMassD0bar(candidate)); + registry.fill(HIST("hmass"), InvMassD0bar(candidate)); } - registry.get(HIST("hptcand"))->Fill(candidate.pt()); - registry.get(HIST("hptprong0"))->Fill(candidate.ptProng0()); - registry.get(HIST("hptprong1"))->Fill(candidate.ptProng1()); - registry.get(HIST("hdeclength"))->Fill(candidate.decayLength()); - registry.get(HIST("hdeclengthxy"))->Fill(candidate.decayLengthXY()); - registry.get(HIST("hd0Prong0"))->Fill(candidate.impactParameter0()); - registry.get(HIST("hd0Prong1"))->Fill(candidate.impactParameter1()); - registry.get(HIST("hd0d0"))->Fill(candidate.impactParameterProduct()); - registry.get(HIST("hCTS"))->Fill(CosThetaStarD0(candidate)); - registry.get(HIST("hCt"))->Fill(CtD0(candidate)); - registry.get(HIST("hCPA"))->Fill(candidate.cpa()); - registry.get(HIST("hEta"))->Fill(candidate.eta()); - registry.get(HIST("hselectionstatus"))->Fill(candidate.isSelD0() + (candidate.isSelD0bar() * 2)); - registry.get(HIST("hImpParErr"))->Fill(candidate.errorImpactParameter0()); - registry.get(HIST("hImpParErr"))->Fill(candidate.errorImpactParameter1()); - registry.get(HIST("hDecLenErr"))->Fill(candidate.errorDecayLength()); - registry.get(HIST("hDecLenXYErr"))->Fill(candidate.errorDecayLengthXY()); + registry.fill(HIST("hptcand"), candidate.pt()); + registry.fill(HIST("hptprong0"), candidate.ptProng0()); + registry.fill(HIST("hptprong1"), candidate.ptProng1()); + registry.fill(HIST("hdeclength"), candidate.decayLength()); + registry.fill(HIST("hdeclengthxy"), candidate.decayLengthXY()); + registry.fill(HIST("hd0Prong0"), candidate.impactParameter0()); + registry.fill(HIST("hd0Prong1"), candidate.impactParameter1()); + registry.fill(HIST("hd0d0"), candidate.impactParameterProduct()); + registry.fill(HIST("hCTS"), CosThetaStarD0(candidate)); + registry.fill(HIST("hCt"), CtD0(candidate)); + registry.fill(HIST("hCPA"), candidate.cpa()); + registry.fill(HIST("hEta"), candidate.eta()); + registry.fill(HIST("hselectionstatus"), candidate.isSelD0() + (candidate.isSelD0bar() * 2)); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter0()); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter1()); + registry.fill(HIST("hDecLenErr"), candidate.errorDecayLength()); + registry.fill(HIST("hDecLenXYErr"), candidate.errorDecayLengthXY()); } } }; @@ -125,13 +125,13 @@ struct TaskD0MC { continue; } if (std::abs(candidate.flagMCMatchRec()) == D0ToPiK) { - registry.get(HIST("hPtRecSig"))->Fill(candidate.pt()); - registry.get(HIST("hCPARecSig"))->Fill(candidate.cpa()); - registry.get(HIST("hEtaRecSig"))->Fill(candidate.eta()); + registry.fill(HIST("hPtRecSig"), candidate.pt()); + registry.fill(HIST("hCPARecSig"), candidate.cpa()); + registry.fill(HIST("hEtaRecSig"), candidate.eta()); } else { - registry.get(HIST("hPtRecBg"))->Fill(candidate.pt()); - registry.get(HIST("hCPARecBg"))->Fill(candidate.cpa()); - registry.get(HIST("hEtaRecBg"))->Fill(candidate.eta()); + registry.fill(HIST("hPtRecBg"), candidate.pt()); + registry.fill(HIST("hCPARecBg"), candidate.cpa()); + registry.fill(HIST("hEtaRecBg"), candidate.eta()); } } // MC gen. @@ -142,8 +142,8 @@ struct TaskD0MC { continue; } if (std::abs(particle.flagMCMatchGen()) == D0ToPiK) { - registry.get(HIST("hPtGen"))->Fill(particle.pt()); - registry.get(HIST("hEtaGen"))->Fill(particle.eta()); + registry.fill(HIST("hPtGen"), particle.pt()); + registry.fill(HIST("hEtaGen"), particle.eta()); } } } diff --git a/Tasks/PWGHF/taskDPlus.cxx b/Tasks/PWGHF/taskDPlus.cxx index 324ad85c00cfb..0b7c9a3d96d6b 100644 --- a/Tasks/PWGHF/taskDPlus.cxx +++ b/Tasks/PWGHF/taskDPlus.cxx @@ -62,30 +62,30 @@ struct TaskDPlus { void process(aod::HfCandProng3 const& candidates) { for (auto& candidate : candidates) { - registry.get(HIST("hMass"))->Fill(InvMassDPlus(candidate)); - registry.get(HIST("hPt"))->Fill(candidate.pt()); - registry.get(HIST("hEta"))->Fill(candidate.eta()); - registry.get(HIST("hCt"))->Fill(CtDPlus(candidate)); - registry.get(HIST("hDecayLength"))->Fill(candidate.decayLength()); - registry.get(HIST("hDecayLengthXY"))->Fill(candidate.decayLengthXY()); - registry.get(HIST("hNormalisedDecayLengthXY"))->Fill(candidate.decayLengthXYNormalised()); - registry.get(HIST("hCPA"))->Fill(candidate.cpa()); - registry.get(HIST("hCPAxy"))->Fill(candidate.cpaXY()); - registry.get(HIST("hImpactParameterXY"))->Fill(candidate.impactParameterXY()); - registry.get(HIST("hMaxNormalisedDeltaIP"))->Fill(candidate.maxNormalisedDeltaIP()); - registry.get(HIST("hImpactParameterProngSqSum"))->Fill(candidate.impactParameterProngSqSum()); - registry.get(HIST("hDecayLengthError"))->Fill(candidate.errorDecayLength()); - registry.get(HIST("hDecayLengthXYError"))->Fill(candidate.errorDecayLengthXY()); - registry.get(HIST("hImpactParameterError"))->Fill(candidate.errorImpactParameter0()); - registry.get(HIST("hImpactParameterError"))->Fill(candidate.errorImpactParameter1()); - registry.get(HIST("hImpactParameterError"))->Fill(candidate.errorImpactParameter2()); - registry.get(HIST("hPtProng0"))->Fill(candidate.ptProng0()); - registry.get(HIST("hPtProng1"))->Fill(candidate.ptProng1()); - registry.get(HIST("hPtProng2"))->Fill(candidate.ptProng2()); - registry.get(HIST("hd0Prong0"))->Fill(candidate.impactParameter0()); - registry.get(HIST("hd0Prong1"))->Fill(candidate.impactParameter1()); - registry.get(HIST("hd0Prong2"))->Fill(candidate.impactParameter2()); - //registry.get(HIST("hSelectionStatus"))->Fill(candidate.isSelDPlus()); + registry.fill(HIST("hMass"), InvMassDPlus(candidate)); + registry.fill(HIST("hPt"), candidate.pt()); + registry.fill(HIST("hEta"), candidate.eta()); + registry.fill(HIST("hCt"), CtDPlus(candidate)); + registry.fill(HIST("hDecayLength"), candidate.decayLength()); + registry.fill(HIST("hDecayLengthXY"), candidate.decayLengthXY()); + registry.fill(HIST("hNormalisedDecayLengthXY"), candidate.decayLengthXYNormalised()); + registry.fill(HIST("hCPA"), candidate.cpa()); + registry.fill(HIST("hCPAxy"), candidate.cpaXY()); + registry.fill(HIST("hImpactParameterXY"), candidate.impactParameterXY()); + registry.fill(HIST("hMaxNormalisedDeltaIP"), candidate.maxNormalisedDeltaIP()); + registry.fill(HIST("hImpactParameterProngSqSum"), candidate.impactParameterProngSqSum()); + registry.fill(HIST("hDecayLengthError"), candidate.errorDecayLength()); + registry.fill(HIST("hDecayLengthXYError"), candidate.errorDecayLengthXY()); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter0()); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter1()); + registry.fill(HIST("hImpactParameterError"), candidate.errorImpactParameter2()); + registry.fill(HIST("hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("hPtProng2"), candidate.ptProng2()); + registry.fill(HIST("hd0Prong0"), candidate.impactParameter0()); + registry.fill(HIST("hd0Prong1"), candidate.impactParameter1()); + registry.fill(HIST("hd0Prong2"), candidate.impactParameter2()); + //registry.fill(HIST("hSelectionStatus"), candidate.isSelDPlus()); } } }; diff --git a/Tasks/PWGHF/taskLc.cxx b/Tasks/PWGHF/taskLc.cxx index ebf91b37889d0..877cb81fb563c 100644 --- a/Tasks/PWGHF/taskLc.cxx +++ b/Tasks/PWGHF/taskLc.cxx @@ -37,12 +37,12 @@ void customize(std::vector& workflowOptions) struct TaskLc { HistogramRegistry registry{ "registry", - {{"hmass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 0., 5.}}}}, + {{"hmass", "3-prong candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 1.6, 3.1}}}}, {"hptcand", "3-prong candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, {"hptprong0", "3-prong candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, {"hptprong1", "3-prong candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, {"hptprong2", "3-prong candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{100, 0., 10.}}}}, - {"hdeclength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{400, -2., 2.}}}}, + {"hdeclength", "3-prong candidates;decay length (cm);entries", {HistType::kTH1F, {{200, 0., 2.}}}}, {"hd0Prong0", "3-prong candidates;prong 0 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{100, -1., 1.}}}}, {"hd0Prong1", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{100, -1., 1.}}}}, {"hd0Prong2", "3-prong candidates;prong 1 DCAxy to prim. vertex (cm);entries", {HistType::kTH1F, {{100, -1., 1.}}}}, @@ -63,36 +63,34 @@ struct TaskLc { void process(soa::Filtered> const& candidates) { for (auto& candidate : candidates) { - /* if (candidate.pt()>5){ - continue;}*/ if (cutEtaCandMax >= 0. && std::abs(candidate.eta()) > cutEtaCandMax) { //Printf("Candidate: eta rejection: %g", candidate.eta()); continue; } if (candidate.isSelLcpKpi() >= d_selectionFlagLc) { - registry.get("hmass")->Fill(InvMassLcpKpi(candidate)); + registry.fill(HIST("hmass"), InvMassLcpKpi(candidate)); } if (candidate.isSelLcpiKp() >= d_selectionFlagLc) { - registry.get("hmass")->Fill(InvMassLcpiKp(candidate)); + registry.fill(HIST("hmass"), InvMassLcpiKp(candidate)); } - registry.get("hptcand")->Fill(candidate.pt()); - registry.get("hptprong0")->Fill(candidate.ptProng0()); - registry.get("hptprong1")->Fill(candidate.ptProng1()); - registry.get("hptprong2")->Fill(candidate.ptProng2()); - registry.get("hdeclength")->Fill(candidate.decayLength()); - registry.get("hd0Prong0")->Fill(candidate.impactParameter0()); - registry.get("hd0Prong1")->Fill(candidate.impactParameter1()); - registry.get("hd0Prong2")->Fill(candidate.impactParameter2()); - registry.get("hCt")->Fill(CtLc(candidate)); - registry.get("hCPA")->Fill(candidate.cpa()); - registry.get("hEta")->Fill(candidate.eta()); - registry.get("hselectionstatus")->Fill(candidate.isSelLcpKpi()); - registry.get("hselectionstatus")->Fill(candidate.isSelLcpiKp()); - registry.get("hImpParErr")->Fill(candidate.errorImpactParameter0()); - registry.get("hImpParErr")->Fill(candidate.errorImpactParameter1()); - registry.get("hImpParErr")->Fill(candidate.errorImpactParameter2()); - registry.get("hDecLenErr")->Fill(candidate.errorDecayLength()); - registry.get("hDecLenErr")->Fill(candidate.chi2PCA()); + registry.fill(HIST("hptcand"), candidate.pt()); + registry.fill(HIST("hptprong0"), candidate.ptProng0()); + registry.fill(HIST("hptprong1"), candidate.ptProng1()); + registry.fill(HIST("hptprong2"), candidate.ptProng2()); + registry.fill(HIST("hdeclength"), candidate.decayLength()); + registry.fill(HIST("hd0Prong0"), candidate.impactParameter0()); + registry.fill(HIST("hd0Prong1"), candidate.impactParameter1()); + registry.fill(HIST("hd0Prong2"), candidate.impactParameter2()); + registry.fill(HIST("hCt"), CtLc(candidate)); + registry.fill(HIST("hCPA"), candidate.cpa()); + registry.fill(HIST("hEta"), candidate.eta()); + registry.fill(HIST("hselectionstatus"), candidate.isSelLcpKpi()); + registry.fill(HIST("hselectionstatus"), candidate.isSelLcpiKp()); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter0()); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter1()); + registry.fill(HIST("hImpParErr"), candidate.errorImpactParameter2()); + registry.fill(HIST("hDecLenErr"), candidate.errorDecayLength()); + registry.fill(HIST("hDecLenErr"), candidate.chi2PCA()); } } }; @@ -127,13 +125,13 @@ struct TaskLcMC { continue; } if (std::abs(candidate.flagMCMatchRec()) == LcToPKPi) { - registry.get("hPtRecSig")->Fill(candidate.pt()); - registry.get("hCPARecSig")->Fill(candidate.cpa()); - registry.get("hEtaRecSig")->Fill(candidate.eta()); + registry.fill(HIST("hPtRecSig"), candidate.pt()); + registry.fill(HIST("hCPARecSig"), candidate.cpa()); + registry.fill(HIST("hEtaRecSig"), candidate.eta()); } else { - registry.get("hPtRecBg")->Fill(candidate.pt()); - registry.get("hCPARecBg")->Fill(candidate.cpa()); - registry.get("hEtaRecBg")->Fill(candidate.eta()); + registry.fill(HIST("hPtRecBg"), candidate.pt()); + registry.fill(HIST("hCPARecBg"), candidate.cpa()); + registry.fill(HIST("hEtaRecBg"), candidate.eta()); } } // MC gen. @@ -144,8 +142,8 @@ struct TaskLcMC { continue; } if (std::abs(particle.flagMCMatchGen()) == LcToPKPi) { - registry.get("hPtGen")->Fill(particle.pt()); - registry.get("hEtaGen")->Fill(particle.eta()); + registry.fill(HIST("hPtGen"), particle.pt()); + registry.fill(HIST("hEtaGen"), particle.eta()); } } }