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