Skip to content

Commit

Permalink
GPU TPC: Build average of avgCharge of 1/sqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr committed Mar 4, 2024
1 parent 0a5bc48 commit 1dc5123
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions GPU/GPUTracking/Base/GPUParam.inc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ MEM_CLASS_PRE()
GPUdi() float MEM_LG(GPUParam)::GetClusterError2(int yz, int type, float z, float angle2, float scaledMult, float scaledAvgCharge, float scaledCharge) const
{
MakeType(const float*) c = ParamErrors[yz][type];
float v = c[0] + c[1] * angle2 + c[2] * z + c[3] * scaledMult;
float v = c[0] + c[1] * angle2 * scaledAvgCharge + c[2] * z * scaledCharge + c[3] * scaledMult * scaledAvgCharge;
v = CAMath::Abs(v);
v *= yz ? rec.tpc.clusterError2CorrectionZ : rec.tpc.clusterError2CorrectionY;
v += yz ? rec.tpc.clusterError2AdditionalZ : rec.tpc.clusterError2AdditionalY;
Expand Down Expand Up @@ -164,8 +164,8 @@ GPUdi() void MEM_LG(GPUParam)::GetClusterErrors2(char sector, int iRow, float z,
const float angleZ2 = DzDs * DzDs * sec2; // dz/dx

const float mult = time >= 0.f ? GetScaledMult(time) / tpcGeometry.Row2X(iRow) : 0.f;
const float scaledAvgCharge = avgCharge * rec.tpc.clusterErrorChargeScaler;
const float scaledCharge = charge * rec.tpc.clusterErrorChargeScaler;
const float scaledAvgCharge = avgCharge * rec.tpc.clusterErrorChargeScaler > 0.f ? avgCharge * rec.tpc.clusterErrorChargeScaler : 1.f;
const float scaledCharge = charge * rec.tpc.clusterErrorChargeScaler > 0.f ? charge * rec.tpc.clusterErrorChargeScaler : 1.f;

ErrY2 = GetClusterError2(0, rowType, z, angleY2, mult, scaledAvgCharge, scaledCharge);
ErrZ2 = GetClusterError2(1, rowType, z, angleZ2, mult, scaledAvgCharge, scaledCharge);
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int iT
}
#endif
float time = merger->Param().par.earlyTpcTransform ? -1.f : merger->GetConstantMem()->ioPtrs.clustersNative->clustersLinear[cluster.num].getTime();
float tmpCharge = merger->GetConstantMem()->ioPtrs.clustersNative ? CAMath::Sqrt(merger->GetConstantMem()->ioPtrs.clustersNative->clustersLinear[cluster.num].qMax) : 0.f;
float tmpCharge = merger->GetConstantMem()->ioPtrs.clustersNative ? CAMath::FastInvSqrt(merger->GetConstantMem()->ioPtrs.clustersNative->clustersLinear[cluster.num].qMax) : 0.f;
retVal = prop.Update(yy, zz, cluster.row, param, clusterState, rejectChi2, &interpolation.hit[ihit], refit, cluster.slice, time, (avgCharge += tmpCharge) / ++nAvgCharge, tmpCharge GPUCA_DEBUG_STREAMER_CHECK(, iTrk)); // TODO: Use avgCharge
GPUCA_DEBUG_STREAMER_CHECK(if (o2::utils::DebugStreamer::checkStream(o2::utils::StreamFlags::streamUpdateTrack, iTrk)) {
merger->DebugStreamerUpdate(iTrk, ihit, xx, yy, zz, cluster, merger->GetConstantMem()->ioPtrs.clustersNative->clustersLinear[cluster.num], *this, prop, interpolation.hit[ihit], rejectChi2, refit, retVal);
Expand Down

0 comments on commit 1dc5123

Please sign in to comment.