Project
Loading...
Searching...
No Matches
TPCFastTransformGeo.cxx
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
16
17#include "TPCFastTransformGeo.h"
18#include "FlatObject.h"
19#include "GPUCommonMath.h"
20#include "GPUCommonLogger.h"
21
22#include <iostream>
23
24using namespace o2::gpu;
25
27{
28 // Default Constructor: creates an empty uninitialized object
29 for (int32_t i = 0; i < NumberOfSectors; i++) {
30 double angle = (i + 0.5) * 2. * M_PI / NumberOfSectorsA;
31 mSectorInfos[i].sinAlpha = sin(angle);
32 mSectorInfos[i].cosAlpha = cos(angle);
33 }
34 mSectorInfos[NumberOfSectors] = SectorInfo{};
35
36 for (int32_t i = 0; i < MaxNumberOfRows + 1; i++) {
37 mRowInfos[i] = RowInfo{};
38 }
39}
40
42{
44
45 assert(numberOfRows >= 0 && numberOfRows < MaxNumberOfRows);
46
47 mConstructionMask = ConstructionState::InProgress;
48 mNumberOfRows = numberOfRows;
49
50 mTPCzLength = 0.f;
51
52 for (int32_t i = 0; i < MaxNumberOfRows; i++) {
53 mRowInfos[i] = RowInfo{};
54 }
55}
56
58{
60
61 assert(mConstructionMask & ConstructionState::InProgress);
62 assert(tpcZlength > 0.f);
63
64 mTPCzLength = tpcZlength;
65
66 mConstructionMask |= ConstructionState::GeometryIsSet;
67}
68
69void TPCFastTransformGeo::setTPCrow(int32_t iRow, float x, int32_t nPads, float padWidth)
70{
72 assert(mConstructionMask & ConstructionState::InProgress);
73 assert(iRow >= 0 && iRow < mNumberOfRows);
74 assert(nPads > 1);
75 assert(padWidth > 0.);
76
77 // Make scaled U = area between centers of the first and the last pad
78
79 // double uWidth = (nPads - 1) * padWidth;
80
81 // Make scaled U = area between the geometrical sector borders
82
83 const double sectorAngle = 2. * M_PI / NumberOfSectorsA;
84 const double scaleXtoRowWidth = 2. * tan(0.5 * sectorAngle);
85 double uWidth = x * scaleXtoRowWidth; // distance to the sector border
86
87 RowInfo& row = mRowInfos[iRow];
88 row.x = x;
89 row.maxPad = nPads - 1;
90 row.padWidth = padWidth;
91 row.yMin = -uWidth / 2.;
92}
93
95{
97
98 assert(mConstructionMask & ConstructionState::InProgress); // construction in process
99 assert(mConstructionMask & ConstructionState::GeometryIsSet); // geometry is set
100
101 for (int32_t i = 0; i < mNumberOfRows; i++) { // all TPC rows are initialized
102 assert(getRowInfo(i).maxPad > 0);
103 }
104
105 mConstructionMask = (uint32_t)ConstructionState::Constructed; // clear all other construction flags
106}
107
109{
111 LOG(info) << "TPC Fast Transformation Geometry: ";
112 LOG(info) << "mNumberOfRows = " << mNumberOfRows;
113 LOG(info) << "mTPCzLength = " << mTPCzLength;
114 LOG(info) << "TPC Rows : ";
115 for (int32_t i = 0; i < mNumberOfRows; i++) {
116 LOG(info) << " tpc row " << i << ": x = " << mRowInfos[i].x << " maxPad = " << mRowInfos[i].maxPad << " padWidth = " << mRowInfos[i].padWidth;
117 }
118}
119
120int32_t TPCFastTransformGeo::test(int32_t sector, int32_t row, float ly, float lz) const
121{
123
124 int32_t error = 0;
125
126 if (!isConstructed()) {
127 error = -1;
128 }
129 if (mNumberOfRows <= 0 || mNumberOfRows >= MaxNumberOfRows) {
130 error = -2;
131 }
132 float lx = getRowInfo(row).x;
133 float lx1 = 0.f, ly1 = 0.f, lz1 = 0.f;
134 float gx = 0.f, gy = 0.f, gz = 0.f;
135
136 convLocalToGlobal(sector, lx, ly, lz, gx, gy, gz);
137 convGlobalToLocal(sector, gx, gy, gz, lx1, ly1, lz1);
138
139 if (fabs(lx1 - lx) > 1.e-4 || fabs(ly1 - ly) > 1.e-4 || fabs(lz1 - lz) > 1.e-7) {
140 LOG(info) << "Error local <-> global: x " << lx << " dx " << lx1 - lx << " y " << ly << " dy " << ly1 - ly << " z " << lz << " dz " << lz1 - lz;
141 error = -3;
142 }
143
144 float pad, length;
145 convLocalToPadDriftLength(sector, 10, ly, lz, pad, length);
146 float ly2, lz2;
147 convPadDriftLengthToLocal(sector, 10, pad, length, ly2, lz2);
148
149 if (fabs(ly2 - ly) + fabs(lz2 - lz) > 1.e-6) {
150 LOG(info) << "Error local <-> UV: y " << ly << " dy " << ly2 - ly << " z " << lz << " dz " << lz2 - lz;
151 error = -4;
152 }
153
154 if (error != 0) {
155 LOG(info) << "TPC Fast Transformation Geometry: Internal ERROR " << error;
156 }
157 return error;
158}
159
161{
163
164 return test(2, 5, 10., 10.); // test at an arbitrary position
165}
unsigned int uint32_t
Definition of FlatObject class.
int32_t i
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
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 tan(phi) dependence of tracklet error due to radial misalignment(centered at 0 angle)") AddOptionRTC(maxChi2Red
char error[CURL_ERROR_SIZE]
Definition of TPCFastTransformGeo class.
void finishConstruction()
Finishes initialization: puts everything to the flat buffer, releases temporary memory.
void setTPCzLength(float tpcZlength)
int32_t test() const
Method for testing consistency.
float float float float float & gy
TPCFastTransformGeo()
_____________ Constructors / destructors __________________________
void startConstruction(int32_t numberOfRows)
_______________ Construction interface ________________________
void setTPCrow(int32_t iRow, float x, int32_t nPads, float padWidth)
Initializes a TPC row.
bool isConstructed() const
Is the object constructed.
void print() const
Print method.
float float float float & gx
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
GLfloat angle
Definition glcorearb.h:4071
The struct contains necessary info about TPC padrow.
float x
nominal X coordinate of the padrow [cm]
int32_t maxPad
maximal pad number = n pads - 1
The struct contains necessary info for TPC sector.
float cosAlpha
cos of the angle between the local x and the global x
float sinAlpha
sin of the angle between the local x and the global x
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
std::vector< int > row