Skip to content

Commit 134f5ea

Browse files
committed
GPU TPC: Remove tpcGeometry instance, use constexpr GPUTPCGeometry::
1 parent 40a8837 commit 134f5ea

26 files changed

+118
-109
lines changed

Detectors/GlobalTrackingWorkflow/study/src/SVStudy.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
// #include "GPUSettingsO2.h"
4949
#include "GPUParam.h"
5050
#include "GPUParam.inc"
51+
#include "GPUTPCGeometry.h"
5152
#include "GPUO2InterfaceRefit.h"
5253
#include "GPUO2InterfaceUtils.h"
5354

@@ -254,7 +255,7 @@ o2::dataformats::V0Ext SVStudySpec::processV0(int iv, o2::globaltracking::RecoCo
254255
tpcTr.getClusterReference(clRefs, tpcTr.getNClusterReferences() - 1, clSect, clRow, clIdx);
255256
const auto& clus = recoData.getTPCClusters().clusters[clSect][clRow][clIdx];
256257
prInfo.lowestRow = clRow;
257-
int npads = mParam->tpcGeometry.NPads(clRow);
258+
int npads = o2::gpu::GPUTPCGeometry::NPads(clRow);
258259
prInfo.padFromEdge = uint8_t(clus.getPad());
259260
if (prInfo.padFromEdge > npads / 2) {
260261
prInfo.padFromEdge = npads - 1 - prInfo.padFromEdge;

Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h
4848
#include "GPUParam.h"
4949
#include "GPUParam.inc"
50+
#include "GPUTPCGeometry.h"
5051
#include "Steer/MCKinematicsReader.h"
5152
#include "MathUtils/fit.h"
5253
#include <TF1.h>
@@ -301,7 +302,7 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
301302
trExt.rowMinTPC = clRow;
302303
const auto& clus = tpcClusAcc.clusters[clSect][clRow][clIdx];
303304
trExt.padFromEdge = uint8_t(clus.getPad());
304-
int npads = mTPCRefitter->getParam()->tpcGeometry.NPads(clRow);
305+
int npads = o2::gpu::GPUTPCGeometry::NPads(clRow);
305306
if (trExt.padFromEdge > npads / 2) {
306307
trExt.padFromEdge = npads - 1 - trExt.padFromEdge;
307308
}

Detectors/TPC/workflow/src/EntropyEncoderSpec.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ void EntropyEncoderSpec::run(ProcessingContext& pc)
230230
int myThread = 0;
231231
#endif
232232
unsigned int count = 0;
233-
const float x = mParam->tpcGeometry.Row2X(j);
233+
const float x = GPUTPCGeometry::Row2X(j);
234234
auto checker = [i, j, firstIR, totalT, x, this, &preCl, &count, &outBuffer = tmpBuffer[myThread], &rejectHits, &clustersFiltered](const o2::tpc::ClusterNative& cl, unsigned int k) {
235-
const float y = mParam->tpcGeometry.LinearPad2Y(i, j, cl.getPad());
235+
const float y = GPUTPCGeometry::LinearPad2Y(i, j, cl.getPad());
236236
const float r = sqrtf(x * x + y * y);
237237
const float maxz = r * mEtaFactor + mMaxZ;
238238
const unsigned int deltaBC = std::max<float>(0.f, totalT - mFastTransform->convDeltaZtoDeltaTimeInTimeFrameAbs(maxz)) * constants::LHCBCPERTIMEBIN;

GPU/GPUTracking/Base/GPUParam.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "GPUDataTypes.h"
2222
#include "GPUConstantMem.h"
2323
#include "DetectorsBase/Propagator.h"
24+
#include "GPUTPCGeometry.h"
2425

2526
using namespace o2::gpu;
2627

@@ -32,7 +33,6 @@ using namespace o2::gpu;
3233
void GPUParam::SetDefaults(float solenoidBz)
3334
{
3435
memset((void*)this, 0, sizeof(*this));
35-
new (&tpcGeometry) GPUTPCGeometry;
3636
new (&rec) GPUSettingsRec;
3737
occupancyMap = nullptr;
3838
occupancyTotal = 0;
@@ -178,8 +178,8 @@ void GPUParam::UpdateRun3ClusterErrors(const float* yErrorParam, const float* zE
178178
for (int32_t rowType = 0; rowType < 4; rowType++) {
179179
constexpr int32_t regionMap[4] = {0, 4, 6, 8};
180180
ParamErrors[yz][rowType][0] = param[0] * param[0];
181-
ParamErrors[yz][rowType][1] = param[1] * param[1] * tpcGeometry.PadHeightByRegion(regionMap[rowType]);
182-
ParamErrors[yz][rowType][2] = param[2] * param[2] / tpcGeometry.TPCLength() / tpcGeometry.PadHeightByRegion(regionMap[rowType]);
181+
ParamErrors[yz][rowType][1] = param[1] * param[1] * GPUTPCGeometry::PadHeightByRegion(regionMap[rowType]);
182+
ParamErrors[yz][rowType][2] = param[2] * param[2] / GPUTPCGeometry::TPCLength() / GPUTPCGeometry::PadHeightByRegion(regionMap[rowType]);
183183
ParamErrors[yz][rowType][3] = param[3] * param[3] * rec.tpc.clusterErrorOccupancyScaler * rec.tpc.clusterErrorOccupancyScaler;
184184
}
185185
}

GPU/GPUTracking/Base/GPUParam.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "GPUCommonMath.h"
2020
#include "GPUDef.h"
2121
#include "GPUSettings.h"
22-
#include "GPUTPCGeometry.h"
2322
#include "GPUTPCGMPolynomialField.h"
2423

2524
#if !defined(GPUCA_GPUCODE)
@@ -59,7 +58,6 @@ struct GPUParam_t {
5958
int32_t continuousMaxTimeBin;
6059
int32_t tpcCutTimeBin;
6160

62-
GPUTPCGeometry tpcGeometry; // TPC Geometry
6361
GPUTPCGMPolynomialField polynomialField; // Polynomial approx. of magnetic field for TPC GM
6462
const uint32_t* occupancyMap; // Ptr to TPC occupancy map
6563
uint32_t occupancyTotal; // Total occupancy in the TPC (nCl / nHbf)

GPU/GPUTracking/Base/GPUParam.inc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "GPUParam.h"
1919
#include "GPUTPCGMMergedTrackHit.h"
2020
#include "GPUTPCClusterOccupancyMap.h"
21+
#include "GPUTPCGeometry.h"
2122

2223
namespace o2::gpu
2324
{
@@ -42,14 +43,14 @@ GPUdi() void GPUParam::Global2Sector(int32_t iSector, float X, float Y, float Z,
4243

4344
GPUdi() void GPUParam::GetClusterErrorsSeeding2(uint8_t sector, int32_t iRow, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const
4445
{
45-
const int32_t rowType = tpcGeometry.GetROC(iRow);
46-
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
46+
const int32_t rowType = GPUTPCGeometry::GetROC(iRow);
47+
z = CAMath::Abs(GPUTPCGeometry::TPCLength() - CAMath::Abs(z));
4748
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
4849
const float sec2 = 1.f / (1.f - s2);
4950
const float angleY2 = s2 * sec2; // dy/dx
5051
const float angleZ2 = DzDs * DzDs * sec2; // dz/dx
5152

52-
const float unscaledMult = time >= 0.f ? GetUnscaledMult(time) / tpcGeometry.Row2X(iRow) : 0.f;
53+
const float unscaledMult = time >= 0.f ? GetUnscaledMult(time) / GPUTPCGeometry::Row2X(iRow) : 0.f;
5354

5455
ErrY2 = GetClusterErrorSeeding(0, rowType, z, angleY2, unscaledMult); // Returns Err2
5556
ErrZ2 = GetClusterErrorSeeding(1, rowType, z, angleZ2, unscaledMult); // Returns Err2
@@ -132,8 +133,8 @@ GPUdi() float GPUParam::GetClusterErrorSeeding(int32_t yz, int32_t type, float z
132133

133134
GPUdi() void GPUParam::GetClusterErrorsSeeding2(uint8_t sector, int32_t iRow, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const
134135
{
135-
int32_t rowType = tpcGeometry.GetROC(iRow);
136-
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
136+
int32_t rowType = GPUTPCGeometry::GetROC(iRow);
137+
z = CAMath::Abs(GPUTPCGeometry::TPCLength() - CAMath::Abs(z));
137138
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
138139
float sec2 = 1.f / (1.f - s2);
139140
float angleY2 = s2 * sec2; // dy/dx
@@ -172,14 +173,14 @@ GPUdi() float GPUParam::GetSystematicClusterErrorC122(float trackX, float trackY
172173

173174
GPUdi() void GPUParam::GetClusterErrors2(uint8_t sector, int32_t iRow, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const
174175
{
175-
const int32_t rowType = tpcGeometry.GetROC(iRow);
176-
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
176+
const int32_t rowType = GPUTPCGeometry::GetROC(iRow);
177+
z = CAMath::Abs(GPUTPCGeometry::TPCLength() - CAMath::Abs(z));
177178
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
178179
const float sec2 = 1.f / (1.f - s2);
179180
const float angleY2 = s2 * sec2; // dy/dx
180181
const float angleZ2 = DzDs * DzDs * sec2; // dz/dx
181182

182-
const float unscaledMult = time >= 0.f ? GetUnscaledMult(time) / tpcGeometry.Row2X(iRow) : 0.f;
183+
const float unscaledMult = time >= 0.f ? GetUnscaledMult(time) / GPUTPCGeometry::Row2X(iRow) : 0.f;
183184
const float scaledInvAvgCharge = avgInvCharge * rec.tpc.clusterErrorChargeScaler > 0.f ? avgInvCharge * rec.tpc.clusterErrorChargeScaler : 1.f;
184185
const float scaledInvCharge = invCharge * rec.tpc.clusterErrorChargeScaler > 0.f ? invCharge * rec.tpc.clusterErrorChargeScaler : 1.f;
185186

@@ -218,7 +219,7 @@ GPUdi() float GPUParam::GetUnscaledMult(float time) const
218219

219220
GPUdi() bool GPUParam::rejectEdgeClusterByY(float uncorrectedY, int32_t iRow, float trackSigmaY) const
220221
{
221-
return CAMath::Abs(uncorrectedY) > (tpcGeometry.NPads(iRow) - 1) * 0.5f * tpcGeometry.PadWidth(iRow) + rec.tpc.rejectEdgeClustersMargin + trackSigmaY * rec.tpc.rejectEdgeClustersSigmaMargin;
222+
return CAMath::Abs(uncorrectedY) > (GPUTPCGeometry::NPads(iRow) - 1) * 0.5f * GPUTPCGeometry::PadWidth(iRow) + rec.tpc.rejectEdgeClustersMargin + trackSigmaY * rec.tpc.rejectEdgeClustersSigmaMargin;
222223
}
223224

224225
} // namespace o2::gpu

GPU/GPUTracking/Base/GPUReconstructionConvert.cxx

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "GPUTPCClusterData.h"
2525
#include "GPUO2DataTypes.h"
2626
#include "GPUDataTypes.h"
27+
#include "GPUTPCGeometry.h"
2728
#include "AliHLTTPCRawCluster.h"
2829
#include "GPUParam.h"
2930
#include "GPULogging.h"
@@ -275,10 +276,10 @@ struct zsEncoderRow : public zsEncoder {
275276

276277
inline bool zsEncoderRow::sort(const o2::tpc::Digit a, const o2::tpc::Digit b)
277278
{
278-
int32_t endpointa = param->tpcGeometry.GetRegion(a.getRow());
279-
int32_t endpointb = param->tpcGeometry.GetRegion(b.getRow());
280-
endpointa = 2 * endpointa + (a.getRow() >= param->tpcGeometry.GetRegionStart(endpointa) + param->tpcGeometry.GetRegionRows(endpointa) / 2);
281-
endpointb = 2 * endpointb + (b.getRow() >= param->tpcGeometry.GetRegionStart(endpointb) + param->tpcGeometry.GetRegionRows(endpointb) / 2);
279+
int32_t endpointa = GPUTPCGeometry::GetRegion(a.getRow());
280+
int32_t endpointb = GPUTPCGeometry::GetRegion(b.getRow());
281+
endpointa = 2 * endpointa + (a.getRow() >= GPUTPCGeometry::GetRegionStart(endpointa) + GPUTPCGeometry::GetRegionRows(endpointa) / 2);
282+
endpointb = 2 * endpointb + (b.getRow() >= GPUTPCGeometry::GetRegionStart(endpointb) + GPUTPCGeometry::GetRegionRows(endpointb) / 2);
282283
if (endpointa != endpointb) {
283284
return endpointa <= endpointb;
284285
}
@@ -295,11 +296,11 @@ bool zsEncoderRow::checkInput(std::vector<o2::tpc::Digit>& tmpBuffer, uint32_t k
295296
{
296297
seqLen = 1;
297298
if (lastRow != tmpBuffer[k].getRow()) {
298-
endpointStart = param->tpcGeometry.GetRegionStart(curRegion);
299+
endpointStart = GPUTPCGeometry::GetRegionStart(curRegion);
299300
endpoint = curRegion * 2;
300-
if (tmpBuffer[k].getRow() >= endpointStart + param->tpcGeometry.GetRegionRows(curRegion) / 2) {
301+
if (tmpBuffer[k].getRow() >= endpointStart + GPUTPCGeometry::GetRegionRows(curRegion) / 2) {
301302
endpoint++;
302-
endpointStart += param->tpcGeometry.GetRegionRows(curRegion) / 2;
303+
endpointStart += GPUTPCGeometry::GetRegionRows(curRegion) / 2;
303304
}
304305
}
305306
for (uint32_t l = k + 1; l < tmpBuffer.size(); l++) {
@@ -408,7 +409,7 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
408409
if ((uint32_t)region != decEndpoint / 2) {
409410
throw std::runtime_error("CRU ID / endpoint mismatch");
410411
}
411-
int32_t nRowsRegion = param->tpcGeometry.GetRegionRows(region);
412+
int32_t nRowsRegion = GPUTPCGeometry::GetRegionRows(region);
412413

413414
int32_t timeBin = (decHDR->timeOffset + (uint64_t)(o2::raw::RDHUtils::getHeartBeatOrbit(*rdh) - firstOrbit) * o2::constants::lhc::LHCMaxBunches) / LHCBCPERTIMEBIN;
414415
for (int32_t l = 0; l < decHDR->nTimeBinSpan; l++) {
@@ -420,7 +421,7 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
420421
if (tbHdr->rowMask != 0 && ((upperRows) ^ ((decEndpoint & 1) != 0))) {
421422
throw std::runtime_error("invalid endpoint");
422423
}
423-
const int32_t rowOffset = param->tpcGeometry.GetRegionStart(region) + (upperRows ? (nRowsRegion / 2) : 0);
424+
const int32_t rowOffset = GPUTPCGeometry::GetRegionStart(region) + (upperRows ? (nRowsRegion / 2) : 0);
424425
const int32_t nRows = upperRows ? (nRowsRegion - nRowsRegion / 2) : (nRowsRegion / 2);
425426
const int32_t nRowsUsed = __builtin_popcount((uint32_t)(tbHdr->rowMask & 0x7FFF));
426427
decPagePtr += nRowsUsed ? (2 * nRowsUsed) : 2;
@@ -513,7 +514,7 @@ void zsEncoderLinkBased::createBitmask(std::vector<o2::tpc::Digit>& tmpBuffer, u
513514
uint32_t l;
514515
for (l = k; l < tmpBuffer.size(); l++) {
515516
const auto& a = tmpBuffer[l];
516-
int32_t cruinsector = param->tpcGeometry.GetRegion(a.getRow());
517+
int32_t cruinsector = GPUTPCGeometry::GetRegion(a.getRow());
517518
o2::tpc::GlobalPadNumber pad = mapper.globalPadNumber(o2::tpc::PadPos(a.getRow(), a.getPad()));
518519
o2::tpc::FECInfo fec = mapper.fecInfo(pad);
519520
o2::tpc::CRU cru = cruinsector;
@@ -535,8 +536,8 @@ void zsEncoderLinkBased::createBitmask(std::vector<o2::tpc::Digit>& tmpBuffer, u
535536
bool zsEncoderLinkBased::sort(const o2::tpc::Digit a, const o2::tpc::Digit b)
536537
{
537538
// Fixme: this is blasphemy... one shoult precompute all values and sort an index array
538-
int32_t cruinsectora = param->tpcGeometry.GetRegion(a.getRow());
539-
int32_t cruinsectorb = param->tpcGeometry.GetRegion(b.getRow());
539+
int32_t cruinsectora = GPUTPCGeometry::GetRegion(a.getRow());
540+
int32_t cruinsectorb = GPUTPCGeometry::GetRegion(b.getRow());
540541
if (cruinsectora != cruinsectorb) {
541542
return cruinsectora < cruinsectorb;
542543
}
@@ -1124,7 +1125,7 @@ inline uint32_t zsEncoderRun<T>::run(std::vector<zsPage>* buffer, std::vector<o2
11241125
}
11251126
}
11261127
if (lastRow != tmpBuffer[k].getRow()) {
1127-
curRegion = param->tpcGeometry.GetRegion(tmpBuffer[k].getRow());
1128+
curRegion = GPUTPCGeometry::GetRegion(tmpBuffer[k].getRow());
11281129
}
11291130
mustWriteSubPage = checkInput(tmpBuffer, k);
11301131
} else {

GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "GPUParam.h"
1919
#include "GPUCommonAlgorithm.h"
2020
#include "GPUTPCCompressionTrackModel.h"
21-
#include "GPUTPCGeometry.h"
2221
#include "GPUTPCClusterRejection.h"
2322
#include "GPUTPCCompressionKernels.inc"
2423

@@ -68,17 +67,18 @@ GPUdii() void GPUTPCCompressionKernels::Thread<GPUTPCCompressionKernels::step0at
6867
continue; // No track model compression
6968
}
7069
const ClusterNative& GPUrestrict() orgCl = clusters -> clusters[hit.sector][hit.row][hit.num - clusters->clusterOffset[hit.sector][hit.row]];
71-
float x = param.tpcGeometry.Row2X(hit.row);
72-
float y = track.LinearPad2Y(hit.sector, orgCl.getPad(), param.tpcGeometry.PadWidth(hit.row), param.tpcGeometry.NPads(hit.row));
73-
float z = param.tpcGeometry.LinearTime2Z(hit.sector, orgCl.getTime());
70+
constexpr GPUTPCGeometry geo;
71+
float x = geo.Row2X(hit.row);
72+
float y = track.LinearPad2Y(hit.sector, orgCl.getPad(), geo.PadWidth(hit.row), geo.NPads(hit.row));
73+
float z = geo.LinearTime2Z(hit.sector, orgCl.getTime());
7474
if (nClustersStored) {
7575
if ((hit.sector < GPUCA_NSECTORS) ^ (lastSector < GPUCA_NSECTORS)) {
7676
break;
7777
}
7878
if (lastLeg != hit.leg && track.Mirror()) {
7979
break;
8080
}
81-
if (track.Propagate(param.tpcGeometry.Row2X(hit.row), param.SectorParam[hit.sector].Alpha)) {
81+
if (track.Propagate(geo.Row2X(hit.row), param.SectorParam[hit.sector].Alpha)) {
8282
break;
8383
}
8484
}
@@ -115,9 +115,9 @@ GPUdii() void GPUTPCCompressionKernels::Thread<GPUTPCCompressionKernels::step0at
115115
}
116116
c.rowDiffA[cidx] = row;
117117
c.sliceLegDiffA[cidx] = (hit.leg == lastLeg ? 0 : compressor.NSECTORS) + sector;
118-
float pad = CAMath::Max(0.f, CAMath::Min((float)param.tpcGeometry.NPads(GPUCA_ROW_COUNT - 1), track.LinearY2Pad(hit.sector, track.Y(), param.tpcGeometry.PadWidth(hit.row), param.tpcGeometry.NPads(hit.row))));
118+
float pad = CAMath::Max(0.f, CAMath::Min((float)geo.NPads(GPUCA_ROW_COUNT - 1), track.LinearY2Pad(hit.sector, track.Y(), geo.PadWidth(hit.row), geo.NPads(hit.row))));
119119
c.padResA[cidx] = orgCl.padPacked - orgCl.packPad(pad);
120-
float time = CAMath::Max(0.f, param.tpcGeometry.LinearZ2Time(hit.sector, track.Z() + zOffset));
120+
float time = CAMath::Max(0.f, geo.LinearZ2Time(hit.sector, track.Z() + zOffset));
121121
c.timeResA[cidx] = (orgCl.getTimePacked() - orgCl.packTime(time)) & 0xFFFFFF;
122122
lastLeg = hit.leg;
123123
}

GPU/GPUTracking/DataCompression/TPCClusterDecompressionCore.inc

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "GPUTPCCompressionTrackModel.h"
2121
#include "GPUCommonAlgorithm.h"
2222
#include "GPUO2DataTypes.h"
23+
#include "GPUTPCGeometry.h"
2324

2425
#ifndef GPUCA_GPUCODE
2526
#include <functional>
@@ -80,6 +81,7 @@ class TPCClusterDecompressionCore
8081
uint32_t slice = cmprClusters.sliceA[trackIndex];
8182
uint32_t row = cmprClusters.rowA[trackIndex];
8283
GPUTPCCompressionTrackModel track;
84+
constexpr GPUTPCGeometry geo;
8385
uint32_t clusterIndex;
8486
for (clusterIndex = 0; clusterIndex < cmprClusters.nTrackClusters[trackIndex]; clusterIndex++) {
8587
uint32_t pad = 0, time = 0;
@@ -105,23 +107,23 @@ class TPCClusterDecompressionCore
105107
if (changeLeg && track.Mirror()) {
106108
break;
107109
}
108-
if (track.Propagate(param.tpcGeometry.Row2X(row), param.SectorParam[slice].Alpha)) {
110+
if (track.Propagate(geo.Row2X(row), param.SectorParam[slice].Alpha)) {
109111
break;
110112
}
111113
uint32_t timeTmp = cmprClusters.timeResA[clusterOffset - trackIndex - 1];
112114
if (timeTmp & 800000) {
113115
timeTmp |= 0xFF000000;
114116
}
115-
time = timeTmp + ClusterNative::packTime(CAMath::Max(0.f, param.tpcGeometry.LinearZ2Time(slice, track.Z() + zOffset)));
116-
float tmpPad = CAMath::Max(0.f, CAMath::Min((float)param.tpcGeometry.NPads(GPUCA_ROW_COUNT - 1), track.LinearY2Pad(slice, track.Y(), param.tpcGeometry.PadWidth(row), param.tpcGeometry.NPads(row))));
117+
time = timeTmp + ClusterNative::packTime(CAMath::Max(0.f, geo.LinearZ2Time(slice, track.Z() + zOffset)));
118+
float tmpPad = CAMath::Max(0.f, CAMath::Min((float)geo.NPads(GPUCA_ROW_COUNT - 1), track.LinearY2Pad(slice, track.Y(), geo.PadWidth(row), geo.NPads(row))));
117119
pad = cmprClusters.padResA[clusterOffset - trackIndex - 1] + ClusterNative::packPad(tmpPad);
118120
time = time & 0xFFFFFF;
119121
pad = (uint16_t)pad;
120-
if (pad >= param.tpcGeometry.NPads(row) * ClusterNative::scalePadPacked) {
122+
if (pad >= geo.NPads(row) * ClusterNative::scalePadPacked) {
121123
if (pad >= 0xFFFF - 11968) { // Constant 11968 = (2^15 - MAX_PADS(138) * scalePadPacked(64)) / 2
122124
pad = 0;
123125
} else {
124-
pad = param.tpcGeometry.NPads(row) * ClusterNative::scalePadPacked - 1;
126+
pad = geo.NPads(row) * ClusterNative::scalePadPacked - 1;
125127
}
126128
}
127129
if (param.continuousMaxTimeBin > 0 && time >= maxTime) {
@@ -136,11 +138,11 @@ class TPCClusterDecompressionCore
136138
pad = cmprClusters.padA[trackIndex];
137139
}
138140
const auto cluster = decompressTrackStore(cmprClusters, clusterOffset, slice, row, pad, time, args...);
139-
float y = track.LinearPad2Y(slice, cluster.getPad(), param.tpcGeometry.PadWidth(row), param.tpcGeometry.NPads(row));
140-
float z = param.tpcGeometry.LinearTime2Z(slice, cluster.getTime());
141+
float y = track.LinearPad2Y(slice, cluster.getPad(), geo.PadWidth(row), geo.NPads(row));
142+
float z = geo.LinearTime2Z(slice, cluster.getTime());
141143
if (clusterIndex == 0) {
142144
zOffset = z;
143-
track.Init(param.tpcGeometry.Row2X(row), y, z - zOffset, param.SectorParam[slice].Alpha, cmprClusters.qPtA[trackIndex], param);
145+
track.Init(geo.Row2X(row), y, z - zOffset, param.SectorParam[slice].Alpha, cmprClusters.qPtA[trackIndex], param);
144146
}
145147
if (clusterIndex + 1 < cmprClusters.nTrackClusters[trackIndex] && track.Filter(y, z - zOffset, row)) {
146148
break;

GPU/GPUTracking/DataTypes/TPCPadBitMap.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using namespace o2::gpu;
2121

2222
TPCPadBitMap::TPCPadBitMap()
2323
{
24-
GPUTPCGeometry geo{};
24+
constexpr GPUTPCGeometry geo;
2525
int32_t offset = 0;
2626
for (int32_t r = 0; r < GPUCA_ROW_COUNT; r++) {
2727
mPadOffsetPerRow[r] = offset;

0 commit comments

Comments
 (0)