Project
Loading...
Searching...
No Matches
AnalysisDataModel.h
Go to the documentation of this file.
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#ifndef O2_FRAMEWORK_ANALYSISDATAMODEL_H_
12#define O2_FRAMEWORK_ANALYSISDATAMODEL_H_
13
14#include "Framework/ASoA.h" // IWYU pragma: export
15
16#include <cmath>
17#include <bitset>
18#include <limits>
19#include <numeric>
20
21#include "Framework/DataTypes.h"
27#include "Framework/PID.h"
28
29#include <fairmq/Version.h>
30#include <fairmq/shmem/Common.h>
31
32namespace o2
33{
34namespace aod
35{
36namespace bc
37{
38DECLARE_SOA_COLUMN(RunNumber, runNumber, int);
39DECLARE_SOA_COLUMN(GlobalBC, globalBC, uint64_t);
40DECLARE_SOA_COLUMN(TriggerMask, triggerMask, uint64_t);
41DECLARE_SOA_COLUMN(InputMask, inputMask, uint64_t);
42DECLARE_SOA_COLUMN(Flags, flags, uint8_t);
43} // namespace bc
44
45DECLARE_SOA_TABLE(BCs_000, "AOD", "BC",
47 bc::RunNumber, bc::GlobalBC,
48 bc::TriggerMask);
49DECLARE_SOA_TABLE_VERSIONED(BCs_001, "AOD", "BC", 1,
51 bc::RunNumber, bc::GlobalBC,
52 bc::TriggerMask, bc::InputMask);
53DECLARE_SOA_TABLE(BCFlags, "AOD", "BCFLAG",
54 bc::Flags);
55
56using BCs = BCs_001; // current version
57template <aod::is_origin_hash O>
58using BCsFrom = BCs_001From<O>;
59using BC = BCs::iterator;
60
61namespace timestamp
62{
63DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t);
64} // namespace timestamp
65
66DECLARE_SOA_TABLE(Timestamps, "AOD", "TIMESTAMPS",
67 timestamp::Timestamp);
68
70} // namespace aod
71
72namespace soa
73{
74extern template struct Join<aod::BCs, aod::Timestamps>;
75}
76namespace aod
77{
78namespace collision
79{
81DECLARE_SOA_COLUMN(PosX, posX, float);
82DECLARE_SOA_COLUMN(PosY, posY, float);
83DECLARE_SOA_COLUMN(PosZ, posZ, float);
84DECLARE_SOA_COLUMN(CovXX, covXX, float);
85DECLARE_SOA_COLUMN(CovXY, covXY, float);
86DECLARE_SOA_COLUMN(CovXZ, covXZ, float);
87DECLARE_SOA_COLUMN(CovYY, covYY, float);
88DECLARE_SOA_COLUMN(CovYZ, covYZ, float);
89DECLARE_SOA_COLUMN(CovZZ, covZZ, float);
90DECLARE_SOA_COLUMN(Flags, flags, uint16_t);
91DECLARE_SOA_COLUMN(Chi2, chi2, float);
92DECLARE_SOA_COLUMN(NumContrib, numContrib, uint16_t);
93DECLARE_SOA_COLUMN(CollisionTime, collisionTime, float);
94DECLARE_SOA_COLUMN(CollisionTimeRes, collisionTimeRes, float);
95} // namespace collision
96
97DECLARE_SOA_TABLE(Collisions_000, "AOD", "COLLISION",
98 o2::soa::Index<>, collision::BCId,
99 collision::PosX, collision::PosY, collision::PosZ,
100 collision::CovXX, collision::CovXY, collision::CovXZ, collision::CovYY, collision::CovYZ, collision::CovZZ,
101 collision::Flags, collision::Chi2, collision::NumContrib,
102 collision::CollisionTime, collision::CollisionTimeRes);
103
104DECLARE_SOA_TABLE_VERSIONED(Collisions_001, "AOD", "COLLISION", 1,
105 o2::soa::Index<>, collision::BCId,
106 collision::PosX, collision::PosY, collision::PosZ,
107 collision::CovXX, collision::CovXY, collision::CovYY, collision::CovXZ, collision::CovYZ, collision::CovZZ,
108 collision::Flags, collision::Chi2, collision::NumContrib,
109 collision::CollisionTime, collision::CollisionTimeRes);
110
111template <aod::is_origin_hash O>
112using CollisionsFrom = Collisions_001From<O>;
113using Collisions = Collisions_001; // current version
114using Collision = Collisions::iterator;
115
116// NOTE Relation between Collisions and BC table
117// (important for pp in case of ambiguous assignment)
118// A collision entry points to the entry in the BC table based on the calculated BC from the collision time
119// To study other compatible triggers with the collision time, check the tutorial: compatibleBCs.cxx
120
121namespace track
122{
123// TRACKPAR TABLE definition
125DECLARE_SOA_COLUMN(TrackType, trackType, uint8_t);
127DECLARE_SOA_COLUMN(Alpha, alpha, float);
130DECLARE_SOA_COLUMN(Snp, snp, float);
131DECLARE_SOA_COLUMN(Tgl, tgl, float);
132DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float);
133DECLARE_SOA_EXPRESSION_COLUMN(Phi, phi, float,
134 ifnode(nasin(aod::track::snp) + aod::track::alpha < 0.0f, nasin(aod::track::snp) + aod::track::alpha + o2::constants::math::TwoPI,
135 ifnode(nasin(aod::track::snp) + aod::track::alpha >= o2::constants::math::TwoPI, nasin(aod::track::snp) + aod::track::alpha - o2::constants::math::TwoPI,
136 nasin(aod::track::snp) + aod::track::alpha)));
138 -1.f * nlog(ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::track::tgl))));
140 ifnode(nabs(aod::track::signed1Pt) <= o2::constants::math::Almost0, o2::constants::math::VeryBig, nabs(1.f / aod::track::signed1Pt)));
141DECLARE_SOA_DYNAMIC_COLUMN(IsWithinBeamPipe, isWithinBeamPipe,
142 [](float x) -> bool { return (std::fabs(x) < o2::constants::geom::XBeamPipeOuterRef); });
144 [](float signed1Pt) -> short { return (signed1Pt > 0) ? 1 : -1; });
146 [](float signed1Pt, float snp, float alpha) -> float {
147 auto pt = 1.f / std::abs(signed1Pt);
148 // FIXME: GCC & clang should optimize to sincosf
149 float cs = cosf(alpha), sn = sinf(alpha);
150 auto r = std::sqrt((1.f - snp) * (1.f + snp));
151 return pt * (r * cs - snp * sn);
152 });
154 [](float signed1Pt, float snp, float alpha) -> float {
155 auto pt = 1.f / std::abs(signed1Pt);
156 // FIXME: GCC & clang should optimize to sincosf
157 float cs = cosf(alpha), sn = sinf(alpha);
158 auto r = std::sqrt((1.f - snp) * (1.f + snp));
159 return pt * (snp * cs + r * sn);
160 });
162 [](float signed1Pt, float tgl) -> float {
163 auto pt = 1.f / std::abs(signed1Pt);
164 return pt * tgl;
165 });
167 [](float signed1Pt, float snp, float alpha, float tgl) -> std::array<float, 3> {
168 const auto pt = 1.f / std::abs(signed1Pt);
169 // FIXME: GCC & clang should optimize to sincosf
170 const float cs = cosf(alpha), sn = sinf(alpha);
171 const auto r = std::sqrt((1.f - snp) * (1.f + snp));
172 const auto px = pt * (r * cs - snp * sn);
173 const auto py = pt * (snp * cs + r * sn);
174 const auto pz = pt * tgl;
175 return std::array<float, 3>{px, py, pz};
176 });
178 ifnode(nabs(aod::track::signed1Pt) <= o2::constants::math::Almost0, o2::constants::math::VeryBig, 0.5f * (ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::track::tgl)) + 1.f / ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::track::tgl))) / nabs(aod::track::signed1Pt)));
180 [](float signed1Pt, float tgl, float mass) -> float {
181 const auto pt = 1.f / std::abs(signed1Pt);
182 const auto p = 0.5f * (std::tan(o2::constants::math::PIQuarter - 0.5f * std::atan(tgl)) + 1.f / std::tan(o2::constants::math::PIQuarter - 0.5f * std::atan(tgl))) * pt;
183 return std::sqrt(p * p + mass * mass);
184 });
185DECLARE_SOA_DYNAMIC_COLUMN(Rapidity, rapidity,
186 [](float signed1Pt, float tgl, float mass) -> float {
187 const auto pt = 1.f / std::abs(signed1Pt);
188 const auto pz = pt * tgl;
189 const auto p = 0.5f * (std::tan(o2::constants::math::PIQuarter - 0.5f * std::atan(tgl)) + 1.f / std::tan(o2::constants::math::PIQuarter - 0.5f * std::atan(tgl))) * pt;
190 const auto energy = std::sqrt(p * p + mass * mass);
191 return 0.5f * std::log((energy + pz) / (energy - pz));
192 });
193
194// TRACKPARCOV TABLE definition
195DECLARE_SOA_COLUMN(SigmaY, sigmaY, float);
196DECLARE_SOA_COLUMN(SigmaZ, sigmaZ, float);
197DECLARE_SOA_COLUMN(SigmaSnp, sigmaSnp, float);
198DECLARE_SOA_COLUMN(SigmaTgl, sigmaTgl, float);
199DECLARE_SOA_COLUMN(Sigma1Pt, sigma1Pt, float);
200DECLARE_SOA_COLUMN(RhoZY, rhoZY, int8_t);
201DECLARE_SOA_COLUMN(RhoSnpY, rhoSnpY, int8_t);
202DECLARE_SOA_COLUMN(RhoSnpZ, rhoSnpZ, int8_t);
203DECLARE_SOA_COLUMN(RhoTglY, rhoTglY, int8_t);
204DECLARE_SOA_COLUMN(RhoTglZ, rhoTglZ, int8_t);
205DECLARE_SOA_COLUMN(RhoTglSnp, rhoTglSnp, int8_t);
206DECLARE_SOA_COLUMN(Rho1PtY, rho1PtY, int8_t);
207DECLARE_SOA_COLUMN(Rho1PtZ, rho1PtZ, int8_t);
208DECLARE_SOA_COLUMN(Rho1PtSnp, rho1PtSnp, int8_t);
209DECLARE_SOA_COLUMN(Rho1PtTgl, rho1PtTgl, int8_t);
210
212 aod::track::sigmaY* aod::track::sigmaY);
214 (aod::track::rhoZY / 128.f) * (aod::track::sigmaZ * aod::track::sigmaY));
216 aod::track::sigmaZ* aod::track::sigmaZ);
217DECLARE_SOA_EXPRESSION_COLUMN(CSnpY, cSnpY, float,
218 (aod::track::rhoSnpY / 128.f) * (aod::track::sigmaSnp * aod::track::sigmaY));
219DECLARE_SOA_EXPRESSION_COLUMN(CSnpZ, cSnpZ, float,
220 (aod::track::rhoSnpZ / 128.f) * (aod::track::sigmaSnp * aod::track::sigmaZ));
221DECLARE_SOA_EXPRESSION_COLUMN(CSnpSnp, cSnpSnp, float,
222 aod::track::sigmaSnp* aod::track::sigmaSnp);
223DECLARE_SOA_EXPRESSION_COLUMN(CTglY, cTglY, float,
224 (aod::track::rhoTglY / 128.f) * (aod::track::sigmaTgl * aod::track::sigmaY));
225DECLARE_SOA_EXPRESSION_COLUMN(CTglZ, cTglZ, float,
226 (aod::track::rhoTglZ / 128.f) * (aod::track::sigmaTgl * aod::track::sigmaZ));
227DECLARE_SOA_EXPRESSION_COLUMN(CTglSnp, cTglSnp, float,
228 (aod::track::rhoTglSnp / 128.f) * (aod::track::sigmaTgl * aod::track::sigmaSnp));
229DECLARE_SOA_EXPRESSION_COLUMN(CTglTgl, cTglTgl, float,
230 aod::track::sigmaTgl* aod::track::sigmaTgl);
231DECLARE_SOA_EXPRESSION_COLUMN(C1PtY, c1PtY, float,
232 (aod::track::rho1PtY / 128.f) * (aod::track::sigma1Pt * aod::track::sigmaY));
233DECLARE_SOA_EXPRESSION_COLUMN(C1PtZ, c1PtZ, float,
234 (aod::track::rho1PtZ / 128.f) * (aod::track::sigma1Pt * aod::track::sigmaZ));
235DECLARE_SOA_EXPRESSION_COLUMN(C1PtSnp, c1PtSnp, float,
236 (aod::track::rho1PtSnp / 128.f) * (aod::track::sigma1Pt * aod::track::sigmaSnp));
237DECLARE_SOA_EXPRESSION_COLUMN(C1PtTgl, c1PtTgl, float,
238 (aod::track::rho1PtTgl / 128.f) * (aod::track::sigma1Pt * aod::track::sigmaTgl));
239DECLARE_SOA_EXPRESSION_COLUMN(C1Pt21Pt2, c1Pt21Pt2, float,
240 aod::track::sigma1Pt* aod::track::sigma1Pt);
241
242// TRACKEXTRA TABLE definition
243DECLARE_SOA_COLUMN(TPCInnerParam, tpcInnerParam, float);
244DECLARE_SOA_COLUMN(Flags, flags, uint32_t);
245DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t);
246DECLARE_SOA_COLUMN(ITSClusterMap, itsClusterMap, uint8_t);
247DECLARE_SOA_COLUMN(TPCNClsFindable, tpcNClsFindable, uint8_t);
248DECLARE_SOA_COLUMN(TPCNClsFindableMinusFound, tpcNClsFindableMinusFound, int8_t);
249DECLARE_SOA_COLUMN(TPCNClsFindableMinusPID, tpcNClsFindableMinusPID, int8_t);
250DECLARE_SOA_COLUMN(TPCNClsFindableMinusCrossedRows, tpcNClsFindableMinusCrossedRows, int8_t);
251DECLARE_SOA_COLUMN(TPCNClsShared, tpcNClsShared, uint8_t);
252DECLARE_SOA_COLUMN(ITSSharedClusterMap, itsSharedClusterMap, uint8_t);
253DECLARE_SOA_COLUMN(TRDPattern, trdPattern, uint8_t);
254DECLARE_SOA_COLUMN(ITSChi2NCl, itsChi2NCl, float);
255DECLARE_SOA_COLUMN(TPCChi2NCl, tpcChi2NCl, float);
256DECLARE_SOA_COLUMN(TRDChi2, trdChi2, float);
257DECLARE_SOA_COLUMN(TOFChi2, tofChi2, float);
258DECLARE_SOA_COLUMN(ITSSignal, itsSignal, float);
259DECLARE_SOA_COLUMN(TPCSignal, tpcSignal, float);
260DECLARE_SOA_COLUMN(TRDSignal, trdSignal, float);
261DECLARE_SOA_COLUMN(Length, length, float);
262DECLARE_SOA_COLUMN(TOFExpMom, tofExpMom, float);
263DECLARE_SOA_COLUMN(TrackEtaEMCAL, trackEtaEmcal, float);
264DECLARE_SOA_COLUMN(TrackPhiEMCAL, trackPhiEmcal, float);
265DECLARE_SOA_COLUMN(TrackTime, trackTime, float);
266DECLARE_SOA_COLUMN(TrackTimeRes, trackTimeRes, float);
267
268// expression columns changing between versions have to be declared in different namespaces
269
270DECLARE_SOA_EXPRESSION_COLUMN(DetectorMap, detectorMap, uint8_t,
271 ifnode(aod::track::itsClusterMap > (uint8_t)0, static_cast<uint8_t>(o2::aod::track::ITS), (uint8_t)0x0) |
272 ifnode(aod::track::tpcNClsFindable > (uint8_t)0, static_cast<uint8_t>(o2::aod::track::TPC), (uint8_t)0x0) |
273 ifnode(aod::track::trdPattern > (uint8_t)0, static_cast<uint8_t>(o2::aod::track::TRD), (uint8_t)0x0) |
274 ifnode((aod::track::tofChi2 >= 0.f) && (aod::track::tofExpMom > 0.f), static_cast<uint8_t>(o2::aod::track::TOF), (uint8_t)0x0));
275
276DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeEl, tofExpTimeEl,
277 [](float length, float tofExpMom) -> float {
278 constexpr float massSquared = o2::constants::physics::MassElectron * o2::constants::physics::MassElectron;
279 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
280 });
281
282DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeMu, tofExpTimeMu,
283 [](float length, float tofExpMom) -> float {
284 constexpr float massSquared = o2::constants::physics::MassMuon * o2::constants::physics::MassMuon;
285 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
286 });
287
288DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimePi, tofExpTimePi,
289 [](float length, float tofExpMom) -> float {
290 constexpr float massSquared = o2::constants::physics::MassPionCharged * o2::constants::physics::MassPionCharged;
291 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
292 });
293
294DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeKa, tofExpTimeKa,
295 [](float length, float tofExpMom) -> float {
296 constexpr float massSquared = o2::constants::physics::MassKaonCharged * o2::constants::physics::MassKaonCharged;
297 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
298 });
299
300DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimePr, tofExpTimePr,
301 [](float length, float tofExpMom) -> float {
302 constexpr float massSquared = o2::constants::physics::MassProton * o2::constants::physics::MassProton;
303 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
304 });
305
306DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeDe, tofExpTimeDe,
307 [](float length, float tofExpMom) -> float {
308 constexpr float massSquared = o2::constants::physics::MassDeuteron * o2::constants::physics::MassDeuteron;
309 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
310 });
311
312DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeTr, tofExpTimeTr,
313 [](float length, float tofExpMom) -> float {
314 constexpr float massSquared = o2::constants::physics::MassTriton * o2::constants::physics::MassTriton;
315 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
316 });
317
318DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeHe, tofExpTimeHe,
319 [](float length, float tofExpMom) -> float {
320 constexpr float massSquared = o2::constants::physics::MassHelium3 * o2::constants::physics::MassHelium3;
321 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
322 });
323
324DECLARE_SOA_DYNAMIC_COLUMN(TOFExpTimeAl, tofExpTimeAl,
325 [](float length, float tofExpMom) -> float {
326 constexpr float massSquared = o2::constants::physics::MassAlpha * o2::constants::physics::MassAlpha;
327 return o2::framework::pid::tof::MassToExpTime(tofExpMom, length, massSquared);
328 });
329
330namespace v001
331{
332DECLARE_SOA_EXPRESSION_COLUMN(DetectorMap, detectorMap, uint8_t,
333 ifnode(aod::track::itsClusterSizes > (uint32_t)0, static_cast<uint8_t>(o2::aod::track::ITS), (uint8_t)0x0) |
334 ifnode(aod::track::tpcNClsFindable > (uint8_t)0, static_cast<uint8_t>(o2::aod::track::TPC), (uint8_t)0x0) |
335 ifnode(aod::track::trdPattern > (uint8_t)0, static_cast<uint8_t>(o2::aod::track::TRD), (uint8_t)0x0) |
336 ifnode((aod::track::tofChi2 >= 0.f) && (aod::track::tofExpMom > 0.f), static_cast<uint8_t>(o2::aod::track::TOF), (uint8_t)0x0));
337DECLARE_SOA_DYNAMIC_COLUMN(ITSClusterMap, itsClusterMap,
338 [](uint32_t itsClusterSizes) -> uint8_t {
339 uint8_t clmap = 0;
340 for (unsigned int layer = 0; layer < 7; layer++) {
341 if ((itsClusterSizes >> (layer * 4)) & 0xf) {
342 clmap |= (1 << layer);
343 }
344 }
345 return clmap;
346 });
348 [](uint32_t itsClusterSizes) -> uint8_t {
349 uint8_t itsNcls = 0;
350 for (int layer = 0; layer < 7; layer++) {
351 if ((itsClusterSizes >> (layer * 4)) & 0xf)
352 itsNcls++;
353 }
354 return itsNcls;
355 });
356DECLARE_SOA_DYNAMIC_COLUMN(ITSNClsInnerBarrel, itsNClsInnerBarrel,
357 [](uint32_t itsClusterSizes) -> uint8_t {
358 uint8_t itsNclsInnerBarrel = 0;
359 for (int layer = 0; layer < 3; layer++) {
360 if ((itsClusterSizes >> (layer * 4)) & 0xf)
361 itsNclsInnerBarrel++;
362 }
363 return itsNclsInnerBarrel;
364 });
365DECLARE_SOA_DYNAMIC_COLUMN(ITSClsSizeInLayer, itsClsSizeInLayer,
366 [](uint32_t itsClusterSizes, int layer) -> uint8_t {
367 if (layer >= 7 || layer < 0) {
368 return 0;
369 }
370 return (itsClusterSizes >> (layer * 4)) & 0xf;
371 });
372
373DECLARE_SOA_DYNAMIC_COLUMN(IsITSAfterburner, isITSAfterburner,
374 [](uint8_t detectorMap, float itsChi2Ncl) -> bool {
375 return (detectorMap & o2::aod::track::ITS) && (itsChi2Ncl < 0.f);
376 });
377
378namespace extensions
379{
381DECLARE_SOA_DYNAMIC_COLUMN(TPCDeltaTFwd, tpcDeltaTFwd,
382 [](float timeErr, uint32_t trackType) -> float {
383 if (!(trackType & TrackFlags::TrackTimeAsym)) {
384 return TPCTimeErrEncoding::invalidValue;
385 }
387 enc.encoding.timeErr = timeErr;
388 return enc.getDeltaTFwd();
389 });
390
391DECLARE_SOA_DYNAMIC_COLUMN(TPCDeltaTBwd, tpcDeltaTBwd,
392 [](float timeErr, uint32_t trackType) -> float {
393 if (!(trackType & TrackFlags::TrackTimeAsym)) {
394 return TPCTimeErrEncoding::invalidValue;
395 }
397 p.encoding.timeErr = timeErr;
398 return p.getDeltaTBwd();
399 });
400} // namespace extensions
401
402} // namespace v001
403
404namespace
405{
406inline uint16_t fixTPCNClsFindable(uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound)
407{
408 uint16_t res = tpcNClsFindable;
409 if (tpcNClsFindable <= tpcNClsFindableMinusFound) {
410 res += 256;
411 }
412 return res;
413}
414} // namespace
415
417 [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::ITS; });
419 [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::TPC; });
421 [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::TRD; });
423 [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::TOF; });
424DECLARE_SOA_DYNAMIC_COLUMN(IsPVContributor, isPVContributor,
425 [](uint8_t flags) -> bool { return (flags & o2::aod::track::PVContributor) == o2::aod::track::PVContributor; });
426DECLARE_SOA_DYNAMIC_COLUMN(HasTPCSideA, hasTPCSideA,
427 [](uint8_t flags) -> bool { return (flags & o2::aod::track::TPCSideA) == o2::aod::track::TPCSideA; });
428DECLARE_SOA_DYNAMIC_COLUMN(HasTPCSideAOnly, hasTPCSideAOnly,
430DECLARE_SOA_DYNAMIC_COLUMN(HasTPCSideC, hasTPCSideC,
431 [](uint8_t flags) -> bool { return (flags & o2::aod::track::TPCSideC) == o2::aod::track::TPCSideC; });
432DECLARE_SOA_DYNAMIC_COLUMN(HasTPCSideCOnly, hasTPCSideCOnly,
434DECLARE_SOA_DYNAMIC_COLUMN(HasTPCBothSides, hasTPCBothSides,
436DECLARE_SOA_DYNAMIC_COLUMN(PIDForTracking, pidForTracking,
437 [](uint32_t flags) -> uint32_t { return flags >> 28; });
438DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsFound, tpcNClsFound,
439 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t {
440 return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound;
441 });
442DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsPID, tpcNClsPID,
443 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID, int8_t tpcNClsFindableMinusFound) -> int16_t {
444 return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusPID;
445 });
446DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows_fix, tpcNClsCrossedRows,
447 [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> int16_t {
448 return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - TPCNClsFindableMinusCrossedRows;
449 });
450DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows,
451 [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t)tpcNClsFindable - TPCNClsFindableMinusCrossedRows; });
453 [](uint8_t itsClusterMap) -> uint8_t {
454 uint8_t itsNcls = 0;
455 constexpr uint8_t bit = 1;
456 for (int layer = 0; layer < 7; layer++) {
457 if (itsClusterMap & (bit << layer))
458 itsNcls++;
459 }
460 return itsNcls;
461 });
462DECLARE_SOA_DYNAMIC_COLUMN(ITSNClsInnerBarrel, itsNClsInnerBarrel,
463 [](uint8_t itsClusterMap) -> uint8_t {
464 uint8_t itsNclsInnerBarrel = 0;
465 constexpr uint8_t bit = 1;
466 for (int layer = 0; layer < 3; layer++) {
467 if (itsClusterMap & (bit << layer))
468 itsNclsInnerBarrel++;
469 }
470 return itsNclsInnerBarrel;
471 });
472DECLARE_SOA_DYNAMIC_COLUMN(ITSNSharedCls, itsNSharedCls,
473 [](uint8_t itsSharedClusterMap) -> uint8_t {
475 constexpr uint8_t bit = 1;
476 for (int layer = 0; layer < 6; layer++) { // ITS1: 6 layers
477 if (itsSharedClusterMap & (bit << layer))
479 }
481 });
482DECLARE_SOA_DYNAMIC_COLUMN(TPCFoundOverFindableCls, tpcFoundOverFindableCls,
483 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float {
484 int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound;
485 return (float)tpcNClsFound / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound);
486 });
487
488DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls_fix, tpcCrossedRowsOverFindableCls,
489 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> float {
490 int16_t tpcNClsCrossedRows = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusCrossedRows;
491 return (float)tpcNClsCrossedRows / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound);
492 });
493
494DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls,
495 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows) -> float {
496 int16_t tpcNClsCrossedRows = (int16_t)tpcNClsFindable - tpcNClsFindableMinusCrossedRows;
497 return (float)tpcNClsCrossedRows / (float)tpcNClsFindable;
498 });
499
500DECLARE_SOA_DYNAMIC_COLUMN(TPCFractionSharedCls, tpcFractionSharedCls,
501 [](uint8_t tpcNClsShared, uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float {
502 int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound;
503 return (float)tpcNClsShared / (float)tpcNClsFound;
504 });
505
506DECLARE_SOA_DYNAMIC_COLUMN(TRDHasNeighbor, trdHasNeighbor,
507 [](uint8_t trdPattern) -> bool { return trdPattern & o2::aod::track::HasNeighbor; });
508
509DECLARE_SOA_DYNAMIC_COLUMN(TRDHasCrossing, trdHasCrossing,
510 [](uint8_t trdPattern) -> bool { return trdPattern & o2::aod::track::HasCrossing; });
511
512DECLARE_SOA_DYNAMIC_COLUMN(TRDNTracklets, trdNTracklets,
513 [](uint8_t trdPattern) -> std::size_t { return std::bitset<6>(trdPattern).count(); });
514} // namespace track
515
516DECLARE_SOA_TABLE_FULL(StoredTracks, "Tracks", "AOD", "TRACK",
517 o2::soa::Index<>, track::CollisionId, track::TrackType,
518 track::X, track::Alpha,
519 track::Y, track::Z, track::Snp, track::Tgl,
520 track::Signed1Pt, track::IsWithinBeamPipe<track::X>,
521 track::Px<track::Signed1Pt, track::Snp, track::Alpha>,
522 track::Py<track::Signed1Pt, track::Snp, track::Alpha>,
523 track::Pz<track::Signed1Pt, track::Tgl>,
524 track::PVector<track::Signed1Pt, track::Snp, track::Alpha, track::Tgl>,
525 track::Energy<track::Signed1Pt, track::Tgl>,
526 track::Rapidity<track::Signed1Pt, track::Tgl>,
527 track::Sign<track::Signed1Pt>,
529
530DECLARE_SOA_EXTENDED_TABLE(Tracks, StoredTracks, "EXTRACK", 0,
531 aod::track::Pt,
532 aod::track::P,
533 aod::track::Eta,
534 aod::track::Phi);
535
536DECLARE_SOA_TABLE_FULL(StoredTracksIU, "Tracks_IU", "AOD", "TRACK_IU",
537 o2::soa::Index<>, track::CollisionId, track::TrackType,
538 track::X, track::Alpha,
539 track::Y, track::Z, track::Snp, track::Tgl,
540 track::Signed1Pt, track::IsWithinBeamPipe<track::X>,
541 track::Px<track::Signed1Pt, track::Snp, track::Alpha>,
542 track::Py<track::Signed1Pt, track::Snp, track::Alpha>,
543 track::Pz<track::Signed1Pt, track::Tgl>,
544 track::PVector<track::Signed1Pt, track::Snp, track::Alpha, track::Tgl>,
545 track::Energy<track::Signed1Pt, track::Tgl>,
546 track::Rapidity<track::Signed1Pt, track::Tgl>,
547 track::Sign<track::Signed1Pt>,
549
550DECLARE_SOA_EXTENDED_TABLE_NG(TracksIU, StoredTracksIU, "EXTRACK_IU", 0,
551 aod::track::Pt,
552 aod::track::P,
553 aod::track::Eta,
554 aod::track::Phi);
555
556DECLARE_SOA_TABLE_FULL(StoredTracksCov, "TracksCov", "AOD", "TRACKCOV",
557 track::SigmaY, track::SigmaZ, track::SigmaSnp, track::SigmaTgl, track::Sigma1Pt,
558 track::RhoZY, track::RhoSnpY, track::RhoSnpZ, track::RhoTglY, track::RhoTglZ,
559 track::RhoTglSnp, track::Rho1PtY, track::Rho1PtZ, track::Rho1PtSnp, track::Rho1PtTgl, o2::soa::Marker<1>);
560
561DECLARE_SOA_EXTENDED_TABLE(TracksCov, StoredTracksCov, "EXTRACKCOV", 0,
562 aod::track::CYY,
563 aod::track::CZY,
564 aod::track::CZZ,
565 aod::track::CSnpY,
566 aod::track::CSnpZ,
567 aod::track::CSnpSnp,
568 aod::track::CTglY,
569 aod::track::CTglZ,
570 aod::track::CTglSnp,
571 aod::track::CTglTgl,
572 aod::track::C1PtY,
573 aod::track::C1PtZ,
574 aod::track::C1PtSnp,
575 aod::track::C1PtTgl,
576 aod::track::C1Pt21Pt2);
577
578DECLARE_SOA_TABLE_FULL(StoredTracksCovIU, "TracksCov_IU", "AOD", "TRACKCOV_IU",
579 track::SigmaY, track::SigmaZ, track::SigmaSnp, track::SigmaTgl, track::Sigma1Pt,
580 track::RhoZY, track::RhoSnpY, track::RhoSnpZ, track::RhoTglY, track::RhoTglZ,
581 track::RhoTglSnp, track::Rho1PtY, track::Rho1PtZ, track::Rho1PtSnp, track::Rho1PtTgl, o2::soa::Marker<2>);
582
583DECLARE_SOA_EXTENDED_TABLE(TracksCovIU, StoredTracksCovIU, "EXTRACKCOV_IU", 0,
584 aod::track::CYY,
585 aod::track::CZY,
586 aod::track::CZZ,
587 aod::track::CSnpY,
588 aod::track::CSnpZ,
589 aod::track::CSnpSnp,
590 aod::track::CTglY,
591 aod::track::CTglZ,
592 aod::track::CTglSnp,
593 aod::track::CTglTgl,
594 aod::track::C1PtY,
595 aod::track::C1PtZ,
596 aod::track::C1PtSnp,
597 aod::track::C1PtTgl,
598 aod::track::C1Pt21Pt2);
599
600DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA",
601 track::TPCInnerParam, track::Flags, track::ITSClusterMap,
602 track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows,
603 track::TPCNClsShared, track::TRDPattern, track::ITSChi2NCl,
604 track::TPCChi2NCl, track::TRDChi2, track::TOFChi2,
605 track::TPCSignal, track::TRDSignal, track::Length, track::TOFExpMom,
606 track::PIDForTracking<track::Flags>,
607 track::IsPVContributor<track::Flags>,
608 track::HasITS<track::DetectorMap>, track::HasTPC<track::DetectorMap>,
609 track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
610 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
611 track::TPCNClsCrossedRows_fix<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound>,
612 track::TOFExpTimeEl<track::Length, track::TOFExpMom>,
613 track::TOFExpTimeMu<track::Length, track::TOFExpMom>,
614 track::TOFExpTimePi<track::Length, track::TOFExpMom>,
615 track::TOFExpTimeKa<track::Length, track::TOFExpMom>,
616 track::TOFExpTimePr<track::Length, track::TOFExpMom>,
617 track::TOFExpTimeDe<track::Length, track::TOFExpMom>,
618 track::TOFExpTimeTr<track::Length, track::TOFExpMom>,
619 track::TOFExpTimeHe<track::Length, track::TOFExpMom>,
620 track::TOFExpTimeAl<track::Length, track::TOFExpMom>,
621 track::ITSNCls<track::ITSClusterMap>, track::ITSNClsInnerBarrel<track::ITSClusterMap>,
622 track::TPCCrossedRowsOverFindableCls_fix<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound>,
623 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
624 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
625 track::TRDHasCrossing<track::TRDPattern>, track::TRDHasNeighbor<track::TRDPattern>, track::TRDNTracklets<track::TRDPattern>,
626 track::TrackEtaEMCAL, track::TrackPhiEMCAL, track::TrackTime, track::TrackTimeRes);
627
628DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "TRACKEXTRA", 1, // On disk version of TracksExtra, version 1
629 track::TPCInnerParam, track::Flags, track::ITSClusterSizes,
630 track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows,
631 track::TPCNClsShared, track::v001::extensions::TPCDeltaTFwd<track::TrackTimeRes, track::Flags>, track::v001::extensions::TPCDeltaTBwd<track::TrackTimeRes, track::Flags>,
632 track::TRDPattern, track::ITSChi2NCl, track::TPCChi2NCl, track::TRDChi2, track::TOFChi2,
633 track::TPCSignal, track::TRDSignal, track::Length, track::TOFExpMom,
634 track::PIDForTracking<track::Flags>,
635 track::IsPVContributor<track::Flags>,
636 track::HasITS<track::v001::DetectorMap>, track::HasTPC<track::v001::DetectorMap>,
637 track::HasTRD<track::v001::DetectorMap>, track::HasTOF<track::v001::DetectorMap>,
638 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
639 track::TPCNClsCrossedRows_fix<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound>,
640 track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
641 track::v001::ITSClsSizeInLayer<track::ITSClusterSizes>,
642 track::v001::IsITSAfterburner<track::v001::DetectorMap, track::ITSChi2NCl>,
643 track::TOFExpTimeEl<track::Length, track::TOFExpMom>,
644 track::TOFExpTimeMu<track::Length, track::TOFExpMom>,
645 track::TOFExpTimePi<track::Length, track::TOFExpMom>,
646 track::TOFExpTimeKa<track::Length, track::TOFExpMom>,
647 track::TOFExpTimePr<track::Length, track::TOFExpMom>,
648 track::TOFExpTimeDe<track::Length, track::TOFExpMom>,
649 track::TOFExpTimeTr<track::Length, track::TOFExpMom>,
650 track::TOFExpTimeHe<track::Length, track::TOFExpMom>,
651 track::TOFExpTimeAl<track::Length, track::TOFExpMom>,
652 track::TPCCrossedRowsOverFindableCls_fix<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound>,
653 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
654 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
655 track::TRDHasCrossing<track::TRDPattern>, track::TRDHasNeighbor<track::TRDPattern>, track::TRDNTracklets<track::TRDPattern>,
656 track::TrackEtaEMCAL, track::TrackPhiEMCAL, track::TrackTime, track::TrackTimeRes);
657
658DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "TRACKEXTRA", 2, // On disk version of TracksExtra, version 2
659 track::TPCInnerParam, track::Flags, track::ITSClusterSizes,
660 track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusCrossedRows,
661 track::TPCNClsShared, track::v001::extensions::TPCDeltaTFwd<track::TrackTimeRes, track::Flags>, track::v001::extensions::TPCDeltaTBwd<track::TrackTimeRes, track::Flags>,
662 track::TRDPattern, track::ITSChi2NCl, track::TPCChi2NCl, track::TRDChi2, track::TOFChi2,
663 track::TPCSignal, track::TRDSignal, track::Length, track::TOFExpMom,
664 track::PIDForTracking<track::Flags>,
665 track::IsPVContributor<track::Flags>,
666 track::HasITS<track::v001::DetectorMap>, track::HasTPC<track::v001::DetectorMap>,
667 track::HasTRD<track::v001::DetectorMap>, track::HasTOF<track::v001::DetectorMap>,
668 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
669 track::TPCNClsPID<track::TPCNClsFindable, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusFound>,
670 track::TPCNClsCrossedRows_fix<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound>,
671 track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
672 track::v001::ITSClsSizeInLayer<track::ITSClusterSizes>,
673 track::v001::IsITSAfterburner<track::v001::DetectorMap, track::ITSChi2NCl>,
674 track::TOFExpTimeEl<track::Length, track::TOFExpMom>,
675 track::TOFExpTimeMu<track::Length, track::TOFExpMom>,
676 track::TOFExpTimePi<track::Length, track::TOFExpMom>,
677 track::TOFExpTimeKa<track::Length, track::TOFExpMom>,
678 track::TOFExpTimePr<track::Length, track::TOFExpMom>,
679 track::TOFExpTimeDe<track::Length, track::TOFExpMom>,
680 track::TOFExpTimeTr<track::Length, track::TOFExpMom>,
681 track::TOFExpTimeHe<track::Length, track::TOFExpMom>,
682 track::TOFExpTimeAl<track::Length, track::TOFExpMom>,
683 track::TPCCrossedRowsOverFindableCls_fix<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound>,
684 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
685 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
686 track::TRDHasCrossing<track::TRDPattern>, track::TRDHasNeighbor<track::TRDPattern>, track::TRDNTracklets<track::TRDPattern>,
687 track::TrackEtaEMCAL, track::TrackPhiEMCAL, track::TrackTime, track::TrackTimeRes);
688
689DECLARE_SOA_EXTENDED_TABLE(TracksExtra_000, StoredTracksExtra_000, "EXTRACKEXTRA", 0,
690 track::DetectorMap);
691DECLARE_SOA_EXTENDED_TABLE(TracksExtra_001, StoredTracksExtra_001, "EXTRACKEXTRA", 1,
692 track::v001::DetectorMap);
693DECLARE_SOA_EXTENDED_TABLE(TracksExtra_002, StoredTracksExtra_002, "EXTRACKEXTRA", 2,
694 track::v001::DetectorMap);
695
696DECLARE_SOA_TABLE(Run2TrackExtras_000, "AOD", "RUN2TRACKEXTRA",
697 track::ITSSignal);
698DECLARE_SOA_TABLE_VERSIONED(Run2TrackExtras_001, "AOD", "RUN2TRACKEXTRA", 1,
699 track::ITSSignal, track::ITSSharedClusterMap,
700 track::ITSNSharedCls<track::ITSSharedClusterMap>);
701
702template <aod::is_origin_hash O>
703using TracksExtraFrom = TracksExtra_002From<O>;
704using StoredTracksExtra = StoredTracksExtra_002;
705using TracksExtra = TracksExtra_002;
706
707using Track = Tracks::iterator;
708using TrackIU = TracksIU::iterator;
709using TrackCov = TracksCov::iterator;
710using TrackCovIU = TracksCovIU::iterator;
711using TrackExtra = TracksExtra::iterator;
712using Run2TrackExtras = Run2TrackExtras_001;
713using Run2TrackExtra = Run2TrackExtras::iterator;
714
715} // namespace aod
716namespace soa
717{
718extern template struct soa::Join<aod::Tracks, aod::TracksExtra>;
721} // namespace soa
722namespace aod
723{
726
727namespace trackqa
728{
729// TRACKQA TABLE COLUMNS
731DECLARE_SOA_COLUMN(TPCTime0, tpcTime0, float);
732DECLARE_SOA_COLUMN(TPCdEdxNorm, tpcdEdxNorm, float);
733DECLARE_SOA_COLUMN(TPCDCAR, tpcdcaR, int16_t);
734DECLARE_SOA_COLUMN(TPCDCAZ, tpcdcaZ, int16_t);
735DECLARE_SOA_COLUMN(TPCClusterByteMask, tpcClusterByteMask, uint8_t);
736DECLARE_SOA_COLUMN(TPCdEdxMax0R, tpcdEdxMax0R, uint8_t);
737DECLARE_SOA_COLUMN(TPCdEdxMax1R, tpcdEdxMax1R, uint8_t);
738DECLARE_SOA_COLUMN(TPCdEdxMax2R, tpcdEdxMax2R, uint8_t);
739DECLARE_SOA_COLUMN(TPCdEdxMax3R, tpcdEdxMax3R, uint8_t);
740DECLARE_SOA_COLUMN(TPCdEdxTot0R, tpcdEdxTot0R, uint8_t);
741DECLARE_SOA_COLUMN(TPCdEdxTot1R, tpcdEdxTot1R, uint8_t);
742DECLARE_SOA_COLUMN(TPCdEdxTot2R, tpcdEdxTot2R, uint8_t);
743DECLARE_SOA_COLUMN(TPCdEdxTot3R, tpcdEdxTot3R, uint8_t);
744DECLARE_SOA_COLUMN(DeltaRefContParamY, deltaRefContParamY, int8_t);
745DECLARE_SOA_COLUMN(DeltaRefContParamZ, deltaRefITSParamZ, int8_t);
746DECLARE_SOA_COLUMN(DeltaRefContParamSnp, deltaRefContParamSnp, int8_t);
747DECLARE_SOA_COLUMN(DeltaRefContParamTgl, deltaRefContParamTgl, int8_t);
748DECLARE_SOA_COLUMN(DeltaRefContParamQ2Pt, deltaRefContParamQ2Pt, int8_t);
749DECLARE_SOA_COLUMN(DeltaRefGloParamY, deltaRefGloParamY, int8_t);
750DECLARE_SOA_COLUMN(DeltaRefGloParamZ, deltaRefGloParamZ, int8_t);
751DECLARE_SOA_COLUMN(DeltaRefGloParamSnp, deltaRefGloParamSnp, int8_t);
752DECLARE_SOA_COLUMN(DeltaRefGloParamTgl, deltaRefGloParamTgl, int8_t);
753DECLARE_SOA_COLUMN(DeltaRefGloParamQ2Pt, deltaRefGloParamQ2Pt, int8_t);
754DECLARE_SOA_COLUMN(DeltaTOFdX, deltaTOFdX, int8_t);
755DECLARE_SOA_COLUMN(DeltaTOFdZ, deltaTOFdZ, int8_t);
756
758 [](int8_t cY, int8_t cZ, int8_t cSnp, int8_t cTgl, int8_t cQ2Pt, int8_t gY, int8_t gZ, int8_t gSnp, int8_t gTgl, int8_t gQ2Pt) -> bool {
759 constexpr int8_t m = std::numeric_limits<int8_t>::min();
760 return (cY == m && cZ == m && cSnp == m && cTgl == m && cQ2Pt == m && gY == m && gZ == m && gSnp == m && gTgl == m && gQ2Pt == m);
761 });
762} // namespace trackqa
763
764DECLARE_SOA_TABLE(TracksQA_000, "AOD", "TRACKQA",
765 o2::soa::Index<>, trackqa::TrackId, trackqa::TPCTime0, trackqa::TPCDCAR, trackqa::TPCDCAZ, trackqa::TPCClusterByteMask,
766 trackqa::TPCdEdxMax0R, trackqa::TPCdEdxMax1R, trackqa::TPCdEdxMax2R, trackqa::TPCdEdxMax3R,
767 trackqa::TPCdEdxTot0R, trackqa::TPCdEdxTot1R, trackqa::TPCdEdxTot2R, trackqa::TPCdEdxTot3R);
768// o2::soa::Index<>, trackqa::TrackId, trackqa::TPCDCAR, trackqa::TPCDCAZ, trackqa::TPCClusterByteMask,
769
770DECLARE_SOA_TABLE_VERSIONED(TracksQA_001, "AOD", "TRACKQA", 1,
771 o2::soa::Index<>, trackqa::TrackId, trackqa::TPCTime0, trackqa::TPCDCAR, trackqa::TPCDCAZ, trackqa::TPCClusterByteMask,
772 trackqa::TPCdEdxMax0R, trackqa::TPCdEdxMax1R, trackqa::TPCdEdxMax2R, trackqa::TPCdEdxMax3R,
773 trackqa::TPCdEdxTot0R, trackqa::TPCdEdxTot1R, trackqa::TPCdEdxTot2R, trackqa::TPCdEdxTot3R,
774 trackqa::DeltaRefContParamY, trackqa::DeltaRefContParamZ, trackqa::DeltaRefContParamSnp, trackqa::DeltaRefContParamTgl, trackqa::DeltaRefContParamQ2Pt,
775 trackqa::DeltaRefGloParamY, trackqa::DeltaRefGloParamZ, trackqa::DeltaRefGloParamSnp, trackqa::DeltaRefGloParamTgl, trackqa::DeltaRefGloParamQ2Pt,
776 trackqa::IsDummy<trackqa::DeltaRefContParamY, trackqa::DeltaRefContParamZ, trackqa::DeltaRefContParamSnp, trackqa::DeltaRefContParamTgl, trackqa::DeltaRefContParamQ2Pt,
777 trackqa::DeltaRefGloParamY, trackqa::DeltaRefGloParamZ, trackqa::DeltaRefGloParamSnp, trackqa::DeltaRefGloParamTgl, trackqa::DeltaRefGloParamQ2Pt>);
778
779DECLARE_SOA_TABLE_VERSIONED(TracksQA_002, "AOD", "TRACKQA", 2,
780 o2::soa::Index<>, trackqa::TrackId, trackqa::TPCTime0, trackqa::TPCDCAR, trackqa::TPCDCAZ, trackqa::TPCClusterByteMask,
781 trackqa::TPCdEdxMax0R, trackqa::TPCdEdxMax1R, trackqa::TPCdEdxMax2R, trackqa::TPCdEdxMax3R,
782 trackqa::TPCdEdxTot0R, trackqa::TPCdEdxTot1R, trackqa::TPCdEdxTot2R, trackqa::TPCdEdxTot3R,
783 trackqa::DeltaRefContParamY, trackqa::DeltaRefContParamZ, trackqa::DeltaRefContParamSnp, trackqa::DeltaRefContParamTgl, trackqa::DeltaRefContParamQ2Pt,
784 trackqa::DeltaRefGloParamY, trackqa::DeltaRefGloParamZ, trackqa::DeltaRefGloParamSnp, trackqa::DeltaRefGloParamTgl, trackqa::DeltaRefGloParamQ2Pt,
785 trackqa::DeltaTOFdX, trackqa::DeltaTOFdZ,
786 trackqa::IsDummy<trackqa::DeltaRefContParamY, trackqa::DeltaRefContParamZ, trackqa::DeltaRefContParamSnp, trackqa::DeltaRefContParamTgl, trackqa::DeltaRefContParamQ2Pt,
787 trackqa::DeltaRefGloParamY, trackqa::DeltaRefGloParamZ, trackqa::DeltaRefGloParamSnp, trackqa::DeltaRefGloParamTgl, trackqa::DeltaRefGloParamQ2Pt>);
788
789DECLARE_SOA_TABLE_VERSIONED(TracksQA_003, "AOD", "TRACKQA", 3,
790 o2::soa::Index<>, trackqa::TrackId, trackqa::TPCTime0, trackqa::TPCdEdxNorm, trackqa::TPCDCAR, trackqa::TPCDCAZ, trackqa::TPCClusterByteMask,
791 trackqa::TPCdEdxMax0R, trackqa::TPCdEdxMax1R, trackqa::TPCdEdxMax2R, trackqa::TPCdEdxMax3R,
792 trackqa::TPCdEdxTot0R, trackqa::TPCdEdxTot1R, trackqa::TPCdEdxTot2R, trackqa::TPCdEdxTot3R,
793 trackqa::DeltaRefContParamY, trackqa::DeltaRefContParamZ, trackqa::DeltaRefContParamSnp, trackqa::DeltaRefContParamTgl, trackqa::DeltaRefContParamQ2Pt,
794 trackqa::DeltaRefGloParamY, trackqa::DeltaRefGloParamZ, trackqa::DeltaRefGloParamSnp, trackqa::DeltaRefGloParamTgl, trackqa::DeltaRefGloParamQ2Pt,
795 trackqa::DeltaTOFdX, trackqa::DeltaTOFdZ,
796 trackqa::IsDummy<trackqa::DeltaRefContParamY, trackqa::DeltaRefContParamZ, trackqa::DeltaRefContParamSnp, trackqa::DeltaRefContParamTgl, trackqa::DeltaRefContParamQ2Pt,
797 trackqa::DeltaRefGloParamY, trackqa::DeltaRefGloParamZ, trackqa::DeltaRefGloParamSnp, trackqa::DeltaRefGloParamTgl, trackqa::DeltaRefGloParamQ2Pt>);
798
799using TracksQAVersion = TracksQA_003;
800using TracksQA = TracksQAVersion::iterator;
801
802namespace fwdtrack
803{
804// FwdTracks and MFTTracks Columns definitions
806DECLARE_SOA_COLUMN(TrackType, trackType, uint8_t);
810DECLARE_SOA_COLUMN(Phi, phi, float);
811DECLARE_SOA_COLUMN(Tgl, tgl, float);
812DECLARE_SOA_COLUMN(Signed1Pt, signed1Pt, float);
813DECLARE_SOA_COLUMN(NClusters, nClusters, int8_t);
814DECLARE_SOA_COLUMN(MFTClusterSizesAndTrackFlags, mftClusterSizesAndTrackFlags, uint64_t);
816DECLARE_SOA_COLUMN(PDca, pDca, float);
817DECLARE_SOA_COLUMN(RAtAbsorberEnd, rAtAbsorberEnd, float);
818DECLARE_SOA_COLUMN(Chi2MatchMCHMID, chi2MatchMCHMID, float);
819DECLARE_SOA_COLUMN(Chi2MatchMCHMFT, chi2MatchMCHMFT, float);
820DECLARE_SOA_COLUMN(MatchScoreMCHMFT, matchScoreMCHMFT, float);
821DECLARE_SOA_SELF_INDEX_COLUMN_FULL(MCHTrack, matchMCHTrack, int, "FwdTracks_MatchMCHTrack");
822DECLARE_SOA_COLUMN(MCHBitMap, mchBitMap, uint16_t);
823DECLARE_SOA_COLUMN(MIDBitMap, midBitMap, uint8_t);
824DECLARE_SOA_COLUMN(MIDBoards, midBoards, uint32_t);
825DECLARE_SOA_COLUMN(TrackTime, trackTime, float);
826DECLARE_SOA_COLUMN(TrackTimeRes, trackTimeRes, float);
828 [](float signed1Pt) -> short { return (signed1Pt > 0) ? 1 : -1; });
830 [](uint64_t mftClusterSizesAndTrackFlags) -> bool { return mftClusterSizesAndTrackFlags & (0x1ULL << 60); });
832 -1.f * nlog(ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl))));
834 ifnode(nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0, o2::constants::math::VeryBig, nabs(1.f / aod::fwdtrack::signed1Pt)));
836 ifnode((nabs(aod::fwdtrack::signed1Pt) < o2::constants::math::Almost0) || (nabs(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) < o2::constants::math::Almost0), o2::constants::math::VeryBig, 0.5f * (ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl)) + 1.f / ntan(o2::constants::math::PIQuarter - 0.5f * natan(aod::fwdtrack::tgl))) / nabs(aod::fwdtrack::signed1Pt)));
838 [](float pt, float phi) -> float {
839 return pt * std::cos(phi);
840 });
842 [](float pt, float phi) -> float {
843 return pt * std::sin(phi);
844 });
846 [](float pt, float tgl) -> float {
847 return pt * tgl;
848 });
849DECLARE_SOA_DYNAMIC_COLUMN(MIDBoardCh1, midBoardCh1,
850 [](uint32_t midBoards) -> int {
851 return static_cast<int>(midBoards & 0xFF);
852 });
853DECLARE_SOA_DYNAMIC_COLUMN(MIDBoardCh2, midBoardCh2,
854 [](uint32_t midBoards) -> int {
855 return static_cast<int>((midBoards >> 8) & 0xFF);
856 });
857DECLARE_SOA_DYNAMIC_COLUMN(MIDBoardCh3, midBoardCh3,
858 [](uint32_t midBoards) -> int {
859 return static_cast<int>((midBoards >> 16) & 0xFF);
860 });
861DECLARE_SOA_DYNAMIC_COLUMN(MIDBoardCh4, midBoardCh4,
862 [](uint32_t midBoards) -> int {
863 return static_cast<int>((midBoards >> 24) & 0xFF);
864 });
865
866namespace v001
867{
869 [](uint64_t mftClusterSizesAndTrackFlags) -> int8_t {
870 int8_t nClusters = 0;
871 for (int layer = 0; layer < 10; layer++) {
872 if ((mftClusterSizesAndTrackFlags >> (layer * 6)) & 0x3F) {
873 nClusters++;
874 }
875 }
876 return nClusters;
877 });
878} // namespace v001
879
880// FwdTracksCov columns definitions
881DECLARE_SOA_COLUMN(SigmaX, sigmaX, float);
882DECLARE_SOA_COLUMN(SigmaY, sigmaY, float);
883DECLARE_SOA_COLUMN(SigmaPhi, sigmaPhi, float);
884DECLARE_SOA_COLUMN(SigmaTgl, sigmaTgl, float);
885DECLARE_SOA_COLUMN(Sigma1Pt, sigma1Pt, float);
886DECLARE_SOA_COLUMN(RhoXY, rhoXY, int8_t);
887DECLARE_SOA_COLUMN(RhoPhiX, rhoPhiX, int8_t);
888DECLARE_SOA_COLUMN(RhoPhiY, rhoPhiY, int8_t);
889DECLARE_SOA_COLUMN(RhoTglX, rhoTglX, int8_t);
890DECLARE_SOA_COLUMN(RhoTglY, rhoTglY, int8_t);
891DECLARE_SOA_COLUMN(RhoTglPhi, rhoTglPhi, int8_t);
892DECLARE_SOA_COLUMN(Rho1PtX, rho1PtX, int8_t);
893DECLARE_SOA_COLUMN(Rho1PtY, rho1PtY, int8_t);
894DECLARE_SOA_COLUMN(Rho1PtPhi, rho1PtPhi, int8_t);
895DECLARE_SOA_COLUMN(Rho1PtTgl, rho1PtTgl, int8_t);
896
898 aod::fwdtrack::sigmaX* aod::fwdtrack::sigmaX);
900 (aod::fwdtrack::rhoXY / 128.f) * (aod::fwdtrack::sigmaX * aod::fwdtrack::sigmaY));
902 aod::fwdtrack::sigmaY* aod::fwdtrack::sigmaY);
903DECLARE_SOA_EXPRESSION_COLUMN(CPhiX, cPhiX, float,
904 (aod::fwdtrack::rhoPhiX / 128.f) * (aod::fwdtrack::sigmaPhi * aod::fwdtrack::sigmaX));
905DECLARE_SOA_EXPRESSION_COLUMN(CPhiY, cPhiY, float,
906 (aod::fwdtrack::rhoPhiY / 128.f) * (aod::fwdtrack::sigmaPhi * aod::fwdtrack::sigmaY));
907DECLARE_SOA_EXPRESSION_COLUMN(CPhiPhi, cPhiPhi, float,
908 aod::fwdtrack::sigmaPhi* aod::fwdtrack::sigmaPhi);
909DECLARE_SOA_EXPRESSION_COLUMN(CTglX, cTglX, float,
910 (aod::fwdtrack::rhoTglX / 128.f) * (aod::fwdtrack::sigmaTgl * aod::fwdtrack::sigmaX));
911DECLARE_SOA_EXPRESSION_COLUMN(CTglY, cTglY, float,
912 (aod::fwdtrack::rhoTglY / 128.f) * (aod::fwdtrack::sigmaTgl * aod::fwdtrack::sigmaY));
913DECLARE_SOA_EXPRESSION_COLUMN(CTglPhi, cTglPhi, float,
914 (aod::fwdtrack::rhoTglPhi / 128.f) * (aod::fwdtrack::sigmaTgl * aod::fwdtrack::sigmaPhi));
915DECLARE_SOA_EXPRESSION_COLUMN(CTglTgl, cTglTgl, float,
916 aod::fwdtrack::sigmaTgl* aod::fwdtrack::sigmaTgl);
917DECLARE_SOA_EXPRESSION_COLUMN(C1PtY, c1PtY, float,
918 (aod::fwdtrack::rho1PtY / 128.f) * (aod::fwdtrack::sigma1Pt * aod::fwdtrack::sigmaY));
919DECLARE_SOA_EXPRESSION_COLUMN(C1PtX, c1PtX, float,
920 (aod::fwdtrack::rho1PtX / 128.f) * (aod::fwdtrack::sigma1Pt * aod::fwdtrack::sigmaX));
921DECLARE_SOA_EXPRESSION_COLUMN(C1PtPhi, c1PtPhi, float,
922 (aod::fwdtrack::rho1PtPhi / 128.f) * (aod::fwdtrack::sigma1Pt * aod::fwdtrack::sigmaPhi));
923DECLARE_SOA_EXPRESSION_COLUMN(C1PtTgl, c1PtTgl, float,
924 (aod::fwdtrack::rho1PtTgl / 128.f) * (aod::fwdtrack::sigma1Pt * aod::fwdtrack::sigmaTgl));
925DECLARE_SOA_EXPRESSION_COLUMN(C1Pt21Pt2, c1Pt21Pt2, float,
926 aod::fwdtrack::sigma1Pt* aod::fwdtrack::sigma1Pt);
927} // namespace fwdtrack
928
929// MFTStandalone tracks
930DECLARE_SOA_TABLE_FULL(StoredMFTTracks_000, "MFTTracks", "AOD", "MFTTRACK",
931 o2::soa::Index<>, fwdtrack::CollisionId,
932 fwdtrack::X, fwdtrack::Y, fwdtrack::Z, fwdtrack::Phi, fwdtrack::Tgl,
933 fwdtrack::Signed1Pt, fwdtrack::NClusters,
934 fwdtrack::Px<fwdtrack::Pt, fwdtrack::Phi>,
935 fwdtrack::Py<fwdtrack::Pt, fwdtrack::Phi>,
936 fwdtrack::Pz<fwdtrack::Pt, fwdtrack::Tgl>,
937 fwdtrack::Sign<fwdtrack::Signed1Pt>, fwdtrack::Chi2,
938 fwdtrack::TrackTime, fwdtrack::TrackTimeRes);
939
940DECLARE_SOA_TABLE_FULL_VERSIONED(StoredMFTTracks_001, "MFTTracks", "AOD", "MFTTRACK", 1,
941 o2::soa::Index<>, fwdtrack::CollisionId,
942 fwdtrack::X, fwdtrack::Y, fwdtrack::Z, fwdtrack::Phi, fwdtrack::Tgl,
943 fwdtrack::Signed1Pt, fwdtrack::v001::NClusters<fwdtrack::MFTClusterSizesAndTrackFlags>, fwdtrack::MFTClusterSizesAndTrackFlags, fwdtrack::IsCA<fwdtrack::MFTClusterSizesAndTrackFlags>,
944 fwdtrack::Px<fwdtrack::Pt, fwdtrack::Phi>,
945 fwdtrack::Py<fwdtrack::Pt, fwdtrack::Phi>,
946 fwdtrack::Pz<fwdtrack::Pt, fwdtrack::Tgl>,
947 fwdtrack::Sign<fwdtrack::Signed1Pt>, fwdtrack::Chi2,
948 fwdtrack::TrackTime, fwdtrack::TrackTimeRes);
949
950DECLARE_SOA_EXTENDED_TABLE(MFTTracks_000, StoredMFTTracks_000, "EXMFTTRACK", 0,
951 aod::fwdtrack::Pt,
952 aod::fwdtrack::Eta,
953 aod::fwdtrack::P);
954
955DECLARE_SOA_EXTENDED_TABLE(MFTTracks_001, StoredMFTTracks_001, "EXMFTTRACK", 1,
956 aod::fwdtrack::Pt,
957 aod::fwdtrack::Eta,
958 aod::fwdtrack::P);
959
960using MFTTracks = MFTTracks_001;
961using StoredMFTTracks = StoredMFTTracks_001;
962
963using MFTTrack = MFTTracks::iterator;
964template <aod::is_origin_hash O>
965using MFTTracksFrom = MFTTracks_001From<O>;
966
967namespace fwdtrack // Index to MFTtrack column must be defined after table definition.
968{
970}
971
972// Tracks including MCH and/or MCH (plus optionally MFT) //!
973DECLARE_SOA_TABLE_FULL(StoredFwdTracks, "FwdTracks", "AOD", "FWDTRACK",
974 o2::soa::Index<>, fwdtrack::CollisionId, fwdtrack::TrackType,
975 fwdtrack::X, fwdtrack::Y, fwdtrack::Z, fwdtrack::Phi, fwdtrack::Tgl,
976 fwdtrack::Signed1Pt, fwdtrack::NClusters, fwdtrack::PDca, fwdtrack::RAtAbsorberEnd,
977 fwdtrack::Px<fwdtrack::Pt, fwdtrack::Phi>,
978 fwdtrack::Py<fwdtrack::Pt, fwdtrack::Phi>,
979 fwdtrack::Pz<fwdtrack::Pt, fwdtrack::Tgl>,
980 fwdtrack::Sign<fwdtrack::Signed1Pt>,
981 fwdtrack::Chi2, fwdtrack::Chi2MatchMCHMID, fwdtrack::Chi2MatchMCHMFT,
982 fwdtrack::MatchScoreMCHMFT, fwdtrack::MFTTrackId, fwdtrack::MCHTrackId,
983 fwdtrack::MCHBitMap, fwdtrack::MIDBitMap, fwdtrack::MIDBoards,
984 fwdtrack::TrackTime, fwdtrack::TrackTimeRes);
985
986DECLARE_SOA_EXTENDED_TABLE(FwdTracks, StoredFwdTracks, "EXFWDTRACK", 0,
987 aod::fwdtrack::Pt,
988 aod::fwdtrack::Eta,
989 aod::fwdtrack::P);
990
991DECLARE_SOA_TABLE_FULL(StoredFwdTracksCov, "FwdTracksCov", "AOD", "FWDTRACKCOV",
992 fwdtrack::SigmaX, fwdtrack::SigmaY, fwdtrack::SigmaPhi, fwdtrack::SigmaTgl, fwdtrack::Sigma1Pt,
993 fwdtrack::RhoXY, fwdtrack::RhoPhiY, fwdtrack::RhoPhiX, fwdtrack::RhoTglX, fwdtrack::RhoTglY,
994 fwdtrack::RhoTglPhi, fwdtrack::Rho1PtX, fwdtrack::Rho1PtY, fwdtrack::Rho1PtPhi, fwdtrack::Rho1PtTgl);
995
996DECLARE_SOA_EXTENDED_TABLE(FwdTracksCov, StoredFwdTracksCov, "EXFWDTRACKCOV", 0,
997 aod::fwdtrack::CXX,
998 aod::fwdtrack::CXY,
999 aod::fwdtrack::CYY,
1000 aod::fwdtrack::CPhiX,
1001 aod::fwdtrack::CPhiY,
1002 aod::fwdtrack::CPhiPhi,
1003 aod::fwdtrack::CTglX,
1004 aod::fwdtrack::CTglY,
1005 aod::fwdtrack::CTglPhi,
1006 aod::fwdtrack::CTglTgl,
1007 aod::fwdtrack::C1PtX,
1008 aod::fwdtrack::C1PtY,
1009 aod::fwdtrack::C1PtPhi,
1010 aod::fwdtrack::C1PtTgl,
1011 aod::fwdtrack::C1Pt21Pt2);
1012
1013using FwdTrack = FwdTracks::iterator;
1014using FwdTrackCovFwd = FwdTracksCov::iterator;
1015
1016DECLARE_SOA_TABLE_FULL(StoredMFTTracksCov, "MFTTracksCov", "AOD", "MFTTRACKCOV",
1017 o2::soa::Index<>, fwdtrack::MFTTrackId,
1018 fwdtrack::SigmaX, fwdtrack::SigmaY, fwdtrack::SigmaPhi, fwdtrack::SigmaTgl, fwdtrack::Sigma1Pt,
1019 fwdtrack::RhoXY, fwdtrack::RhoPhiX, fwdtrack::RhoPhiY, fwdtrack::RhoTglX, fwdtrack::RhoTglY,
1020 fwdtrack::RhoTglPhi, fwdtrack::Rho1PtX, fwdtrack::Rho1PtY, fwdtrack::Rho1PtPhi, fwdtrack::Rho1PtTgl);
1021
1022DECLARE_SOA_EXTENDED_TABLE(MFTTracksCov, StoredMFTTracksCov, "EXMFTTRACKCOV", 0,
1023 aod::fwdtrack::CXX,
1024 aod::fwdtrack::CXY,
1025 aod::fwdtrack::CYY,
1026 aod::fwdtrack::CPhiX,
1027 aod::fwdtrack::CPhiY,
1028 aod::fwdtrack::CPhiPhi,
1029 aod::fwdtrack::CTglX,
1030 aod::fwdtrack::CTglY,
1031 aod::fwdtrack::CTglPhi,
1032 aod::fwdtrack::CTglTgl,
1033 aod::fwdtrack::C1PtX,
1034 aod::fwdtrack::C1PtY,
1035 aod::fwdtrack::C1PtPhi,
1036 aod::fwdtrack::C1PtTgl,
1037 aod::fwdtrack::C1Pt21Pt2);
1038
1039using MFTTrack = MFTTracks::iterator;
1040using MFTTrackCovFwd = MFTTracksCov::iterator;
1041
1042} // namespace aod
1043namespace soa
1044{
1045extern template struct Join<aod::FwdTracks, aod::FwdTracksCov>;
1046}
1047namespace aod
1048{
1051
1052// Some tracks cannot be uniquely identified with a collision. Some tracks cannot be assigned to a collision at all.
1053// Those tracks have -1 as collision index and have an entry in the AmbiguousTracks table.
1054// The estimated track time is used to assign BCs which are compatible with this track. Those are stored as a slice.
1055// All collisions compatible with these BCs may then have produced the ambiguous track.
1056// In the future possibly the DCA information can be exploited to reduce the possible collisions and then this table will be extended.
1064
1065DECLARE_SOA_TABLE(AmbiguousTracks, "AOD", "AMBIGUOUSTRACK",
1066 o2::soa::Index<>, ambiguous::TrackId, ambiguous::BCIdSlice);
1067
1068using AmbiguousTrack = AmbiguousTracks::iterator;
1069
1070DECLARE_SOA_TABLE(AmbiguousMFTTracks, "AOD", "AMBIGUOUSMFTTR",
1071 o2::soa::Index<>, ambiguous::MFTTrackId, ambiguous::BCIdSlice);
1072
1073using AmbiguousMFTTrack = AmbiguousMFTTracks::iterator;
1074
1075DECLARE_SOA_TABLE(AmbiguousFwdTracks, "AOD", "AMBIGUOUSFWDTR",
1076 o2::soa::Index<>, ambiguous::FwdTrackId, ambiguous::BCIdSlice);
1077
1078using AmbiguousFwdTrack = AmbiguousFwdTracks::iterator;
1079
1080// Forward Tracks Cluster information
1081namespace fwdtrkcl
1082{
1087DECLARE_SOA_COLUMN(ClInfo, clInfo, uint16_t);
1088DECLARE_SOA_DYNAMIC_COLUMN(DEId, deId, [](uint16_t info) -> uint16_t { return (info & 0x7FF); });
1089DECLARE_SOA_DYNAMIC_COLUMN(IsGoodX, isGoodX, [](uint16_t info) -> bool { return ((info & 0x800) >> 11); });
1090DECLARE_SOA_DYNAMIC_COLUMN(IsGoodY, isGoodY, [](uint16_t info) -> bool { return ((info & 0x1000) >> 12); });
1091} // namespace fwdtrkcl
1092
1093DECLARE_SOA_TABLE(FwdTrkCls, "AOD", "FWDTRKCL",
1095 fwdtrkcl::FwdTrackId,
1096 fwdtrkcl::X,
1097 fwdtrkcl::Y,
1098 fwdtrkcl::Z,
1099 fwdtrkcl::ClInfo,
1100 fwdtrkcl::DEId<fwdtrkcl::ClInfo>,
1101 fwdtrkcl::IsGoodX<fwdtrkcl::ClInfo>,
1102 fwdtrkcl::IsGoodY<fwdtrkcl::ClInfo>);
1103
1104using FwdTrkCl = FwdTrkCls::iterator;
1105
1106// HMPID information
1107namespace hmpid
1108{
1110DECLARE_SOA_COLUMN(HMPIDSignal, hmpidSignal, float);
1111DECLARE_SOA_COLUMN(HMPIDDistance, hmpidDistance, float);
1112DECLARE_SOA_COLUMN(HMPIDXTrack, hmpidXTrack, float);
1113DECLARE_SOA_COLUMN(HMPIDYTrack, hmpidYTrack, float);
1114DECLARE_SOA_COLUMN(HMPIDXMip, hmpidXMip, float);
1115DECLARE_SOA_COLUMN(HMPIDYMip, hmpidYMip, float);
1116DECLARE_SOA_COLUMN(HMPIDNPhotons, hmpidNPhotons, int);
1117DECLARE_SOA_COLUMN(HMPIDQMip, hmpidQMip, float);
1118DECLARE_SOA_COLUMN(HMPIDClusSize, hmpidClusSize, int);
1119DECLARE_SOA_COLUMN(HMPIDMom, hmpidMom, float);
1120DECLARE_SOA_COLUMN(HMPIDPhotsCharge, hmpidPhotsCharge, float[10]);
1121} // namespace hmpid
1122
1123DECLARE_SOA_TABLE(HMPID_000, "AOD", "HMPID",
1125 hmpid::TrackId,
1126 hmpid::HMPIDSignal,
1127 hmpid::HMPIDDistance,
1128 hmpid::HMPIDNPhotons,
1129 hmpid::HMPIDQMip);
1130
1131DECLARE_SOA_TABLE_VERSIONED(HMPID_001, "AOD", "HMPID", 1,
1133 hmpid::TrackId,
1134 hmpid::HMPIDSignal,
1135 hmpid::HMPIDXTrack,
1136 hmpid::HMPIDYTrack,
1137 hmpid::HMPIDXMip,
1138 hmpid::HMPIDYMip,
1139 hmpid::HMPIDNPhotons,
1140 hmpid::HMPIDQMip,
1141 hmpid::HMPIDClusSize,
1142 hmpid::HMPIDMom,
1143 hmpid::HMPIDPhotsCharge);
1144
1145using HMPIDs = HMPID_001;
1146using HMPID = HMPIDs::iterator;
1147
1148namespace calo
1149{
1151DECLARE_SOA_COLUMN(CellNumber, cellNumber, int16_t);
1152DECLARE_SOA_COLUMN(Amplitude, amplitude, float);
1154DECLARE_SOA_COLUMN(CellType, cellType, int8_t);
1155DECLARE_SOA_COLUMN(CaloType, caloType, int8_t);
1156} // namespace calo
1157
1158DECLARE_SOA_TABLE(Calos, "AOD", "CALO",
1159 o2::soa::Index<>, calo::BCId, calo::CellNumber, calo::Amplitude,
1160 calo::Time, calo::CellType, calo::CaloType);
1161using Calo = Calos::iterator;
1162
1163namespace calotrigger
1164{
1166DECLARE_SOA_COLUMN(FastOrAbsID, fastOrAbsID, int16_t);
1167DECLARE_SOA_COLUMN(LnAmplitude, lnAmplitude, int16_t);
1168DECLARE_SOA_COLUMN(TriggerBits, triggerBits, int32_t);
1169DECLARE_SOA_COLUMN(CaloType, caloType, int8_t);
1170} // namespace calotrigger
1171
1172DECLARE_SOA_TABLE(CaloTriggers, "AOD", "CALOTRIGGER",
1173 o2::soa::Index<>, calotrigger::BCId, calotrigger::FastOrAbsID,
1174 calotrigger::LnAmplitude, calotrigger::TriggerBits, calotrigger::CaloType);
1175using CaloTrigger = CaloTriggers::iterator;
1176
1177namespace cpvcluster
1178{
1180DECLARE_SOA_COLUMN(PosX, posX, float);
1181DECLARE_SOA_COLUMN(PosZ, posZ, float);
1182DECLARE_SOA_COLUMN(Amplitude, amplitude, float);
1183DECLARE_SOA_COLUMN(ClusterStatus, clusterStatus, uint8_t);
1184DECLARE_SOA_DYNAMIC_COLUMN(PadMult, padMult, [](uint8_t status) -> uint8_t {
1185 return status & 0b00011111;
1186});
1187DECLARE_SOA_DYNAMIC_COLUMN(ModuleNumber, moduleNumber, [](uint8_t status) -> uint8_t {
1188 return 2 + ((status & 0b01100000) >> 5);
1189});
1190DECLARE_SOA_DYNAMIC_COLUMN(IsUnfolded, isUnfolded, [](uint8_t status) -> bool {
1191 return (status & 0b01100000) >> 7;
1192});
1193} // namespace cpvcluster
1194
1195DECLARE_SOA_TABLE(CPVClusters, "AOD", "CPVCLUSTER",
1196 o2::soa::Index<>, cpvcluster::BCId, cpvcluster::PosX, cpvcluster::PosZ, cpvcluster::Amplitude,
1197 cpvcluster::ClusterStatus, cpvcluster::PadMult<cpvcluster::ClusterStatus>,
1198 cpvcluster::ModuleNumber<cpvcluster::ClusterStatus>, cpvcluster::IsUnfolded<cpvcluster::ClusterStatus>);
1199using CPVCluster = CPVClusters::iterator;
1200
1201namespace zdc
1202{
1204DECLARE_SOA_COLUMN(EnergyZEM1, energyZEM1, float);
1205DECLARE_SOA_COLUMN(EnergyZEM2, energyZEM2, float);
1206DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float);
1207DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float);
1208DECLARE_SOA_COLUMN(EnergyCommonZPA, energyCommonZPA, float);
1209DECLARE_SOA_COLUMN(EnergyCommonZPC, energyCommonZPC, float);
1210DECLARE_SOA_COLUMN(EnergySectorZNA, energySectorZNA, float[4]);
1211DECLARE_SOA_COLUMN(EnergySectorZNC, energySectorZNC, float[4]);
1212DECLARE_SOA_COLUMN(EnergySectorZPA, energySectorZPA, float[4]);
1213DECLARE_SOA_COLUMN(EnergySectorZPC, energySectorZPC, float[4]);
1214DECLARE_SOA_COLUMN(TimeZEM1, timeZEM1, float);
1215DECLARE_SOA_COLUMN(TimeZEM2, timeZEM2, float);
1216DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float);
1217DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float);
1218DECLARE_SOA_COLUMN(TimeZPA, timeZPA, float);
1219DECLARE_SOA_COLUMN(TimeZPC, timeZPC, float);
1220// New summarized table, minimal disk footprint, per channel like other detectors
1221DECLARE_SOA_COLUMN(Energy, energy, std::vector<float>);
1222DECLARE_SOA_COLUMN(ChannelE, channelE, std::vector<uint8_t>);
1223DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector<float>);
1224DECLARE_SOA_COLUMN(Time, time, std::vector<float>);
1225DECLARE_SOA_COLUMN(ChannelT, channelT, std::vector<uint8_t>);
1226// Dynamic columns to take into account packed information; replace old getters
1227DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyZEM1, energyZEM1,
1228 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> float {
1229 auto ne = channelE.size();
1230 auto thisenergy = -std::numeric_limits<float>::infinity();
1231 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1232 if (channelE[ie] == o2::zdc::IdZEM1) {
1233 thisenergy = energy[ie];
1234 break; // avoid unnecessary looping
1235 }
1236 }
1237 return thisenergy;
1238 });
1239DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyZEM2, energyZEM2,
1240 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> float {
1241 auto thisenergy = -std::numeric_limits<float>::infinity();
1242 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1243 if (channelE[ie] == o2::zdc::IdZEM2) {
1244 thisenergy = energy[ie];
1245 break; // avoid unnecessary looping
1246 }
1247 }
1248 return thisenergy;
1249 });
1250DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZNA, energyCommonZNA,
1251 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> float {
1252 auto thisenergy = -std::numeric_limits<float>::infinity();
1253 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1254 if (channelE[ie] == o2::zdc::IdZNAC) {
1255 thisenergy = energy[ie];
1256 break; // avoid unnecessary looping
1257 }
1258 }
1259 return thisenergy;
1260 });
1261DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZNC, energyCommonZNC,
1262 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> float {
1263 auto thisenergy = -std::numeric_limits<float>::infinity();
1264 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1265 if (channelE[ie] == o2::zdc::IdZNCC) {
1266 thisenergy = energy[ie];
1267 break; // avoid unnecessary looping
1268 }
1269 }
1270 return thisenergy;
1271 });
1272DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZPA, energyCommonZPA,
1273 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> float {
1274 auto thisenergy = -std::numeric_limits<float>::infinity();
1275 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1276 if (channelE[ie] == o2::zdc::IdZPAC) {
1277 thisenergy = energy[ie];
1278 break; // avoid unnecessary looping
1279 }
1280 }
1281 return thisenergy;
1282 });
1283DECLARE_SOA_DYNAMIC_COLUMN(DyEnergyCommonZPC, energyCommonZPC,
1284 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> float {
1285 auto thisenergy = -std::numeric_limits<float>::infinity();
1286 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1287 if (channelE[ie] == o2::zdc::IdZPCC) {
1288 thisenergy = energy[ie];
1289 break; // avoid unnecessary looping
1290 }
1291 }
1292 return thisenergy;
1293 });
1294DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZNA, energySectorZNA,
1295 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> std::array<float, 4> {
1296 std::array<float, 4> thisenergy = {
1297 -std::numeric_limits<float>::infinity(),
1298 -std::numeric_limits<float>::infinity(),
1299 -std::numeric_limits<float>::infinity(),
1300 -std::numeric_limits<float>::infinity()};
1301 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1302 if (channelE[ie] == o2::zdc::IdZNA1)
1303 thisenergy[0] = energy[ie];
1304 if (channelE[ie] == o2::zdc::IdZNA2)
1305 thisenergy[1] = energy[ie];
1306 if (channelE[ie] == o2::zdc::IdZNA3)
1307 thisenergy[2] = energy[ie];
1308 if (channelE[ie] == o2::zdc::IdZNA4)
1309 thisenergy[3] = energy[ie];
1310 }
1312 });
1313DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZNC, energySectorZNC,
1314 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> std::array<float, 4> {
1315 std::array<float, 4> thisenergy = {
1316 -std::numeric_limits<float>::infinity(),
1317 -std::numeric_limits<float>::infinity(),
1318 -std::numeric_limits<float>::infinity(),
1319 -std::numeric_limits<float>::infinity()};
1320 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1321 if (channelE[ie] == o2::zdc::IdZNC1)
1322 thisenergy[0] = energy[ie];
1323 if (channelE[ie] == o2::zdc::IdZNC2)
1324 thisenergy[1] = energy[ie];
1325 if (channelE[ie] == o2::zdc::IdZNC3)
1326 thisenergy[2] = energy[ie];
1327 if (channelE[ie] == o2::zdc::IdZNC4)
1328 thisenergy[3] = energy[ie];
1329 }
1330 return thisenergy;
1331 });
1332DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZPA, energySectorZPA,
1333 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> std::array<float, 4> {
1334 std::array<float, 4> thisenergy = {
1335 -std::numeric_limits<float>::infinity(),
1336 -std::numeric_limits<float>::infinity(),
1337 -std::numeric_limits<float>::infinity(),
1338 -std::numeric_limits<float>::infinity()};
1339 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1340 if (channelE[ie] == o2::zdc::IdZPA1)
1341 thisenergy[0] = energy[ie];
1342 if (channelE[ie] == o2::zdc::IdZPA2)
1343 thisenergy[1] = energy[ie];
1344 if (channelE[ie] == o2::zdc::IdZPA3)
1345 thisenergy[2] = energy[ie];
1346 if (channelE[ie] == o2::zdc::IdZPA4)
1347 thisenergy[3] = energy[ie];
1348 }
1349 return thisenergy;
1350 });
1351DECLARE_SOA_DYNAMIC_COLUMN(DyEnergySectorZPC, energySectorZPC,
1352 [](gsl::span<const uint8_t> channelE, gsl::span<const float> energy) -> std::array<float, 4> {
1353 std::array<float, 4> thisenergy = {
1354 -std::numeric_limits<float>::infinity(),
1355 -std::numeric_limits<float>::infinity(),
1356 -std::numeric_limits<float>::infinity(),
1357 -std::numeric_limits<float>::infinity()};
1358 for (uint64_t ie = 0; ie < channelE.size(); ie++) {
1359 if (channelE[ie] == o2::zdc::IdZPC1)
1360 thisenergy[0] = energy[ie];
1361 if (channelE[ie] == o2::zdc::IdZPC2)
1362 thisenergy[1] = energy[ie];
1363 if (channelE[ie] == o2::zdc::IdZPC3)
1364 thisenergy[2] = energy[ie];
1365 if (channelE[ie] == o2::zdc::IdZPC4)
1366 thisenergy[3] = energy[ie];
1367 }
1368 return thisenergy;
1369 });
1370DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZEM1, timeZEM1,
1371 [](gsl::span<const uint8_t> channelT, gsl::span<const float> time) -> float {
1372 auto thistime = -std::numeric_limits<float>::infinity();
1373 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1374 if (channelT[ie] == o2::zdc::IdZEM1) {
1375 thistime = time[ie];
1376 break; // avoid unnecessary looping
1377 }
1378 }
1379 return thistime;
1380 });
1381DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZEM2, timeZEM2,
1382 [](gsl::span<const uint8_t> channelT, gsl::span<const float> time) -> float {
1383 auto thistime = -std::numeric_limits<float>::infinity();
1384 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1385 if (channelT[ie] == o2::zdc::IdZEM2) {
1386 thistime = time[ie];
1387 break; // avoid unnecessary looping
1388 }
1389 }
1390 return thistime;
1391 });
1392DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZNA, timeZNA,
1393 [](gsl::span<const uint8_t> channelT, gsl::span<const float> time) -> float {
1394 auto thistime = -std::numeric_limits<float>::infinity();
1395 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1396 if (channelT[ie] == o2::zdc::IdZNAC) {
1397 thistime = time[ie];
1398 break; // avoid unnecessary looping
1399 }
1400 }
1401 return thistime;
1402 });
1403DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZNC, timeZNC,
1404 [](gsl::span<const uint8_t> channelT, gsl::span<const float> time) -> float {
1405 auto thistime = -std::numeric_limits<float>::infinity();
1406 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1407 if (channelT[ie] == o2::zdc::IdZNCC) {
1408 thistime = time[ie];
1409 break; // avoid unnecessary looping
1410 }
1411 }
1412 return thistime;
1413 });
1414DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZPA, timeZPA,
1415 [](gsl::span<const uint8_t> channelT, gsl::span<const float> time) -> float {
1416 auto thistime = -std::numeric_limits<float>::infinity();
1417 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1418 if (channelT[ie] == o2::zdc::IdZPAC) {
1419 thistime = time[ie];
1420 break; // avoid unnecessary looping
1421 }
1422 }
1423 return thistime;
1424 });
1425DECLARE_SOA_DYNAMIC_COLUMN(DyTimeZPC, timeZPC,
1426 [](gsl::span<const uint8_t> channelT, gsl::span<const float> time) -> float {
1427 auto thistime = -std::numeric_limits<float>::infinity();
1428 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1429 if (channelT[ie] == o2::zdc::IdZPCC) {
1430 thistime = time[ie];
1431 break; // avoid unnecessary looping
1432 }
1433 }
1434 return thistime;
1435 });
1436
1437DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZEM1, amplitudeZEM1,
1438 [](gsl::span<const uint8_t> channelT, gsl::span<const float> amplitude) -> float {
1439 auto thisamplitude = -std::numeric_limits<float>::infinity();
1440 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1441 if (channelT[ie] == o2::zdc::IdZEM1) {
1442 thisamplitude = amplitude[ie];
1443 break; // avoid unnecessary looping
1444 }
1445 }
1446 return thisamplitude;
1447 });
1448DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZEM2, amplitudeZEM2,
1449 [](gsl::span<const uint8_t> channelT, gsl::span<const float> amplitude) -> float {
1450 auto thisamplitude = -std::numeric_limits<float>::infinity();
1451 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1452 if (channelT[ie] == o2::zdc::IdZEM2) {
1453 thisamplitude = amplitude[ie];
1454 break; // avoid unnecessary looping
1455 }
1456 }
1457 return thisamplitude;
1458 });
1459DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZNA, amplitudeZNA,
1460 [](gsl::span<const uint8_t> channelT, gsl::span<const float> amplitude) -> float {
1461 auto thisamplitude = -std::numeric_limits<float>::infinity();
1462 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1463 if (channelT[ie] == o2::zdc::IdZNAC) {
1464 thisamplitude = amplitude[ie];
1465 break; // avoid unnecessary looping
1466 }
1467 }
1468 return thisamplitude;
1469 });
1470DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZNC, amplitudeZNC,
1471 [](gsl::span<const uint8_t> channelT, gsl::span<const float> amplitude) -> float {
1472 auto thisamplitude = -std::numeric_limits<float>::infinity();
1473 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1474 if (channelT[ie] == o2::zdc::IdZNCC) {
1475 thisamplitude = amplitude[ie];
1476 break; // avoid unnecessary looping
1477 }
1478 }
1479 return thisamplitude;
1480 });
1481DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZPA, amplitudeZPA,
1482 [](gsl::span<const uint8_t> channelT, gsl::span<const float> amplitude) -> float {
1483 auto thisamplitude = -std::numeric_limits<float>::infinity();
1484 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1485 if (channelT[ie] == o2::zdc::IdZPAC) {
1486 thisamplitude = amplitude[ie];
1487 break; // avoid unnecessary looping
1488 }
1489 }
1490 return thisamplitude;
1491 });
1492DECLARE_SOA_DYNAMIC_COLUMN(DyAmplitudeZPC, amplitudeZPC,
1493 [](gsl::span<const uint8_t> channelT, gsl::span<const float> amplitude) -> float {
1494 auto thisamplitude = -std::numeric_limits<float>::infinity();
1495 for (uint64_t ie = 0; ie < channelT.size(); ie++) {
1496 if (channelT[ie] == o2::zdc::IdZPCC) {
1497 thisamplitude = amplitude[ie];
1498 break; // avoid unnecessary looping
1499 }
1500 }
1501 return thisamplitude;
1502 });
1503} // namespace zdc
1504
1505DECLARE_SOA_TABLE(Zdcs_000, "AOD", "ZDC",
1506 o2::soa::Index<>, zdc::BCId, zdc::EnergyZEM1, zdc::EnergyZEM2,
1507 zdc::EnergyCommonZNA, zdc::EnergyCommonZNC, zdc::EnergyCommonZPA, zdc::EnergyCommonZPC,
1508 zdc::EnergySectorZNA, zdc::EnergySectorZNC, zdc::EnergySectorZPA, zdc::EnergySectorZPC,
1509 zdc::TimeZEM1, zdc::TimeZEM2, zdc::TimeZNA, zdc::TimeZNC, zdc::TimeZPA, zdc::TimeZPC);
1510
1511// new version of tables: different names for dynamic columns, but same getters
1512DECLARE_SOA_TABLE_VERSIONED(Zdcs_001, "AOD", "ZDC", 1,
1513 o2::soa::Index<>, zdc::BCId, zdc::Energy, zdc::ChannelE, zdc::Amplitude, zdc::Time, zdc::ChannelT,
1514 zdc::DyEnergyZEM1<zdc::ChannelE, zdc::Energy>, zdc::DyEnergyZEM2<zdc::ChannelE, zdc::Energy>,
1515 zdc::DyEnergyCommonZNA<zdc::ChannelE, zdc::Energy>, zdc::DyEnergyCommonZNC<zdc::ChannelE, zdc::Energy>,
1516 zdc::DyEnergyCommonZPA<zdc::ChannelE, zdc::Energy>, zdc::DyEnergyCommonZPC<zdc::ChannelE, zdc::Energy>,
1517 zdc::DyEnergySectorZNA<zdc::ChannelE, zdc::Energy>, zdc::DyEnergySectorZNC<zdc::ChannelE, zdc::Energy>,
1518 zdc::DyEnergySectorZPA<zdc::ChannelE, zdc::Energy>, zdc::DyEnergySectorZPC<zdc::ChannelE, zdc::Energy>,
1519 zdc::DyTimeZEM1<zdc::ChannelT, zdc::Time>, zdc::DyTimeZEM2<zdc::ChannelT, zdc::Time>,
1520 zdc::DyTimeZNA<zdc::ChannelT, zdc::Time>, zdc::DyTimeZNC<zdc::ChannelT, zdc::Time>,
1521 zdc::DyTimeZPA<zdc::ChannelT, zdc::Time>, zdc::DyTimeZPC<zdc::ChannelT, zdc::Time>,
1522 zdc::DyAmplitudeZEM1<zdc::ChannelT, zdc::Amplitude>, zdc::DyAmplitudeZEM2<zdc::ChannelT, zdc::Amplitude>,
1523 zdc::DyAmplitudeZNA<zdc::ChannelT, zdc::Amplitude>, zdc::DyAmplitudeZNC<zdc::ChannelT, zdc::Amplitude>,
1524 zdc::DyAmplitudeZPA<zdc::ChannelT, zdc::Amplitude>, zdc::DyAmplitudeZPC<zdc::ChannelT, zdc::Amplitude>); //
1525using Zdcs = Zdcs_001;
1526using Zdc = Zdcs::iterator;
1527
1528namespace fv0a
1529{
1531DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector<float>);
1532DECLARE_SOA_COLUMN(TimeFV0A, timeFV0A, std::vector<float>);
1533DECLARE_SOA_COLUMN(Channel, channel, std::vector<uint8_t>);
1535DECLARE_SOA_COLUMN(TriggerMask, triggerMask, uint8_t);
1536} // namespace fv0a
1537
1538DECLARE_SOA_TABLE(FV0As, "AOD", "FV0A",
1539 o2::soa::Index<>, fv0a::BCId, fv0a::Amplitude, fv0a::Channel, fv0a::Time, fv0a::TriggerMask);
1540using FV0A = FV0As::iterator;
1541
1542DECLARE_SOA_TABLE(FV0AsExtra, "AOD", "FV0AEXTRA",
1543 o2::soa::Index<>, fv0a::BCId, fv0a::TimeFV0A);
1544using FV0AExtra = FV0AsExtra::iterator;
1545
1546// V0C table for Run2 only
1547namespace fv0c
1548{
1550DECLARE_SOA_COLUMN(Amplitude, amplitude, std::vector<float>);
1551DECLARE_SOA_COLUMN(Channel, channel, std::vector<uint8_t>);
1553} // namespace fv0c
1554
1555DECLARE_SOA_TABLE(FV0Cs, "AOD", "FV0C",
1556 o2::soa::Index<>, fv0c::BCId, fv0c::Amplitude, fv0a::Channel, fv0c::Time);
1557using FV0C = FV0Cs::iterator;
1558
1559namespace ft0
1560{
1562DECLARE_SOA_COLUMN(AmplitudeA, amplitudeA, std::vector<float>);
1563DECLARE_SOA_COLUMN(TimeFT0A, timeFT0A, std::vector<float>);
1564DECLARE_SOA_COLUMN(ChannelA, channelA, std::vector<uint8_t>);
1565DECLARE_SOA_COLUMN(AmplitudeC, amplitudeC, std::vector<float>);
1566DECLARE_SOA_COLUMN(TimeFT0C, timeFT0C, std::vector<float>);
1567DECLARE_SOA_COLUMN(ChannelC, channelC, std::vector<uint8_t>);
1570DECLARE_SOA_COLUMN(TriggerMask, triggerMask, uint8_t);
1572 [](float timeA, float timeC) -> float {
1573 return o2::constants::physics::LightSpeedCm2NS * (timeC - timeA) / 2;
1574 });
1575DECLARE_SOA_DYNAMIC_COLUMN(CollTime, collTime,
1576 [](float timeA, float timeC) -> float {
1577 return (timeA + timeC) / 2;
1578 });
1579DECLARE_SOA_DYNAMIC_COLUMN(IsValidTimeA, isValidTimeA,
1580 [](float timeA) -> bool {
1581 return timeA < 30.f; // Due to HW limitations time can be only within range (-25,25) ns, dummy time is around 32 ns
1582 });
1583DECLARE_SOA_DYNAMIC_COLUMN(IsValidTimeC, isValidTimeC,
1584 [](float timeC) -> bool {
1585 return timeC < 30.f; // Due to HW limitations time can be only within range (-25,25) ns, dummy time is around 32 ns
1586 });
1587DECLARE_SOA_DYNAMIC_COLUMN(IsValidTime, isValidTime,
1588 [](float timeA, float timeC) -> bool {
1589 return (timeA < 30.f) && (timeC < 30.f); // Due to HW limitations time can be only within range (-25,25) ns, dummy time is around 32 ns
1590 });
1592 [](gsl::span<const float> vecAmpA) -> float {
1593 return std::accumulate(vecAmpA.begin(), vecAmpA.end(), 0.f, [](auto&& sum, auto&& curr) { return sum + (curr > 0 ? curr : 0); });
1594 });
1596 [](gsl::span<const float> vecAmpC) -> float {
1597 return std::accumulate(vecAmpC.begin(), vecAmpC.end(), 0.f, [](auto&& sum, auto&& curr) { return sum + (curr > 0 ? curr : 0); });
1598 });
1599
1600} // namespace ft0
1601
1602DECLARE_SOA_TABLE(FT0s, "AOD", "FT0",
1603 o2::soa::Index<>, ft0::BCId,
1604 ft0::AmplitudeA, ft0::ChannelA, ft0::AmplitudeC, ft0::ChannelC, ft0::TimeA, ft0::TimeC,
1605 ft0::TriggerMask, ft0::PosZ<ft0::TimeA, ft0::TimeC>, ft0::CollTime<ft0::TimeA, ft0::TimeC>,
1606 ft0::IsValidTimeA<ft0::TimeA>, ft0::IsValidTimeC<ft0::TimeC>, ft0::IsValidTime<ft0::TimeA, ft0::TimeC>,
1607 ft0::SumAmpA<ft0::AmplitudeA>, ft0::SumAmpC<ft0::AmplitudeC>);
1608using FT0 = FT0s::iterator;
1609
1610DECLARE_SOA_TABLE(FT0sExtra, "AOD", "FT0EXTRA",
1611 o2::soa::Index<>, ft0::BCId,
1612 ft0::TimeFT0A, ft0::TimeFT0C);
1613using FT0Extra = FT0sExtra::iterator;
1614
1615namespace fdd
1616{
1618DECLARE_SOA_COLUMN(AmplitudeA, amplitudeA, float[4]);
1619DECLARE_SOA_COLUMN(AmplitudeC, amplitudeC, float[4]);
1620
1621DECLARE_SOA_COLUMN(ChargeA, chargeA, int16_t[8]);
1622DECLARE_SOA_COLUMN(ChargeC, chargeC, int16_t[8]);
1623
1624DECLARE_SOA_COLUMN(TimeFDDA, timeFDDA, float[8]);
1625DECLARE_SOA_COLUMN(TimeFDDC, timeFDDC, float[8]);
1626
1629DECLARE_SOA_COLUMN(TriggerMask, triggerMask, uint8_t);
1630} // namespace fdd
1631
1632DECLARE_SOA_TABLE(FDDs_000, "AOD", "FDD",
1633 o2::soa::Index<>, fdd::BCId,
1634 fdd::AmplitudeA, fdd::AmplitudeC,
1635 fdd::TimeA, fdd::TimeC,
1636 fdd::TriggerMask);
1637
1638DECLARE_SOA_TABLE_VERSIONED(FDDs_001, "AOD", "FDD", 1,
1640 fdd::BCId,
1641 fdd::ChargeA, fdd::ChargeC,
1642 fdd::TimeA, fdd::TimeC,
1643 fdd::TriggerMask);
1644
1645using FDDs = FDDs_001;
1646using FDD = FDDs::iterator;
1647
1648DECLARE_SOA_TABLE(FDDsExtra, "AOD", "FDDEXTRA",
1649 o2::soa::Index<>, fdd::BCId,
1650 fdd::TimeFDDA, fdd::TimeFDDC);
1651using FDDExtra = FDDsExtra::iterator;
1652
1653namespace trd
1654{
1656DECLARE_SOA_COLUMN(TRDQ0s, trdQ0s, int[6]);
1657DECLARE_SOA_COLUMN(TRDQ1s, trdQ1s, int[6]);
1658DECLARE_SOA_COLUMN(TRDQ2s, trdQ2s, int[6]);
1659DECLARE_SOA_COLUMN(TRDQ0sCorrected, trdQ0sCorrected, float[6]);
1660DECLARE_SOA_COLUMN(TRDQ1sCorrected, trdQ1sCorrected, float[6]);
1661DECLARE_SOA_COLUMN(TRDQ2sCorrected, trdQ2sCorrected, float[6]);
1662DECLARE_SOA_COLUMN(TRDTgls, trdTgls, float[6]);
1663DECLARE_SOA_COLUMN(TRDPhis, trdPhis, float[6]);
1664} // namespace trd
1665
1666DECLARE_SOA_TABLE(TRDsExtra, "AOD", "TRDEXTRA",
1667 o2::soa::Index<>, trd::TrackId,
1668 trd::TRDQ0s, trd::TRDQ1s, trd::TRDQ2s,
1669 trd::TRDQ0sCorrected, trd::TRDQ1sCorrected, trd::TRDQ2sCorrected,
1670 trd::TRDTgls, trd::TRDPhis);
1671using TRDExtra = TRDsExtra::iterator;
1672
1673namespace v0
1674{
1675DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos");
1676DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg");
1678DECLARE_SOA_COLUMN(V0Type, v0Type, uint8_t);
1679
1680DECLARE_SOA_DYNAMIC_COLUMN(IsStandardV0, isStandardV0,
1681 [](uint8_t V0Type) -> bool { return V0Type == 1; });
1682DECLARE_SOA_DYNAMIC_COLUMN(IsPhotonV0, isPhotonV0,
1683 [](uint8_t V0Type) -> bool { return V0Type & (1 << 1); });
1684DECLARE_SOA_DYNAMIC_COLUMN(IsCollinearV0, isCollinearV0,
1685 [](uint8_t V0Type) -> bool { return V0Type & (1 << 2); });
1686
1687} // namespace v0
1688
1689DECLARE_SOA_TABLE(V0s_000, "AOD", "V0",
1691 v0::PosTrackId, v0::NegTrackId);
1692DECLARE_SOA_TABLE_VERSIONED(V0s_001, "AOD", "V0", 1,
1693 o2::soa::Index<>, v0::CollisionId,
1694 v0::PosTrackId, v0::NegTrackId);
1695DECLARE_SOA_TABLE_VERSIONED(V0s_002, "AOD", "V0", 2,
1696 o2::soa::Index<>, v0::CollisionId,
1697 v0::PosTrackId, v0::NegTrackId,
1698 v0::V0Type,
1699 v0::IsStandardV0<v0::V0Type>,
1700 v0::IsPhotonV0<v0::V0Type>,
1701 v0::IsCollinearV0<v0::V0Type>);
1702
1703using V0s = V0s_002;
1704using V0 = V0s::iterator;
1705
1706namespace cascade
1707{
1709DECLARE_SOA_INDEX_COLUMN_FULL(Bachelor, bachelor, int, Tracks, "");
1711} // namespace cascade
1712
1713DECLARE_SOA_TABLE(Cascades_000, "AOD", "CASCADE",
1714 o2::soa::Index<>, cascade::V0Id, cascade::BachelorId);
1715DECLARE_SOA_TABLE_VERSIONED(Cascades_001, "AOD", "CASCADE", 1,
1716 o2::soa::Index<>, cascade::CollisionId, cascade::V0Id, cascade::BachelorId);
1717
1718using Cascades = Cascades_001;
1719using Cascade = Cascades::iterator;
1720
1721namespace decay3body
1722{
1723DECLARE_SOA_INDEX_COLUMN_FULL(Track0, track0, int, Tracks, "_0");
1724DECLARE_SOA_INDEX_COLUMN_FULL(Track1, track1, int, Tracks, "_1");
1725DECLARE_SOA_INDEX_COLUMN_FULL(Track2, track2, int, Tracks, "_2");
1727} // namespace decay3body
1728
1729DECLARE_SOA_TABLE(Decay3Bodys, "AOD", "DECAY3BODY",
1730 o2::soa::Index<>, decay3body::CollisionId, decay3body::Track0Id, decay3body::Track1Id, decay3body::Track2Id);
1731
1733using Decay3Body = Decay3Bodys::iterator;
1734
1735namespace strangenesstracking
1736{
1738DECLARE_SOA_INDEX_COLUMN_FULL(ITSTrack, itsTrack, int, Tracks, "_ITS");
1742
1743DECLARE_SOA_COLUMN(DecayX, decayX, float);
1744DECLARE_SOA_COLUMN(DecayY, decayY, float);
1745DECLARE_SOA_COLUMN(DecayZ, decayZ, float);
1746DECLARE_SOA_COLUMN(XiMass, xiMass, float);
1747DECLARE_SOA_COLUMN(OmegaMass, omegaMass, float);
1748DECLARE_SOA_COLUMN(H3Lmass, h3Lmass, float);
1749DECLARE_SOA_COLUMN(H4Lmass, h4Lmass, float);
1750DECLARE_SOA_COLUMN(He4Lmass, he4Lmass, float);
1751DECLARE_SOA_COLUMN(MatchingChi2, matchingChi2, float);
1752DECLARE_SOA_COLUMN(TopologyChi2, topologyChi2, float);
1753DECLARE_SOA_COLUMN(ITSclsSize, itsClsSize, float);
1754} // namespace strangenesstracking
1755
1757DECLARE_SOA_TABLE_FULL(TrackedCascades, "TrackedCascade", "AOD", "TRACKEDCASCADE",
1759 strangenesstracking::TrackId,
1760 strangenesstracking::ITSTrackId,
1761 strangenesstracking::CascadeId,
1762 strangenesstracking::DecayX,
1763 strangenesstracking::DecayY,
1764 strangenesstracking::DecayZ,
1765 strangenesstracking::XiMass,
1766 strangenesstracking::OmegaMass,
1767 strangenesstracking::MatchingChi2,
1768 strangenesstracking::TopologyChi2,
1769 strangenesstracking::ITSclsSize);
1770
1771DECLARE_SOA_TABLE_FULL(TrackedV0s, "TrackedV0", "AOD", "TRACKEDV0",
1773 strangenesstracking::TrackId,
1774 strangenesstracking::ITSTrackId,
1775 strangenesstracking::V0Id,
1776 strangenesstracking::DecayX,
1777 strangenesstracking::DecayY,
1778 strangenesstracking::DecayZ,
1779 strangenesstracking::H3Lmass,
1780 strangenesstracking::H4Lmass,
1781 strangenesstracking::MatchingChi2,
1782 strangenesstracking::TopologyChi2,
1783 strangenesstracking::ITSclsSize);
1784
1785DECLARE_SOA_TABLE_FULL(Tracked3Bodys, "Tracked3Body", "AOD", "TRACKED3BODY",
1787 strangenesstracking::TrackId,
1788 strangenesstracking::ITSTrackId,
1789 strangenesstracking::Decay3BodyId,
1790 strangenesstracking::DecayX,
1791 strangenesstracking::DecayY,
1792 strangenesstracking::DecayZ,
1793 strangenesstracking::H3Lmass,
1794 strangenesstracking::He4Lmass,
1795 strangenesstracking::MatchingChi2,
1796 strangenesstracking::TopologyChi2,
1797 strangenesstracking::ITSclsSize);
1798
1800using TrackedCascade = TrackedCascades::iterator;
1802using TrackedV0 = TrackedV0s::iterator;
1804using Tracked3body = Tracked3Bodys::iterator;
1805
1806namespace origins
1807{
1808DECLARE_SOA_COLUMN(DataframeID, dataframeID, uint64_t);
1809} // namespace origins
1810
1811DECLARE_SOA_TABLE(Origins, "AOD", "ORIGIN",
1812 o2::soa::Index<>, origins::DataframeID);
1813
1814using Origin = Origins::iterator;
1815
1816// ---- Run 2 tables ----
1817namespace run2
1818{
1819DECLARE_SOA_COLUMN(EventCuts, eventCuts, uint32_t);
1820DECLARE_SOA_COLUMN(TriggerMaskNext50, triggerMaskNext50, uint64_t);
1821DECLARE_SOA_COLUMN(L0TriggerInputMask, l0TriggerInputMask, uint32_t);
1822DECLARE_SOA_COLUMN(SPDClustersL0, spdClustersL0, uint16_t);
1823DECLARE_SOA_COLUMN(SPDClustersL1, spdClustersL1, uint16_t);
1824DECLARE_SOA_COLUMN(SPDFiredChipsL0, spdFiredChipsL0, uint16_t);
1825DECLARE_SOA_COLUMN(SPDFiredChipsL1, spdFiredChipsL1, uint16_t);
1826DECLARE_SOA_COLUMN(SPDFiredFastOrL0, spdFiredFastOrL0, uint16_t);
1827DECLARE_SOA_COLUMN(SPDFiredFastOrL1, spdFiredFastOrL1, uint16_t);
1828DECLARE_SOA_COLUMN(V0TriggerChargeA, v0TriggerChargeA, uint16_t);
1829DECLARE_SOA_COLUMN(V0TriggerChargeC, v0TriggerChargeC, uint16_t);
1830DECLARE_SOA_COLUMN(NTPCClusters, nTPCClusters, uint32_t);
1831DECLARE_SOA_COLUMN(NSDDSSDClusters, nSDDSSDClusters, uint32_t);
1832namespace oftv0
1833{
1835DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos");
1836DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg");
1837DECLARE_SOA_COLUMN(Px, px, float);
1838DECLARE_SOA_COLUMN(Py, py, float);
1839DECLARE_SOA_COLUMN(Pz, pz, float);
1841DECLARE_SOA_COLUMN(Qt, qt, float);
1846DECLARE_SOA_COLUMN(Chi2NDF, chi2NDF, float);
1847DECLARE_SOA_COLUMN(PsiPair, psiPair, float);
1848DECLARE_SOA_COLUMN(DCAr, dcaR, float);
1849DECLARE_SOA_COLUMN(DCAz, dcaZ, float);
1850DECLARE_SOA_COLUMN(MassInMeV, mass, float);
1851} // namespace oftv0
1852namespace pmd
1853{
1855DECLARE_SOA_COLUMN(X, pmdclsx, float);
1856DECLARE_SOA_COLUMN(Y, pmdclsy, float);
1857DECLARE_SOA_COLUMN(Z, pmdclsz, float);
1858DECLARE_SOA_COLUMN(CluADC, pmdclsadc, float);
1859DECLARE_SOA_COLUMN(CluPID, pmdclspid, float);
1860DECLARE_SOA_COLUMN(Det, pmddet, uint8_t);
1861DECLARE_SOA_COLUMN(Ncell, pmdncell, uint8_t);
1862DECLARE_SOA_COLUMN(Smn, pmdmodule, int32_t);
1863DECLARE_SOA_COLUMN(TrackNo, pmdtrackno, int32_t);
1864DECLARE_SOA_COLUMN(TrackPid, pmdtrackpid, int32_t);
1865DECLARE_SOA_COLUMN(SigX, pmdsigx, float);
1866DECLARE_SOA_COLUMN(SigY, pmdsigy, float);
1867DECLARE_SOA_COLUMN(ClMatching, pmdclmatching, int32_t);
1868} // namespace pmd
1869} // namespace run2
1870
1871DECLARE_SOA_TABLE(Run2BCInfos_000, "AOD", "RUN2BCINFO", run2::EventCuts,
1872 run2::TriggerMaskNext50, run2::L0TriggerInputMask,
1873 run2::SPDClustersL0, run2::SPDClustersL1,
1874 run2::SPDFiredChipsL0, run2::SPDFiredChipsL1,
1875 run2::SPDFiredFastOrL0, run2::SPDFiredFastOrL1,
1876 run2::V0TriggerChargeA, run2::V0TriggerChargeC);
1877
1878DECLARE_SOA_TABLE_VERSIONED(Run2BCInfos_001, "AOD", "RUN2BCINFO", 1,
1879 run2::EventCuts,
1880 run2::TriggerMaskNext50, run2::L0TriggerInputMask,
1881 run2::SPDClustersL0, run2::SPDClustersL1,
1882 run2::SPDFiredChipsL0, run2::SPDFiredChipsL1,
1883 run2::SPDFiredFastOrL0, run2::SPDFiredFastOrL1,
1884 run2::V0TriggerChargeA, run2::V0TriggerChargeC,
1885 run2::NTPCClusters, run2::NSDDSSDClusters);
1886
1887using Run2BCInfos = Run2BCInfos_001;
1888using Run2BCInfo = Run2BCInfos::iterator;
1889
1890DECLARE_SOA_TABLE(Run2OTFV0s, "AOD", "Run2OTFV0",
1892 run2::oftv0::CollisionId, run2::oftv0::PosTrackId, run2::oftv0::NegTrackId,
1893 run2::oftv0::Px, run2::oftv0::Py, run2::oftv0::Pz, run2::oftv0::E,
1894 run2::oftv0::Qt, run2::oftv0::Alpha,
1895 run2::oftv0::X, run2::oftv0::Y, run2::oftv0::Z,
1896 run2::oftv0::Chi2NDF, run2::oftv0::PsiPair,
1897 run2::oftv0::DCAr, run2::oftv0::DCAz,
1898 run2::oftv0::MassInMeV);
1899
1900using Run2OTFV0 = Run2OTFV0s::iterator;
1901
1902DECLARE_SOA_TABLE(Pmds, "AOD", "PMD",
1903 o2::soa::Index<>, run2::pmd::BCId, run2::pmd::X, run2::pmd::Y,
1904 run2::pmd::Z, run2::pmd::CluADC, run2::pmd::CluPID, run2::pmd::Det,
1905 run2::pmd::Ncell, run2::pmd::Smn, run2::pmd::TrackNo, run2::pmd::TrackPid,
1906 run2::pmd::SigX, run2::pmd::SigY, run2::pmd::ClMatching);
1907
1908using Pmd = Pmds::iterator;
1909
1910// ---- MC tables ----
1911namespace mccollision
1912{
1914DECLARE_SOA_COLUMN(GeneratorsID, generatorsID, short);
1915DECLARE_SOA_COLUMN(PosX, posX, float);
1916DECLARE_SOA_COLUMN(PosY, posY, float);
1917DECLARE_SOA_COLUMN(PosZ, posZ, float);
1920DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float);
1921DECLARE_SOA_COLUMN(EventPlaneAngle, eventPlaneAngle, float);
1922DECLARE_SOA_DYNAMIC_COLUMN(GetGeneratorId, getGeneratorId,
1923 [](short generatorsID) -> int { return o2::mcgenid::getGeneratorId(generatorsID); });
1924DECLARE_SOA_DYNAMIC_COLUMN(GetSubGeneratorId, getSubGeneratorId,
1925 [](short generatorsID) -> int { return o2::mcgenid::getSubGeneratorId(generatorsID); });
1926DECLARE_SOA_DYNAMIC_COLUMN(GetSourceId, getSourceId,
1927 [](short generatorsID) -> int { return o2::mcgenid::getSourceId(generatorsID); });
1928
1929} // namespace mccollision
1930
1931DECLARE_SOA_TABLE(McCollisions_000, "AOD", "MCCOLLISION",
1932 o2::soa::Index<>, mccollision::BCId,
1933 mccollision::GeneratorsID,
1934 mccollision::PosX, mccollision::PosY, mccollision::PosZ,
1935 mccollision::T, mccollision::Weight,
1936 mccollision::ImpactParameter,
1937 mccollision::GetGeneratorId<mccollision::GeneratorsID>,
1938 mccollision::GetSubGeneratorId<mccollision::GeneratorsID>,
1939 mccollision::GetSourceId<mccollision::GeneratorsID>);
1940DECLARE_SOA_TABLE_VERSIONED(McCollisions_001, "AOD", "MCCOLLISION", 1,
1941 o2::soa::Index<>, mccollision::BCId,
1942 mccollision::GeneratorsID,
1943 mccollision::PosX, mccollision::PosY, mccollision::PosZ,
1944 mccollision::T, mccollision::Weight,
1945 mccollision::ImpactParameter,
1946 mccollision::EventPlaneAngle,
1947 mccollision::GetGeneratorId<mccollision::GeneratorsID>,
1948 mccollision::GetSubGeneratorId<mccollision::GeneratorsID>,
1949 mccollision::GetSourceId<mccollision::GeneratorsID>);
1950
1951template <aod::is_origin_hash O>
1952using McCollisionsFrom = McCollisions_001From<O>;
1953using McCollisions = McCollisions_001;
1954using McCollision = McCollisions::iterator;
1955
1956namespace mcparticle
1957{
1959DECLARE_SOA_COLUMN(PdgCode, pdgCode, int);
1960DECLARE_SOA_COLUMN(StatusCode, statusCode, int);
1961DECLARE_SOA_COLUMN(Flags, flags, uint8_t);
1962DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Mother0, mother0, int, "McParticles_Mother0");
1963DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Mother1, mother1, int, "McParticles_Mother1");
1964DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Daughter0, daughter0, int, "McParticles_Daughter0");
1965DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Daughter1, daughter1, int, "McParticles_Daughter1");
1969DECLARE_SOA_COLUMN(Px, px, float);
1970DECLARE_SOA_COLUMN(Py, py, float);
1971DECLARE_SOA_COLUMN(Pz, pz, float);
1973DECLARE_SOA_COLUMN(Vx, vx, float);
1974DECLARE_SOA_COLUMN(Vy, vy, float);
1975DECLARE_SOA_COLUMN(Vz, vz, float);
1976DECLARE_SOA_COLUMN(Vt, vt, float);
1977DECLARE_SOA_DYNAMIC_COLUMN(ProducedByGenerator, producedByGenerator,
1978 [](uint8_t flags) -> bool { return (flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0; });
1979DECLARE_SOA_DYNAMIC_COLUMN(FromBackgroundEvent, fromBackgroundEvent,
1981DECLARE_SOA_DYNAMIC_COLUMN(GetProcess, getProcess,
1982 [](uint8_t flags, int statusCode) -> int { if ((flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0) { return 0 /*TMCProcess::kPrimary*/; } else { return statusCode; } });
1983DECLARE_SOA_DYNAMIC_COLUMN(GetGenStatusCode, getGenStatusCode,
1984 [](uint8_t flags, int statusCode) -> int { if ((flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0) { return o2::mcgenstatus::getGenStatusCode(statusCode); } else { return -1; } });
1985DECLARE_SOA_DYNAMIC_COLUMN(GetHepMCStatusCode, getHepMCStatusCode,
1986 [](uint8_t flags, int statusCode) -> int { if ((flags & o2::aod::mcparticle::enums::ProducedByTransport) == 0x0) { return o2::mcgenstatus::getHepMCStatusCode(statusCode); } else { return -1; } });
1987DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary,
1990 [](float px, float py, float pz) -> std::array<float, 3> { return std::array<float, 3>{px, py, pz}; });
1991
1992DECLARE_SOA_EXPRESSION_COLUMN(Phi, phi, float,
1993 o2::constants::math::PI + natan2(-1.0f * aod::mcparticle::py, -1.0f * aod::mcparticle::px));
1995 ifnode((nsqrt(aod::mcparticle::px * aod::mcparticle::px +
1996 aod::mcparticle::py * aod::mcparticle::py +
1997 aod::mcparticle::pz * aod::mcparticle::pz) -
1998 aod::mcparticle::pz) < static_cast<float>(1e-7),
1999 ifnode(aod::mcparticle::pz < 0.f, -100.f, 100.f),
2000 0.5f * nlog((nsqrt(aod::mcparticle::px * aod::mcparticle::px +
2001 aod::mcparticle::py * aod::mcparticle::py +
2002 aod::mcparticle::pz * aod::mcparticle::pz) +
2003 aod::mcparticle::pz) /
2004 (nsqrt(aod::mcparticle::px * aod::mcparticle::px +
2005 aod::mcparticle::py * aod::mcparticle::py +
2006 aod::mcparticle::pz * aod::mcparticle::pz) -
2007 aod::mcparticle::pz))));
2009 nsqrt(aod::mcparticle::px* aod::mcparticle::px +
2010 aod::mcparticle::py * aod::mcparticle::py));
2012 nsqrt(aod::mcparticle::px* aod::mcparticle::px +
2013 aod::mcparticle::py * aod::mcparticle::py +
2014 aod::mcparticle::pz * aod::mcparticle::pz));
2016 ifnode((aod::mcparticle::e - aod::mcparticle::pz) < static_cast<float>(1e-7),
2017 ifnode(aod::mcparticle::pz < 0.f, -100.f, 100.f),
2018 0.5f * nlog((aod::mcparticle::e + aod::mcparticle::pz) /
2019 (aod::mcparticle::e - aod::mcparticle::pz))));
2020} // namespace mcparticle
2021
2022namespace mcparticle_v2
2023{
2024// for improved getters with protection against incorrect physical primary tagging
2025// note: this has to be declared in a separate namespace so it does not conflict with existing
2026// derived data table declarations in O2Physics
2027DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary,
2028 [](uint8_t input_flags, float vx, float vy) -> bool { return (o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy) & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; });
2029
2030// avoid that the stored flags are provided unprotected via
2031// the getter '.flags': analysers will get the correct bit map transparently
2032DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t);
2034 [](uint8_t input_flags, float vx, float vy) -> uint8_t { return o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy); });
2035
2036} // namespace mcparticle_v2
2037
2038DECLARE_SOA_TABLE_FULL(StoredMcParticles_000, "McParticles", "AOD", "MCPARTICLE",
2039 o2::soa::Index<>, mcparticle::McCollisionId,
2040 mcparticle::PdgCode, mcparticle::StatusCode, mcparticle_v2::Flags,
2041 mcparticle::Mother0Id, mcparticle::Mother1Id,
2042 mcparticle::Daughter0Id, mcparticle::Daughter1Id, mcparticle::Weight,
2043 mcparticle::Px, mcparticle::Py, mcparticle::Pz, mcparticle::E,
2044 mcparticle::Vx, mcparticle::Vy, mcparticle::Vz, mcparticle::Vt,
2045 mcparticle::PVector<mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
2046 mcparticle::ProducedByGenerator<mcparticle_v2::Flags>,
2047 mcparticle::FromBackgroundEvent<mcparticle_v2::Flags>,
2048 mcparticle::GetGenStatusCode<mcparticle_v2::Flags, mcparticle::StatusCode>,
2049 mcparticle::GetHepMCStatusCode<mcparticle_v2::Flags, mcparticle::StatusCode>,
2050 mcparticle::GetProcess<mcparticle_v2::Flags, mcparticle::StatusCode>,
2051 mcparticle_v2::ProtectedFlags<mcparticle_v2::Flags, mcparticle::Vx, mcparticle::Vy>,
2052 mcparticle_v2::IsPhysicalPrimary<mcparticle_v2::Flags, mcparticle::Vx, mcparticle::Vy>);
2053
2054DECLARE_SOA_TABLE_FULL_VERSIONED(StoredMcParticles_001, "McParticles", "AOD", "MCPARTICLE", 1,
2055 o2::soa::Index<>, mcparticle::McCollisionId,
2056 mcparticle::PdgCode, mcparticle::StatusCode, mcparticle_v2::Flags,
2057 mcparticle::MothersIds, mcparticle::DaughtersIdSlice, mcparticle::Weight,
2058 mcparticle::Px, mcparticle::Py, mcparticle::Pz, mcparticle::E,
2059 mcparticle::Vx, mcparticle::Vy, mcparticle::Vz, mcparticle::Vt,
2060 mcparticle::PVector<mcparticle::Px, mcparticle::Py, mcparticle::Pz>,
2061 mcparticle::ProducedByGenerator<mcparticle_v2::Flags>,
2062 mcparticle::FromBackgroundEvent<mcparticle_v2::Flags>,
2063 mcparticle::GetGenStatusCode<mcparticle_v2::Flags, mcparticle::StatusCode>,
2064 mcparticle::GetHepMCStatusCode<mcparticle_v2::Flags, mcparticle::StatusCode>,
2065 mcparticle::GetProcess<mcparticle_v2::Flags, mcparticle::StatusCode>,
2066 mcparticle_v2::ProtectedFlags<mcparticle_v2::Flags, mcparticle::Vx, mcparticle::Vy>,
2067 mcparticle_v2::IsPhysicalPrimary<mcparticle_v2::Flags, mcparticle::Vx, mcparticle::Vy>);
2068
2069DECLARE_SOA_EXTENDED_TABLE(McParticles_000, StoredMcParticles_000, "EXMCPARTICLE", 0,
2070 mcparticle::Phi,
2071 mcparticle::Eta,
2072 mcparticle::Pt,
2073 mcparticle::P,
2074 mcparticle::Y);
2075
2076DECLARE_SOA_EXTENDED_TABLE(McParticles_001, StoredMcParticles_001, "EXMCPARTICLE", 1,
2077 mcparticle::Phi,
2078 mcparticle::Eta,
2079 mcparticle::Pt,
2080 mcparticle::P,
2081 mcparticle::Y);
2082
2083template <aod::is_origin_hash O>
2084using McParticlesFrom = McParticles_001From<O>;
2085
2086using StoredMcParticles = StoredMcParticles_001;
2087using McParticles = McParticles_001;
2088using McParticle = McParticles::iterator;
2089template <aod::is_origin_hash O>
2090using McParticlesFrom = McParticles_001From<O>;
2091} // namespace aod
2092namespace soa
2093{
2094DECLARE_EQUIVALENT_FOR_INDEX_NG("COLLISION/0", "COLLISION/1");
2095DECLARE_EQUIVALENT_FOR_INDEX_NG("MCPARTICLE/0", "MCPARTICLE/1");
2096DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK/0", "TRACK_IU/0");
2097DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK/0", "TRACKEXTRA/0");
2098DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK_IU/0", "TRACKEXTRA/0");
2099DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK/0", "TRACKEXTRA/1");
2100DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK_IU/0", "TRACKEXTRA/1");
2101DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK/0", "TRACKEXTRA/2");
2102DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACK_IU/0", "TRACKEXTRA/2");
2103DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACKEXTRA/0", "TRACKEXTRA/1");
2104DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACKEXTRA/0", "TRACKEXTRA/2");
2105DECLARE_EQUIVALENT_FOR_INDEX_NG("TRACKEXTRA/1", "TRACKEXTRA/2");
2107DECLARE_EQUIVALENT_FOR_INDEX_NG("MFTTracks/0", "MFTTracks/1");
2108} // namespace soa
2109
2110namespace aod
2111{
2112namespace mctracklabel
2113{
2115DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t);
2116} // namespace mctracklabel
2117
2118DECLARE_SOA_TABLE(McTrackLabels, "AOD", "MCTRACKLABEL",
2119 mctracklabel::McParticleId, mctracklabel::McMask);
2120using McTrackLabel = McTrackLabels::iterator;
2121
2122namespace mcmfttracklabel
2123{
2125DECLARE_SOA_COLUMN(McMask, mcMask, uint8_t);
2126} // namespace mcmfttracklabel
2127
2128DECLARE_SOA_TABLE(McMFTTrackLabels, "AOD", "MCMFTTRACKLABEL",
2129 mcmfttracklabel::McParticleId, mcmfttracklabel::McMask);
2130using McMFTTrackLabel = McMFTTrackLabels::iterator;
2131
2132namespace mcfwdtracklabel
2133{
2135DECLARE_SOA_COLUMN(McMask, mcMask, uint8_t);
2136} // namespace mcfwdtracklabel
2137
2138DECLARE_SOA_TABLE(McFwdTrackLabels, "AOD", "MCFWDTRACKLABEL",
2139 mcfwdtracklabel::McParticleId, mcfwdtracklabel::McMask);
2140using McFwdTrackLabel = McFwdTrackLabels::iterator;
2141
2142namespace mccalolabel
2143{
2146DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t);
2147DECLARE_SOA_COLUMN(AmplitudeA, amplitudeA, std::vector<float>);
2148} // namespace mccalolabel
2149
2150DECLARE_SOA_TABLE(McCaloLabels_000, "AOD", "MCCALOLABEL",
2151 mccalolabel::McParticleId, mccalolabel::McMask);
2152DECLARE_SOA_TABLE_VERSIONED(McCaloLabels_001, "AOD", "MCCALOLABEL", 1,
2153 mccalolabel::McParticleIds, mccalolabel::AmplitudeA);
2154using McCaloLabels = McCaloLabels_000;
2155using McCaloLabel = McCaloLabels::iterator;
2156
2157namespace mccollisionlabel
2158{
2160DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t);
2161} // namespace mccollisionlabel
2162
2163DECLARE_SOA_TABLE(McCollisionLabels, "AOD", "MCCOLLISLABEL",
2164 mccollisionlabel::McCollisionId, mccollisionlabel::McMask);
2165using McCollisionLabel = McCollisionLabels::iterator;
2166
2167// --- HepMC ---
2168namespace hepmcxsection
2169{
2171DECLARE_SOA_COLUMN(GeneratorsID, generatorsID, short);
2172DECLARE_SOA_COLUMN(Accepted, accepted, uint64_t);
2173DECLARE_SOA_COLUMN(Attempted, attempted, uint64_t);
2174DECLARE_SOA_COLUMN(XsectGen, xsectGen, float);
2175DECLARE_SOA_COLUMN(XsectErr, xsectErr, float);
2176DECLARE_SOA_COLUMN(PtHard, ptHard, float);
2177DECLARE_SOA_COLUMN(NMPI, nMPI, int);
2178DECLARE_SOA_COLUMN(ProcessId, processId, int);
2179} // namespace hepmcxsection
2180
2181DECLARE_SOA_TABLE(HepMCXSections, "AOD", "HEPMCXSECTION",
2182 o2::soa::Index<>, hepmcxsection::McCollisionId, hepmcxsection::GeneratorsID,
2183 hepmcxsection::Accepted, hepmcxsection::Attempted, hepmcxsection::XsectGen,
2184 hepmcxsection::XsectErr, hepmcxsection::PtHard, hepmcxsection::NMPI, hepmcxsection::ProcessId);
2185using HepMCXSection = HepMCXSections::iterator;
2186
2187namespace hepmcpdfinfo
2188{
2190DECLARE_SOA_COLUMN(GeneratorsID, generatorsID, short);
2191DECLARE_SOA_COLUMN(Id1, id1, int);
2192DECLARE_SOA_COLUMN(Id2, id2, int);
2193DECLARE_SOA_COLUMN(PdfId1, pdfId1, int);
2194DECLARE_SOA_COLUMN(PdfId2, pdfId2, int);
2196DECLARE_SOA_COLUMN(X2, x2, float);
2197DECLARE_SOA_COLUMN(ScalePdf, scalePdf, float);
2198DECLARE_SOA_COLUMN(Pdf1, pdf1, float);
2199DECLARE_SOA_COLUMN(Pdf2, pdf2, float);
2200} // namespace hepmcpdfinfo
2201
2202DECLARE_SOA_TABLE(HepMCPdfInfos, "AOD", "HEPMCPDFINFO",
2203 o2::soa::Index<>, hepmcpdfinfo::McCollisionId, hepmcpdfinfo::GeneratorsID,
2204 hepmcpdfinfo::Id1, hepmcpdfinfo::Id2,
2205 hepmcpdfinfo::PdfId1, hepmcpdfinfo::PdfId2,
2206 hepmcpdfinfo::X1, hepmcpdfinfo::X2,
2207 hepmcpdfinfo::ScalePdf, hepmcpdfinfo::Pdf1, hepmcpdfinfo::Pdf2);
2208using HepMCPdfInfo = HepMCPdfInfos::iterator;
2209
2210namespace hepmcheavyion
2211{
2213DECLARE_SOA_COLUMN(GeneratorsID, generatorsID, short);
2214DECLARE_SOA_COLUMN(NcollHard, ncollHard, int);
2215DECLARE_SOA_COLUMN(NpartProj, npartProj, int);
2216DECLARE_SOA_COLUMN(NpartTarg, npartTarg, int);
2217DECLARE_SOA_COLUMN(Ncoll, ncoll, int);
2218DECLARE_SOA_COLUMN(NNwoundedCollisions, nNwoundedCollisions, int);
2219DECLARE_SOA_COLUMN(NwoundedNCollisions, nwoundedNCollisions, int);
2220DECLARE_SOA_COLUMN(NwoundedNwoundedCollisions, nwoundedNwoundedCollisions, int);
2221DECLARE_SOA_COLUMN(SpectatorNeutrons, spectatorNeutrons, int);
2222DECLARE_SOA_COLUMN(SpectatorProtons, spectatorProtons, int);
2223DECLARE_SOA_COLUMN(ImpactParameter, impactParameter, float);
2224DECLARE_SOA_COLUMN(EventPlaneAngle, eventPlaneAngle, float);
2225DECLARE_SOA_COLUMN(Eccentricity, eccentricity, float);
2226DECLARE_SOA_COLUMN(SigmaInelNN, sigmaInelNN, float);
2227DECLARE_SOA_COLUMN(Centrality, centrality, float);
2228} // namespace hepmcheavyion
2229
2230DECLARE_SOA_TABLE(HepMCHeavyIons, "AOD", "HEPMCHEAVYION",
2231 o2::soa::Index<>, hepmcheavyion::McCollisionId, hepmcheavyion::GeneratorsID,
2232 hepmcheavyion::NcollHard, hepmcheavyion::NpartProj, hepmcheavyion::NpartTarg,
2233 hepmcheavyion::Ncoll, hepmcheavyion::NNwoundedCollisions, hepmcheavyion::NwoundedNCollisions,
2234 hepmcheavyion::NwoundedNwoundedCollisions, hepmcheavyion::SpectatorNeutrons,
2235 hepmcheavyion::SpectatorProtons, hepmcheavyion::ImpactParameter, hepmcheavyion::EventPlaneAngle,
2236 hepmcheavyion::Eccentricity, hepmcheavyion::SigmaInelNN, hepmcheavyion::Centrality);
2237using HepMCHeavyIon = HepMCHeavyIons::iterator;
2238
2239// --- Matching between collisions and other tables through BC ---
2240
2252
2253// First entry: Collision
2254#define INDEX_LIST_RUN2 indices::CollisionId, indices::ZdcId, indices::BCId, indices::FT0Id, indices::FV0AId, indices::FV0CId, indices::FDDId
2255DECLARE_SOA_INDEX_TABLE_EXCLUSIVE(Run2MatchedExclusive, BCs, "MA_RN2_EX", INDEX_LIST_RUN2);
2256DECLARE_SOA_INDEX_TABLE(Run2MatchedSparse, BCs_001, "MA_RN2_SP", INDEX_LIST_RUN2);
2257
2258#define INDEX_LIST_RUN3 indices::CollisionId, indices::ZdcId, indices::BCId, indices::FT0Id, indices::FV0AId, indices::FDDId
2259DECLARE_SOA_INDEX_TABLE_EXCLUSIVE(Run3MatchedExclusive, BCs, "MA_RN3_EX", INDEX_LIST_RUN3);
2260DECLARE_SOA_INDEX_TABLE(Run3MatchedSparse, BCs_001, "MA_RN3_SP", INDEX_LIST_RUN3);
2261
2262// First entry: BC
2263DECLARE_SOA_INDEX_TABLE_EXCLUSIVE(MatchedBCCollisionsExclusive, BCs, "MA_BCCOL_EX",
2264 indices::BCId, indices::CollisionId);
2265DECLARE_SOA_INDEX_TABLE(MatchedBCCollisionsSparse, BCs, "MA_BCCOL_SP",
2266 indices::BCId, indices::CollisionId);
2267
2268DECLARE_SOA_INDEX_TABLE_EXCLUSIVE(MatchedBCCollisionsExclusiveMulti, BCs, "MA_BCCOLS_EX",
2269 indices::BCId, indices::CollisionIds);
2270DECLARE_SOA_INDEX_TABLE(MatchedBCCollisionsSparseMulti, BCs, "MA_BCCOLS_SP",
2271 indices::BCId, indices::CollisionIds);
2272
2273DECLARE_SOA_INDEX_TABLE_EXCLUSIVE(Run3MatchedToBCExclusive, BCs, "MA_RN3_BC_EX",
2274 indices::BCId, indices::ZdcId, indices::FT0Id, indices::FV0AId, indices::FDDId);
2275DECLARE_SOA_INDEX_TABLE(Run3MatchedToBCSparse, BCs, "MA_RN3_BC_SP",
2276 indices::BCId, indices::ZdcId, indices::FT0Id, indices::FV0AId, indices::FDDId);
2277
2278DECLARE_SOA_INDEX_TABLE(Run2MatchedToBCSparse, BCs, "MA_RN2_BC_SP",
2279 indices::BCId, indices::ZdcId, indices::FT0Id, indices::FV0AId, indices::FV0CId, indices::FDDId);
2280
2281} // namespace aod
2282namespace soa
2283{
2284// equivalences
2285DECLARE_EQUIVALENT_FOR_INDEX(aod::StoredTracks, aod::McTrackLabels);
2286DECLARE_EQUIVALENT_FOR_INDEX(aod::StoredTracksIU, aod::McTrackLabels);
2288// Joins with collisions (only for sparse ones)
2289// NOTE: index table needs to be always last argument
2292} // namespace soa
2293namespace aod
2294{
2297
2298} // namespace aod
2299
2300} // namespace o2
2301#endif // O2_FRAMEWORK_ANALYSISDATAMODEL_H_
#define DECLARE_SOA_ARRAY_INDEX_COLUMN(_Name_, _Getter_)
Definition ASoA.h:2811
#define DECLARE_SOA_SELF_INDEX_COLUMN_FULL(_Name_, _Getter_, _Type_, _Label_)
Definition ASoA.h:2953
#define DECLARE_SOA_SLICE_INDEX_COLUMN(_Name_, _Getter_)
Definition ASoA.h:2670
#define DECLARE_SOA_EXTENDED_TABLE_NG(_Name_, _OriginalTable_, _Desc_, _Version_,...)
Definition ASoA.h:3229
#define DECLARE_SOA_DYNAMIC_COLUMN(_Name_, _Getter_,...)
Definition ASoA.h:3119
#define DECLARE_SOA_TABLE(_Name_, _Origin_, _Desc_,...)
Definition ASoA.h:3207
#define DECLARE_SOA_EXPRESSION_COLUMN(_Name_, _Getter_, _Type_, _Expression_)
Definition ASoA.h:2525
#define DECLARE_SOA_COLUMN(_Name_, _Getter_, _Type_)
Definition ASoA.h:2451
#define DECLARE_SOA_INDEX_COLUMN_FULL(_Name_, _Getter_, _Type_, _Table_, _Suffix_)
Definition ASoA.h:2892
#define DECLARE_EQUIVALENT_FOR_INDEX(_Base_, _Equiv_)
Definition ASoA.h:2333
#define DECLARE_SOA_SELF_SLICE_INDEX_COLUMN(_Name_, _Getter_)
Definition ASoA.h:3018
#define DECLARE_SOA_TABLE_FULL(_Name_, _Label_, _Origin_, _Desc_,...)
Definition ASoA.h:3202
#define DECLARE_EQUIVALENT_FOR_INDEX_NG(_Base_, _Equiv_)
Definition ASoA.h:2339
#define DECLARE_SOA_TABLE_VERSIONED(_Name_, _Origin_, _Desc_, _Version_,...)
Definition ASoA.h:3210
#define DECLARE_SOA_INDEX_COLUMN(_Name_, _Getter_)
Definition ASoA.h:2893
#define DECLARE_SOA_TABLE_FULL_VERSIONED(_Name_, _Label_, _Origin_, _Desc_, _Version_,...)
Definition ASoA.h:3198
#define DECLARE_SOA_EXTENDED_TABLE(_Name_, _Table_, _Description_, _Version_,...)
Definition ASoA.h:3257
#define DECLARE_SOA_INDEX_TABLE_EXCLUSIVE(_Name_, _Key_, _Description_,...)
Definition ASoA.h:3331
#define DECLARE_SOA_INDEX_TABLE(_Name_, _Key_, _Description_,...)
Definition ASoA.h:3328
#define DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(_Name_, _Getter_)
Definition ASoA.h:3089
#define INDEX_LIST_RUN3
#define INDEX_LIST_RUN2
int64_t timeC
int64_t timeA
uint64_t bc
Definition RawEventData.h:5
int16_t time
Definition RawEventData.h:4
TOF PID utilities to work with the information stored in the AO2D.
std::vector< double > sum
Some ALICE geometry constants of common interest.
float chi2
useful math constants
Header to collect physics constants.
uint32_t res
Definition RawData.h:0
Some ZDC constants shared between O2 and O2Physics.
int nClusters
constexpr bool run2
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
const GLfloat * m
Definition glcorearb.h:4066
GLuint GLfloat GLfloat GLfloat x1
Definition glcorearb.h:5034
GLuint GLuint GLfloat weight
Definition glcorearb.h:5477
GLint y
Definition glcorearb.h:270
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
GLsizei GLenum const void * indices
Definition glcorearb.h:400
GLfloat v0
Definition glcorearb.h:811
GLbitfield flags
Definition glcorearb.h:1570
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLboolean r
Definition glcorearb.h:1233
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
o2::constants::math::PI natan2(-1.0f *aod::mcparticle::py, -1.0f *aod::mcparticle::px))
uint8_t itsSharedClusterMap uint8_t
constexpr uint8_t bit
ifnode(nasin(aod::track::snp)+aod::track::alpha< 0.0f, nasin(aod::track::snp)+aod::track::alpha+o2::constants::math::TwoPI, ifnode(nasin(aod::track::snp)+aod::track::alpha >=o2::constants::math::TwoPI, nasin(aod::track::snp)+aod::track::alpha - o2::constants::math::TwoPI, nasin(aod::track::snp)+aod::track::alpha)))
(sign of charge)/Pt in c/GeV. Use pt() and sign() instead
gsl::span< const uint8_t > channelE
McParticles::iterator McParticle
FV0Cs::iterator FV0C
StoredMcParticles_001 StoredMcParticles
TrackedV0s::iterator TrackedV0
Calos::iterator Calo
FT0sExtra::iterator FT0Extra
McParticles_001 McParticles
Origins::iterator Origin
FullTracks::iterator FullTrack
BCs::iterator BC
Pmds::iterator Pmd
TRDsExtra::iterator TRDExtra
FDDsExtra::iterator FDDExtra
HepMCHeavyIons::iterator HepMCHeavyIon
FT0s::iterator FT0
Tracked3Bodys Tracked3Bodys
TracksExtra::iterator TrackExtra
TrackedCascades TrackedCascades
McCollisions_001 McCollisions
AmbiguousMFTTracks::iterator AmbiguousMFTTrack
McParticles_001From< O > McParticlesFrom
Zdcs::iterator Zdc
new version
TracksQA_003 TracksQAVersion
FDDs::iterator FDD
this defines the current default version
AmbiguousFwdTracks::iterator AmbiguousFwdTrack
Run2OTFV0s::iterator Run2OTFV0
TrackedV0s TrackedV0s
FV0AsExtra::iterator FV0AExtra
StoredTracksExtra_002 StoredTracksExtra
HepMCXSections::iterator HepMCXSection
BCs_001From< O > BCsFrom
Decay3Bodys Decay3Bodys
FV0As::iterator FV0A
McFwdTrackLabels::iterator McFwdTrackLabel
Cascades_001 Cascades
TracksExtra_002From< O > TracksExtraFrom
McCaloLabels::iterator McCaloLabel
Run2TrackExtras::iterator Run2TrackExtra
McCollisions::iterator McCollision
FwdTracksCov::iterator FwdTrackCovFwd
Collisions_001 Collisions
soa::Join< Collisions, Run2MatchedSparse >::iterator CollisionMatchedRun2Sparse
AmbiguousTracks::iterator AmbiguousTrack
TracksQAVersion::iterator TracksQA
MFTTracks_001From< O > MFTTracksFrom
FwdTrkCls::iterator FwdTrkCl
Run2TrackExtras_001 Run2TrackExtras
CPVClusters::iterator CPVCluster
McCollisionLabels::iterator McCollisionLabel
FwdTracks::iterator FwdTrack
TracksIU::iterator TrackIU
Cascades::iterator Cascade
this defines the current default version
HMPIDs::iterator HMPID
McMFTTrackLabels::iterator McMFTTrackLabel
TracksCov::iterator TrackCov
HepMCPdfInfos::iterator HepMCPdfInfo
TracksExtra_002 TracksExtra
StoredMFTTracks_001 StoredMFTTracks
Decay3Bodys::iterator Decay3Body
this defines the current default version
Tracks::iterator Track
HMPID_001 HMPIDs
McCollisions_001From< O > McCollisionsFrom
FullFwdTracks::iterator FullFwdTrack
TracksCovIU::iterator TrackCovIU
MFTTracks_001 MFTTracks
Run2BCInfos::iterator Run2BCInfo
McCaloLabels_000 McCaloLabels
Collisions_001From< O > CollisionsFrom
soa::Join< Collisions, Run3MatchedSparse >::iterator CollisionMatchedRun3Sparse
CaloTriggers::iterator CaloTrigger
Tracked3Bodys::iterator Tracked3body
McTrackLabels::iterator McTrackLabel
MFTTracksCov::iterator MFTTrackCovFwd
Run2BCInfos_001 Run2BCInfos
TrackedCascades::iterator TrackedCascade
Collisions::iterator Collision
MFTTracks::iterator MFTTrack
constexpr float XBeamPipeOuterRef
inner radius of the beam pipe
float MassToExpTime(float tofExpMom, float length, float massSquared)
Compute the expected time of flight for a given momentum, length and massSquared.
Definition PID.h:36
int getSourceId(short encoded)
int getGeneratorId(short encoded)
int getSubGeneratorId(short encoded)
int getGenStatusCode(MCGenStatusEncoding enc)
int getHepMCStatusCode(MCGenStatusEncoding enc)
constexpr int IdZPC4
constexpr int IdZPA2
constexpr int IdZNA3
constexpr int IdZNA1
constexpr int IdZPA1
constexpr int IdZNC2
constexpr int IdZEM1
constexpr int IdZNCC
constexpr int IdZPAC
constexpr int IdZPC2
constexpr int IdZPA4
constexpr int IdZNC1
constexpr int IdZNC3
constexpr int IdZPCC
constexpr int IdZPC1
constexpr int IdZPA3
constexpr int IdZNC4
constexpr int IdZEM2
constexpr int IdZNA2
constexpr int IdZPC3
constexpr int IdZNA4
constexpr int IdZNAC
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
static uint8_t removeIsPhysicalPrimaryBit(uint8_t input_flags, float vx, float vy)
Definition DataTypes.h:168
union o2::aod::track::extensions::TPCTimeErrEncoding::TPCDeltaTime encoding
table_t::template iterator_template< DefaultIndexPolicy, self_t, Ts... > iterator
Definition ASoA.h:3452