@@ -496,8 +496,7 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
496496 const int32_t nMaxChambersToSearch = 4 ;
497497
498498 mDebug ->SetGeneralInfo (mNEvents , mNTracks , iTrk, t->getPt ());
499-
500- // LOGF(info, "start id: %d errTrkY: %f", (int)trkWork->getRefGlobalTrackIdRaw(), CAMath::Sqrt(trkWork->getSigmaY2()));
499+
501500 for (int32_t iLayer = 0 ; iLayer < kNLayers ; ++iLayer) {
502501 nCurrHypothesis = 0 ;
503502 bool isOK = false ; // if at least one candidate could be propagated or the track was stopped this becomes true
@@ -535,15 +534,15 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
535534 }
536535 continue ;
537536 }
538- // LOGF(info, "prop id: %d, layer: %d errTrkY: %f", (int)trkWork->getRefGlobalTrackIdRaw(), iLayer, CAMath::Sqrt(trkWork->getSigmaY2()));
537+
539538 // rotate track in new sector in case of sector crossing
540539 if (!AdjustSector (prop, trkWork)) {
541540 if (ENABLE_INFO ) {
542541 GPUInfo (" Adjusting sector failed for track %i candidate %i in layer %i" , iTrk, iCandidate, iLayer);
543542 }
544543 continue ;
545544 }
546- // LOGF(info, "adj id: %d, layer: %d errTrkY: %f", (int)trkWork->getRefGlobalTrackIdRaw(), iLayer, CAMath::Sqrt(trkWork->getSigmaY2()));
545+
547546 // check if track is findable
548547 if (IsGeoFindable (trkWork, iLayer, prop->getAlpha (), zShiftTrk)) {
549548 trkWork->setIsFindable (iLayer);
@@ -594,7 +593,6 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
594593 }
595594 }
596595
597- // LOGF(info, "id: %d, layer: %d errTrkY: %f", (int)trkWork->getRefGlobalTrackIdRaw(), iLayer, CAMath::Sqrt(trkWork->getSigmaY2()));
598596 // first propagate track to x of tracklet
599597 for (int32_t trkltIdx = glbTrkltIdxOffset + mTrackletIndexArray [trkltIdxOffset + currDet]; trkltIdx < glbTrkltIdxOffset + mTrackletIndexArray [trkltIdxOffset + currDet + 1 ]; ++trkltIdx) {
600598 if (CAMath::Abs (trkWork->getY () - spacePoints[trkltIdx].getY ()) > roadY || CAMath::Abs (trkWork->getZ () + zShiftTrk - spacePoints[trkltIdx].getZ ()) > roadZ) {
@@ -658,13 +656,6 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
658656 // Correction of y position based on angular pull
659657 if (Param ().rec .trd .useAngularPull == 3 || Param ().rec .trd .useAngularPull == 4 ) {
660658 float corrPull = - angularPull * mRecoParam ->getCorrYDy (trkWork->getSnp ());
661- // in the tails with very large angle difference, the correlation becomes flat
662- if (spacePoints[trkltIdx].getDy () + dyTiltCorr - mRecoParam ->convertAngleToDy (trkWork->getSnp ()) > 0.6 ) {
663- corrPull = - 0.6 / mRecoParam ->getDyRes (trkWork->getSnp (), nTrackletsChamber) * mRecoParam ->getCorrYDy (trkWork->getSnp ());
664- }
665- if (spacePoints[trkltIdx].getDy () + dyTiltCorr - mRecoParam ->convertAngleToDy (trkWork->getSnp ()) < -0.6 ) {
666- corrPull = 0.6 / mRecoParam ->getDyRes (trkWork->getSnp (), nTrackletsChamber) * mRecoParam ->getCorrYDy (trkWork->getSnp ());
667- }
668659 yPosCorr += corrPull;
669660 }
670661
@@ -678,8 +669,7 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
678669 RecalcTrkltCov (tilt, trkWork->getSnp (), pad->GetRowSize (tracklets[trkltIdx].GetZbin ()), (Param ().rec .trd .useAngularPull == 2 || Param ().rec .trd .useAngularPull == 4 ? angularPull : 0 .f ), nTrackletsChamber, trkltCovTmp);
679670 trkltCovTmp[0 ] += yAddErrPileUp2;
680671 float chi2 = prop->getPredictedChi2 (trkltPosTmpYZ, trkltCovTmp);
681- // if (currDet/30 != sector0 && chi2 < 12) LOGF(info, "track matching : id: %d layer %d trkPt: %f trkltY: %f trkY: %f %f errYtrklt: %f errYtrk: %f diff: %f chi2: %f alpha: %f X: %f", (int)trkWork->getRefGlobalTrackIdRaw(), iLayer, 1./trkWork->getQ2Pt(), yPosCorr, trkWork->getY(), projY, CAMath::Sqrt(trkltCovTmp[0]), CAMath::Sqrt(trkWork->getSigmaY2()), yPosCorr - projY, chi2, trkWork->getAlpha(), trkWork->getX());
682-
672+
683673 if (Param ().rec .trd .addDeflectionInChi2 >= 1 && (trkWork->getSnp () < 1 .f - 1e-6f ) && (trkWork->getSnp () > -1 .f + 1e-6f )) {
684674 // we add the slope in the chi2 calculation
685675 float trkltCovTmpWithDy[6 ] = {trkltCovTmp[0 ], trkltCovTmp[1 ], trkltCovTmp[2 ], 0 .f , 0 .f , 0 .f };
@@ -709,15 +699,13 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
709699 // In this case we take into account the full likelihood, so we replace (deltaDy/sigmaDy)^2 by -2*ln(likelihood), which is the same in the default Gaussian case
710700 double likelihood = mRecoParam ->getDyLikelihood (trkWork->getSnp (), spacePoints[trkltIdx].getDy () + dyTiltCorr, nTrackletsChamber);
711701 if (likelihood < 1e-6f ) continue ; // likelihood of 1e-6 is equivalent to 5 sigma deviation, so we can safely cut it to avoid numerical instability in log calculation
712- deltaDy = CAMath::Sqrt (-2 .f * CAMath::Log (likelihood) * sigmaDy2);
702+ deltaDy = CAMath::Sqrt (-2 .f * CAMath::Log (likelihood) * sigmaDy2) * (deltaDy > 0 . f ? 1 . f : - 1 . f ) ;
713703 }
714704 if (Param ().rec .trd .addDeflectionInChi2 == 3 ) {
715705 // We do the same for deltaZ
716- // LOGF(info, "before z new: %f %f", deltaZ, 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);
717706 double likelihood = mRecoParam ->getZLikelihood (deltaZ, pad->GetRowSize (tracklets[trkltIdx].GetZbin ()), CAMath::Sqrt (trkWork->getSigmaZ2 ()));
718707 if (likelihood < 1e-6f ) continue ;
719- deltaZ = CAMath::Sqrt (-2 .f * CAMath::Log (likelihood) * sigmaZ2);
720- // LOGF(info, "after z new: %f %f likelihood: %f %f", deltaZ, 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, mRecoParam->getZLikelihood(deltaZ, pad->GetRowSize(tracklets[trkltIdx].GetZbin()), CAMath::Sqrt(trkWork->getSigmaZ2())), -2.f * CAMath::Log(mRecoParam->getZLikelihood(deltaZ, pad->GetRowSize(tracklets[trkltIdx].GetZbin()), CAMath::Sqrt(trkWork->getSigmaZ2()))));
708+ deltaZ = CAMath::Sqrt (-2 .f * CAMath::Log (likelihood) * sigmaZ2) * (deltaZ > 0 .f ? 1 .f : -1 .f );
721709 }
722710 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;
723711 }
@@ -855,13 +843,6 @@ GPUd() bool GPUTRDTracker_t<TRDTRK, PROP>::FollowProlongation(PROP* prop, TRDTRK
855843 // Correction of y position based on angular pull
856844 if (Param ().rec .trd .useAngularPull == 3 || Param ().rec .trd .useAngularPull == 4 ) {
857845 float corrPull = - angularPull * mRecoParam ->getCorrYDy (trkWork->getSnp ());
858- // in the tails with very large angle difference, the correlation becomes flat
859- if (spacePoints[mHypothesis [iUpdate + hypothesisIdxOffset].mTrackletId ].getDy () + dyTiltCorr - mRecoParam ->convertAngleToDy (trkWork->getSnp ()) > 0.6 ) {
860- corrPull = - 0.6 / mRecoParam ->getDyRes (trkWork->getSnp (), nTrackletsChamber) * mRecoParam ->getCorrYDy (trkWork->getSnp ());
861- }
862- if (spacePoints[mHypothesis [iUpdate + hypothesisIdxOffset].mTrackletId ].getDy () + dyTiltCorr - mRecoParam ->convertAngleToDy (trkWork->getSnp ()) < -0.6 ) {
863- corrPull = 0.6 / mRecoParam ->getDyRes (trkWork->getSnp (), nTrackletsChamber) * mRecoParam ->getCorrYDy (trkWork->getSnp ());
864- }
865846 yPosCorrUp += corrPull;
866847 }
867848
0 commit comments