2020#define ALICE3_DATAMODEL_OTFSTRANGENESS_H_
2121
2222// O2 includes
23+ #include " Common/Core/RecoDecay.h"
24+
2325#include " Framework/AnalysisDataModel.h"
2426
2527namespace o2 ::aod
@@ -33,8 +35,8 @@ DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg");
3335DECLARE_SOA_INDEX_COLUMN_FULL (BachTrack, bachTrack, int , Tracks, " _Bach" ); // !
3436
3537// topo vars
36- DECLARE_SOA_COLUMN (DCAV0Daughters , dcaV0Daughters, float );
37- DECLARE_SOA_COLUMN (DCACascadeDaughters , dcaCascadeDaughters, float );
38+ DECLARE_SOA_COLUMN (DcaV0Daughters , dcaV0Daughters, float );
39+ DECLARE_SOA_COLUMN (DcaCascadeDaughters , dcaCascadeDaughters, float );
3840DECLARE_SOA_COLUMN (V0Radius, v0Radius, float );
3941DECLARE_SOA_COLUMN (CascRadius, cascRadius, float );
4042DECLARE_SOA_COLUMN (CascRadiusMC, cascRadiusMC, float );
@@ -53,8 +55,8 @@ DECLARE_SOA_TABLE(UpgradeCascades, "AOD", "UPGRADECASCADES",
5355 otfcascade::PosTrackId,
5456 otfcascade::NegTrackId,
5557 otfcascade::BachTrackId,
56- otfcascade::DCAV0Daughters ,
57- otfcascade::DCACascadeDaughters ,
58+ otfcascade::DcaV0Daughters ,
59+ otfcascade::DcaCascadeDaughters ,
5860 otfcascade::V0Radius,
5961 otfcascade::CascRadius,
6062 otfcascade::CascRadiusMC,
@@ -70,10 +72,10 @@ namespace otfv0
7072DECLARE_SOA_INDEX_COLUMN (Collision, collision); // !
7173DECLARE_SOA_INDEX_COLUMN_FULL (PosTrack, posTrack, int , Tracks, " _Pos" ); // !
7274DECLARE_SOA_INDEX_COLUMN_FULL (NegTrack, negTrack, int , Tracks, " _Neg" ); // !
73- DECLARE_SOA_INDEX_COLUMN (V0, v0); // !
75+ DECLARE_SOA_INDEX_COLUMN (V0, v0); // ! index of the mc particle corresponding to the V0
7476
7577// topo vars
76- DECLARE_SOA_COLUMN (DCAV0Daughters , dcaV0Daughters, float );
78+ DECLARE_SOA_COLUMN (DcaV0Daughters , dcaV0Daughters, float );
7779DECLARE_SOA_COLUMN (V0Radius, v0Radius, float );
7880DECLARE_SOA_COLUMN (MLambda, mLambda , float );
7981DECLARE_SOA_COLUMN (MAntiLambda, mAntiLambda , float );
@@ -86,16 +88,166 @@ DECLARE_SOA_COLUMN(Pt, pt, float);
8688DECLARE_SOA_TABLE (UpgradeV0s, " AOD" , " UPGRADEV0S" ,
8789 o2::soa::Index<>,
8890 otfv0::CollisionId,
91+ otfv0::V0Id,
8992 otfv0::PosTrackId,
9093 otfv0::NegTrackId,
91- otfv0::DCAV0Daughters ,
94+ otfv0::DcaV0Daughters ,
9295 otfv0::V0Radius,
9396 otfv0::MLambda,
9497 otfv0::MAntiLambda,
9598 otfv0::MK0,
9699 otfv0::Pt);
97100
98101using UpgradeV0 = UpgradeV0s::iterator;
99- } // namespace o2::aod
100102
103+ namespace candidatev0
104+ {
105+ DECLARE_SOA_INDEX_COLUMN (Collision, collision); // !
106+ DECLARE_SOA_INDEX_COLUMN_FULL (PosTrack, posTrack, int , Tracks, " _Pos" ); // !
107+ DECLARE_SOA_INDEX_COLUMN_FULL (NegTrack, negTrack, int , Tracks, " _Neg" ); // !
108+ DECLARE_SOA_INDEX_COLUMN (V0, v0); // !
109+
110+ // Label to MC particle
111+ DECLARE_SOA_INDEX_COLUMN_FULL (McParticle, mcParticle, int , McParticles, " " ); // ! label to the MC particle corresponding to the V0
112+
113+ // General V0 properties: position, momentum
114+ DECLARE_SOA_COLUMN (PosX, posX, float ); // ! positive track X at min
115+ DECLARE_SOA_COLUMN (NegX, negX, float ); // ! negative track X at min
116+ DECLARE_SOA_COLUMN (PxPos, pxPos, float ); // ! positive track px at min
117+ DECLARE_SOA_COLUMN (PyPos, pyPos, float ); // ! positive track py at min
118+ DECLARE_SOA_COLUMN (PzPos, pzPos, float ); // ! positive track pz at min
119+ DECLARE_SOA_COLUMN (PxNeg, pxNeg, float ); // ! negative track px at min
120+ DECLARE_SOA_COLUMN (PyNeg, pyNeg, float ); // ! negative track py at min
121+ DECLARE_SOA_COLUMN (PzNeg, pzNeg, float ); // ! negative track pz at min
122+ DECLARE_SOA_COLUMN (X, x, float ); // ! decay position X
123+ DECLARE_SOA_COLUMN (Y, y, float ); // ! decay position Y
124+ DECLARE_SOA_COLUMN (Z, z, float ); // ! decay position Z
125+
126+ // topo vars
127+ DECLARE_SOA_COLUMN (DcaV0Daughters, dcaV0Daughters, float );
128+ DECLARE_SOA_COLUMN (CosPA, cosPA, float );
129+ DECLARE_SOA_COLUMN (DcaPosToPV, dcaPosToPV, float );
130+ DECLARE_SOA_COLUMN (DcaNegToPV, dcaNegToPV, float );
131+ DECLARE_SOA_COLUMN (DcaV0ToPV, dcaV0ToPV, float );
132+
133+ // ______________________________________________________
134+ // DYNAMIC COLUMNS
135+
136+ DECLARE_SOA_DYNAMIC_COLUMN (Px, px, // ! V0 px
137+ [](float pxPos, float pxNeg) -> float { return pxPos + pxNeg; });
138+ DECLARE_SOA_DYNAMIC_COLUMN (Py, py, // ! V0 py
139+ [](float pyPos, float pyNeg) -> float { return pyPos + pyNeg; });
140+ DECLARE_SOA_DYNAMIC_COLUMN (Pz, pz, // ! V0 pz
141+ [](float pzPos, float pzNeg) -> float { return pzPos + pzNeg; });
142+ DECLARE_SOA_DYNAMIC_COLUMN (Pt, pt, // ! Transverse momentum in GeV/c
143+ [](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float {
144+ return RecoDecay::sqrtSumOfSquares (pxPos + pxNeg, pyPos + pyNeg);
145+ });
146+ DECLARE_SOA_DYNAMIC_COLUMN (P, p, // ! Total momentum in GeV/c
147+ [](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
148+ return RecoDecay::sqrtSumOfSquares (pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
149+ });
150+ DECLARE_SOA_DYNAMIC_COLUMN (Phi, phi, // ! Phi in the range [0, 2pi)
151+ [](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float { return RecoDecay::phi (pxPos + pxNeg, pyPos + pyNeg); });
152+ DECLARE_SOA_DYNAMIC_COLUMN (Eta, eta, // ! Pseudorapidity, conditionally defined to avoid FPEs
153+ [](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
154+ return RecoDecay::eta (std::array{pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg});
155+ });
156+ // Length quantities
157+ DECLARE_SOA_DYNAMIC_COLUMN (V0radius, v0radius, // ! V0 decay radius (2D, centered at zero)
158+ [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares (x, y); });
159+
160+ // Distance Over To Mom
161+ DECLARE_SOA_DYNAMIC_COLUMN (DistOverTotMom, distOverTotMom, // ! PV to V0decay distance over total momentum
162+ [](float X, float Y, float Z, float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg, float pvX, float pvY, float pvZ) {
163+ float p = RecoDecay::sqrtSumOfSquares (pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
164+ return std::sqrt (std::pow (X - pvX, 2 ) + std::pow (Y - pvY, 2 ) + std::pow (Z - pvZ, 2 )) / (p + 1E-10 );
165+ });
166+
167+ // Armenteros-Podolanski variables
168+ DECLARE_SOA_DYNAMIC_COLUMN (Alpha, alpha, // ! Armenteros Alpha
169+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
170+ float momTot = RecoDecay::p (pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
171+ float lQlNeg = RecoDecay::dotProd (std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
172+ float lQlPos = RecoDecay::dotProd (std::array{pxpos, pypos, pzpos}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
173+ return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); // alphav0
174+ });
175+
176+ DECLARE_SOA_DYNAMIC_COLUMN (QtArm, qtArm, // ! Armenteros Qt
177+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
178+ float momTot = RecoDecay::p2 (pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
179+ float dp = RecoDecay::dotProd (std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg});
180+ return std::sqrt (RecoDecay::p2 (pxneg, pyneg, pzneg) - dp * dp / momTot); // qtarm
181+ });
182+ // Mass assumption
183+ DECLARE_SOA_DYNAMIC_COLUMN (MLambda, mLambda , // ! mass under lambda hypothesis
184+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
185+ return RecoDecay::m (std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
186+ });
187+ DECLARE_SOA_DYNAMIC_COLUMN (MAntiLambda, mAntiLambda , // ! mass under antilambda hypothesis
188+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
189+ return RecoDecay::m (std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton});
190+ });
191+ DECLARE_SOA_DYNAMIC_COLUMN (MK0Short, mK0Short , // ! mass under K0short hypothesis
192+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
193+ return RecoDecay::m (std::array{std::array{pxpos, pypos, pzpos}, std::array{pxneg, pyneg, pzneg}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassPionCharged});
194+ });
195+ // Rapidity
196+ DECLARE_SOA_DYNAMIC_COLUMN (YK0Short, yK0Short, // ! V0 y with K0short hypothesis
197+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
198+ return RecoDecay::y (std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassKaonNeutral);
199+ });
200+ DECLARE_SOA_DYNAMIC_COLUMN (YLambda, yLambda, // ! V0 y with lambda or antilambda hypothesis
201+ [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
202+ return RecoDecay::y (std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassLambda);
203+ });
204+ // Daughter track momenta
205+ DECLARE_SOA_DYNAMIC_COLUMN (NegativePt, negativePt, // ! negative daughter pT
206+ [](float pxneg, float pyneg) -> float { return RecoDecay::sqrtSumOfSquares (pxneg, pyneg); });
207+ DECLARE_SOA_DYNAMIC_COLUMN (PositivePt, positivePt, // ! positive daughter pT
208+ [](float pxpos, float pypos) -> float { return RecoDecay::sqrtSumOfSquares (pxpos, pypos); });
209+ DECLARE_SOA_DYNAMIC_COLUMN (NegativeEta, negativeEta, // ! negative daughter eta
210+ [](float PxNeg, float PyNeg, float PzNeg) -> float { return RecoDecay::eta (std::array{PxNeg, PyNeg, PzNeg}); });
211+ DECLARE_SOA_DYNAMIC_COLUMN (NegativePhi, negativePhi, // ! negative daughter phi
212+ [](float PxNeg, float PyNeg) -> float { return RecoDecay::phi (PxNeg, PyNeg); });
213+ DECLARE_SOA_DYNAMIC_COLUMN (PositiveEta, positiveEta, // ! positive daughter eta
214+ [](float PxPos, float PyPos, float PzPos) -> float { return RecoDecay::eta (std::array{PxPos, PyPos, PzPos}); });
215+ DECLARE_SOA_DYNAMIC_COLUMN (PositivePhi, positivePhi, // ! positive daughter phi
216+ [](float PxPos, float PyPos) -> float { return RecoDecay::phi (PxPos, PyPos); });
217+ } // namespace candidatev0
218+ DECLARE_SOA_TABLE (V0CandidateIndices, " AOD" , " V0CANDIDATEINDEX" , // ! index table
219+ o2::soa::Index<>, candidatev0::CollisionId, candidatev0::PosTrackId, candidatev0::NegTrackId, candidatev0::McParticleId);
220+
221+ DECLARE_SOA_TABLE (V0CandidateCores, " AOD" , " V0CANDIDATECORE" ,
222+ o2::soa::Index<>,
223+ candidatev0::X, candidatev0::Y, candidatev0::Z,
224+ candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos,
225+ candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg,
226+ candidatev0::DcaV0Daughters, candidatev0::DcaPosToPV, candidatev0::DcaNegToPV,
227+ candidatev0::CosPA, candidatev0::DcaV0ToPV,
228+ candidatev0::Px<candidatev0::PxPos, candidatev0::PxNeg>,
229+ candidatev0::Py<candidatev0::PyPos, candidatev0::PyNeg>,
230+ candidatev0::Pz<candidatev0::PzPos, candidatev0::PzNeg>,
231+ candidatev0::Pt<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
232+ candidatev0::P<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
233+ candidatev0::Phi<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
234+ candidatev0::Eta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
235+ candidatev0::V0radius<candidatev0::X, candidatev0::Y>,
236+ candidatev0::DistOverTotMom<candidatev0::X, candidatev0::Y, candidatev0::Z, candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
237+ candidatev0::Alpha<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
238+ candidatev0::QtArm<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
239+ candidatev0::MLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
240+ candidatev0::MAntiLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
241+ candidatev0::MK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
242+ candidatev0::YK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
243+ candidatev0::YLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
244+ candidatev0::NegativePt<candidatev0::PxNeg, candidatev0::PyNeg>,
245+ candidatev0::PositivePt<candidatev0::PxPos, candidatev0::PyPos>,
246+ candidatev0::NegativeEta<candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
247+ candidatev0::NegativePhi<candidatev0::PxNeg, candidatev0::PyNeg>,
248+ candidatev0::PositiveEta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos>,
249+ candidatev0::PositivePhi<candidatev0::PxPos, candidatev0::PyPos>);
250+
251+ using V0CandidateCore = V0CandidateCores::iterator;
252+ } // namespace o2::aod
101253#endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_
0 commit comments