From 0666f25e1b5163920ed39433570c563e2254785f Mon Sep 17 00:00:00 2001 From: Cristian Moscatelli Date: Fri, 22 May 2026 16:14:11 +0200 Subject: [PATCH 1/2] Add INELgt0 ev-sel --- .../Nuspex/deuteronInTriggeredEvents.cxx | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx b/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx index 8749d248835..1da2bfb4c85 100644 --- a/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx +++ b/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx @@ -29,6 +29,7 @@ // same as Data and o2-analysis-mccollision-converter #include "PWGLF/DataModel/LFSlimNucleiTables.h" +#include "PWGLF/Utils/inelGt.h" // #include "PWGJE/Core/JetBkgSubUtils.h" #include "PWGJE/Core/JetUtilities.h" @@ -62,6 +63,7 @@ #include #include +#include #include #include // for PDG codes #include @@ -205,14 +207,15 @@ enum evSel { kIsGoodZvtxFT0vsPV, kIsGoodITSLayersAll, kIsEPtriggered, + kINELgt0, kIsJetTriggered, // Check: evSel for event with at least one jet over pT-threshold kNevSels }; static const std::vector eventSelectionTitle{"Event selections"}; -static const std::vector eventSelectionLabels{"TVX", "TF border", "ITS ROF border", "Z vtx", "No same-bunch pile-up", "kIsGoodZvtxFT0vsPV", "isGoodITSLayersAll", "isEPtriggered", "IsJetTriggered"}; +static const std::vector eventSelectionLabels{"TVX", "TF border", "ITS ROF border", "Z vtx", "No same-bunch pile-up", "kIsGoodZvtxFT0vsPV", "isGoodITSLayersAll", "isEPtriggered", "IsINELgt0", "IsJetTriggered"}; -constexpr int EvSelDefault[9][1]{ +constexpr int EvSelDefault[10][1]{ {1}, {1}, {1}, // Default: sel8 @@ -221,11 +224,13 @@ constexpr int EvSelDefault[9][1]{ {0}, {0}, {0}, + {0}, // INEL > 0 {1}}; // Triggered on jets enum evGenSel : uint8_t { - kGenIsJetTriggered = 1 << 0, - kGenHasRecoEv = 1 << 1 + kGenIsINELgt0 = 1 << 0, + kGenIsJetTriggered = 1 << 1, + kGenHasRecoEv = 1 << 2 }; enum triggerListName { @@ -280,7 +285,7 @@ struct DeuteronInTriggeredEvents { Configurable cfgCutPtMaxTree{"cfgCutPtMaxTree", 15.0f, "Maximum track transverse momentum for tree saving"}; // Event selections - Configurable> cfgEventSelections{"cfgEventSelections", {nuclei::EvSelDefault[0], 9, 1, nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, "Event selections"}; + Configurable> cfgEventSelections{"cfgEventSelections", {nuclei::EvSelDefault[0], 10, 1, nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, "Event selections"}; Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; Configurable> cfgMomentumScalingBetheBloch{"cfgMomentumScalingBetheBloch", {nuclei::bbMomScalingDefault[0], 5, 2, nuclei::names, nuclei::chargeLabelNames}, "TPC Bethe-Bloch momentum scaling for light nuclei"}; @@ -409,6 +414,11 @@ struct DeuteronInTriggeredEvents { spectra.fill(HIST("hEventSelections"), nuclei::evSel::kIsEPtriggered + 1); } + if (cfgEventSelections->get(nuclei::evSel::kINELgt0) && !collision.selection_bit(aod::kINELgtZERO)) { + return false; + } + spectra.fill(HIST("hEventSelections"), nuclei::evSel::kINELgt0 + 1); + auto bc = collision.template bc_as(); initCCDB(bc); @@ -494,6 +504,7 @@ struct DeuteronInTriggeredEvents { spectra.get(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsGoodZvtxFT0vsPV + 2, "isGoodZvtxFT0vsPV"); spectra.get(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsGoodITSLayersAll + 2, "IsGoodITSLayersAll"); spectra.get(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsEPtriggered + 2, "IsEPtriggered"); + spectra.get(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kINELgt0 + 2, "IsINELgt0"); spectra.get(HIST("hEventSelections"))->GetXaxis()->SetBinLabel(nuclei::evSel::kIsJetTriggered + 2, "IsJetTriggered"); // Distribution of z-vertex of selected events @@ -933,6 +944,8 @@ struct DeuteronInTriggeredEvents { std::vector goodCollisions(mcCollisions.size(), false); std::vector eventMask(mcCollisions.size(), 0); + auto* pdgDB = TDatabasePDG::Instance(); + // Jet trigger condition auto trigger = static_cast(cfgTriggerList.value); @@ -943,8 +956,11 @@ struct DeuteronInTriggeredEvents { auto mcParticlesPerColl = particlesMC.sliceBy(perMcCollision, c.globalIndex()); auto& mask = eventMask[c.globalIndex()]; + if (o2::pwglf::isINELgt0mc(mcParticlesPerColl, pdgDB)) + mask |= nuclei::kGenIsINELgt0; + if (isMCJetTriggered(mcParticlesPerColl, particlesMC, trigger)) - mask |= nuclei::kIsJetTriggered; + mask |= nuclei::kGenIsJetTriggered; } for (const auto& collision : collisions) { @@ -971,10 +987,13 @@ struct DeuteronInTriggeredEvents { auto& mask = eventMask[mcId]; mask |= nuclei::kGenHasRecoEv; - GenEventMCSel(mask); fillDataInfo(collision, slicedTracks); } + for (const auto& c : mcCollisions) { + GenEventMCSel(eventMask[c.globalIndex()]); + } + std::vector isReconstructed(particlesMC.size(), false); for (auto& c : nuclei::candidates) { auto label = tracks.iteratorAt(c.globalIndex); From e5ab9146b8b48c7cf8ddfe81d311e091a5cc543d Mon Sep 17 00:00:00 2001 From: Cristian Moscatelli Date: Fri, 22 May 2026 17:28:05 +0200 Subject: [PATCH 2/2] Modify pdgDB --- PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx b/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx index 1da2bfb4c85..0f309b028d0 100644 --- a/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx +++ b/PWGLF/TableProducer/Nuspex/deuteronInTriggeredEvents.cxx @@ -58,12 +58,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include // for PDG codes #include @@ -259,7 +259,8 @@ struct DeuteronInTriggeredEvents { Produces nucleiTableMCExtension; // For MC analysis Produces GenEventMCSel; // For MC reco events Service ccdb; - Zorro zorro; // Definition of Zorro: helpful for skimmed data + Service pdgDB; // For INELgt0 gen MC selection + Zorro zorro; // Definition of Zorro: helpful for skimmed data OutputObj zorroSummary{"zorroSummary"}; Configurable cfgCompensatePIDinTracking{"cfgCompensatePIDinTracking", false, "If true, divide tpcInnerParam by the electric charge"}; @@ -944,8 +945,6 @@ struct DeuteronInTriggeredEvents { std::vector goodCollisions(mcCollisions.size(), false); std::vector eventMask(mcCollisions.size(), 0); - auto* pdgDB = TDatabasePDG::Instance(); - // Jet trigger condition auto trigger = static_cast(cfgTriggerList.value);