|
13 | 13 |
|
14 | 14 | #define GPUCA_CADEBUG 0 |
15 | 15 | #define DEBUG_SINGLE_TRACK -1 |
| 16 | +#define EXTRACT_RESIDUALS 0 |
| 17 | + |
| 18 | +#if EXTRACT_RESIDUALS == 1 |
| 19 | +#include "GPUROOTDump.h" |
| 20 | +#endif |
16 | 21 |
|
17 | | -#include "GPUTPCClusterErrorStat.h" |
18 | 22 | #include "GPUTPCDef.h" |
19 | 23 | #include "GPUTPCGMTrackParam.h" |
20 | 24 | #include "GPUTPCGMPhysicalTrackModel.h" |
@@ -58,8 +62,6 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int iT |
58 | 62 | { |
59 | 63 | const GPUParam& GPUrestrict() param = merger->Param(); |
60 | 64 |
|
61 | | - GPUTPCClusterErrorStat errorStat(N); |
62 | | - |
63 | 65 | GPUdEdx dEdx; |
64 | 66 | GPUTPCGMPropagator prop; |
65 | 67 | gputpcgmmergertypes::InterpolationErrors interpolation; |
@@ -266,14 +268,32 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int iT |
266 | 268 | continue; |
267 | 269 | } |
268 | 270 | CADEBUG(printf("\n")); |
269 | | - errorStat.Fill(xx, yy, zz, prop.GetAlpha(), mX, mP, mC, ihit, iWay); |
270 | 271 |
|
271 | 272 | int retVal; |
272 | 273 | float threshold = 3.f + (lastUpdateX >= 0 ? (CAMath::Abs(mX - lastUpdateX) / 2) : 0.f); |
273 | 274 | if (mNDF > 5 && (CAMath::Abs(yy - mP[0]) > threshold || CAMath::Abs(zz - mP[1]) > threshold)) { |
274 | 275 | retVal = 2; |
275 | 276 | } else { |
276 | 277 | char rejectChi2 = attempt ? 0 : ((param.rec.mergerInterpolateErrors && CAMath::Abs(ihit - ihitMergeFirst) <= 1) ? (refit ? (2 + ((nWays - iWay) & 1)) : 0) : (allowModification && goodRows > 5)); |
| 278 | +#if EXTRACT_RESIDUALS == 1 |
| 279 | + if (iWay == nWays - 1 && interpolation.hit[ihit].errorY > (GPUCA_MERGER_INTERPOLATION_ERROR_TYPE)0) { |
| 280 | + const float Iz0 = interpolation.hit[ihit].posY - mP[0]; |
| 281 | + const float Iz1 = interpolation.hit[ihit].posZ - mP[1]; |
| 282 | + float Iw0 = mC[2] + (float)interpolation.hit[ihit].errorZ; |
| 283 | + float Iw2 = mC[0] + (float)interpolation.hit[ihit].errorY; |
| 284 | + float Idet1 = 1.f / CAMath::Max(1e-10f, Iw0 * Iw2 - mC[1] * mC[1]); |
| 285 | + const float Ik00 = (mC[0] * Iw0 + mC[1] * mC[1]) * Idet1; |
| 286 | + const float Ik01 = (mC[0] * mC[1] + mC[1] * Iw2) * Idet1; |
| 287 | + const float Ik10 = (mC[1] * Iw0 + mC[2] * mC[1]) * Idet1; |
| 288 | + const float Ik11 = (mC[1] * mC[1] + mC[2] * Iw2) * Idet1; |
| 289 | + const float ImP0 = mP[0] + Ik00 * Iz0 + Ik01 * Iz1; |
| 290 | + const float ImP1 = mP[1] + Ik10 * Iz0 + Ik11 * Iz1; |
| 291 | + const float ImC0 = mC[0] - Ik00 * mC[0] + Ik01 * mC[1]; |
| 292 | + const float ImC2 = mC[2] - Ik10 * mC[1] + Ik11 * mC[2]; |
| 293 | + auto& tup = GPUROOTDump<TNtuple>::get("clusterres", "row:clX:clY:clZ:angle:trkX:trkY:trkZ:trkSinPhi:trkDzDs:trkQPt:trkSigmaY2:trkSigmaZ2trkSigmaQPt2"); |
| 294 | + tup.Fill((float)clusters[ihit].row, xx, yy, zz, clAlpha, mX, ImP0, ImP1, mP[2], mP[3], mP[4], ImC0, ImC2, mC[14]); |
| 295 | + } |
| 296 | +#endif |
277 | 297 | retVal = prop.Update(yy, zz, clusters[ihit].row, param, clusterState, rejectChi2, &interpolation.hit[ihit], refit); |
278 | 298 | } |
279 | 299 | // clang-format off |
|
0 commit comments