@@ -595,17 +595,17 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
595595 float trkltCovTmp[3 ] = {0 .f };
596596 if ((CAMath::Abs (deltaY) < roadY) && (CAMath::Abs (deltaZ) < roadZ)) { // TODO: check if this is still necessary after the cut before propagation of track
597597 // tracklet is in windwow: get predicted chi2 for update and store tracklet index if best guess
598- mRecoParam -> recalcTrkltCov (tilt, trkWork->getSnp (), pad->GetRowSize (tracklets[trkltIdx].GetZbin ()), trkltCovTmp);
598+ RecalcTrkltCov (tilt, trkWork->getSnp (), pad->GetRowSize (tracklets[trkltIdx].GetZbin ()), trkltCovTmp);
599599 float chi2 = prop->getPredictedChi2 (trkltPosTmpYZ, trkltCovTmp);
600600 if (Param ().rec .trd .addDeflectionInChi2 && (trkWork->getSnp () < 1 .f - 1e-6f ) && (trkWork->getSnp () > -1 .f + 1e-6f )) {
601601 // we add the slope in the chi2 calculation
602602 float trkltCovTmpWithDy[6 ] = {trkltCovTmp[0 ], trkltCovTmp[1 ], trkltCovTmp[2 ], 0 .f , 0 .f , 0 .f };
603- mRecoParam -> recalcTrkltCovDy (tilt, trkWork->getSnp (), trkltCovTmpWithDy);
603+ RecalcTrkltCovDy (tilt, trkWork->getSnp (), trkltCovTmpWithDy);
604604 trkltCovTmpWithDy[0 ] += trkWork->getSigmaY2 ();
605605 trkltCovTmpWithDy[1 ] += trkWork->getSigmaZY ();
606606 trkltCovTmpWithDy[2 ] += trkWork->getSigmaZ2 ();
607607
608- // For now, dy uncertainty also includes track uncertainty, so no need to add additional uncertainty
608+ // For now, dy uncertainty parametrization also includes track uncertainty, so no need to add additional uncertainty
609609 if (InvertCov (trkltCovTmpWithDy)) {
610610 float deltaDy = spacePoints[trkltIdx].getDy () + dyTiltCorr - mRecoParam ->convertAngleToDy (trkWork->getSnp ());
611611 chi2 = deltaY * trkltCovTmpWithDy[0 ] * deltaY + 2 * deltaY * trkltCovTmpWithDy[1 ] * deltaZ + 2 * deltaY * trkltCovTmpWithDy[3 ] * deltaDy + deltaZ * trkltCovTmpWithDy[2 ] * deltaZ + 2 * deltaZ * trkltCovTmpWithDy[4 ] * deltaDy + deltaDy * trkltCovTmpWithDy[5 ] * deltaDy;
@@ -954,6 +954,18 @@ GPUd() void GPUTRDTracker_t<TRDTRK, PROP>::RecalcTrkltCov(const float tilt, cons
954954 cov[2 ] = c2 * (t2 * sy2 + sz2);
955955}
956956
957+ template <class TRDTRK , class PROP >
958+ GPUd () void GPUTRDTracker_t<TRDTRK, PROP>::RecalcTrkltCovDy(const float tilt, const float snp, float (&cov)[6])
959+ {
960+ float t2 = tilt * tilt; // tan^2 (tilt)
961+ float c2 = 1 .f / (1 .f + t2); // cos^2 (tilt)
962+ float sy2 = mRecoParam ->getRPhiRes (snp);
963+ float sdy2 = mRecoParam ->getDyRes (snp);
964+ cov[3 ] = mRecoParam ->getCorrYDy (snp) * CAMath::Sqrt (sdy2 * c2 * sy2);
965+ cov[4 ] = -tilt * mRecoParam ->getCorrYDy (snp) * CAMath::Sqrt (sdy2 * c2 * sy2);
966+ cov[5 ] = sdy2;
967+ }
968+
957969template <class TRDTRK , class PROP >
958970GPUd () bool GPUTRDTracker_t<TRDTRK, PROP>::InvertCov(float (&cov)[6])
959971{
0 commit comments