Skip to content

Commit f9672ee

Browse files
committed
GPU: Add clusterError2AdditionalY/ZSeeding for separate errors during seeding, and simplify error formula during seeding without charge parts
1 parent 1858e31 commit f9672ee

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

GPU/GPUTracking/Base/GPUParam.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ struct GPUParam : public internal::GPUParam_t<GPUSettingsRec, GPUSettingsParam>
9797
}
9898
return 0.174533f + par.dAlpha * iSlice;
9999
}
100-
GPUd() float GetClusterErrorSeeding(int yz, int type, float zDiff, float angle2) const;
100+
GPUd() float GetClusterErrorSeeding(int yz, int type, float zDiff, float angle2, float unscaledMult) const;
101101
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

105-
GPUd() float GetClusterError2(int yz, int type, float zDiff, float angle2, float scaledMult, float scaledAvgInvCharge, float scaledInvCharge) const;
105+
GPUd() float GetClusterError2(int yz, int type, float zDiff, float angle2, float unscaledMult, float scaledAvgInvCharge, float scaledInvCharge) const;
106106
GPUd() void GetClusterErrors2(char sector, int row, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const;
107107
GPUd() void UpdateClusterError2ByState(short clusterState, float& ErrY2, float& ErrZ2) const;
108-
GPUd() float GetScaledMult(float time) const;
108+
GPUd() float GetUnscaledMult(float time) const;
109109

110110
GPUd() void Slice2Global(int iSlice, float x, float y, float z, float* X, float* Y, float* Z) const;
111111
GPUd() void Global2Slice(int iSlice, float x, float y, float z, float* X, float* Y, float* Z) const;

GPU/GPUTracking/Base/GPUParam.inc

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,34 @@ GPUdi() void MEM_LG(GPUParam)::Global2Slice(int iSlice, float X, float Y, float
4949
MEM_CLASS_PRE()
5050
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, 0.f, 0.f, ErrY2, ErrZ2);
52+
const int rowType = tpcGeometry.GetROC(iRow);
53+
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
54+
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
55+
const float sec2 = 1.f / (1.f - s2);
56+
const float angleY2 = s2 * sec2; // dy/dx
57+
const float angleZ2 = DzDs * DzDs * sec2; // dz/dx
58+
59+
const float unscaledMult = time >= 0.f ? GetUnscaledMult(time) / tpcGeometry.Row2X(iRow) : 0.f;
60+
61+
ErrY2 = GetClusterErrorSeeding(0, rowType, z, angleY2, unscaledMult); // Returns Err2
62+
ErrZ2 = GetClusterErrorSeeding(1, rowType, z, angleZ2, unscaledMult); // Returns Err2
63+
}
64+
65+
MEM_CLASS_PRE()
66+
GPUdi() float MEM_LG(GPUParam)::GetClusterErrorSeeding(int yz, int type, float zDiff, float angle2, float unscaledMult) const // Note, returns Err2 despite the name not containing 2
67+
{
68+
MakeType(const float*) c = ParamErrors[yz][type]; // Note: c[0] = p[0]^2, c[1] = p[1]^2 * padHeight, c[2] = p[2]^2 / tpcLength / padHeight, c[3] = p[3]^2 * clusterErrorOccupancyScaler^2
69+
float v = c[0] + c[1] * angle2 + c[2] * zDiff + c[3] * (unscaledMult * unscaledMult);
70+
v = CAMath::Abs(v);
71+
v *= yz ? rec.tpc.clusterError2CorrectionZ : rec.tpc.clusterError2CorrectionY;
72+
v += yz ? rec.tpc.clusterError2AdditionalZSeeding : rec.tpc.clusterError2AdditionalYSeeding;
73+
return v;
5374
}
5475

5576
MEM_CLASS_PRE()
5677
GPUdi() float MEM_LG(GPUParam)::GetClusterError2(int yz, int type, float zDiff, float angle2, float unscaledMult, float scaledInvAvgCharge, float scaledInvCharge) const
5778
{
58-
MakeType(const float*) c = ParamErrors[yz][type]; // Note: c[0] = p[0]^2, c[1] = p[1]^2 * padHeight, c[2] = p[2]^2 / tpcLength / padHeight, c[3] = p[3]^2
79+
MakeType(const float*) c = ParamErrors[yz][type]; // Note: c[0] = p[0]^2, c[1] = p[1]^2 * padHeight, c[2] = p[2]^2 / tpcLength / padHeight, c[3] = p[3]^2 * clusterErrorOccupancyScaler^2
5980
float v = c[0] + c[1] * angle2 * scaledInvAvgCharge + c[2] * zDiff * scaledInvCharge + c[3] * (unscaledMult * unscaledMult) * (scaledInvAvgCharge * scaledInvAvgCharge);
6081
v = CAMath::Abs(v);
6182
v *= yz ? rec.tpc.clusterError2CorrectionZ : rec.tpc.clusterError2CorrectionY;
@@ -113,7 +134,7 @@ GPUdi() float MEM_LG(GPUParam)::GetSystematicClusterErrorC122(float x, float y,
113134
#else // GPUCA_TPC_GEOMETRY_O2
114135

115136
MEM_CLASS_PRE()
116-
GPUdi() float MEM_LG(GPUParam)::GetClusterErrorSeeding(int yz, int type, float zDiff, float angle2) const
137+
GPUdi() float MEM_LG(GPUParam)::GetClusterErrorSeeding(int yz, int type, float zDiff, float angle2, float scaledMult) const
117138
{
118139
MakeType(const float*) c = ParamErrorsSeeding0[yz][type];
119140
float v = c[0] + c[1] * zDiff + c[2] * angle2;
@@ -131,8 +152,8 @@ GPUdi() void MEM_LG(GPUParam)::GetClusterErrorsSeeding2(char sector, int iRow, f
131152
float angleY2 = s2 * sec2; // dy/dx
132153
float angleZ2 = DzDs * DzDs * sec2; // dz/dx
133154

134-
ErrY2 = GetClusterErrorSeeding(0, rowType, z, angleY2);
135-
ErrZ2 = GetClusterErrorSeeding(1, rowType, z, angleZ2);
155+
ErrY2 = GetClusterErrorSeeding(0, rowType, z, angleY2, 0.f);
156+
ErrZ2 = GetClusterErrorSeeding(1, rowType, z, angleZ2, 0.f);
136157
ErrY2 = ErrY2 * ErrY2 * rec.tpc.clusterError2CorrectionY + rec.tpc.clusterError2AdditionalY;
137158
ErrZ2 = ErrZ2 * ErrZ2 * rec.tpc.clusterError2CorrectionZ + rec.tpc.clusterError2AdditionalZ;
138159
}
@@ -168,15 +189,14 @@ GPUdi() float MEM_LG(GPUParam)::GetSystematicClusterErrorC122(float trackX, floa
168189
MEM_CLASS_PRE()
169190
GPUdi() void MEM_LG(GPUParam)::GetClusterErrors2(char sector, int iRow, float z, float sinPhi, float DzDs, float time, float avgInvCharge, float invCharge, float& ErrY2, float& ErrZ2) const
170191
{
171-
// Calibrated cluster error from OCDB for Y and Z
172192
const int rowType = tpcGeometry.GetROC(iRow);
173193
z = CAMath::Abs(tpcGeometry.TPCLength() - CAMath::Abs(z));
174194
const float s2 = CAMath::Min(sinPhi * sinPhi, 0.95f * 0.95f);
175195
const float sec2 = 1.f / (1.f - s2);
176196
const float angleY2 = s2 * sec2; // dy/dx
177197
const float angleZ2 = DzDs * DzDs * sec2; // dz/dx
178198

179-
const float unscaledMult = time >= 0.f ? GetScaledMult(time) / tpcGeometry.Row2X(iRow) : 0.f;
199+
const float unscaledMult = time >= 0.f ? GetUnscaledMult(time) / tpcGeometry.Row2X(iRow) : 0.f;
180200
const float scaledInvAvgCharge = avgInvCharge * rec.tpc.clusterErrorChargeScaler > 0.f ? avgInvCharge * rec.tpc.clusterErrorChargeScaler : 1.f;
181201
const float scaledInvCharge = invCharge * rec.tpc.clusterErrorChargeScaler > 0.f ? invCharge * rec.tpc.clusterErrorChargeScaler : 1.f;
182202

@@ -206,7 +226,7 @@ GPUdi() void MEM_LG(GPUParam)::UpdateClusterError2ByState(short clusterState, fl
206226
}
207227

208228
MEM_CLASS_PRE()
209-
GPUdi() float MEM_LG(GPUParam)::GetScaledMult(float time) const
229+
GPUdi() float MEM_LG(GPUParam)::GetUnscaledMult(float time) const
210230
{
211231
#if !defined(__OPENCL__) || defined(__OPENCLCPP__)
212232
if (!occupancyMap) {

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ AddOptionRTC(hitSearchArea2, float, 2.f, "", 0, "square of maximum search road o
4242
AddOptionRTC(neighboursSearchArea, float, 3.f, "", 0, "area in cm for the search of neighbours, only used if searchWindowDZDR = 0")
4343
AddOptionRTC(clusterError2CorrectionY, float, 1.f, "", 0, "correction (multiplicative) for the squared cluster error during tracking")
4444
AddOptionRTC(clusterError2CorrectionZ, float, 1.f, "", 0, "correction (multiplicative) for the squared cluster error during tracking")
45-
AddOptionRTC(clusterError2AdditionalY, float, 0.f, "", 0, "correction (additive) for the squared cluster error during tracking")
46-
AddOptionRTC(clusterError2AdditionalZ, float, 0.f, "", 0, "correction (additive) for the squared cluster error during tracking")
45+
AddOptionRTC(clusterError2AdditionalY, float, 0.f, "", 0, "correction (additive) for the squared cluster error during track fitting")
46+
AddOptionRTC(clusterError2AdditionalZ, float, 0.f, "", 0, "correction (additive) for the squared cluster error during track fitting")
47+
AddOptionRTC(clusterError2AdditionalYSeeding, float, 0.f, "", 0, "correction (additive) for the squared cluster error during track seeding")
48+
AddOptionRTC(clusterError2AdditionalZSeeding, float, 0.f, "", 0, "correction (additive) for the squared cluster error during track seeding")
4749
AddOptionRTC(clusterRejectChi2TolleranceY, float, 1.f, "", 0, "Multiplicative factor multiplied onto chi2 in Y direction for cluster rejection check during track fit")
4850
AddOptionRTC(clusterRejectChi2TolleranceZ, float, 1.f, "", 0, "Multiplicative factor multiplied onto chi2 in Z direction for cluster rejection check during track fit")
4951
AddOptionRTC(clusterErrorOccupancyScaler, float, 9.95e-04f, "", 0, "Scaling factor applied to occupancy histogram bin in cluster error estimation")

GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void GPUTPCGMMerger::DebugStreamerUpdate(int iTrk, int ihit, float xx, float yy,
360360
auto uncorrectedYZ = StreamerUncorrectedZY(cluster.slice, cluster.row, track, prop);
361361
float invCharge = 1.f / clusterNative.qMax;
362362
int iRow = cluster.row;
363-
float scaledMult = (time >= 0.f ? Param().GetScaledMult(time) / Param().tpcGeometry.Row2X(iRow) : 0.f);
363+
float unscaledMult = (time >= 0.f ? Param().GetUnscaledMult(time) / Param().tpcGeometry.Row2X(iRow) : 0.f);
364364
const float clAlpha = Param().Alpha(cluster.slice);
365365
unsigned int occupancyTotal = Param().occupancyTotal;
366366
o2::utils::DebugStreamer::instance()->getStreamer("debug_update_track", "UPDATE") << o2::utils::DebugStreamer::instance()->getUniqueTreeName("tree_update_track").data()
@@ -381,7 +381,7 @@ void GPUTPCGMMerger::DebugStreamerUpdate(int iTrk, int ihit, float xx, float yy,
381381
<< "trackUncorrectedYZ=" << uncorrectedYZ
382382
<< "avgInvCharge=" << avgInvCharge
383383
<< "invCharge=" << invCharge
384-
<< "scaledMultiplicity=" << scaledMult
384+
<< "unscaledMultiplicity=" << unscaledMult
385385
<< "alpha=" << clAlpha
386386
<< "iRow=" << iRow
387387
<< "posY=" << posY

0 commit comments

Comments
 (0)