From 4147943a4f004260461f58f32584159053edb7de Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Mon, 2 Jun 2025 17:56:24 +0200 Subject: [PATCH] feat: Add nuclei pair table to data model This commit adds a new table called `NucleiPairTable` to the data model. The new table contains information about pairs of light nuclei, including their kinematic properties, detector signals, and quality flags. The changes include: - Defining a new namespace `NucleiPairTableNS` with columns for the first and second particles in the pair. - Declaring a new table `NucleiPairTable` in the `o2::aod` namespace, which includes the columns from `NucleiPairTableNS`. - Modifying the `nucleiSpectra.cxx` file to produce the new `NucleiPairTable` in addition to the existing `NucleiTable`. - Adding a new configurable `cfgFillPairTree` to control whether the pair table should be filled. These changes will enable the analysis of light nuclei pairs. --- PWGLF/DataModel/LFSlimNucleiTables.h | 43 ++++++++++++++++++++ PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx | 24 ++++++++--- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/PWGLF/DataModel/LFSlimNucleiTables.h b/PWGLF/DataModel/LFSlimNucleiTables.h index 28067a9521b..fe23bbcae5b 100644 --- a/PWGLF/DataModel/LFSlimNucleiTables.h +++ b/PWGLF/DataModel/LFSlimNucleiTables.h @@ -53,6 +53,29 @@ DECLARE_SOA_COLUMN(SurvivedEventSelection, survivedEventSelection, bool); DECLARE_SOA_COLUMN(AbsoDecL, absoDecL, float); } // namespace NucleiTableNS + +namespace NucleiPairTableNS +{ +DECLARE_SOA_COLUMN(Pt1, pt1, float); // first particle pt +DECLARE_SOA_COLUMN(Eta1, eta1, float); // first particle eta +DECLARE_SOA_COLUMN(Phi1, phi1, float); // first particle phi +DECLARE_SOA_COLUMN(TPCInnerParam1, tpcInnerParam1, float); // first particle TPC inner param +DECLARE_SOA_COLUMN(TPCsignal1, tpcSignal1, float); // first particle TPC signal +DECLARE_SOA_COLUMN(DCAxy1, dcaxy1, float); // first particle DCA xy +DECLARE_SOA_COLUMN(DCAz1, dcaz1, float); // first particle DCA z +DECLARE_SOA_COLUMN(ClusterSizesITS1, clusterSizesITS1, uint32_t); // first particle ITS cluster sizes +DECLARE_SOA_COLUMN(Flags1, flags1, uint16_t); // first particle flags +DECLARE_SOA_COLUMN(Pt2, pt2, float); // second particle pt +DECLARE_SOA_COLUMN(Eta2, eta2, float); // second particle eta +DECLARE_SOA_COLUMN(Phi2, phi2, float); // second particle phi +DECLARE_SOA_COLUMN(TPCInnerParam2, tpcInnerParam2, float); // second particle TPC inner param +DECLARE_SOA_COLUMN(TPCsignal2, tpcSignal2, float); // second particle TPC signal +DECLARE_SOA_COLUMN(DCAxy2, dcaxy2, float); // second particle DCA xy +DECLARE_SOA_COLUMN(DCAz2, dcaz2, float); // second particle DCA z +DECLARE_SOA_COLUMN(ClusterSizesITS2, clusterSizesITS2, uint32_t); // second particle ITS cluster sizes +DECLARE_SOA_COLUMN(Flags2, flags2, uint16_t); // second particle flags +} // namespace NucleiPairTableNS + namespace NucleiFlowTableNS { DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); // centrality with FT0A estimator @@ -136,6 +159,26 @@ DECLARE_SOA_TABLE(NucleiTableMC, "AOD", "NUCLEITABLEMC", NucleiTableNS::SurvivedEventSelection, NucleiTableNS::AbsoDecL); +DECLARE_SOA_TABLE(NucleiPairTable, "AOD", "NUCLEIPAIRTABLE", + NucleiPairTableNS::Pt1, + NucleiPairTableNS::Eta1, + NucleiPairTableNS::Phi1, + NucleiPairTableNS::TPCInnerParam1, + NucleiPairTableNS::TPCsignal1, + NucleiPairTableNS::DCAxy1, + NucleiPairTableNS::DCAz1, + NucleiPairTableNS::ClusterSizesITS1, + NucleiPairTableNS::Flags1, + NucleiPairTableNS::Pt2, + NucleiPairTableNS::Eta2, + NucleiPairTableNS::Phi2, + NucleiPairTableNS::TPCInnerParam2, + NucleiPairTableNS::TPCsignal2, + NucleiPairTableNS::DCAxy2, + NucleiPairTableNS::DCAz2, + NucleiPairTableNS::ClusterSizesITS2, + NucleiPairTableNS::Flags2); + } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFSLIMNUCLEITABLES_H_ diff --git a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx index 2494942e9c3..ecf322306d2 100644 --- a/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx +++ b/PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx @@ -267,6 +267,7 @@ struct nucleiSpectra { }; Produces nucleiTable; + Produces nucleiPairTable; Produces nucleiTableMC; Produces nucleiTableFlow; Service ccdb; @@ -297,6 +298,7 @@ struct nucleiSpectra { Configurable> cfgDCAcut{"cfgDCAcut", {nuclei::DCAcutDefault[0], 5, 2, nuclei::names, nuclei::nDCAConfigName}, "Max DCAxy and DCAz for light nuclei"}; Configurable> cfgDownscaling{"cfgDownscaling", {nuclei::DownscalingDefault[0], 5, 1, nuclei::names, nuclei::DownscalingConfigName}, "Fraction of kept candidates for light nuclei"}; Configurable> cfgTreeConfig{"cfgTreeConfig", {nuclei::TreeConfigDefault[0], 5, 2, nuclei::names, nuclei::treeConfigNames}, "Filtered trees configuration"}; + Configurable cfgFillPairTree{"cfgFillPairTree", true, "Fill trees for pairs of light nuclei"}; Configurable> cfgDCAHists{"cfgDCAHists", {nuclei::DCAHistDefault[0], 5, 2, nuclei::names, nuclei::DCAConfigNames}, "DCA hist configuration"}; Configurable> cfgFlowHist{"cfgFlowHist", {nuclei::FlowHistDefault[0], 5, 1, nuclei::names, nuclei::flowConfigNames}, "Flow hist configuration"}; @@ -833,14 +835,24 @@ struct nucleiSpectra { } fillDataInfo(collision, tracks); - for (auto& c : nuclei::candidates) { - if (c.fillTree) { - nucleiTable(c.pt, c.eta, c.phi, c.tpcInnerParam, c.beta, c.zVertex, c.DCAxy, c.DCAz, c.TPCsignal, c.ITSchi2, c.TPCchi2, c.TOFchi2, c.flags, c.TPCfindableCls, c.TPCcrossedRows, c.ITSclsMap, c.TPCnCls, c.TPCnClsShared, c.clusterSizesITS); + for (size_t i1{0}; i1 < nuclei::candidates.size(); ++i1) { + auto& c1 = nuclei::candidates[i1]; + if (c1.fillTree) { + nucleiTable(c1.pt, c1.eta, c1.phi, c1.tpcInnerParam, c1.beta, c1.zVertex, c1.DCAxy, c1.DCAz, c1.TPCsignal, c1.ITSchi2, c1.TPCchi2, c1.TOFchi2, c1.flags, c1.TPCfindableCls, c1.TPCcrossedRows, c1.ITSclsMap, c1.TPCnCls, c1.TPCnClsShared, c1.clusterSizesITS); + if (cfgFillPairTree) { + for (size_t i2{i1 + 1}; i2 < nuclei::candidates.size(); ++i2) { + auto& c2 = nuclei::candidates[i2]; + if (!c2.fillTree || ((c1.flags & c2.flags) & 0x1F) == 0) { + continue; + } + nucleiPairTable(c1.pt, c1.eta, c1.phi, c1.tpcInnerParam, c1.TPCsignal, c1.DCAxy, c1.DCAz, c1.clusterSizesITS, c1.flags, c2.pt, c2.eta, c2.phi, c2.tpcInnerParam, c2.TPCsignal, c2.DCAxy, c2.DCAz, c2.clusterSizesITS, c2.flags); + } + } } - if (c.fillDCAHist) { + if (c1.fillDCAHist) { for (int iS{0}; iS < nuclei::species; ++iS) { - if (c.flags & BIT(iS)) { - nuclei::hDCAHists[c.pt < 0][iS]->Fill(std::abs(c.pt), c.DCAxy, c.DCAz, c.nSigmaTPC[iS], c.tofMasses[iS], c.ITSnCls, c.TPCnCls); + if (c1.flags & BIT(iS)) { + nuclei::hDCAHists[c1.pt < 0][iS]->Fill(std::abs(c1.pt), c1.DCAxy, c1.DCAz, c1.nSigmaTPC[iS], c1.tofMasses[iS], c1.ITSnCls, c1.TPCnCls); } } }