Skip to content

Commit c4dcb22

Browse files
mhartung71alibuild
andauthored
[PWGLF] Initial commit of KF hypernuclei task (#8612)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 8cc7df5 commit c4dcb22

File tree

4 files changed

+2231
-0
lines changed

4 files changed

+2231
-0
lines changed
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
// authors Janik Ditzel <jditzel@cern.ch> and Michael Hartung <mhartung@cern.ch>
12+
13+
#ifndef PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_
14+
#define PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_
15+
16+
#include "Framework/ASoA.h"
17+
#include "Framework/AnalysisDataModel.h"
18+
#include "Common/DataModel/Centrality.h"
19+
#include "Common/Core/RecoDecay.h"
20+
21+
namespace o2::aod
22+
{
23+
namespace hykfmcColl
24+
{
25+
DECLARE_SOA_COLUMN(PassedEvSel, passedEvSel, bool); //!
26+
}
27+
DECLARE_SOA_TABLE(HypKfMcCollisions, "AOD", "HYPKFMCCOLL",
28+
o2::soa::Index<>,
29+
hykfmcColl::PassedEvSel,
30+
mccollision::PosX,
31+
mccollision::PosY,
32+
mccollision::PosZ);
33+
using HypKfMcCollision = HypKfMcCollisions::iterator;
34+
35+
namespace hykfmc
36+
{
37+
DECLARE_SOA_INDEX_COLUMN(HypKfMcCollision, hypKfMcCollision);
38+
DECLARE_SOA_COLUMN(Species, species, int8_t); //!
39+
DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //!
40+
DECLARE_SOA_COLUMN(Svx, svx, float); //!
41+
DECLARE_SOA_COLUMN(Svy, svy, float); //!
42+
DECLARE_SOA_COLUMN(Svz, svz, float); //!
43+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(std::array{px, py}); });
44+
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float E, float pz) { return 0.5 * TMath::Log((E + pz) / (E - pz)); });
45+
DECLARE_SOA_DYNAMIC_COLUMN(Mass, mass, [](float E, float px, float py, float pz) { return TMath::Sqrt(E * E - px * px - py * py - pz * pz); });
46+
DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int pdgCode) { return pdgCode > 0; });
47+
} // namespace hykfmc
48+
49+
DECLARE_SOA_TABLE(HypKfMcParticles, "AOD", "HYPKFMCPART",
50+
o2::soa::Index<>,
51+
hykfmc::HypKfMcCollisionId,
52+
hykfmc::Species,
53+
mcparticle::PdgCode,
54+
hykfmc::IsPhysicalPrimary,
55+
mcparticle::Px,
56+
mcparticle::Py,
57+
mcparticle::Pz,
58+
mcparticle::E,
59+
hykfmc::Svx,
60+
hykfmc::Svy,
61+
hykfmc::Svz,
62+
hykfmc::Pt<mcparticle::Px, mcparticle::Py>,
63+
hykfmc::Y<mcparticle::E, mcparticle::Pz>,
64+
hykfmc::Mass<mcparticle::E, mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
65+
hykfmc::IsMatter<mcparticle::PdgCode>);
66+
using HypKfMcParticle = HypKfMcParticles::iterator;
67+
68+
DECLARE_SOA_TABLE(HypKfCollisions, "AOD", "HYPKFCOLL",
69+
o2::soa::Index<>,
70+
hykfmcColl::PassedEvSel,
71+
hykfmc::HypKfMcCollisionId,
72+
collision::PosX,
73+
collision::PosY,
74+
collision::PosZ,
75+
cent::CentFT0A,
76+
cent::CentFT0C,
77+
cent::CentFT0M);
78+
using HypKfCollision = HypKfCollisions::iterator;
79+
80+
namespace hykftrk
81+
{
82+
DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision);
83+
DECLARE_SOA_COLUMN(Rigidity, rigidity, float); //!
84+
DECLARE_SOA_COLUMN(TPCnCluster, tpcNcluster, float); //!
85+
DECLARE_SOA_COLUMN(TPCnSigma, tpcNsigma, float); //!
86+
DECLARE_SOA_COLUMN(TPCnSigmaNhp, tpcNsigmaNhp, float); //!
87+
DECLARE_SOA_COLUMN(TPCnSigmaNlp, tpcNsigmaNlp, float); //!
88+
DECLARE_SOA_COLUMN(TOFMass, tofMass, float); //!
89+
DECLARE_SOA_COLUMN(IsPVContributor, isPVContributor, bool); //!
90+
DECLARE_SOA_COLUMN(SubMass, subMass, float); //!
91+
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return (double)pt * TMath::Cos(phi); });
92+
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return (double)pt * TMath::Sin(phi); });
93+
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return (double)pt * TMath::SinH(eta); });
94+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); //
95+
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float pt, float eta, float mass) { return std::log((RecoDecay::sqrtSumOfSquares(mass, pt * TMath::CosH(eta)) + pt * TMath::SinH(eta)) / RecoDecay::sqrtSumOfSquares(mass, pt)); });
96+
DECLARE_SOA_DYNAMIC_COLUMN(Lambda, lambda, [](float eta) { return 1. / TMath::CosH(eta); });
97+
DECLARE_SOA_DYNAMIC_COLUMN(ITSnCluster, itsNcluster, [](uint32_t itsClusterSizes) {
98+
uint8_t n = 0;
99+
for (uint8_t i = 0; i < 7; i++) {
100+
if (itsClusterSizes >> (4 * i) & 15)
101+
n++;
102+
}
103+
return n;
104+
});
105+
DECLARE_SOA_DYNAMIC_COLUMN(ITSfirstLayer, itsFirstLayer, [](uint32_t itsClusterSizes) {
106+
for (int i = 0; i < 8; i++) {
107+
if (itsClusterSizes >> (4 * i) & 15)
108+
return i;
109+
}
110+
return -999;
111+
});
112+
DECLARE_SOA_DYNAMIC_COLUMN(ITSmeanClsSize, itsMeanClsSize, [](uint32_t itsClusterSizes) {
113+
int sum = 0, n = 0;
114+
for (int i = 0; i < 8; i++) {
115+
sum += (itsClusterSizes >> (4 * i) & 15);
116+
if (itsClusterSizes >> (4 * i) & 15)
117+
n++;
118+
}
119+
return static_cast<float>(sum) / n;
120+
});
121+
} // namespace hykftrk
122+
123+
DECLARE_SOA_TABLE(HypKfTracks, "AOD", "HYPKFTRACK",
124+
o2::soa::Index<>,
125+
hykfmc::Species,
126+
track::Pt,
127+
track::Eta,
128+
track::Phi,
129+
track::DcaXY,
130+
track::DcaZ,
131+
hykftrk::TPCnCluster,
132+
track::TPCChi2NCl,
133+
track::ITSClusterSizes,
134+
track::ITSChi2NCl,
135+
hykftrk::Rigidity,
136+
track::TPCSignal,
137+
hykftrk::TPCnSigma,
138+
hykftrk::TPCnSigmaNhp,
139+
hykftrk::TPCnSigmaNlp,
140+
hykftrk::TOFMass,
141+
hykftrk::IsPVContributor,
142+
hykftrk::Px<track::Pt, track::Phi>,
143+
hykftrk::Py<track::Pt, track::Phi>,
144+
hykftrk::Pz<track::Pt, track::Eta>,
145+
hykftrk::P<track::Pt, track::Eta>,
146+
hykftrk::Lambda<track::Eta>,
147+
hykftrk::ITSnCluster<track::ITSClusterSizes>,
148+
hykftrk::ITSfirstLayer<track::ITSClusterSizes>,
149+
hykftrk::ITSmeanClsSize<track::ITSClusterSizes>);
150+
using HypKfTrack = HypKfTracks::iterator;
151+
152+
DECLARE_SOA_TABLE(HypKfSubDaughters, "AOD", "HYPKFSUBD",
153+
o2::soa::Index<>,
154+
hykftrk::SubMass);
155+
using HypKfSubDaughter = HypKfSubDaughters::iterator;
156+
157+
DECLARE_SOA_TABLE(HypKfDaughterAddons, "AOD", "HYPKFDADD",
158+
o2::soa::Index<>,
159+
track::X,
160+
track::Y,
161+
track::Z,
162+
mcparticle::Px,
163+
mcparticle::Py,
164+
mcparticle::Pz);
165+
using HypKfDaughterAddon = HypKfDaughterAddons::iterator;
166+
167+
namespace hykfhyp
168+
{
169+
DECLARE_SOA_INDEX_COLUMN(HypKfCollision, hypKfCollision);
170+
DECLARE_SOA_INDEX_COLUMN(HypKfMcParticle, hypKfMcParticle);
171+
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfDaughterAddon, addons);
172+
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfTrack, daughterTracks);
173+
DECLARE_SOA_SELF_INDEX_COLUMN(HypDaughter, hypDaughter);
174+
DECLARE_SOA_ARRAY_INDEX_COLUMN(HypKfSubDaughter, subDaughters);
175+
DECLARE_SOA_COLUMN(Primary, primary, bool); //!
176+
DECLARE_SOA_COLUMN(Mass, mass, float); //!
177+
DECLARE_SOA_COLUMN(Px, px, float); //!
178+
DECLARE_SOA_COLUMN(Py, py, float); //!
179+
DECLARE_SOA_COLUMN(Pz, pz, float); //!
180+
DECLARE_SOA_COLUMN(DcaToPvXY, dcaToPvXY, float); //!
181+
DECLARE_SOA_COLUMN(DcaToPvZ, dcaToPvZ, float); //!
182+
DECLARE_SOA_COLUMN(DcaToVtxXY, dcaToVtxXY, float); //!
183+
DECLARE_SOA_COLUMN(DcaToVtxZ, dcaToVtxZ, float); //!
184+
DECLARE_SOA_COLUMN(Chi2, chi2, float); //!
185+
DECLARE_SOA_COLUMN(DevToPvXY, devToPvXY, float); //!
186+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) { return RecoDecay::pt(px, py); });
187+
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) { return RecoDecay::eta(std::array{px, py, pz}); });
188+
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) { return RecoDecay::phi(std::array{px, py}); });
189+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float px, float py, float pz) { return RecoDecay::p(px, py, pz); }); //
190+
DECLARE_SOA_DYNAMIC_COLUMN(Y, y, [](float px, float py, float pz, float mass) { return RecoDecay::y(std::array{px, py, pz}, mass); });
191+
DECLARE_SOA_DYNAMIC_COLUMN(McTrue, mcTrue, [](int hypKfMcParticleId) { return hypKfMcParticleId > 0; });
192+
DECLARE_SOA_DYNAMIC_COLUMN(IsMatter, isMatter, [](int8_t species) { return species > 0; });
193+
DECLARE_SOA_DYNAMIC_COLUMN(Cascade, cascade, [](int hypDaughter) { return hypDaughter > 0; });
194+
} // namespace hykfhyp
195+
196+
DECLARE_SOA_TABLE(HypKfHypNucs, "AOD", "HYPKFHYPNUC",
197+
o2::soa::Index<>,
198+
hykfhyp::HypKfMcParticleId,
199+
hykfhyp::HypKfCollisionId,
200+
hykfhyp::HypKfTrackIds,
201+
hykfhyp::HypKfDaughterAddonIds,
202+
hykfhyp::HypDaughterId,
203+
hykfhyp::HypKfSubDaughterIds,
204+
hykfmc::Species,
205+
hykfhyp::Primary,
206+
hykfhyp::Mass,
207+
hykfhyp::Px,
208+
hykfhyp::Py,
209+
hykfhyp::Pz,
210+
hykfhyp::DcaToPvXY,
211+
hykfhyp::DcaToPvZ,
212+
hykfhyp::DevToPvXY,
213+
hykfhyp::DcaToVtxXY,
214+
hykfhyp::DcaToVtxZ,
215+
hykfhyp::Chi2,
216+
hykfmc::Svx,
217+
hykfmc::Svy,
218+
hykfmc::Svz,
219+
hykfhyp::Y<hykfhyp::Px, hykfhyp::Py, hykfhyp::Pz, hykfhyp::Mass>,
220+
hykfhyp::Pt<hykfhyp::Px, hykfhyp::Py>,
221+
hykfhyp::Eta<hykfhyp::Px, hykfhyp::Py, hykfhyp::Pz>,
222+
hykfhyp::Phi<hykfhyp::Px, hykfhyp::Py>,
223+
hykfhyp::P<hykfhyp::Px, hykfhyp::Py, hykfhyp::Pz>,
224+
hykfhyp::McTrue<hykfhyp::HypKfMcParticleId>,
225+
hykfhyp::IsMatter<hykfmc::Species>,
226+
hykfhyp::Cascade<hykfhyp::HypDaughterId>);
227+
using HypKfHypNuc = HypKfHypNucs::iterator;
228+
} // namespace o2::aod
229+
230+
#endif // PWGLF_DATAMODEL_LFHYPERNUCLEIKFTABLES_H_

PWGLF/TableProducer/Nuspex/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,13 @@ o2physics_add_dpl_workflow(threebody-kf-task
8888
SOURCES threebodyKFTask.cxx
8989
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
9090
COMPONENT_NAME Analysis)
91+
92+
o2physics_add_dpl_workflow(hypernuclei-kf-reco-task
93+
SOURCES hypKfRecoTask.cxx
94+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore KFParticle::KFParticle
95+
COMPONENT_NAME Analysis)
96+
97+
o2physics_add_dpl_workflow(hypernuclei-kf-tree-creator
98+
SOURCES hypKfTreeCreator.cxx
99+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
100+
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)