Skip to content

Commit

Permalink
PWHF: fix of the histogram registry in the Lc task (AliceO2Group#5150)
Browse files Browse the repository at this point in the history
Co-authored-by: Luigi <ldellost@aliceml.cern.ch>
  • Loading branch information
2 people authored and jgrosseo committed Aug 18, 2021
1 parent 6f3e623 commit 28373c9
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 83 deletions.
54 changes: 27 additions & 27 deletions Tasks/PWGHF/taskD0.cxx
Expand Up @@ -69,28 +69,28 @@ struct TaskD0 {
continue;
}
if (candidate.isSelD0() >= d_selectionFlagD0) {
registry.get<TH1>(HIST("hmass"))->Fill(InvMassD0(candidate));
registry.fill(HIST("hmass"), InvMassD0(candidate));
}
if (candidate.isSelD0bar() >= d_selectionFlagD0bar) {
registry.get<TH1>(HIST("hmass"))->Fill(InvMassD0bar(candidate));
registry.fill(HIST("hmass"), InvMassD0bar(candidate));
}
registry.get<TH1>(HIST("hptcand"))->Fill(candidate.pt());
registry.get<TH1>(HIST("hptprong0"))->Fill(candidate.ptProng0());
registry.get<TH1>(HIST("hptprong1"))->Fill(candidate.ptProng1());
registry.get<TH1>(HIST("hdeclength"))->Fill(candidate.decayLength());
registry.get<TH1>(HIST("hdeclengthxy"))->Fill(candidate.decayLengthXY());
registry.get<TH1>(HIST("hd0Prong0"))->Fill(candidate.impactParameter0());
registry.get<TH1>(HIST("hd0Prong1"))->Fill(candidate.impactParameter1());
registry.get<TH1>(HIST("hd0d0"))->Fill(candidate.impactParameterProduct());
registry.get<TH1>(HIST("hCTS"))->Fill(CosThetaStarD0(candidate));
registry.get<TH1>(HIST("hCt"))->Fill(CtD0(candidate));
registry.get<TH1>(HIST("hCPA"))->Fill(candidate.cpa());
registry.get<TH1>(HIST("hEta"))->Fill(candidate.eta());
registry.get<TH1>(HIST("hselectionstatus"))->Fill(candidate.isSelD0() + (candidate.isSelD0bar() * 2));
registry.get<TH1>(HIST("hImpParErr"))->Fill(candidate.errorImpactParameter0());
registry.get<TH1>(HIST("hImpParErr"))->Fill(candidate.errorImpactParameter1());
registry.get<TH1>(HIST("hDecLenErr"))->Fill(candidate.errorDecayLength());
registry.get<TH1>(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());
}
}
};
Expand Down Expand Up @@ -125,13 +125,13 @@ struct TaskD0MC {
continue;
}
if (std::abs(candidate.flagMCMatchRec()) == D0ToPiK) {
registry.get<TH1>(HIST("hPtRecSig"))->Fill(candidate.pt());
registry.get<TH1>(HIST("hCPARecSig"))->Fill(candidate.cpa());
registry.get<TH1>(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<TH1>(HIST("hPtRecBg"))->Fill(candidate.pt());
registry.get<TH1>(HIST("hCPARecBg"))->Fill(candidate.cpa());
registry.get<TH1>(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.
Expand All @@ -142,8 +142,8 @@ struct TaskD0MC {
continue;
}
if (std::abs(particle.flagMCMatchGen()) == D0ToPiK) {
registry.get<TH1>(HIST("hPtGen"))->Fill(particle.pt());
registry.get<TH1>(HIST("hEtaGen"))->Fill(particle.eta());
registry.fill(HIST("hPtGen"), particle.pt());
registry.fill(HIST("hEtaGen"), particle.eta());
}
}
}
Expand Down
48 changes: 24 additions & 24 deletions Tasks/PWGHF/taskDPlus.cxx
Expand Up @@ -62,30 +62,30 @@ struct TaskDPlus {
void process(aod::HfCandProng3 const& candidates)
{
for (auto& candidate : candidates) {
registry.get<TH1>(HIST("hMass"))->Fill(InvMassDPlus(candidate));
registry.get<TH1>(HIST("hPt"))->Fill(candidate.pt());
registry.get<TH1>(HIST("hEta"))->Fill(candidate.eta());
registry.get<TH1>(HIST("hCt"))->Fill(CtDPlus(candidate));
registry.get<TH1>(HIST("hDecayLength"))->Fill(candidate.decayLength());
registry.get<TH1>(HIST("hDecayLengthXY"))->Fill(candidate.decayLengthXY());
registry.get<TH1>(HIST("hNormalisedDecayLengthXY"))->Fill(candidate.decayLengthXYNormalised());
registry.get<TH1>(HIST("hCPA"))->Fill(candidate.cpa());
registry.get<TH1>(HIST("hCPAxy"))->Fill(candidate.cpaXY());
registry.get<TH1>(HIST("hImpactParameterXY"))->Fill(candidate.impactParameterXY());
registry.get<TH1>(HIST("hMaxNormalisedDeltaIP"))->Fill(candidate.maxNormalisedDeltaIP());
registry.get<TH1>(HIST("hImpactParameterProngSqSum"))->Fill(candidate.impactParameterProngSqSum());
registry.get<TH1>(HIST("hDecayLengthError"))->Fill(candidate.errorDecayLength());
registry.get<TH1>(HIST("hDecayLengthXYError"))->Fill(candidate.errorDecayLengthXY());
registry.get<TH1>(HIST("hImpactParameterError"))->Fill(candidate.errorImpactParameter0());
registry.get<TH1>(HIST("hImpactParameterError"))->Fill(candidate.errorImpactParameter1());
registry.get<TH1>(HIST("hImpactParameterError"))->Fill(candidate.errorImpactParameter2());
registry.get<TH1>(HIST("hPtProng0"))->Fill(candidate.ptProng0());
registry.get<TH1>(HIST("hPtProng1"))->Fill(candidate.ptProng1());
registry.get<TH1>(HIST("hPtProng2"))->Fill(candidate.ptProng2());
registry.get<TH1>(HIST("hd0Prong0"))->Fill(candidate.impactParameter0());
registry.get<TH1>(HIST("hd0Prong1"))->Fill(candidate.impactParameter1());
registry.get<TH1>(HIST("hd0Prong2"))->Fill(candidate.impactParameter2());
//registry.get<TH1>(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());
}
}
};
Expand Down
62 changes: 30 additions & 32 deletions Tasks/PWGHF/taskLc.cxx
Expand Up @@ -37,12 +37,12 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& 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.}}}},
Expand All @@ -63,36 +63,34 @@ struct TaskLc {
void process(soa::Filtered<soa::Join<aod::HfCandProng3, aod::HFSelLcCandidate>> 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<TH1>("hmass")->Fill(InvMassLcpKpi(candidate));
registry.fill(HIST("hmass"), InvMassLcpKpi(candidate));
}
if (candidate.isSelLcpiKp() >= d_selectionFlagLc) {
registry.get<TH1>("hmass")->Fill(InvMassLcpiKp(candidate));
registry.fill(HIST("hmass"), InvMassLcpiKp(candidate));
}
registry.get<TH1>("hptcand")->Fill(candidate.pt());
registry.get<TH1>("hptprong0")->Fill(candidate.ptProng0());
registry.get<TH1>("hptprong1")->Fill(candidate.ptProng1());
registry.get<TH1>("hptprong2")->Fill(candidate.ptProng2());
registry.get<TH1>("hdeclength")->Fill(candidate.decayLength());
registry.get<TH1>("hd0Prong0")->Fill(candidate.impactParameter0());
registry.get<TH1>("hd0Prong1")->Fill(candidate.impactParameter1());
registry.get<TH1>("hd0Prong2")->Fill(candidate.impactParameter2());
registry.get<TH1>("hCt")->Fill(CtLc(candidate));
registry.get<TH1>("hCPA")->Fill(candidate.cpa());
registry.get<TH1>("hEta")->Fill(candidate.eta());
registry.get<TH1>("hselectionstatus")->Fill(candidate.isSelLcpKpi());
registry.get<TH1>("hselectionstatus")->Fill(candidate.isSelLcpiKp());
registry.get<TH1>("hImpParErr")->Fill(candidate.errorImpactParameter0());
registry.get<TH1>("hImpParErr")->Fill(candidate.errorImpactParameter1());
registry.get<TH1>("hImpParErr")->Fill(candidate.errorImpactParameter2());
registry.get<TH1>("hDecLenErr")->Fill(candidate.errorDecayLength());
registry.get<TH1>("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());
}
}
};
Expand Down Expand Up @@ -127,13 +125,13 @@ struct TaskLcMC {
continue;
}
if (std::abs(candidate.flagMCMatchRec()) == LcToPKPi) {
registry.get<TH1>("hPtRecSig")->Fill(candidate.pt());
registry.get<TH1>("hCPARecSig")->Fill(candidate.cpa());
registry.get<TH1>("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<TH1>("hPtRecBg")->Fill(candidate.pt());
registry.get<TH1>("hCPARecBg")->Fill(candidate.cpa());
registry.get<TH1>("hEtaRecBg")->Fill(candidate.eta());
registry.fill(HIST("hPtRecBg"), candidate.pt());
registry.fill(HIST("hCPARecBg"), candidate.cpa());
registry.fill(HIST("hEtaRecBg"), candidate.eta());
}
}
// MC gen.
Expand All @@ -144,8 +142,8 @@ struct TaskLcMC {
continue;
}
if (std::abs(particle.flagMCMatchGen()) == LcToPKPi) {
registry.get<TH1>("hPtGen")->Fill(particle.pt());
registry.get<TH1>("hEtaGen")->Fill(particle.eta());
registry.fill(HIST("hPtGen"), particle.pt());
registry.fill(HIST("hEtaGen"), particle.eta());
}
}
}
Expand Down

0 comments on commit 28373c9

Please sign in to comment.