Skip to content

Commit 73bd098

Browse files
author
Lucia Anna Tarasovicova
committed
V0 finder is created to search for strange weak decays and an analysis is adjusted to process the found V0 candidates.
1 parent e5aefca commit 73bd098

File tree

5 files changed

+572
-10
lines changed

5 files changed

+572
-10
lines changed

ALICE3/DataModel/OTFStrangeness.h

Lines changed: 151 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define ALICE3_DATAMODEL_OTFSTRANGENESS_H_
2121

2222
// O2 includes
23+
#include "Common/Core/RecoDecay.h"
24+
2325
#include "Framework/AnalysisDataModel.h"
2426

2527
namespace o2::aod
@@ -70,7 +72,7 @@ namespace otfv0
7072
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
7173
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
7274
DECLARE_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
7678
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);
@@ -86,6 +88,7 @@ DECLARE_SOA_COLUMN(Pt, pt, float);
8688
DECLARE_SOA_TABLE(UpgradeV0s, "AOD", "UPGRADEV0S",
8789
o2::soa::Index<>,
8890
otfv0::CollisionId,
91+
otfv0::V0Id,
8992
otfv0::PosTrackId,
9093
otfv0::NegTrackId,
9194
otfv0::DCAV0Daughters,
@@ -96,6 +99,152 @@ DECLARE_SOA_TABLE(UpgradeV0s, "AOD", "UPGRADEV0S",
9699
otfv0::Pt);
97100

98101
using 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+
// General V0 properties: position, momentum
111+
DECLARE_SOA_COLUMN(PosX, posX, float); //! positive track X at min
112+
DECLARE_SOA_COLUMN(NegX, negX, float); //! negative track X at min
113+
DECLARE_SOA_COLUMN(PxPos, pxpos, float); //! positive track px at min
114+
DECLARE_SOA_COLUMN(PyPos, pypos, float); //! positive track py at min
115+
DECLARE_SOA_COLUMN(PzPos, pzpos, float); //! positive track pz at min
116+
DECLARE_SOA_COLUMN(PxNeg, pxneg, float); //! negative track px at min
117+
DECLARE_SOA_COLUMN(PyNeg, pyneg, float); //! negative track py at min
118+
DECLARE_SOA_COLUMN(PzNeg, pzneg, float); //! negative track pz at min
119+
DECLARE_SOA_COLUMN(X, x, float); //! decay position X
120+
DECLARE_SOA_COLUMN(Y, y, float); //! decay position Y
121+
DECLARE_SOA_COLUMN(Z, z, float); //! decay position Z
122+
123+
// topo vars
124+
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);
125+
DECLARE_SOA_COLUMN(CosPA, cosPA, float);
126+
DECLARE_SOA_COLUMN(DCAPosToPV, dcaPosToPV, float);
127+
DECLARE_SOA_COLUMN(DCANegToPV, dcaNegToPV, float);
128+
DECLARE_SOA_COLUMN(DCAV0ToPV, dcaV0ToPV, float);
129+
130+
//______________________________________________________
131+
// DYNAMIC COLUMNS
132+
133+
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! V0 px
134+
[](float pxPos, float pxNeg) -> float { return pxPos + pxNeg; });
135+
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! V0 py
136+
[](float pyPos, float pyNeg) -> float { return pyPos + pyNeg; });
137+
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! V0 pz
138+
[](float pzPos, float pzNeg) -> float { return pzPos + pzNeg; });
139+
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! Transverse momentum in GeV/c
140+
[](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float {
141+
return RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg);
142+
});
143+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, //! Total momentum in GeV/c
144+
[](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
145+
return RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
146+
});
147+
DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, //! Phi in the range [0, 2pi)
148+
[](float pxPos, float pyPos, float pxNeg, float pyNeg) -> float { return RecoDecay::phi(pxPos + pxNeg, pyPos + pyNeg); });
149+
DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, //! Pseudorapidity, conditionally defined to avoid FPEs
150+
[](float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg) -> float {
151+
return RecoDecay::eta(std::array{pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg});
152+
});
153+
// Length quantities
154+
DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, //! V0 decay radius (2D, centered at zero)
155+
[](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); });
156+
157+
// Distance Over To Mom
158+
DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to V0decay distance over total momentum
159+
[](float X, float Y, float Z, float pxPos, float pyPos, float pzPos, float pxNeg, float pyNeg, float pzNeg, float pvX, float pvY, float pvZ) {
160+
float P = RecoDecay::sqrtSumOfSquares(pxPos + pxNeg, pyPos + pyNeg, pzPos + pzNeg);
161+
return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10);
162+
});
163+
164+
// Armenteros-Podolanski variables
165+
DECLARE_SOA_DYNAMIC_COLUMN(Alpha, alpha, //! Armenteros Alpha
166+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
167+
float momTot = RecoDecay::p(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
168+
float lQlNeg = RecoDecay::dotProd(std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
169+
float lQlPos = RecoDecay::dotProd(std::array{pxpos, pypos, pzpos}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot;
170+
return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); // alphav0
171+
});
172+
173+
DECLARE_SOA_DYNAMIC_COLUMN(QtArm, qtarm, //! Armenteros Qt
174+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) {
175+
float momTot = RecoDecay::p2(pxpos + pxneg, pypos + pyneg, pzpos + pzneg);
176+
float dp = RecoDecay::dotProd(std::array{pxneg, pyneg, pzneg}, std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg});
177+
return std::sqrt(RecoDecay::p2(pxneg, pyneg, pzneg) - dp * dp / momTot); // qtarm
178+
});
179+
// Mass assumption
180+
DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! mass under lambda hypothesis
181+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
182+
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});
183+
});
184+
DECLARE_SOA_DYNAMIC_COLUMN(MAntiLambda, mAntiLambda, //! mass under antilambda hypothesis
185+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
186+
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});
187+
});
188+
DECLARE_SOA_DYNAMIC_COLUMN(MK0Short, mK0Short, //! mass under K0short hypothesis
189+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
190+
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});
191+
});
192+
// Rapidity
193+
DECLARE_SOA_DYNAMIC_COLUMN(YK0Short, yK0Short, //! V0 y with K0short hypothesis
194+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
195+
return RecoDecay::y(std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassKaonNeutral);
196+
});
197+
DECLARE_SOA_DYNAMIC_COLUMN(YLambda, yLambda, //! V0 y with lambda or antilambda hypothesis
198+
[](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float {
199+
return RecoDecay::y(std::array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}, o2::constants::physics::MassLambda);
200+
});
201+
// Daughter track momenta
202+
DECLARE_SOA_DYNAMIC_COLUMN(NegativePt, negativept, //! negative daughter pT
203+
[](float pxneg, float pyneg) -> float { return RecoDecay::sqrtSumOfSquares(pxneg, pyneg); });
204+
DECLARE_SOA_DYNAMIC_COLUMN(PositivePt, positivept, //! positive daughter pT
205+
[](float pxpos, float pypos) -> float { return RecoDecay::sqrtSumOfSquares(pxpos, pypos); });
206+
DECLARE_SOA_DYNAMIC_COLUMN(NegativeEta, negativeeta, //! negative daughter eta
207+
[](float PxNeg, float PyNeg, float PzNeg) -> float { return RecoDecay::eta(std::array{PxNeg, PyNeg, PzNeg}); });
208+
DECLARE_SOA_DYNAMIC_COLUMN(NegativePhi, negativephi, //! negative daughter phi
209+
[](float PxNeg, float PyNeg) -> float { return RecoDecay::phi(PxNeg, PyNeg); });
210+
DECLARE_SOA_DYNAMIC_COLUMN(PositiveEta, positiveeta, //! positive daughter eta
211+
[](float PxPos, float PyPos, float PzPos) -> float { return RecoDecay::eta(std::array{PxPos, PyPos, PzPos}); });
212+
DECLARE_SOA_DYNAMIC_COLUMN(PositivePhi, positivephi, //! positive daughter phi
213+
[](float PxPos, float PyPos) -> float { return RecoDecay::phi(PxPos, PyPos); });
214+
} // namespace candidatev0
215+
DECLARE_SOA_TABLE(V0CandidateIndices, "AOD", "V0CANDIDATEINDEX", //! index table
216+
o2::soa::Index<>, candidatev0::CollisionId, candidatev0::PosTrackId, candidatev0::NegTrackId);
217+
218+
DECLARE_SOA_TABLE(V0CandidateCores, "AOD", "V0CANDIDATECORE",
219+
o2::soa::Index<>,
220+
candidatev0::X, candidatev0::Y, candidatev0::Z,
221+
candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos,
222+
candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg,
223+
candidatev0::DCAV0Daughters, candidatev0::DCAPosToPV, candidatev0::DCANegToPV,
224+
candidatev0::CosPA, candidatev0::DCAV0ToPV,
225+
candidatev0::Px<candidatev0::PxPos, candidatev0::PxNeg>,
226+
candidatev0::Py<candidatev0::PyPos, candidatev0::PyNeg>,
227+
candidatev0::Pz<candidatev0::PzPos, candidatev0::PzNeg>,
228+
candidatev0::Pt<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
229+
candidatev0::P<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
230+
candidatev0::Phi<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PxNeg, candidatev0::PyNeg>,
231+
candidatev0::Eta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
232+
candidatev0::V0Radius<candidatev0::X, candidatev0::Y>,
233+
candidatev0::DistOverTotMom<candidatev0::X, candidatev0::Y, candidatev0::Z, candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
234+
candidatev0::Alpha<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
235+
candidatev0::QtArm<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
236+
candidatev0::MLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
237+
candidatev0::MAntiLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
238+
candidatev0::MK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
239+
candidatev0::YK0Short<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
240+
candidatev0::YLambda<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos, candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
241+
candidatev0::NegativePt<candidatev0::PxNeg, candidatev0::PyNeg>,
242+
candidatev0::PositivePt<candidatev0::PxPos, candidatev0::PyPos>,
243+
candidatev0::NegativeEta<candidatev0::PxNeg, candidatev0::PyNeg, candidatev0::PzNeg>,
244+
candidatev0::NegativePhi<candidatev0::PxNeg, candidatev0::PyNeg>,
245+
candidatev0::PositiveEta<candidatev0::PxPos, candidatev0::PyPos, candidatev0::PzPos>,
246+
candidatev0::PositivePhi<candidatev0::PxPos, candidatev0::PyPos>);
247+
248+
using V0CandidateCore = V0CandidateCores::iterator;
249+
} // namespace o2::aod
101250
#endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_

ALICE3/TableProducer/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,8 @@ o2physics_add_dpl_workflow(alice3-tracking-translator
6060
SOURCES alice3TrackingTranslator.cxx
6161
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
6262
COMPONENT_NAME Analysis)
63+
64+
o2physics_add_dpl_workflow(alice3-strangeness-finder
65+
SOURCES alice3-strangenessFinder.cxx
66+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
67+
COMPONENT_NAME Analysis)

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ struct OnTheFlyTracker {
248248
struct v0candidate {
249249
int positiveId; // track index in the Tracks table
250250
int negativeId; // track index in the Tracks table
251+
int mcParticleId; // mc particle index
251252

252253
float pt;
253254

@@ -1193,6 +1194,7 @@ struct OnTheFlyTracker {
11931194
// n-2: negative Track from V0
11941195
thisV0.positiveId = lastTrackIndex + tracksAlice3.size() - 1;
11951196
thisV0.negativeId = lastTrackIndex + tracksAlice3.size() - 2;
1197+
thisV0.mcParticleId = mcParticle.globalIndex();
11961198
// use DCA fitters
11971199
int nCand = 0;
11981200
bool dcaFitterOK_V0 = true;
@@ -1535,6 +1537,7 @@ struct OnTheFlyTracker {
15351537
// populate V0s
15361538
for (const auto& v0 : v0sAlice3) {
15371539
tableUpgradeV0s(tableCollisions.lastIndex(), // now we know the collision index -> populate table
1540+
v0.mcParticleId,
15381541
v0.positiveId,
15391542
v0.negativeId,
15401543
v0.dcaV0dau,

0 commit comments

Comments
 (0)