Project
Loading...
Searching...
No Matches
DataTypes.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_DATATYPES_H_
12#define O2_FRAMEWORK_DATATYPES_H_
13
15
16#include <cstdint>
17#include <limits>
18#include <array>
19
20namespace o2::aod::bc
21{
22enum BCFlags : uint8_t {
23 ITSUPCMode = 0x1
24};
25}
26
27namespace o2::aod::collision
28{
38} // namespace o2::aod::collision
39namespace o2::aod::track
40{
42 TrackIU = 0, // track at point of innermost update (not propagated)
43 Track = 1, // propagated track
44 StrangeTrack = 2, // track found by strangeness tracking at point of innermost update
45 Run2Track = 254,
46 Run2Tracklet = 255
47};
48enum TrackFlags : uint32_t {
49 TrackTimeResIsRange = 0x1, // Gaussian or range
50 PVContributor = 0x2, // This track has contributed to the collision vertex fit
51 OrphanTrack = 0x4, // Track has no association with any collision vertex
52 TrackTimeAsym = 0x8, // track with an asymmetric time range
53 TPCdEdxAlt = 0x10, // TPCSignal and tpcNClsFindableMinusPID correspond for alternative dEdx since the nominal was 0
54 TPCSideA = 0x20, // TPC track has A-side clusters (if any)
55 TPCSideC = 0x40, // TPC track has C-side clusters (if any)
56 // NOTE Highest 4 (29..32) bits reserved for PID hypothesis
57};
59 ITSrefit = 0x1,
60 FreeClsSPDTracklet = 0x1, // for SPD tracklets, tracklet from cluster not used in tracking
61 TPCrefit = 0x2,
63 TPCout = 0x8
64 // NOTE Highest 4 (29..32) bits reserved for PID hypothesis
65};
67 ITS = 0x1,
68 TPC = 0x2,
69 TRD = 0x4,
70 TOF = 0x8
71};
73 Layer0 = 0x1,
74 Layer1 = 0x2,
75 Layer2 = 0x4,
76 Layer3 = 0x8,
77 Layer4 = 0x10,
78 Layer5 = 0x20,
81};
82namespace extensions
83{
85 // TPC delta forward & backward packing
87 struct {
88 uint16_t timeForward;
89 uint16_t timeBackward;
90 } __attribute__((packed)) deltas;
91 float timeErr;
93 static_assert(sizeof(float) == 2 * sizeof(uint16_t));
94
95 float getTimeErr() const
96 {
97 return encoding.timeErr;
98 }
99
100 // Use all 16 bits of uint16_t to encode delta scale with max precision
101 // e.g., TPCTrack::mDeltaFwd * timeScaler
102 // max range for the time deltas is 0 - <512 (1<<9) TPC time bins
103 static constexpr float timeScaler{(1 << 16) / (1 << 9)};
104 // bogus value to max incorrect usae immedately obvious
105 static constexpr float invalidValue{std::numeric_limits<float>::min()};
106 // convert TPC time bins to ns
108
109 void setDeltaTFwd(float fwd)
110 {
111 encoding.deltas.timeForward = static_cast<uint16_t>(fwd * timeScaler);
112 }
113 void setDeltaTBwd(float bwd)
114 {
115 encoding.deltas.timeBackward = static_cast<uint16_t>(bwd * timeScaler);
116 }
117
118 float getDeltaTFwd() const
119 {
120 return static_cast<float>(encoding.deltas.timeForward) / timeScaler * TPCBinNS;
121 }
122 float getDeltaTBwd() const
123 {
124 return static_cast<float>(encoding.deltas.timeBackward) / timeScaler * TPCBinNS;
125 }
126};
127} // namespace extensions
128
129// Reference radius for extrapolated tracks
130constexpr float trackQARefRadius{50.f};
131constexpr float trackQAScaleBins{5.f};
132// Fit parameters for scale dY, dZ, dSnp, dTgl, dQ2Pt
133constexpr std::array<float, 5> trackQAScaleContP0{0.257192, 0.0775375, 0.00424283, 0.00107201, 0.0335447};
134constexpr std::array<float, 5> trackQAScaleContP1{0.189371, 0.409071, 0.00694444, 0.00720038, 0.0806902};
135constexpr std::array<float, 5> trackQAScaleGloP0{0.130985, 0.0775375, 0.00194703, 0.000405458, 0.0160007};
136constexpr std::array<float, 5> trackQAScaleGloP1{0.183731, 0.409071, 0.00621802, 0.00624881, 0.0418957};
137constexpr std::array<float, 2> trackQAScaledTOF{1.1, 0.33};
138} // namespace o2::aod::track
139
140namespace o2::aod::fwdtrack
141{
142enum ForwardTrackTypeEnum : uint8_t {
143 GlobalMuonTrack = 0, // MFT-MCH-MID
144 GlobalMuonTrackOtherMatch, // MFT-MCH-MID (MCH-MID used another time)
147 MCHStandaloneTrack // MCH
149} // namespace o2::aod::fwdtrack
150
152{
153enum MCParticleFlags : uint8_t {
155 FromBackgroundEvent = 0x2, // Particle from background event (may have been used several times)
156 PhysicalPrimary = 0x4, // Particle is a physical primary according to ALICE definition
157 FromOutOfBunchPileUpCollision = 0x8 // Particle from out-of-bunch pile up collision (currently Run 2 only)
159} // namespace o2::aod::mcparticle::enums
160
161namespace o2::aod::run2
162{
179 kTRDHCO, // Offline TRD cosmic trigger decision
180 kTRDHJT, // Offline TRD jet trigger decision
181 kTRDHSE, // Offline TRD single electron trigger decision
182 kTRDHQU, // Offline TRD quarkonium trigger decision
183 kTRDHEE // Offline TRD single-electron-in-EMCAL-acceptance trigger decision
185} // namespace o2::aod::run2
186
187#endif // O2_FRAMEWORK_DATATYPES_H_
Header to collect LHC related constants.
@ Run2VertexerTracksMultiVertex
Definition DataTypes.h:36
@ Run2VertexerTracksWithConstraint
Definition DataTypes.h:34
@ kAliEventCutsAccepted
Definition DataTypes.h:174
@ kConsistencySPDandTrackVertices
Definition DataTypes.h:166
constexpr std::array< float, 2 > trackQAScaledTOF
Definition DataTypes.h:137
constexpr std::array< float, 5 > trackQAScaleContP1
Definition DataTypes.h:134
uint8_t itsSharedClusterMap uint8_t
constexpr std::array< float, 5 > trackQAScaleContP0
Definition DataTypes.h:133
constexpr std::array< float, 5 > trackQAScaleGloP0
Definition DataTypes.h:135
constexpr std::array< float, 5 > trackQAScaleGloP1
Definition DataTypes.h:136
constexpr float trackQAScaleBins
Definition DataTypes.h:131
constexpr float trackQARefRadius
Definition DataTypes.h:130
TracksIU::iterator TrackIU
Tracks::iterator Track
constexpr double LHCBunchSpacingNS
union o2::aod::track::extensions::TPCTimeErrEncoding::TPCDeltaTime encoding