From 495365e9788199e409d8d225c851d6b9eb47cb1c Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Mon, 8 Sep 2025 17:18:51 +0200 Subject: [PATCH 1/7] NucleiTask - Add mothers pT --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 101 ++++++++++++++++---------- 1 file changed, 64 insertions(+), 37 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index ef8cc86ef87..c595a35c7a8 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -71,7 +71,7 @@ struct LFNucleiBATask { Configurable enableAl{"enableAl", true, "Flag to enable alpha analysis."}; Configurable enableTrackingEff{"enableTrackingEff", 0, "Flag to enable tracking efficiency hitos."}; - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // NOLINT // Set the triggered events skimming scheme struct : ConfigurableGroup { @@ -214,6 +214,9 @@ struct LFNucleiBATask { Configurable enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"}; + // Weak-decay flag + static constexpr int kProcessWeakDecay = 4; + // PDG codes and masses used in this analysis static constexpr int PDGPion = PDG_t::kPiPlus; static constexpr int PDGKaon = PDG_t::kKPlus; @@ -231,19 +234,32 @@ struct LFNucleiBATask { // PDG of Mothers static constexpr int kPdgMotherlist[] = { - PDGProton, // proton - PDGPion, // pi+ - PDGKaon, // K+ - 311, // K0 - PDGDeuteron, // deuteron - PDGTriton, // triton - PDGHelium, // He-3 - PDGAlpha, // Alpha - 1000130270, // Aluminium - 1000140280, // Silicon - 1000260560 // Iron - }; + PDGPion, + PDGKaon, + 311, + PDGProton, + PDGDeuteron, + PDGTriton, + PDGHelium, + PDGAlpha, + 1000130270, + 1000140280, + 1000260560}; static constexpr int kNumMotherlist = sizeof(kPdgMotherlist) / sizeof(kPdgMotherlist[0]); + + static constexpr const char* kMomtherNames[kNumMotherlist] = { + "#pi", + "K+", + "K0", + "p", + "d", + "t", + "He3", + "#alpha", + "Al", + "Si", + "Fe"}; + static constexpr int kMaxNumMom = 4; // X: 0..4, overflow=5 template @@ -1146,20 +1162,22 @@ struct LFNucleiBATask { histos.add("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueSec", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}}); histos.add("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueMaterial", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}}); - histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother PDG", HistType::kTH2I, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}}); + histos.add("tracks/helium/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}}); + histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {200, 0.0, 8.0}}); - // Fix for getting TH2 pointer - std::shared_ptr hTemp = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); - TH2* hPDG = hTemp.get(); + // Fix for getting TH3 pointer + std::shared_ptr hTemp = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); + TH3* hPDG = hTemp.get(); TAxis* axPDG = hPDG->GetXaxis(); for (int i = 0; i <= kMaxNumMom; ++i) { axPDG->SetBinLabel(i + 1, Form("%d", i)); } axPDG->SetBinLabel(kMaxNumMom + 2, ">=5"); + TAxis* ayPDG = hPDG->GetYaxis(); - ayPDG->SetBinLabel(1, "-1"); // undefined - ayPDG->SetBinLabel(2, "0"); // other + ayPDG->SetBinLabel(1, "undef."); + ayPDG->SetBinLabel(2, "other"); for (int i = 0; i < kNumMotherlist; ++i) { ayPDG->SetBinLabel(i + 3, Form("%d", kPdgMotherlist[i])); } @@ -2655,7 +2673,7 @@ struct LFNucleiBATask { if constexpr (IsFilteredData) { isPhysPrim = track.isPhysicalPrimary(); isProdByGen = track.producedByGenerator(); - isWeakDecay = track.getProcess() == 4; // NOLINT + isWeakDecay = (track.getProcess() == kProcessWeakDecay); pdgCode = track.pdgCode(); } else { if (!track.has_mcParticle()) { @@ -2663,7 +2681,7 @@ struct LFNucleiBATask { } isPhysPrim = track.mcParticle().isPhysicalPrimary(); isProdByGen = track.mcParticle().producedByGenerator(); - isWeakDecay = track.mcParticle().getProcess() == 4; // NOLINT + isWeakDecay = (track.mcParticle().getProcess() == kProcessWeakDecay); pdgCode = track.mcParticle().pdgCode(); } @@ -3158,16 +3176,19 @@ struct LFNucleiBATask { int pdgMom = 0; // gen Pt float genPt = 0; + float ptMom = 0; // Mothers variables [[maybe_unused]] int firstMotherId = -1; [[maybe_unused]] int firstMotherPdg = -1; - [[maybe_unused]] int pdgList[8]; + [[maybe_unused]] float firstMotherPt = -1.f; + [[maybe_unused]] int pdgMomList[8]; + [[maybe_unused]] float ptMomList[8]; [[maybe_unused]] int nSaved = 0; if constexpr (IsFilteredData) { isPhysPrim = track.isPhysicalPrimary(); isProdByGen = track.producedByGenerator(); - isWeakDecay = track.getProcess() == 4; // NOLINT + isWeakDecay = (track.getProcess() == kProcessWeakDecay); pdgCode = track.pdgCode(); genPt = std::sqrt(std::pow(track.px(), 2) + std::pow(track.py(), 2)); @@ -3177,7 +3198,7 @@ struct LFNucleiBATask { } isPhysPrim = track.mcParticle().isPhysicalPrimary(); isProdByGen = track.mcParticle().producedByGenerator(); - isWeakDecay = track.mcParticle().getProcess() == 4; // NOLINT + isWeakDecay = (track.mcParticle().getProcess() == kProcessWeakDecay); pdgCode = track.mcParticle().pdgCode(); // Access to MC particles mother @@ -3186,7 +3207,7 @@ struct LFNucleiBATask { const int nMothers = static_cast(motherIds.size()); firstMotherId = -1; firstMotherPdg = -1; - + firstMotherPt = -1.f; nSaved = 0; for (int iMom = 0; iMom < nMothers; ++iMom) { @@ -3196,13 +3217,17 @@ struct LFNucleiBATask { } o2::aod::McParticles::iterator mother = particles.iteratorAt(motherId); pdgMom = mother.pdgCode(); + ptMom = mother.pt(); if (iMom == 0) { firstMotherId = motherId; firstMotherPdg = pdgMom; + firstMotherPt = ptMom; } if (nSaved < 8) { - pdgList[nSaved++] = pdgMom; + pdgMomList[nSaved] = pdgMom; + ptMomList[nSaved] = ptMom; + ++nSaved; } } @@ -3472,21 +3497,23 @@ struct LFNucleiBATask { } else { histos.fill(HIST("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueMaterial"), hePt, track.dcaXY()); if (!IsFilteredData) { + histos.fill(HIST("tracks/helium/dca/before/hNumMothers"), nSaved); if (nSaved > 0) { - for (int i = 0; i < nSaved; ++i) { - int idxComp = (i <= kMaxNumMom) ? i : (kMaxNumMom + 1); - int pdgMom = pdgList[i]; - int yVal = -1; + for (int iMom = 0; iMom < nSaved; iMom++) { + int motherIndexBin = (iMom <= kMaxNumMom) ? iMom : (kMaxNumMom + 1); + int pdgMom = pdgMomList[iMom]; + float ptMom = ptMomList[iMom]; + int motherSpeciesBin = -1; if (pdgMom != -1) { - yVal = 0; - for (int j = 0; j < kNumMotherlist; ++j) { + motherSpeciesBin = 0; + for (int j = 0; j < kNumMotherlist; j++) { if (kPdgMotherlist[j] == pdgMom) { - yVal = j + 1; + motherSpeciesBin = j + 1; break; } } } - histos.fill(HIST("tracks/helium/dca/before/hMomTrueMaterial"), idxComp, yVal); + histos.fill(HIST("tracks/helium/dca/before/hMomTrueMaterial"), motherIndexBin, motherSpeciesBin, ptMom); } } } @@ -4908,7 +4935,7 @@ struct LFNucleiBATask { if constexpr (IsFilteredData) { isPhysPrim = track.isPhysicalPrimary(); isProdByGen = track.producedByGenerator(); - isWeakDecay = track.getProcess() == 4; + isWeakDecay = (track.getProcess() == kProcessWeakDecay); pdgCode = track.pdgCode(); isItsPassed = track.itsPassed(); isTpcPassed = track.tpcPassed(); @@ -4920,7 +4947,7 @@ struct LFNucleiBATask { } isPhysPrim = track.mcParticle().isPhysicalPrimary(); isProdByGen = track.mcParticle().producedByGenerator(); - isWeakDecay = track.mcParticle().getProcess() == 4; + isWeakDecay = (track.mcParticle().getProcess() == kProcessWeakDecay); pdgCode = track.mcParticle().pdgCode(); isItsPassed = track.passedITSNCls() && track.passedITSChi2NDF() && @@ -6066,7 +6093,7 @@ struct LFNucleiBATask { bool isPhysPrim = mcParticleGen.isPhysicalPrimary(); bool isProdByGen = mcParticleGen.producedByGenerator(); - bool isWeakDecay = mcParticleGen.getProcess() == 4; + bool isWeakDecay = (mcParticleGen.getProcess() == kProcessWeakDecay); if (mcParticleGen.pdgCode() == PDGPion) { spectraGen.fill(HIST("pion/histGenPtPion"), mcParticleGen.pt()); From bc3cd60518bf31d006e554b97d2cd6d2231f2f0b Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 9 Sep 2025 14:11:57 +0200 Subject: [PATCH 2/7] NucleiTask - Add mothers for Deuteron --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 105 +++++++++++++++++++------- 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index c595a35c7a8..092c122f85e 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -214,6 +214,11 @@ struct LFNucleiBATask { Configurable enableCentrality{"enableCentrality", true, "Flag to enable centrality 3D histos)"}; + // ITS to TPC - Fake hit loop + static constexpr int kFakeLoop = 10; // Fixed O2Linter error + // TPC low/high momentum range + static constexpr float cfgTpcClasses[] = {0.5f, 0.1f}; + // Weak-decay flag static constexpr int kProcessWeakDecay = 4; @@ -247,7 +252,7 @@ struct LFNucleiBATask { 1000260560}; static constexpr int kNumMotherlist = sizeof(kPdgMotherlist) / sizeof(kPdgMotherlist[0]); - static constexpr const char* kMomtherNames[kNumMotherlist] = { + static constexpr const char* kMotherNames[kNumMotherlist] = { "#pi", "K+", "K0", @@ -965,6 +970,26 @@ struct LFNucleiBATask { histos.add("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTruePrim", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); histos.add("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueSec", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); histos.add("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueMaterial", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); + + histos.add("tracks/deuteron/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}}); + histos.add("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); + + std::shared_ptr hTemp_De = histos.get(HIST("tracks/deuteron/dca/before/hMomTrueMaterial")); + TH3* hPDG_De = hTemp_De.get(); + + TAxis* axPDG_De = hPDG_De->GetXaxis(); + for (int i = 0; i <= kMaxNumMom; i++) { + axPDG_De->SetBinLabel(i + 1, Form("%d", i)); + } + axPDG_De->SetBinLabel(kMaxNumMom + 2, ">=5"); + + TAxis* ayPDG_De = hPDG_De->GetYaxis(); + ayPDG_De->SetBinLabel(1, "undef."); + ayPDG_De->SetBinLabel(2, "other"); + for (int i = 0; i < kNumMotherlist; i++) { + ayPDG_De->SetBinLabel(i + 3, kMotherNames[i]); + } + histos.add("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueTransport", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); histos.add("tracks/deuteron/dca/before/hDCAxyVsPtantiDeuteronTrue", "DCAxy vs Pt (#bar{d}); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); @@ -1163,23 +1188,23 @@ struct LFNucleiBATask { histos.add("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueMaterial", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}}); histos.add("tracks/helium/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}}); - histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {200, 0.0, 8.0}}); + histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); // Fix for getting TH3 pointer - std::shared_ptr hTemp = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); - TH3* hPDG = hTemp.get(); + std::shared_ptr hTemp_He = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); + TH3* hPDG_He = hTemp_He.get(); - TAxis* axPDG = hPDG->GetXaxis(); - for (int i = 0; i <= kMaxNumMom; ++i) { - axPDG->SetBinLabel(i + 1, Form("%d", i)); + TAxis* axPDG_He = hPDG_He->GetXaxis(); + for (int i = 0; i <= kMaxNumMom; i++) { + axPDG_He->SetBinLabel(i + 1, Form("%d", i)); } - axPDG->SetBinLabel(kMaxNumMom + 2, ">=5"); + axPDG_He->SetBinLabel(kMaxNumMom + 2, ">=5"); - TAxis* ayPDG = hPDG->GetYaxis(); - ayPDG->SetBinLabel(1, "undef."); - ayPDG->SetBinLabel(2, "other"); - for (int i = 0; i < kNumMotherlist; ++i) { - ayPDG->SetBinLabel(i + 3, Form("%d", kPdgMotherlist[i])); + TAxis* ayPDG_He = hPDG_He->GetYaxis(); + ayPDG_He->SetBinLabel(1, "undef."); + ayPDG_He->SetBinLabel(2, "other"); + for (int i = 0; i < kNumMotherlist; i++) { + ayPDG_He->SetBinLabel(i + 3, kMotherNames[i]); } histos.add("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueTransport", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}}); @@ -3181,8 +3206,8 @@ struct LFNucleiBATask { [[maybe_unused]] int firstMotherId = -1; [[maybe_unused]] int firstMotherPdg = -1; [[maybe_unused]] float firstMotherPt = -1.f; - [[maybe_unused]] int pdgMomList[8]; - [[maybe_unused]] float ptMomList[8]; + [[maybe_unused]] int pdgMomList[kMaxNumMom]; + [[maybe_unused]] float ptMomList[kMaxNumMom]; [[maybe_unused]] int nSaved = 0; if constexpr (IsFilteredData) { @@ -3210,7 +3235,7 @@ struct LFNucleiBATask { firstMotherPt = -1.f; nSaved = 0; - for (int iMom = 0; iMom < nMothers; ++iMom) { + for (int iMom = 0; iMom < nMothers; iMom++) { int motherId = motherIds[iMom]; if (motherId < 0 || motherId >= particles.size()) { continue; // added check on mother @@ -3224,15 +3249,15 @@ struct LFNucleiBATask { firstMotherPdg = pdgMom; firstMotherPt = ptMom; } - if (nSaved < 8) { + if (nSaved < kMaxNumMom) { pdgMomList[nSaved] = pdgMom; ptMomList[nSaved] = ptMom; - ++nSaved; + nSaved++; } } genPt = track.mcParticle().pt(); - for (int i = 0; i < 10; i++) { // From ITS to TPC + for (int i = 0; i < kFakeLoop; i++) { // From ITS to TPC if (track.mcMask() & 1 << i) { hasFakeHit = true; break; @@ -3333,10 +3358,32 @@ struct LFNucleiBATask { if (!isPhysPrim && !isProdByGen) { if (outFlagOptions.makeDCABeforeCutPlots) { histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueTransport"), DPt, track.dcaXY()); - if (isWeakDecay) + if (isWeakDecay) { histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueSec"), DPt, track.dcaXY()); - else + } else { histos.fill(HIST("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueMaterial"), DPt, track.dcaXY()); + if constexpr (!IsFilteredData) { + histos.fill(HIST("tracks/deuteron/dca/before/hNumMothers"), nSaved); + if (nSaved > 0) { + for (int iMom = 0; iMom < nSaved; iMom++) { + int motherIndexBin = (iMom <= kMaxNumMom) ? iMom : (kMaxNumMom + 1); + int pdgMom = pdgMomList[iMom]; + float ptMom = ptMomList[iMom]; + int motherSpeciesBin = -1; + if (pdgMom != -1) { + motherSpeciesBin = 0; + for (int j = 0; j < kNumMotherlist; j++) { + if (kPdgMotherlist[j] == pdgMom) { + motherSpeciesBin = j + 1; + break; + } + } + } + histos.fill(HIST("tracks/deuteron/dca/before/hMomTrueMaterial"), motherIndexBin, motherSpeciesBin, ptMom); + } + } + } + } if (track.hasTOF() && outFlagOptions.doTOFplots) { histos.fill(HIST("tracks/deuteron/dca/before/TOF/hDCAxyVsPtDeuteronTrueTransport"), DPt, track.dcaXY()); if (isWeakDecay) @@ -3929,26 +3976,26 @@ struct LFNucleiBATask { debugHistos.fill(HIST("debug/qa/h2TPCncrVsPtPos"), track.tpcInnerParam(), track.tpcNClsCrossedRows()); debugHistos.fill(HIST("debug/qa/h2TPCncrVsTPCsignalPos"), track.tpcSignal(), track.tpcNClsCrossedRows()); - if (track.tpcInnerParam() < 0.5f) { + if (track.tpcInnerParam() < cfgTpcClasses[0]) { debugHistos.fill(HIST("debug/qa/h1TPCncrLowPPos"), track.tpcNClsCrossedRows()); } - if ((track.tpcInnerParam() >= 0.5f) && (track.tpcInnerParam() < 1.f)) { + if ((track.tpcInnerParam() >= cfgTpcClasses[0]) && (track.tpcInnerParam() < cfgTpcClasses[1])) { debugHistos.fill(HIST("debug/qa/h1TPCncrMidPPos"), track.tpcNClsCrossedRows()); } - if (track.tpcInnerParam() >= 1.f) { + if (track.tpcInnerParam() >= cfgTpcClasses[1]) { debugHistos.fill(HIST("debug/qa/h1TPCncrHighPPos"), track.tpcNClsCrossedRows()); } } else { debugHistos.fill(HIST("debug/qa/h2TPCncrVsPtNeg"), track.tpcInnerParam(), track.tpcNClsCrossedRows()); debugHistos.fill(HIST("debug/qa/h2TPCncrVsTPCsignalNeg"), track.tpcSignal(), track.tpcNClsCrossedRows()); - if (track.tpcInnerParam() < 0.5f) { + if (track.tpcInnerParam() < cfgTpcClasses[0]) { debugHistos.fill(HIST("debug/qa/h1TPCncrLowPNeg"), track.tpcNClsCrossedRows()); } - if ((track.tpcInnerParam() >= 0.5f) && (track.tpcInnerParam() < 1.f)) { + if ((track.tpcInnerParam() >= cfgTpcClasses[0]) && (track.tpcInnerParam() < cfgTpcClasses[1])) { debugHistos.fill(HIST("debug/qa/h1TPCncrMidPNeg"), track.tpcNClsCrossedRows()); } - if (track.tpcInnerParam() >= 1.f) { + if (track.tpcInnerParam() >= cfgTpcClasses[1]) { debugHistos.fill(HIST("debug/qa/h1TPCncrHighPNeg"), track.tpcNClsCrossedRows()); } } @@ -4961,7 +5008,7 @@ struct LFNucleiBATask { track.passedTPCRefit() && track.hasTPC(); - for (int i = 0; i < 10; i++) { // From ITS to TPC + for (int i = 0; i < kFakeLoop; i++) { // From ITS to TPC if (track.mcMask() & 1 << i) { hasFakeHit = true; break; @@ -6086,7 +6133,7 @@ struct LFNucleiBATask { spectraGen.fill(HIST("histGenVetxZ"), mcCollision.posZ()); if (mcCollision.centFT0M() < cfgMultCutLow || mcCollision.centFT0M() > cfgMultCutHigh) return; - for (auto& mcParticleGen : mcParticles) { // NOLINT + for (auto const& mcParticleGen : mcParticles) { // NOLINT if (mcParticleGen.y() > kinemOptions.cfgRapidityCutHigh || mcParticleGen.y() < kinemOptions.cfgRapidityCutLow) { continue; } From 1c1c116c3f5daa52a91feec79979771c86b217a5 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 9 Sep 2025 14:19:52 +0200 Subject: [PATCH 3/7] NucleiTask - Add mothers - Small fix --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 55 ++++++++++++++------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 092c122f85e..75f85b59a37 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -217,7 +217,8 @@ struct LFNucleiBATask { // ITS to TPC - Fake hit loop static constexpr int kFakeLoop = 10; // Fixed O2Linter error // TPC low/high momentum range - static constexpr float cfgTpcClasses[] = {0.5f, 0.1f}; + static constexpr float kCfgTpcClasses[] = {0.5f, 0.1f}; + static constexpr float kCfgKaonCut = 5.f; // Weak-decay flag static constexpr int kProcessWeakDecay = 4; @@ -974,20 +975,20 @@ struct LFNucleiBATask { histos.add("tracks/deuteron/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}}); histos.add("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); - std::shared_ptr hTemp_De = histos.get(HIST("tracks/deuteron/dca/before/hMomTrueMaterial")); - TH3* hPDG_De = hTemp_De.get(); + std::shared_ptr hTempDe = histos.get(HIST("tracks/deuteron/dca/before/hMomTrueMaterial")); + TH3* hPDG_De = hTempDe.get(); - TAxis* axPDG_De = hPDG_De->GetXaxis(); + TAxis* axPdgDe = hPDG_De->GetXaxis(); for (int i = 0; i <= kMaxNumMom; i++) { - axPDG_De->SetBinLabel(i + 1, Form("%d", i)); + axPdgDe->SetBinLabel(i + 1, Form("%d", i)); } - axPDG_De->SetBinLabel(kMaxNumMom + 2, ">=5"); + axPdgDe->SetBinLabel(kMaxNumMom + 2, ">=5"); - TAxis* ayPDG_De = hPDG_De->GetYaxis(); - ayPDG_De->SetBinLabel(1, "undef."); - ayPDG_De->SetBinLabel(2, "other"); + TAxis* ayPdgDe = hPDG_De->GetYaxis(); + ayPdgDe->SetBinLabel(1, "undef."); + ayPdgDe->SetBinLabel(2, "other"); for (int i = 0; i < kNumMotherlist; i++) { - ayPDG_De->SetBinLabel(i + 3, kMotherNames[i]); + ayPdgDe->SetBinLabel(i + 3, kMotherNames[i]); } histos.add("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueTransport", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); @@ -1191,20 +1192,20 @@ struct LFNucleiBATask { histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); // Fix for getting TH3 pointer - std::shared_ptr hTemp_He = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); - TH3* hPDG_He = hTemp_He.get(); + std::shared_ptr hTempHe = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); + TH3* hPDG_He = hTempHe.get(); - TAxis* axPDG_He = hPDG_He->GetXaxis(); + TAxis* axPdgHe = hPDG_He->GetXaxis(); for (int i = 0; i <= kMaxNumMom; i++) { - axPDG_He->SetBinLabel(i + 1, Form("%d", i)); + axPdgHe->SetBinLabel(i + 1, Form("%d", i)); } - axPDG_He->SetBinLabel(kMaxNumMom + 2, ">=5"); + axPdgHe->SetBinLabel(kMaxNumMom + 2, ">=5"); - TAxis* ayPDG_He = hPDG_He->GetYaxis(); - ayPDG_He->SetBinLabel(1, "undef."); - ayPDG_He->SetBinLabel(2, "other"); + TAxis* ayPdgHe = hPDG_He->GetYaxis(); + ayPdgHe->SetBinLabel(1, "undef."); + ayPdgHe->SetBinLabel(2, "other"); for (int i = 0; i < kNumMotherlist; i++) { - ayPDG_He->SetBinLabel(i + 3, kMotherNames[i]); + ayPdgHe->SetBinLabel(i + 3, kMotherNames[i]); } histos.add("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueTransport", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}}); @@ -3976,26 +3977,26 @@ struct LFNucleiBATask { debugHistos.fill(HIST("debug/qa/h2TPCncrVsPtPos"), track.tpcInnerParam(), track.tpcNClsCrossedRows()); debugHistos.fill(HIST("debug/qa/h2TPCncrVsTPCsignalPos"), track.tpcSignal(), track.tpcNClsCrossedRows()); - if (track.tpcInnerParam() < cfgTpcClasses[0]) { + if (track.tpcInnerParam() < kCfgTpcClasses[0]) { debugHistos.fill(HIST("debug/qa/h1TPCncrLowPPos"), track.tpcNClsCrossedRows()); } - if ((track.tpcInnerParam() >= cfgTpcClasses[0]) && (track.tpcInnerParam() < cfgTpcClasses[1])) { + if ((track.tpcInnerParam() >= kCfgTpcClasses[0]) && (track.tpcInnerParam() < kCfgTpcClasses[1])) { debugHistos.fill(HIST("debug/qa/h1TPCncrMidPPos"), track.tpcNClsCrossedRows()); } - if (track.tpcInnerParam() >= cfgTpcClasses[1]) { + if (track.tpcInnerParam() >= kCfgTpcClasses[1]) { debugHistos.fill(HIST("debug/qa/h1TPCncrHighPPos"), track.tpcNClsCrossedRows()); } } else { debugHistos.fill(HIST("debug/qa/h2TPCncrVsPtNeg"), track.tpcInnerParam(), track.tpcNClsCrossedRows()); debugHistos.fill(HIST("debug/qa/h2TPCncrVsTPCsignalNeg"), track.tpcSignal(), track.tpcNClsCrossedRows()); - if (track.tpcInnerParam() < cfgTpcClasses[0]) { + if (track.tpcInnerParam() < kCfgTpcClasses[0]) { debugHistos.fill(HIST("debug/qa/h1TPCncrLowPNeg"), track.tpcNClsCrossedRows()); } - if ((track.tpcInnerParam() >= cfgTpcClasses[0]) && (track.tpcInnerParam() < cfgTpcClasses[1])) { + if ((track.tpcInnerParam() >= kCfgTpcClasses[0]) && (track.tpcInnerParam() < kCfgTpcClasses[1])) { debugHistos.fill(HIST("debug/qa/h1TPCncrMidPNeg"), track.tpcNClsCrossedRows()); } - if (track.tpcInnerParam() >= cfgTpcClasses[1]) { + if (track.tpcInnerParam() >= kCfgTpcClasses[1]) { debugHistos.fill(HIST("debug/qa/h1TPCncrHighPNeg"), track.tpcNClsCrossedRows()); } } @@ -4008,7 +4009,7 @@ struct LFNucleiBATask { histos.fill(HIST("tracks/eff/h2pVsTPCmomentum"), track.tpcInnerParam(), track.p()); if (filterOptions.enableFiltering) { - if (track.tpcNSigmaKa() < 5) + if (track.tpcNSigmaKa() < kCfgKaonCut) continue; } @@ -6398,7 +6399,7 @@ struct LFNucleiBATask { for (const auto& mcPart : mcParticles) { if (!mcPart.isPhysicalPrimary()) continue; - if (std::abs(mcPart.y()) >= 0.5) + if (std::abs(mcPart.y()) >= kCfgTpcClasses[0]) continue; if (mcPart.pdgCode() == PDGDeuteron) { evLossHistos.fill(HIST("evLoss/pt/hDeuteronGen"), mcPart.pt()); From c481eaeb241d99a176315ce83c4f229a30115f01 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 9 Sep 2025 14:22:08 +0200 Subject: [PATCH 4/7] NucleiTask - Add mothers - Fix --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 75f85b59a37..65db80f491c 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -976,15 +976,15 @@ struct LFNucleiBATask { histos.add("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); std::shared_ptr hTempDe = histos.get(HIST("tracks/deuteron/dca/before/hMomTrueMaterial")); - TH3* hPDG_De = hTempDe.get(); + TH3* hPdgDe = hTempDe.get(); - TAxis* axPdgDe = hPDG_De->GetXaxis(); + TAxis* axPdgDe = hPdgDe->GetXaxis(); for (int i = 0; i <= kMaxNumMom; i++) { axPdgDe->SetBinLabel(i + 1, Form("%d", i)); } axPdgDe->SetBinLabel(kMaxNumMom + 2, ">=5"); - TAxis* ayPdgDe = hPDG_De->GetYaxis(); + TAxis* ayPdgDe = hPdgDe->GetYaxis(); ayPdgDe->SetBinLabel(1, "undef."); ayPdgDe->SetBinLabel(2, "other"); for (int i = 0; i < kNumMotherlist; i++) { @@ -1193,15 +1193,15 @@ struct LFNucleiBATask { // Fix for getting TH3 pointer std::shared_ptr hTempHe = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); - TH3* hPDG_He = hTempHe.get(); + TH3* hPdgHe = hTempHe.get(); - TAxis* axPdgHe = hPDG_He->GetXaxis(); + TAxis* axPdgHe = hPdgHe->GetXaxis(); for (int i = 0; i <= kMaxNumMom; i++) { axPdgHe->SetBinLabel(i + 1, Form("%d", i)); } axPdgHe->SetBinLabel(kMaxNumMom + 2, ">=5"); - TAxis* ayPdgHe = hPDG_He->GetYaxis(); + TAxis* ayPdgHe = hPdgHe->GetYaxis(); ayPdgHe->SetBinLabel(1, "undef."); ayPdgHe->SetBinLabel(2, "other"); for (int i = 0; i < kNumMotherlist; i++) { From 717a5730e45cdc77ced4edbdbecbc108942a9706 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 9 Sep 2025 16:10:21 +0200 Subject: [PATCH 5/7] NucleiTask - Added suggested fixes --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 65db80f491c..a7035166559 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -41,6 +41,7 @@ #include "ReconstructionDataFormats/PID.h" #include "ReconstructionDataFormats/Track.h" +#include "TMCProcess.h" #include #include @@ -71,7 +72,7 @@ struct LFNucleiBATask { Configurable enableAl{"enableAl", true, "Flag to enable alpha analysis."}; Configurable enableTrackingEff{"enableTrackingEff", 0, "Flag to enable tracking efficiency hitos."}; - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // NOLINT + Configurable ccdbUrl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; // Set the triggered events skimming scheme struct : ConfigurableGroup { @@ -220,9 +221,6 @@ struct LFNucleiBATask { static constexpr float kCfgTpcClasses[] = {0.5f, 0.1f}; static constexpr float kCfgKaonCut = 5.f; - // Weak-decay flag - static constexpr int kProcessWeakDecay = 4; - // PDG codes and masses used in this analysis static constexpr int PDGPion = PDG_t::kPiPlus; static constexpr int PDGKaon = PDG_t::kKPlus; @@ -2699,7 +2697,7 @@ struct LFNucleiBATask { if constexpr (IsFilteredData) { isPhysPrim = track.isPhysicalPrimary(); isProdByGen = track.producedByGenerator(); - isWeakDecay = (track.getProcess() == kProcessWeakDecay); + isWeakDecay = (track.getProcess() == TMCProcess::kPDecay); pdgCode = track.pdgCode(); } else { if (!track.has_mcParticle()) { @@ -2707,7 +2705,7 @@ struct LFNucleiBATask { } isPhysPrim = track.mcParticle().isPhysicalPrimary(); isProdByGen = track.mcParticle().producedByGenerator(); - isWeakDecay = (track.mcParticle().getProcess() == kProcessWeakDecay); + isWeakDecay = (track.mcParticle().getProcess() == TMCProcess::kPDecay); pdgCode = track.mcParticle().pdgCode(); } @@ -3214,7 +3212,7 @@ struct LFNucleiBATask { if constexpr (IsFilteredData) { isPhysPrim = track.isPhysicalPrimary(); isProdByGen = track.producedByGenerator(); - isWeakDecay = (track.getProcess() == kProcessWeakDecay); + isWeakDecay = (track.getProcess() == TMCProcess::kPDecay); pdgCode = track.pdgCode(); genPt = std::sqrt(std::pow(track.px(), 2) + std::pow(track.py(), 2)); @@ -3224,7 +3222,7 @@ struct LFNucleiBATask { } isPhysPrim = track.mcParticle().isPhysicalPrimary(); isProdByGen = track.mcParticle().producedByGenerator(); - isWeakDecay = (track.mcParticle().getProcess() == kProcessWeakDecay); + isWeakDecay = (track.mcParticle().getProcess() == TMCProcess::kPDecay); pdgCode = track.mcParticle().pdgCode(); // Access to MC particles mother @@ -4983,7 +4981,7 @@ struct LFNucleiBATask { if constexpr (IsFilteredData) { isPhysPrim = track.isPhysicalPrimary(); isProdByGen = track.producedByGenerator(); - isWeakDecay = (track.getProcess() == kProcessWeakDecay); + isWeakDecay = (track.getProcess() == TMCProcess::kPDecay); pdgCode = track.pdgCode(); isItsPassed = track.itsPassed(); isTpcPassed = track.tpcPassed(); @@ -4995,7 +4993,7 @@ struct LFNucleiBATask { } isPhysPrim = track.mcParticle().isPhysicalPrimary(); isProdByGen = track.mcParticle().producedByGenerator(); - isWeakDecay = (track.mcParticle().getProcess() == kProcessWeakDecay); + isWeakDecay = (track.mcParticle().getProcess() == TMCProcess::kPDecay); pdgCode = track.mcParticle().pdgCode(); isItsPassed = track.passedITSNCls() && track.passedITSChi2NDF() && @@ -6141,7 +6139,7 @@ struct LFNucleiBATask { bool isPhysPrim = mcParticleGen.isPhysicalPrimary(); bool isProdByGen = mcParticleGen.producedByGenerator(); - bool isWeakDecay = (mcParticleGen.getProcess() == kProcessWeakDecay); + bool isWeakDecay = (mcParticleGen.getProcess() == TMCProcess::kPDecay); if (mcParticleGen.pdgCode() == PDGPion) { spectraGen.fill(HIST("pion/histGenPtPion"), mcParticleGen.pt()); From a6e4f382026e63b31204849f28cbe8c5e4a353ba Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 9 Sep 2025 16:18:49 +0200 Subject: [PATCH 6/7] NucleiTask - Added suggested fixes - 2 --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index a7035166559..3429371b0fd 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -238,14 +238,14 @@ struct LFNucleiBATask { // PDG of Mothers static constexpr int kPdgMotherlist[] = { - PDGPion, - PDGKaon, - 311, - PDGProton, - PDGDeuteron, - PDGTriton, - PDGHelium, - PDGAlpha, + PDG_t::kPiPlus, + PDG_t::kKPlus, + PDG_t::kK0Short, + PDG_t::kProton, + o2::constants::physics::Pdg::kDeuteron, + o2::constants::physics::Pdg::kTriton, + o2::constants::physics::Pdg::kHelium3, + o2::constants::physics::Pdg::kAlpha, 1000130270, 1000140280, 1000260560}; From d5ef01e3b181f073f2a7da205ec6fc6f50ac3486 Mon Sep 17 00:00:00 2001 From: Giovanni Malfattore Date: Tue, 9 Sep 2025 17:04:03 +0200 Subject: [PATCH 7/7] NucleiTask - Changed PDG mother list --- PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx | 51 ++++++++++++++------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx index 3429371b0fd..3e365e0991d 100644 --- a/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx +++ b/PWGLF/Tasks/Nuspex/LFNucleiBATask.cxx @@ -237,32 +237,33 @@ struct LFNucleiBATask { static constexpr float MassAlphaVal = o2::constants::physics::MassAlpha; // PDG of Mothers - static constexpr int kPdgMotherlist[] = { + static constexpr int kPdgMotherList[] = { PDG_t::kPiPlus, PDG_t::kKPlus, PDG_t::kK0Short, + PDG_t::kNeutron, PDG_t::kProton, + PDG_t::kLambda0, o2::constants::physics::Pdg::kDeuteron, - o2::constants::physics::Pdg::kTriton, o2::constants::physics::Pdg::kHelium3, - o2::constants::physics::Pdg::kAlpha, - 1000130270, - 1000140280, - 1000260560}; - static constexpr int kNumMotherlist = sizeof(kPdgMotherlist) / sizeof(kPdgMotherlist[0]); - - static constexpr const char* kMotherNames[kNumMotherlist] = { - "#pi", - "K+", - "K0", + o2::constants::physics::Pdg::kTriton, + o2::constants::physics::Pdg::kHyperTriton, + o2::constants::physics::Pdg::kAlpha}; + + static constexpr int kNumMotherList = sizeof(kPdgMotherList) / sizeof(kPdgMotherList[0]); + + static constexpr const char* kMotherNames[kNumMotherList] = { + "#pi^{+}", + "K^{+}", + "K^{0}_{S}", + "n", "p", + "#Lambda", "d", - "t", "He3", - "#alpha", - "Al", - "Si", - "Fe"}; + "t", + "^{3}_{#Lambda}H", + "He4"}; static constexpr int kMaxNumMom = 4; // X: 0..4, overflow=5 @@ -971,7 +972,7 @@ struct LFNucleiBATask { histos.add("tracks/deuteron/dca/before/hDCAxyVsPtDeuteronTrueMaterial", "DCAxy vs Pt (d); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptAxis}, {dcaxyAxis}}); histos.add("tracks/deuteron/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}}); - histos.add("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); + histos.add("tracks/deuteron/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherList + 2, -1.5, static_cast(kNumMotherList) + 0.5}, {250, 0.0, 10.0}}); std::shared_ptr hTempDe = histos.get(HIST("tracks/deuteron/dca/before/hMomTrueMaterial")); TH3* hPdgDe = hTempDe.get(); @@ -985,7 +986,7 @@ struct LFNucleiBATask { TAxis* ayPdgDe = hPdgDe->GetYaxis(); ayPdgDe->SetBinLabel(1, "undef."); ayPdgDe->SetBinLabel(2, "other"); - for (int i = 0; i < kNumMotherlist; i++) { + for (int i = 0; i < kNumMotherList; i++) { ayPdgDe->SetBinLabel(i + 3, kMotherNames[i]); } @@ -1187,7 +1188,7 @@ struct LFNucleiBATask { histos.add("tracks/helium/dca/before/hDCAxyVsPtHeliumTrueMaterial", "DCAxy vs Pt (He); #it{p}_{T} (GeV/#it{c}); DCAxy (cm)", HistType::kTH2F, {{ptZHeAxis}, {dcaxyAxis}}); histos.add("tracks/helium/dca/before/hNumMothers", "N mothers per particle; N mothers;counts", HistType::kTH1I, {{7, 1.0, 8.0}}); - histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherlist + 2, -1.5, static_cast(kNumMotherlist) + 0.5}, {250, 0.0, 10.0}}); + histos.add("tracks/helium/dca/before/hMomTrueMaterial", "MC mothers;mother index;mother type; mother #it{p}_{T}", HistType::kTH3F, {{kMaxNumMom + 2, -0.5, static_cast(kMaxNumMom) + 1.5}, {kNumMotherList + 2, -1.5, static_cast(kNumMotherList) + 0.5}, {250, 0.0, 10.0}}); // Fix for getting TH3 pointer std::shared_ptr hTempHe = histos.get(HIST("tracks/helium/dca/before/hMomTrueMaterial")); @@ -1202,7 +1203,7 @@ struct LFNucleiBATask { TAxis* ayPdgHe = hPdgHe->GetYaxis(); ayPdgHe->SetBinLabel(1, "undef."); ayPdgHe->SetBinLabel(2, "other"); - for (int i = 0; i < kNumMotherlist; i++) { + for (int i = 0; i < kNumMotherList; i++) { ayPdgHe->SetBinLabel(i + 3, kMotherNames[i]); } @@ -3371,8 +3372,8 @@ struct LFNucleiBATask { int motherSpeciesBin = -1; if (pdgMom != -1) { motherSpeciesBin = 0; - for (int j = 0; j < kNumMotherlist; j++) { - if (kPdgMotherlist[j] == pdgMom) { + for (int j = 0; j < kNumMotherList; j++) { + if (kPdgMotherList[j] == pdgMom) { motherSpeciesBin = j + 1; break; } @@ -3552,8 +3553,8 @@ struct LFNucleiBATask { int motherSpeciesBin = -1; if (pdgMom != -1) { motherSpeciesBin = 0; - for (int j = 0; j < kNumMotherlist; j++) { - if (kPdgMotherlist[j] == pdgMom) { + for (int j = 0; j < kNumMotherList; j++) { + if (kPdgMotherList[j] == pdgMom) { motherSpeciesBin = j + 1; break; }