Skip to content

Commit 1858e31

Browse files
committed
GPU: Simplify TPC cluster error functions and remove unused parameters
1 parent a60bdb7 commit 1858e31

File tree

8 files changed

+24
-30
lines changed

8 files changed

+24
-30
lines changed

GPU/GPUTracking/Base/GPUParam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct GPUParam : public internal::GPUParam_t<GPUSettingsRec, GPUSettingsParam>
9898
return 0.174533f + par.dAlpha * iSlice;
9999
}
100100
GPUd() float GetClusterErrorSeeding(int yz, int type, float zDiff, float angle2) const;
101-
GPUd() void GetClusterErrorsSeeding2(char sector, int row, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const;
101+
GPUd() void GetClusterErrorsSeeding2(char sector, int row, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const;
102102
GPUd() float GetSystematicClusterErrorIFC2(float trackX, float trackY, float z, bool sideC) const;
103103
GPUd() float GetSystematicClusterErrorC122(float trackX, float trackY, char sector) const;
104104

GPU/GPUTracking/Base/GPUParam.inc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ GPUdi() void MEM_LG(GPUParam)::Global2Slice(int iSlice, float X, float Y, float
4747
#ifdef GPUCA_TPC_GEOMETRY_O2
4848

4949
MEM_CLASS_PRE()
50-
GPUdi() void MEM_LG(GPUParam)::GetClusterErrorsSeeding2(char sector, int iRow, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const
50+
GPUdi() void MEM_LG(GPUParam)::GetClusterErrorsSeeding2(char sector, int iRow, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const
5151
{
52-
GetClusterErrors2(sector, iRow, z, sinPhi, DzDs, time, avgInvCharge, invCharge, ErrY2, ErrZ2);
52+
GetClusterErrors2(sector, iRow, z, sinPhi, DzDs, time, 0.f, 0.f, ErrY2, ErrZ2);
5353
}
5454

5555
MEM_CLASS_PRE()
@@ -122,14 +122,11 @@ GPUdi() float MEM_LG(GPUParam)::GetClusterErrorSeeding(int yz, int type, float z
122122
}
123123

124124
MEM_CLASS_PRE()
125-
GPUdi() void MEM_LG(GPUParam)::GetClusterErrorsSeeding2(char sector, int iRow, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const
125+
GPUdi() void MEM_LG(GPUParam)::GetClusterErrorsSeeding2(char sector, int iRow, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const
126126
{
127127
int rowType = tpcGeometry.GetROC(iRow);
128128
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
129-
float s2 = sinPhi * sinPhi;
130-
if (s2 > 0.95f * 0.95f) {
131-
s2 = 0.95f * 0.95f;
132-
}
129+
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
133130
float sec2 = 1.f / (1.f - s2);
134131
float angleY2 = s2 * sec2; // dy/dx
135132
float angleZ2 = DzDs * DzDs * sec2; // dz/dx
@@ -174,10 +171,7 @@ GPUdi() void MEM_LG(GPUParam)::GetClusterErrors2(char sector, int iRow, float z,
174171
// Calibrated cluster error from OCDB for Y and Z
175172
const int rowType = tpcGeometry.GetROC(iRow);
176173
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
177-
float s2 = sinPhi * sinPhi;
178-
if (s2 > 0.95f * 0.95f) {
179-
s2 = 0.95f * 0.95f;
180-
}
174+
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
181175
const float sec2 = 1.f / (1.f - s2);
182176
const float angleY2 = s2 * sec2; // dy/dx
183177
const float angleZ2 = DzDs * DzDs * sec2; // dz/dx

GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ GPUd() int GPUTPCCompressionTrackModel::Filter(float y, float z, int iRow)
100100
{
101101
mTrk.ConstrainSinPhi();
102102
float err2Y, err2Z;
103-
GPUTPCTracker::GetErrors2Seeding(*mParam, iRow, mTrk, 0.f, err2Y, err2Z);
103+
GPUTPCTracker::GetErrors2Seeding(*mParam, iRow, mTrk, -1.f, err2Y, err2Z);
104104
int retVal = !mTrk.Filter(y, z, err2Y, err2Z, GPUCA_MAX_SIN_PHI, false);
105105
// GPUInfo("Filtered with %f %f: y %f z %f qPt %f", y, z, mTrk.Y(), mTrk.Z(), mTrk.QPt());
106106
return retVal;

GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ GPUd() void GPUTPCGMPropagator::GetErr2(float& GPUrestrict() err2Y, float& GPUre
607607
{
608608
#ifndef GPUCA_TPC_GEOMETRY_O2
609609
if (seedingErrors) {
610-
param.GetClusterErrorsSeeding2(sector, iRow, posZ, snp, tgl, time, avgCharge, charge, err2Y, err2Z);
610+
param.GetClusterErrorsSeeding2(sector, iRow, posZ, snp, tgl, time, err2Y, err2Z);
611611
} else
612612
#endif
613613
{

GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ GPUd() bool GPUTPCGMSliceTrack::FilterErrors(const GPUTPCGMMerger* merger, int i
130130
merger->Param().GetClusterErrors2(iSlice, 0, mParam.mZ, mParam.mSinPhi, mParam.mDzDs, -1.f, 0.f, 0.f, mParam.mC0, mParam.mC2); // TODO: provide correct time and row
131131
#ifndef GPUCA_TPC_GEOMETRY_O2
132132
float C0a, C2a;
133-
merger->Param().GetClusterErrorsSeeding2(iSlice, 0, mParam.mZ, mParam.mSinPhi, mParam.mDzDs, -1.f, 0.f, 0.f, C0a, C2a);
133+
merger->Param().GetClusterErrorsSeeding2(iSlice, 0, mParam.mZ, mParam.mSinPhi, mParam.mDzDs, -1.f, C0a, C2a);
134134
if (C0a > mParam.mC0) {
135135
mParam.mC0 = C0a;
136136
}
@@ -190,7 +190,7 @@ GPUd() bool GPUTPCGMSliceTrack::FilterErrors(const GPUTPCGMMerger* merger, int i
190190
merger->Param().GetClusterErrors2(iSlice, 0, mParam.mZ, mParam.mSinPhi, mParam.mDzDs, -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Provide correct time / row
191191
#ifndef GPUCA_TPC_GEOMETRY_O2
192192
float C0a, C2a;
193-
merger->Param().GetClusterErrorsSeeding2(iSlice, 0, mParam.mZ, mParam.mSinPhi, mParam.mDzDs, -1.f, 0.f, 0.f, C0a, C2a);
193+
merger->Param().GetClusterErrorsSeeding2(iSlice, 0, mParam.mZ, mParam.mSinPhi, mParam.mDzDs, -1.f, C0a, C2a);
194194
if (C0a > err2Y) {
195195
err2Y = C0a;
196196
}

GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ GPUd() int GPUTPCGlobalTracking::PerformGlobalTrackingRun(GPUTPCTracker& tracker
6161
} while (CAMath::Abs(tParam.Y()) > tracker.Row(rowIndex).MaxY());
6262

6363
float err2Y, err2Z;
64-
tracker.GetErrors2Seeding(rowIndex, tParam.Z(), tParam.SinPhi(), tParam.DzDs(), -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Use correct time for multiplicity part of error estimation
64+
tracker.GetErrors2Seeding(rowIndex, tParam.Z(), tParam.SinPhi(), tParam.DzDs(), -1.f, err2Y, err2Z); // TODO: Use correct time for multiplicity part of error estimation
6565
if (tParam.GetCov(0) < err2Y) {
6666
tParam.SetCov(0, err2Y);
6767
}

GPU/GPUTracking/SliceTracker/GPUTPCTracker.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ class GPUTPCTracker : public GPUProcessor
108108
}
109109

110110
MEM_CLASS_PRE2()
111-
GPUdi() static void GetErrors2Seeding(const MEM_CONSTANT(GPUParam) & param, char sector, int iRow, const MEM_LG2(GPUTPCTrackParam) & t, float time, float avgCharge, float charge, float& ErrY2, float& ErrZ2)
111+
GPUdi() static void GetErrors2Seeding(const MEM_CONSTANT(GPUParam) & param, char sector, int iRow, const MEM_LG2(GPUTPCTrackParam) & t, float time, float& ErrY2, float& ErrZ2)
112112
{
113-
// param.GetClusterErrors2(sector, iRow, param.GetContinuousTracking() != 0. ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, avgCharge, ErrY2, ErrZ2);
114-
param.GetClusterErrorsSeeding2(sector, iRow, param.par.continuousTracking != 0.f ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, avgCharge, charge, ErrY2, ErrZ2);
113+
// param.GetClusterErrors2(sector, iRow, param.GetContinuousTracking() != 0. ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, 0.f, 0.f, ErrY2, ErrZ2);
114+
param.GetClusterErrorsSeeding2(sector, iRow, param.par.continuousTracking != 0.f ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, ErrY2, ErrZ2);
115115
}
116116

117117
MEM_CLASS_PRE2()
118-
GPUdi() void GetErrors2Seeding(int iRow, const MEM_LG2(GPUTPCTrackParam) & t, float time, float avgCharge, float charge, float& ErrY2, float& ErrZ2) const
118+
GPUdi() void GetErrors2Seeding(int iRow, const MEM_LG2(GPUTPCTrackParam) & t, float time, float& ErrY2, float& ErrZ2) const
119119
{
120-
// Param().GetClusterErrors2(mISlice, iRow, Param().GetContinuousTracking() != 0. ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, avgCharge, ErrY2, ErrZ2);
121-
Param().GetClusterErrorsSeeding2(mISlice, iRow, Param().par.continuousTracking != 0.f ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, avgCharge, charge, ErrY2, ErrZ2);
120+
// Param().GetClusterErrors2(mISlice, iRow, Param().GetContinuousTracking() != 0. ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, 0.f, 0.f, ErrY2, ErrZ2);
121+
Param().GetClusterErrorsSeeding2(mISlice, iRow, Param().par.continuousTracking != 0.f ? 125.f : t.Z(), t.SinPhi(), t.DzDs(), time, ErrY2, ErrZ2);
122122
}
123-
GPUdi() void GetErrors2Seeding(int iRow, float z, float sinPhi, float DzDs, float time, float avgCharge, float charge, float& ErrY2, float& ErrZ2) const
123+
GPUdi() void GetErrors2Seeding(int iRow, float z, float sinPhi, float DzDs, float time, float& ErrY2, float& ErrZ2) const
124124
{
125-
// Param().GetClusterErrors2(mISlice, iRow, Param().GetContinuousTracking() != 0. ? 125.f : z, sinPhi, DzDs, time, avgCharge, ErrY2, ErrZ2);
126-
Param().GetClusterErrorsSeeding2(mISlice, iRow, Param().par.continuousTracking != 0.f ? 125.f : z, sinPhi, DzDs, time, avgCharge, charge, ErrY2, ErrZ2);
125+
// Param().GetClusterErrors2(mISlice, iRow, Param().GetContinuousTracking() != 0. ? 125.f : z, sinPhi, DzDs, time, 0.f, 0.f, ErrY2, ErrZ2);
126+
Param().GetClusterErrorsSeeding2(mISlice, iRow, Param().par.continuousTracking != 0.f ? 125.f : z, sinPhi, DzDs, time, ErrY2, ErrZ2);
127127
}
128128

129129
void SetupCommonMemory();

GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::UpdateTracklet(int /*nBlocks*/, int
183183
tParam.SetSignCosPhi(dx);
184184
tParam.SetDzDs(dz * ri);
185185
float err2Y, err2Z;
186-
tracker.GetErrors2Seeding(iRow, tParam, -1.f, 0.f, 0.f, err2Y, err2Z); // Use correct time
186+
tracker.GetErrors2Seeding(iRow, tParam, -1.f, err2Y, err2Z); // Use correct time
187187
tParam.SetCov(0, err2Y);
188188
tParam.SetCov(2, err2Z);
189189
}
@@ -202,7 +202,7 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::UpdateTracklet(int /*nBlocks*/, int
202202
}
203203
CADEBUG(printf("%5s hits %3d: FIT PROP ROW %3d X %8.3f -", "", r.mNHits, iRow, tParam.X()); for (int i = 0; i < 5; i++) { printf(" %8.3f", tParam.Par()[i]); } printf(" -"); for (int i = 0; i < 15; i++) { printf(" %8.3f", tParam.Cov()[i]); } printf("\n"));
204204
float err2Y, err2Z;
205-
tracker.GetErrors2Seeding(iRow, tParam.GetZ(), sinPhi, tParam.GetDzDs(), -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Use correct time
205+
tracker.GetErrors2Seeding(iRow, tParam.GetZ(), sinPhi, tParam.GetDzDs(), -1.f, err2Y, err2Z); // TODO: Use correct time
206206

207207
if (r.mNHits >= 10) {
208208
const float sErr2 = tracker.Param().GetSystematicClusterErrorIFC2(x, tParam.GetY(), tParam.GetZ(), tracker.ISlice() >= 18);
@@ -310,7 +310,7 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::UpdateTracklet(int /*nBlocks*/, int
310310
calink best = CALINK_INVAL;
311311

312312
float err2Y, err2Z;
313-
tracker.GetErrors2Seeding(iRow, *((MEM_LG2(GPUTPCTrackParam)*)&tParam), -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Use correct time
313+
tracker.GetErrors2Seeding(iRow, *((MEM_LG2(GPUTPCTrackParam)*)&tParam), -1.f, err2Y, err2Z); // TODO: Use correct time
314314
if (r.mNHits >= 10) {
315315
const float sErr2 = tracker.Param().GetSystematicClusterErrorIFC2(x, tParam.GetY(), tParam.GetZ(), tracker.ISlice() >= 18);
316316
err2Y += sErr2;
@@ -480,7 +480,7 @@ GPUdic(2, 1) void GPUTPCTrackletConstructor::DoTracklet(GPUconstantref() MEM_GLO
480480
if ((r.mGo = (tParam.TransportToX(x, tracker.Param().bzCLight, GPUCA_MAX_SIN_PHI) && tParam.Filter(r.mLastY, r.mLastZ, tParam.Err2Y() * 0.5f, tParam.Err2Z() * 0.5f, GPUCA_MAX_SIN_PHI_LOW, true)))) {
481481
CADEBUG(printf("%14s: SEA BACK ROW %3d X %8.3f -", "", iRow, tParam.X()); for (int i = 0; i < 5; i++) { printf(" %8.3f", tParam.Par()[i]); } printf(" -"); for (int i = 0; i < 15; i++) { printf(" %8.3f", tParam.Cov()[i]); } printf("\n"));
482482
float err2Y, err2Z;
483-
tracker.GetErrors2Seeding(r.mEndRow, tParam, -1.f, 0.f, 0.f, err2Y, err2Z); // TODO: Use correct time
483+
tracker.GetErrors2Seeding(r.mEndRow, tParam, -1.f, err2Y, err2Z); // TODO: Use correct time
484484
if (tParam.GetCov(0) < err2Y) {
485485
tParam.SetCov(0, err2Y);
486486
}

0 commit comments

Comments
 (0)