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 // NOTE Highest 4 (29..32) bits reserved for PID hypothesis
55};
57 ITSrefit = 0x1,
58 FreeClsSPDTracklet = 0x1, // for SPD tracklets, tracklet from cluster not used in tracking
59 TPCrefit = 0x2,
61 TPCout = 0x8
62 // NOTE Highest 4 (29..32) bits reserved for PID hypothesis
63};
65 ITS = 0x1,
66 TPC = 0x2,
67 TRD = 0x4,
68 TOF = 0x8
69};
71 Layer0 = 0x1,
72 Layer1 = 0x2,
73 Layer2 = 0x4,
74 Layer3 = 0x8,
75 Layer4 = 0x10,
76 Layer5 = 0x20,
79};
80namespace extensions
81{
83 // TPC delta forward & backward packing
85 struct {
86 uint16_t timeForward;
87 uint16_t timeBackward;
88 } __attribute__((packed)) deltas;
89 float timeErr;
91 static_assert(sizeof(float) == 2 * sizeof(uint16_t));
92
93 float getTimeErr() const
94 {
95 return encoding.timeErr;
96 }
97
98 // Use all 16 bits of uint16_t to encode delta scale with max precision
99 // e.g., TPCTrack::mDeltaFwd * timeScaler
100 // max range for the time deltas is 0 - <512 (1<<9) TPC time bins
101 static constexpr float timeScaler{(1 << 16) / (1 << 9)};
102 // bogus value to max incorrect usae immedately obvious
103 static constexpr float invalidValue{std::numeric_limits<float>::min()};
104 // convert TPC time bins to ns
106
107 void setDeltaTFwd(float fwd)
108 {
109 encoding.deltas.timeForward = static_cast<uint16_t>(fwd * timeScaler);
110 }
111 void setDeltaTBwd(float bwd)
112 {
113 encoding.deltas.timeBackward = static_cast<uint16_t>(bwd * timeScaler);
114 }
115
116 float getDeltaTFwd() const
117 {
118 return static_cast<float>(encoding.deltas.timeForward) / timeScaler * TPCBinNS;
119 }
120 float getDeltaTBwd() const
121 {
122 return static_cast<float>(encoding.deltas.timeBackward) / timeScaler * TPCBinNS;
123 }
124};
125} // namespace extensions
126
127// Reference radius for extrapolated tracks
128constexpr float trackQARefRadius{50.f};
129constexpr float trackQAScaleBins{5.f};
130// Fit parameters for scale dY, dZ, dSnp, dTgl, dQ2Pt
131constexpr std::array<float, 5> trackQAScaleContP0{0.257192, 0.0775375, 0.00424283, 0.00107201, 0.0335447};
132constexpr std::array<float, 5> trackQAScaleContP1{0.189371, 0.409071, 0.00694444, 0.00720038, 0.0806902};
133constexpr std::array<float, 5> trackQAScaleGloP0{0.130985, 0.0775375, 0.00194703, 0.000405458, 0.0160007};
134constexpr std::array<float, 5> trackQAScaleGloP1{0.183731, 0.409071, 0.00621802, 0.00624881, 0.0418957};
135constexpr std::array<float, 2> trackQAScaledTOF{1.1, 0.33};
136} // namespace o2::aod::track
137
138namespace o2::aod::fwdtrack
139{
140enum ForwardTrackTypeEnum : uint8_t {
141 GlobalMuonTrack = 0, // MFT-MCH-MID
142 GlobalMuonTrackOtherMatch, // MFT-MCH-MID (MCH-MID used another time)
145 MCHStandaloneTrack // MCH
147} // namespace o2::aod::fwdtrack
148
150{
151enum MCParticleFlags : uint8_t {
153 FromBackgroundEvent = 0x2, // Particle from background event (may have been used several times)
154 PhysicalPrimary = 0x4, // Particle is a physical primary according to ALICE definition
155 FromOutOfBunchPileUpCollision = 0x8 // Particle from out-of-bunch pile up collision (currently Run 2 only)
157} // namespace o2::aod::mcparticle::enums
158
159namespace o2::aod::run2
160{
177 kTRDHCO, // Offline TRD cosmic trigger decision
178 kTRDHJT, // Offline TRD jet trigger decision
179 kTRDHSE, // Offline TRD single electron trigger decision
180 kTRDHQU, // Offline TRD quarkonium trigger decision
181 kTRDHEE // Offline TRD single-electron-in-EMCAL-acceptance trigger decision
183} // namespace o2::aod::run2
184
185#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:172
@ kConsistencySPDandTrackVertices
Definition DataTypes.h:164
constexpr std::array< float, 2 > trackQAScaledTOF
Definition DataTypes.h:135
constexpr std::array< float, 5 > trackQAScaleContP1
Definition DataTypes.h:132
uint8_t itsSharedClusterMap uint8_t
constexpr std::array< float, 5 > trackQAScaleContP0
Definition DataTypes.h:131
constexpr std::array< float, 5 > trackQAScaleGloP0
Definition DataTypes.h:133
constexpr std::array< float, 5 > trackQAScaleGloP1
Definition DataTypes.h:134
constexpr float trackQAScaleBins
Definition DataTypes.h:129
constexpr float trackQARefRadius
Definition DataTypes.h:128
TracksIU::iterator TrackIU
Tracks::iterator Track
constexpr double LHCBunchSpacingNS
union o2::aod::track::extensions::TPCTimeErrEncoding::TPCDeltaTime encoding