Skip to content

Commit 8e467a8

Browse files
authored
[PWGLF] feat: Add nuclei pair table to data model (#11444)
1 parent b0eedc5 commit 8e467a8

File tree

2 files changed

+61
-6
lines changed

2 files changed

+61
-6
lines changed

PWGLF/DataModel/LFSlimNucleiTables.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ DECLARE_SOA_COLUMN(SurvivedEventSelection, survivedEventSelection, bool);
5353
DECLARE_SOA_COLUMN(AbsoDecL, absoDecL, float);
5454

5555
} // namespace NucleiTableNS
56+
57+
namespace NucleiPairTableNS
58+
{
59+
DECLARE_SOA_COLUMN(Pt1, pt1, float); // first particle pt
60+
DECLARE_SOA_COLUMN(Eta1, eta1, float); // first particle eta
61+
DECLARE_SOA_COLUMN(Phi1, phi1, float); // first particle phi
62+
DECLARE_SOA_COLUMN(TPCInnerParam1, tpcInnerParam1, float); // first particle TPC inner param
63+
DECLARE_SOA_COLUMN(TPCsignal1, tpcSignal1, float); // first particle TPC signal
64+
DECLARE_SOA_COLUMN(DCAxy1, dcaxy1, float); // first particle DCA xy
65+
DECLARE_SOA_COLUMN(DCAz1, dcaz1, float); // first particle DCA z
66+
DECLARE_SOA_COLUMN(ClusterSizesITS1, clusterSizesITS1, uint32_t); // first particle ITS cluster sizes
67+
DECLARE_SOA_COLUMN(Flags1, flags1, uint16_t); // first particle flags
68+
DECLARE_SOA_COLUMN(Pt2, pt2, float); // second particle pt
69+
DECLARE_SOA_COLUMN(Eta2, eta2, float); // second particle eta
70+
DECLARE_SOA_COLUMN(Phi2, phi2, float); // second particle phi
71+
DECLARE_SOA_COLUMN(TPCInnerParam2, tpcInnerParam2, float); // second particle TPC inner param
72+
DECLARE_SOA_COLUMN(TPCsignal2, tpcSignal2, float); // second particle TPC signal
73+
DECLARE_SOA_COLUMN(DCAxy2, dcaxy2, float); // second particle DCA xy
74+
DECLARE_SOA_COLUMN(DCAz2, dcaz2, float); // second particle DCA z
75+
DECLARE_SOA_COLUMN(ClusterSizesITS2, clusterSizesITS2, uint32_t); // second particle ITS cluster sizes
76+
DECLARE_SOA_COLUMN(Flags2, flags2, uint16_t); // second particle flags
77+
} // namespace NucleiPairTableNS
78+
5679
namespace NucleiFlowTableNS
5780
{
5881
DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float); // centrality with FT0A estimator
@@ -136,6 +159,26 @@ DECLARE_SOA_TABLE(NucleiTableMC, "AOD", "NUCLEITABLEMC",
136159
NucleiTableNS::SurvivedEventSelection,
137160
NucleiTableNS::AbsoDecL);
138161

162+
DECLARE_SOA_TABLE(NucleiPairTable, "AOD", "NUCLEIPAIRTABLE",
163+
NucleiPairTableNS::Pt1,
164+
NucleiPairTableNS::Eta1,
165+
NucleiPairTableNS::Phi1,
166+
NucleiPairTableNS::TPCInnerParam1,
167+
NucleiPairTableNS::TPCsignal1,
168+
NucleiPairTableNS::DCAxy1,
169+
NucleiPairTableNS::DCAz1,
170+
NucleiPairTableNS::ClusterSizesITS1,
171+
NucleiPairTableNS::Flags1,
172+
NucleiPairTableNS::Pt2,
173+
NucleiPairTableNS::Eta2,
174+
NucleiPairTableNS::Phi2,
175+
NucleiPairTableNS::TPCInnerParam2,
176+
NucleiPairTableNS::TPCsignal2,
177+
NucleiPairTableNS::DCAxy2,
178+
NucleiPairTableNS::DCAz2,
179+
NucleiPairTableNS::ClusterSizesITS2,
180+
NucleiPairTableNS::Flags2);
181+
139182
} // namespace o2::aod
140183

141184
#endif // PWGLF_DATAMODEL_LFSLIMNUCLEITABLES_H_

PWGLF/TableProducer/Nuspex/nucleiSpectra.cxx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ struct nucleiSpectra {
267267
};
268268

269269
Produces<o2::aod::NucleiTable> nucleiTable;
270+
Produces<o2::aod::NucleiPairTable> nucleiPairTable;
270271
Produces<o2::aod::NucleiTableMC> nucleiTableMC;
271272
Produces<o2::aod::NucleiTableFlow> nucleiTableFlow;
272273
Service<o2::ccdb::BasicCCDBManager> ccdb;
@@ -297,6 +298,7 @@ struct nucleiSpectra {
297298
Configurable<LabeledArray<double>> cfgDCAcut{"cfgDCAcut", {nuclei::DCAcutDefault[0], 5, 2, nuclei::names, nuclei::nDCAConfigName}, "Max DCAxy and DCAz for light nuclei"};
298299
Configurable<LabeledArray<double>> cfgDownscaling{"cfgDownscaling", {nuclei::DownscalingDefault[0], 5, 1, nuclei::names, nuclei::DownscalingConfigName}, "Fraction of kept candidates for light nuclei"};
299300
Configurable<LabeledArray<int>> cfgTreeConfig{"cfgTreeConfig", {nuclei::TreeConfigDefault[0], 5, 2, nuclei::names, nuclei::treeConfigNames}, "Filtered trees configuration"};
301+
Configurable<bool> cfgFillPairTree{"cfgFillPairTree", true, "Fill trees for pairs of light nuclei"};
300302
Configurable<LabeledArray<int>> cfgDCAHists{"cfgDCAHists", {nuclei::DCAHistDefault[0], 5, 2, nuclei::names, nuclei::DCAConfigNames}, "DCA hist configuration"};
301303
Configurable<LabeledArray<int>> cfgFlowHist{"cfgFlowHist", {nuclei::FlowHistDefault[0], 5, 1, nuclei::names, nuclei::flowConfigNames}, "Flow hist configuration"};
302304

@@ -833,14 +835,24 @@ struct nucleiSpectra {
833835
}
834836

835837
fillDataInfo(collision, tracks);
836-
for (auto& c : nuclei::candidates) {
837-
if (c.fillTree) {
838-
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);
838+
for (size_t i1{0}; i1 < nuclei::candidates.size(); ++i1) {
839+
auto& c1 = nuclei::candidates[i1];
840+
if (c1.fillTree) {
841+
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);
842+
if (cfgFillPairTree) {
843+
for (size_t i2{i1 + 1}; i2 < nuclei::candidates.size(); ++i2) {
844+
auto& c2 = nuclei::candidates[i2];
845+
if (!c2.fillTree || ((c1.flags & c2.flags) & 0x1F) == 0) {
846+
continue;
847+
}
848+
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);
849+
}
850+
}
839851
}
840-
if (c.fillDCAHist) {
852+
if (c1.fillDCAHist) {
841853
for (int iS{0}; iS < nuclei::species; ++iS) {
842-
if (c.flags & BIT(iS)) {
843-
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);
854+
if (c1.flags & BIT(iS)) {
855+
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);
844856
}
845857
}
846858
}

0 commit comments

Comments
 (0)