Project
Loading...
Searching...
No Matches
PID.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
15
16#ifndef ALICEO2_track_PID_H_
17#define ALICEO2_track_PID_H_
18
19#ifndef GPUCA_GPUCODE_DEVICE
20#include <cstdint>
21#endif
22
23#include "GPUCommonDef.h"
24#include "GPUCommonRtypes.h"
26
27namespace o2
28{
29namespace track
30{
32
33namespace pid_constants // GPUs currently cannot have static constexpr array members
34{
35typedef uint8_t ID;
36static GPUglobalconstexpr() ID NIDsTot = 19;
37
38#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
39GPUconstexpr() const char* sNames[NIDsTot + 1] =
40 {"Electron", "Muon", "Pion", "Kaon", "Proton", "Deuteron", "Triton", "He3", "Alpha",
41 "Pion0", "Photon", "K0", "Lambda", "HyperTriton", "Hyperhydrog4", "XiMinus", "OmegaMinus", "HyperHelium4", "HyperHelium5", nullptr};
42#endif
43
44GPUconstexpr() const float sMasses[NIDsTot] =
45 {o2cp::MassElectron, o2cp::MassMuon, o2cp::MassPionCharged, o2cp::MassKaonCharged,
46 o2cp::MassProton, o2cp::MassDeuteron, o2cp::MassTriton, o2cp::MassHelium3,
47 o2cp::MassAlpha, o2cp::MassPionNeutral, o2cp::MassPhoton,
48 o2cp::MassKaonNeutral, o2cp::MassLambda, o2cp::MassHyperTriton, o2cp::MassHyperhydrog4, o2cp::MassXiMinus, o2cp::MassOmegaMinus, o2cp::MassHyperHelium4, o2cp::MassHyperHelium5};
49
50GPUconstexpr() const float sMasses2[NIDsTot] =
51 {o2cp::MassElectron * o2cp::MassElectron,
52 o2cp::MassMuon* o2cp::MassMuon,
53 o2cp::MassPionCharged* o2cp::MassPionCharged,
54 o2cp::MassKaonCharged* o2cp::MassKaonCharged,
55 o2cp::MassProton* o2cp::MassProton,
56 o2cp::MassDeuteron* o2cp::MassDeuteron,
57 o2cp::MassTriton* o2cp::MassTriton,
58 o2cp::MassHelium3* o2cp::MassHelium3,
59 o2cp::MassAlpha* o2cp::MassAlpha,
60 o2cp::MassPionNeutral* o2cp::MassPionNeutral,
61 o2cp::MassPhoton* o2cp::MassPhoton,
62 o2cp::MassKaonNeutral* o2cp::MassKaonNeutral,
63 o2cp::MassLambda* o2cp::MassLambda,
64 o2cp::MassHyperTriton* o2cp::MassHyperTriton,
65 o2cp::MassHyperhydrog4* o2cp::MassHyperhydrog4,
66 o2cp::MassXiMinus* o2cp::MassXiMinus,
67 o2cp::MassOmegaMinus* o2cp::MassOmegaMinus,
68 o2cp::MassHyperHelium4* o2cp::MassHyperHelium4,
69 o2cp::MassHyperHelium5* o2cp::MassHyperHelium5};
70
71GPUconstexpr() const float sMasses2Z[NIDsTot] =
72 {o2cp::MassElectron, o2cp::MassMuon,
73 o2cp::MassPionCharged, o2cp::MassKaonCharged,
74 o2cp::MassProton, o2cp::MassDeuteron,
75 o2cp::MassTriton, o2cp::MassHelium3 / 2.,
76 o2cp::MassAlpha / 2.,
77 0, 0, 0, 0, o2cp::MassHyperTriton, o2cp::MassHyperhydrog4,
78 o2cp::MassXiMinus, o2cp::MassOmegaMinus,
79 o2cp::MassHyperHelium4 / 2., o2cp::MassHyperHelium5 / 2.};
80
81GPUconstexpr() const int sCharges[NIDsTot] =
82 {1, 1, 1, 1, 1, 1, 1, 2, 2,
83 0, 0, 0, 0, 1, 1,
84 1, 1,
85 2, 2};
86} // namespace pid_constants
87
88class PID
89{
90 public:
91 // particle identifiers, continuos starting from 0
93
94 static GPUglobalconstexpr() ID Electron = 0;
95 static GPUglobalconstexpr() ID Muon = 1;
96 static GPUglobalconstexpr() ID Pion = 2;
97 static GPUglobalconstexpr() ID Kaon = 3;
98 static GPUglobalconstexpr() ID Proton = 4;
99 static GPUglobalconstexpr() ID Deuteron = 5;
100 static GPUglobalconstexpr() ID Triton = 6;
101 static GPUglobalconstexpr() ID Helium3 = 7;
102 static GPUglobalconstexpr() ID Alpha = 8;
103
104 static GPUglobalconstexpr() ID First = Electron;
105 static GPUglobalconstexpr() ID Last = Alpha;
106 static GPUglobalconstexpr() ID NIDs = Last + 1;
107
108 // PID for derived particles
109 static GPUglobalconstexpr() ID PI0 = 9;
110 static GPUglobalconstexpr() ID Photon = 10;
111 static GPUglobalconstexpr() ID K0 = 11;
112 static GPUglobalconstexpr() ID Lambda = 12;
113 static GPUglobalconstexpr() ID HyperTriton = 13;
114 static GPUglobalconstexpr() ID Hyperhydrog4 = 14;
115 static GPUglobalconstexpr() ID XiMinus = 15;
116 static GPUglobalconstexpr() ID OmegaMinus = 16;
117 static GPUglobalconstexpr() ID HyperHelium4 = 17;
118 static GPUglobalconstexpr() ID HyperHelium5 = 18;
119 static GPUglobalconstexpr() ID FirstExt = PI0;
120 static GPUglobalconstexpr() ID LastExt = HyperHelium5;
121 static GPUglobalconstexpr() ID NIDsTot = pid_constants::NIDsTot;
122 static_assert(NIDsTot == LastExt + 1, "Incorrect NIDsTot, please update!");
123
124 GPUdDefault() PID() = default;
125 GPUd() PID(ID id) : mID(id) {}
126 GPUd() PID(const char* name);
127 GPUdDefault() PID(const PID& src) = default;
128 GPUhdDefault() PID& operator=(const PID& src) = default;
129
130 GPUd() ID getID() const { return mID; }
131 GPUd() operator ID() const { return getID(); }
132
133 GPUd() float getMass() const { return getMass(mID); }
134 GPUd() float getMass2() const { return getMass2(mID); }
135 GPUd() float getMass2Z() const { return getMass2Z(mID); }
136 GPUd() int getCharge() const { return getCharge(mID); }
137
138 GPUd() static float getMass(ID id) { return pid_constants::sMasses[id]; }
139 GPUd() static float getMass2(ID id) { return pid_constants::sMasses2[id]; }
140 GPUd() static float getMass2Z(ID id) { return pid_constants::sMasses2Z[id]; }
141 GPUd() static int getCharge(ID id) { return pid_constants::sCharges[id]; }
142#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
143 GPUd() const char* getName() const
144 {
145 return getName(mID);
146 }
147 GPUd() static const char* getName(ID id) { return pid_constants::sNames[id]; }
148#endif
149
150 private:
151 ID mID = Pion;
152
153#if !defined(GPUCA_GPUCODE_DEVICE) || defined(GPUCA_GPU_DEBUG_PRINT)
154 // are 2 strings equal ? (trick from Giulio)
155 GPUdi() static constexpr bool sameStr(char const* x, char const* y)
156 {
157 return !*x && !*y ? true : /* default */ (*x == *y && sameStr(x + 1, y + 1));
158 }
159
160 GPUdi() static constexpr ID nameToID(char const* name, ID id)
161 {
162 return id > LastExt ? id : sameStr(name, pid_constants::sNames[id]) ? id
163 : nameToID(name, id + 1);
164 }
165#endif
166
167 ClassDefNV(PID, 2);
168};
169} // namespace track
170} // namespace o2
171
172#endif
std::string getName(const TDataMember *dm, int index, int size)
#define GPUglobalconstexpr()
#define GPUhdDefault()
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc true
configStandalone Reconstruction rec_tpc float
Header to collect physics constants.
GPUd() static float getMass(ID id)
Definition PID.h:138
GPUdDefault() PID()=default
GPUd() operator ID() const
Definition PID.h:131
GPUd() static float getMass2(ID id)
Definition PID.h:139
GPUd() float getMass() const
Definition PID.h:133
GPUd() PID(const char *name)
pid_constants::ID ID
Definition PID.h:92
GPUd() static const char *getName(ID id)
Definition PID.h:147
GPUd() static int getCharge(ID id)
Definition PID.h:141
static GPUglobalconstexpr() ID Electron=0
GPUd() const char *getName() const
Definition PID.h:143
GPUd() float getMass2() const
Definition PID.h:134
GPUd() PID(ID id)
Definition PID.h:125
GPUd() int getCharge() const
Definition PID.h:136
GPUd() float getMass2Z() const
Definition PID.h:135
GPUd() static float getMass2Z(ID id)
Definition PID.h:140
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint const GLchar * name
Definition glcorearb.h:781
GLint y
Definition glcorearb.h:270
const bool const int TrackITSInternal< NLayers > & track
GPUconstexpr() const char *sNames[NIDsTot+1]
defined particle names
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...