Project
Loading...
Searching...
No Matches
GPUTPCCompressionTrackModel.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
14
15#ifndef GPUTPCCOMPRESSIONTRACKMODEL_H
16#define GPUTPCCOMPRESSIONTRACKMODEL_H
17
18// For debugging purposes, we provide means to use other track models
19// #define GPUCA_COMPRESSION_TRACK_MODEL_MERGER
20// #define GPUCA_COMPRESSION_TRACK_MODEL_SECTORTRACKER
21
22#include "GPUDef.h"
24
25#ifdef GPUCA_COMPRESSION_TRACK_MODEL_MERGER
26#include "GPUTPCGMPropagator.h"
27#include "GPUTPCGMTrackParam.h"
28
29#elif defined(GPUCA_COMPRESSION_TRACK_MODEL_SECTORTRACKER)
30#include "GPUTPCTrackParam.h"
31
32#else // Default internal track model for compression
33#endif
34
35namespace o2::gpu
36{
37// ATTENTION! This track model is used for the data compression.
38// Changes to the propagation and fit will prevent the decompression of data
39// encoded with the old version!!!
40
41struct GPUParam;
42
43GPUglobalconstexpr() float MaxSinPhi = 0.999f;
44
46{
47 public:
48 GPUd() void Init(float x, float y, float z, float alpha, uint8_t qPt, const GPUParam& proc);
49 GPUd() int32_t Propagate(float x, float alpha);
50 GPUd() int32_t Filter(float y, float z, int32_t iRow);
51 GPUd() int32_t Mirror();
52
53#if defined(GPUCA_COMPRESSION_TRACK_MODEL_MERGER) || defined(GPUCA_COMPRESSION_TRACK_MODEL_SECTORTRACKER)
54 GPUd() float X() const
55 {
56 return mTrk.GetX();
57 }
58 GPUd() float Y() const { return mTrk.GetY(); }
59 GPUd() float Z() const { return mTrk.GetZ(); }
60 GPUd() float SinPhi() const { return mTrk.GetSinPhi(); }
61 GPUd() float DzDs() const { return mTrk.GetDzDs(); }
62 GPUd() float QPt() const { return mTrk.GetQPt(); }
63
64#else // Default internal track model for compression
65
66 struct PhysicalTrackModel { // see GPUTPCGMPhysicalTrackModel
67 // physical parameters of the trajectory
68
69 float x = 0.f; // X
70 float y = 0.f; // Y
71 float z = 0.f; // Z
72 float px = 1.e4f; // Px, >0
73 float py = 0.f; // Py
74 float pz = 0.f; // Pz
75 float q = 1.f; // charge, +-1
76
77 // some additional variables needed for GMTrackParam transport
78
79 float sinphi = 0.f; // SinPhi = Py/Pt
80 float cosphi = 1.f; // CosPhi = abs(Px)/Pt
81 float secphi = 1.f; // 1/cos(phi) = Pt/abs(Px)
82 float dzds = 0.f; // DzDs = Pz/Pt
83 float dlds = 1.f; // DlDs = P/Pt
84 float qpt = 0.f; // QPt = q/Pt
85 float p = 1.e4f; // momentum
86 float pt = 1.e4f; // Pt momentum
87 };
88
89 GPUd() float Y() const { return mP[0]; }
90 GPUd() float Z() const { return mP[1]; }
91
92 // helper functions for standalone propagation and update methods
93 GPUd() void updatePhysicalTrackValues(PhysicalTrackModel& trk);
94 GPUd() void changeDirection();
95 GPUd() int32_t rotateToAlpha(float newAlpha);
96 GPUd() int32_t propagateToXBzLightNoUpdate(PhysicalTrackModel& t, float x, float Bz, float& dLp);
97 GPUd() bool setDirectionAlongX(PhysicalTrackModel& t);
98 GPUd() int32_t followLinearization(const PhysicalTrackModel& t0e, float Bz, float dLp);
99 GPUd() void calculateMaterialCorrection();
100 GPUd() float approximateBetheBloch(float beta2);
101 GPUd() void getClusterErrors2(int32_t iRow, float z, float sinPhi, float DzDs, float& ErrY2, float& ErrZ2) const;
102 GPUd() void resetCovariance();
103
104 GPUd() float LinearPad2Y(uint32_t sector, float pad, float padWidth, uint8_t npads) const
105 {
106 const float u = (pad - 0.5f * npads) * padWidth;
107 return (sector >= o2::tpc::constants::MAXSECTOR / 2) ? -u : u;
108 }
109
110 GPUd() float LinearY2Pad(uint32_t sector, float y, float padWidth, uint8_t npads) const
111 {
112 const float u = (sector >= o2::tpc::constants::MAXSECTOR / 2) ? -y : y;
113 return u / padWidth + 0.5f * npads;
114 }
115
116#endif
117
118 protected:
119#ifdef GPUCA_COMPRESSION_TRACK_MODEL_MERGER
120 GPUTPCGMPropagator mProp;
122 const GPUParam* mParam;
123
124#elif defined(GPUCA_COMPRESSION_TRACK_MODEL_SECTORTRACKER)
125 GPUTPCTrackParam mTrk;
126 float mAlpha;
127 const GPUParam* mParam;
128
129#else // Default internal track model for compression
130
132 GPUhd() MaterialCorrection() : radLen(28811.7f), rho(1.025e-3f), radLenInv(1.f / radLen), DLMax(0.f), EP2(0.f), sigmadE2(0.f), k22(0.f), k33(0.f), k43(0.f), k44(0.f) {}
133
134 float radLen; // [cm]
135 float rho; // [g/cm^3]
136 float radLenInv, DLMax, EP2, sigmadE2, k22, k33, k43, k44; // precalculated values for MS and EnergyLoss correction
137 };
138
139 // default TPC cluster error parameterization taken from GPUParam.cxx
140 // clang-format off
141 const float mParamErrors0[2][3][4] =
142 {
143 { { 4.17516864836e-02, 1.87623649254e-04, 5.63788712025e-02, 5.38373768330e-01, },
144 { 8.29434990883e-02, 2.03291710932e-04, 6.81538805366e-02, 9.70965325832e-01, },
145 { 8.67543518543e-02, 2.10733342101e-04, 1.38366967440e-01, 2.55089461803e-01, }
146 }, {
147 { 5.96254616976e-02, 8.62886518007e-05, 3.61776389182e-02, 4.79704320431e-01, },
148 { 6.12571723759e-02, 7.23929333617e-05, 3.93057651818e-02, 9.29222583771e-01, },
149 { 6.58465921879e-02, 1.03639606095e-04, 6.07583411038e-02, 9.90289509296e-01, } }
150 };
151 // clang-format on
152
153 float mX;
154 float mAlpha;
155 float mP[5];
156 float mC[15];
157 int32_t mNDF = -5;
160
161 // propagation parameters
162 float mBz;
164
166#endif
167};
168} // namespace o2::gpu
169
170#endif
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char e
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 Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
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 proc
configStandalone Reconstruction rec_tpc float
GPUd() void updatePhysicalTrackValues(PhysicalTrackModel &trk)
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble f
Definition glcorearb.h:310
GLint y
Definition glcorearb.h:270
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
GPUglobalconstexpr() float MaxSinPhi=0.999f
Definition CfChargePos.h:64
GPUd() const expr uint32_t MultivariatePolynomialHelper< Dim