Skip to content

Commit 7f6aff4

Browse files
authored
[PWGCF] FU: histograms correction for reco D0 (#17861)
1 parent 4571d7a commit 7f6aff4

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ struct FemtoUniversePairTaskTrackD0 {
184184
// Correlated background for D0/D0bar candidates
185185
Configurable<bool> fillCorrBkgs{"fillCorrBkgs", false, "Fill histograms with correlated background candidates"};
186186
// Configurable to enable filling histograms with BDT scores values
187-
Configurable<bool> fillBDTvsPt{"fillBDTvsPt", false, "Fill BDT vs pT histograms for D0/D0bar candidates"};
188-
Configurable<bool> fillBDTvsPtVsMass{"fillBDTvsPtVsMass", true, "Fill BDT vs pT vs mass histograms for D0/D0bar candidates"};
187+
Configurable<bool> fillBDTvsPt{"fillBDTvsPt", true, "Fill BDT vs pT histograms for D0/D0bar candidates"};
188+
Configurable<bool> fillBDTvsPtVsMass{"fillBDTvsPtVsMass", false, "Fill BDT vs pT vs mass histograms for D0/D0bar candidates"};
189189
} ConfFill;
190190
// Efficiency
191191
Configurable<bool> doEfficiencyCorr{"doEfficiencyCorr", false, "Apply efficiency corrections"};
@@ -260,6 +260,7 @@ struct FemtoUniversePairTaskTrackD0 {
260260
struct : o2::framework::ConfigurableGroup {
261261
ConfigurableAxis thnConfigAxisNonPromptScore{"thnConfigAxisNonPromptScore", {100, 0., 1.}, "Non-prompt score bins"};
262262
ConfigurableAxis thnConfigAxisPromptScore{"thnConfigAxisPromptScore", {100, 0., 1.}, "Prompt score bins"};
263+
ConfigurableAxis thnConfigAxisBkgScore{"thnConfigAxisBkgScore", {100, 0., 1.}, "Background score bins"};
263264
ConfigurableAxis thnConfigAxisMass{"thnConfigAxisMass", {500, 0., 5.0}, "Cand. inv-mass bins"};
264265
ConfigurableAxis thnConfigAxisPt{"thnConfigAxisPt", {360, 0., 36.}, "Cand. pT bins"};
265266
} ConfThnAxes;
@@ -475,9 +476,13 @@ struct FemtoUniversePairTaskTrackD0 {
475476
// Axes for THnSparse
476477
const AxisSpec thnAxisNonPromptScore{ConfThnAxes.thnConfigAxisNonPromptScore, "BDT score non-prompt"};
477478
const AxisSpec thnAxisPromptScore{ConfThnAxes.thnConfigAxisPromptScore, "BDT score prompt"};
479+
const AxisSpec thnAxisBkgScore{ConfThnAxes.thnConfigAxisBkgScore, "BDT score background"};
478480
const AxisSpec thnAxisMass{ConfThnAxes.thnConfigAxisMass, "inv. mass (#pi K) (GeV/#it{c}^{2})"};
479-
const AxisSpec thnAxisPt{ConfThnAxes.thnConfigAxisPt, "#it{p}_{T} (GeV/#it{c})"};
481+
const AxisSpec thnAxisPt{vbins, "#it{p}_{T} (GeV/#it{c})"};
482+
const AxisSpec thnAxisPtWiderBins{vFivePtBins, "#it{p}_{T} (GeV/#it{c})"};
480483
std::vector<AxisSpec> axesTHn = {thnAxisPromptScore, thnAxisNonPromptScore, thnAxisMass, thnAxisPt};
484+
std::vector<AxisSpec> axesTHnMc = {thnAxisBkgScore, thnAxisPromptScore, thnAxisNonPromptScore, thnAxisPt};
485+
std::vector<AxisSpec> axesTHnFD = {thnAxisBkgScore, thnAxisPromptScore, thnAxisNonPromptScore, thnAxisPtWiderBins};
481486

482487
if (doEfficiencyCorr) {
483488
registry.add("D0D0bar_oneMassHypo/hMassVsPtEffCorr", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
@@ -499,17 +504,18 @@ struct FemtoUniversePairTaskTrackD0 {
499504
registry.add("DebugBdt/hBdtScore1", ";BDT score;Entries", {HistType::kTH1F, {axisBdtScore}});
500505
registry.add("DebugBdt/hBdtScore2", ";BDT score;Entries", {HistType::kTH1F, {axisBdtScore}});
501506
if (ConfFill.fillBDTvsPt) {
502-
registry.add("DebugBdtMcReco/hBdtScore0VsPt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vbins}}});
503-
registry.add("DebugBdtMcReco/hBdtScore1VsPt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vbins}}});
504-
registry.add("DebugBdtMcReco/hBdtScore2VsPt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vbins}}});
505-
registry.add("DebugBdtMcReco/hBdtScore1VsPtD0Prompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
506-
registry.add("DebugBdtMcReco/hBdtScore1VsPtD0NonPrompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
507-
registry.add("DebugBdtMcReco/hBdtScore1VsPtD0barPrompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
508-
registry.add("DebugBdtMcReco/hBdtScore1VsPtD0barNonPrompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
509-
registry.add("DebugBdtMcReco/hBdtScore2VsPtD0Prompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
510-
registry.add("DebugBdtMcReco/hBdtScore2VsPtD0NonPrompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
511-
registry.add("DebugBdtMcReco/hBdtScore2VsPtD0barPrompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
512-
registry.add("DebugBdtMcReco/hBdtScore2VsPtD0barNonPrompt", ";BDT score;#it{p}_{T} (GeV/#it{c})", {HistType::kTH2F, {axisBdtScore, {vFivePtBins}}});
507+
registry.add("DebugBdtMcReco/hBdtScoresVsPtD0", "Thn for reconstructed D0 candidates", HistType::kTHnSparseD, axesTHnMc);
508+
registry.get<THnSparse>(HIST("DebugBdtMcReco/hBdtScoresVsPtD0"))->Sumw2();
509+
registry.add("DebugBdtMcReco/hBdtScoresVsPtD0bar", "Thn for reconstructed D0bar candidates", HistType::kTHnSparseD, axesTHnMc);
510+
registry.get<THnSparse>(HIST("DebugBdtMcReco/hBdtScoresVsPtD0bar"))->Sumw2();
511+
registry.add("DebugBdtMcReco/hBdtScoresVsPtPromptD0", "Thn for reconstructed prompt D0 candidates", HistType::kTHnSparseD, axesTHnFD);
512+
registry.get<THnSparse>(HIST("DebugBdtMcReco/hBdtScoresVsPtPromptD0"))->Sumw2();
513+
registry.add("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0", "Thn for reconstructed non-prompt D0 candidates", HistType::kTHnSparseD, axesTHnFD);
514+
registry.get<THnSparse>(HIST("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0"))->Sumw2();
515+
registry.add("DebugBdtMcReco/hBdtScoresVsPtPromptD0bar", "Thn for reconstructed prompt D0bar candidates", HistType::kTHnSparseD, axesTHnFD);
516+
registry.get<THnSparse>(HIST("DebugBdtMcReco/hBdtScoresVsPtPromptD0bar"))->Sumw2();
517+
registry.add("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0bar", "Thn for reconstructed non-prompt D0bar candidates", HistType::kTHnSparseD, axesTHnFD);
518+
registry.get<THnSparse>(HIST("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0bar"))->Sumw2();
513519
}
514520
if (ConfFill.fillBDTvsPtVsMass) {
515521
registry.add("DebugBdt/hBdtScoresVsMassVsPtD0", "Thn for D0 candidates", HistType::kTHnSparseD, axesTHn);
@@ -1330,52 +1336,46 @@ struct FemtoUniversePairTaskTrackD0 {
13301336
}
13311337
}
13321338
}
1333-
} else if ((part.partType() == aod::femtouniverseparticle::ParticleType::kD0) && (part.pt() > ConfDmesons.confMinPtD0D0barReco) && (part.pt() < ConfDmesons.confMaxPtD0D0barReco)) {
1334-
if (ConfFill.fillBDTvsPt && std::abs(mcpart.pdgMCTruth()) == o2::constants::physics::Pdg::kD0) {
1335-
registry.fill(HIST("DebugBdtMcReco/hBdtScore0VsPt"), part.decayVtxX(), part.pt());
1336-
registry.fill(HIST("DebugBdtMcReco/hBdtScore1VsPt"), part.decayVtxY(), part.pt());
1337-
registry.fill(HIST("DebugBdtMcReco/hBdtScore2VsPt"), part.decayVtxZ(), part.pt());
1338-
}
1339+
} else if ((part.partType() == aod::femtouniverseparticle::ParticleType::kD0) && (part.pt() > ConfDmesons.confMinPtD0D0barReco) && (part.pt() < ConfDmesons.confMaxPtD0D0barReco) && (part.decayVtxZ() < ConfMlProb.confMlProbNonPromptMax)) {
1340+
13391341
if (mcpart.pdgMCTruth() == ConfDmesons.confPDGCodeD0) {
13401342
mcRecoRegistry.fill(HIST("hMcRecD0"), part.pt(), part.eta());
13411343
mcRecoRegistry.fill(HIST("hMcRecD0Pt"), part.pt());
13421344
mcRecoRegistry.fill(HIST("hMcRecD0Phi"), part.phi());
1345+
registry.fill(HIST("DebugBdtMcReco/hBdtScoresVsPtD0"), part.decayVtxX(), part.decayVtxY(), part.decayVtxZ(), part.pt());
13431346

13441347
if (part.tpcNClsFound() == 0) { // prompt candidates
13451348
mcRecoRegistry.fill(HIST("hMcRecD0Prompt"), part.pt(), part.eta());
13461349
mcRecoRegistry.fill(HIST("hMcRecD0PromptPt"), part.pt());
13471350
mcRecoRegistry.fill(HIST("hMcRecD0PromptPhi"), part.phi());
13481351
if (ConfFill.fillBDTvsPt) {
1349-
registry.fill(HIST("DebugBdtMcReco/hBdtScore1VsPtD0Prompt"), part.decayVtxY(), part.pt());
1350-
registry.fill(HIST("DebugBdtMcReco/hBdtScore2VsPtD0Prompt"), part.decayVtxZ(), part.pt());
1352+
registry.fill(HIST("DebugBdtMcReco/hBdtScoresVsPtPromptD0"), part.decayVtxX(), part.decayVtxY(), part.decayVtxZ(), part.pt());
13511353
}
13521354
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
13531355
mcRecoRegistry.fill(HIST("hMcRecD0NonPrompt"), part.pt(), part.eta());
13541356
mcRecoRegistry.fill(HIST("hMcRecD0NonPromptPt"), part.pt());
13551357
mcRecoRegistry.fill(HIST("hMcRecD0NonPromptPhi"), part.phi());
13561358
if (ConfFill.fillBDTvsPt) {
1357-
registry.fill(HIST("DebugBdtMcReco/hBdtScore1VsPtD0NonPrompt"), part.decayVtxY(), part.pt());
1358-
registry.fill(HIST("DebugBdtMcReco/hBdtScore2VsPtD0NonPrompt"), part.decayVtxZ(), part.pt());
1359+
registry.fill(HIST("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0"), part.decayVtxX(), part.decayVtxY(), part.decayVtxZ(), part.pt());
13591360
}
13601361
}
13611362
} else if (mcpart.pdgMCTruth() == ConfDmesons.confPDGCodeD0bar) {
13621363
mcRecoRegistry.fill(HIST("hMcRecD0bar"), part.pt(), part.eta());
13631364
mcRecoRegistry.fill(HIST("hMcRecD0barPt"), part.pt());
13641365
mcRecoRegistry.fill(HIST("hMcRecD0barPhi"), part.phi());
1366+
registry.fill(HIST("DebugBdtMcReco/hBdtScoresVsPtD0bar"), part.decayVtxX(), part.decayVtxY(), part.decayVtxZ(), part.pt());
13651367

13661368
if (part.tpcNClsFound() == 0) { // prompt candidates
13671369
mcRecoRegistry.fill(HIST("hMcRecD0barPrompt"), part.pt(), part.eta());
13681370
mcRecoRegistry.fill(HIST("hMcRecD0barPromptPt"), part.pt());
13691371
if (ConfFill.fillBDTvsPt) {
1370-
registry.fill(HIST("DebugBdtMcReco/hBdtScore1VsPtD0barPrompt"), part.decayVtxY(), part.pt());
1371-
registry.fill(HIST("DebugBdtMcReco/hBdtScore2VsPtD0barPrompt"), part.decayVtxZ(), part.pt());
1372+
registry.fill(HIST("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0bar"), part.decayVtxX(), part.decayVtxY(), part.decayVtxZ(), part.pt());
13721373
}
13731374
} else if (part.tpcNClsFound() == 1) { // non-prompt candidates
13741375
mcRecoRegistry.fill(HIST("hMcRecD0barNonPrompt"), part.pt(), part.eta());
13751376
mcRecoRegistry.fill(HIST("hMcRecD0barNonPromptPt"), part.pt());
13761377
if (ConfFill.fillBDTvsPt) {
1377-
registry.fill(HIST("DebugBdtMcReco/hBdtScore1VsPtD0barNonPrompt"), part.decayVtxY(), part.pt());
1378-
registry.fill(HIST("DebugBdtMcReco/hBdtScore2VsPtD0barNonPrompt"), part.decayVtxZ(), part.pt());
1378+
registry.fill(HIST("DebugBdtMcReco/hBdtScoresVsPtNonPromptD0bar"), part.decayVtxX(), part.decayVtxY(), part.decayVtxZ(), part.pt());
13791379
}
13801380
}
13811381
}

0 commit comments

Comments
 (0)