@@ -191,17 +191,9 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
191191 if (allowModification && changeDirection && !noFollowCircle && !noFollowCircle2) {
192192 bool tryFollow = lastRow != 255 ;
193193 if (tryFollow) {
194- const GPUTPCGMTrackParam backup = *this ;
195- const float backupAlpha = prop.GetAlpha ();
196- if (FollowCircle<0 >(merger, prop, lastSector, lastRow, iTrk, clAlpha, xx, yy, cluster.sector , cluster.row , inFlyDirection)) {
197- CADEBUG (printf (" Error during follow circle, resetting track!\n " ));
198- *this = backup;
199- prop.SetTrack (this , backupAlpha);
200- noFollowCircle = true ;
201- tryFollow = false ;
194+ if (!(merger->Param ().rec .tpc .disableRefitAttachment & 4 )) {
195+ StoreAttachMirror (merger, lastSector, lastRow, iTrk, clAlpha, yy, xx, cluster.sector , cluster.row , inFlyDirection, prop.GetAlpha ());
202196 }
203- }
204- if (tryFollow) {
205197 MirrorTo (prop, yy, zz, inFlyDirection, param, cluster.row , clusterState, false , cluster.sector );
206198 lastUpdateX = mX ;
207199 lastLeg = cluster.leg ;
@@ -269,8 +261,8 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_
269261 CADEBUG (printf (" -- MirroredY: %f --> %f" , mP [0 ], mirrordY));
270262 if (CAMath::Abs (yy - mP [0 ]) > CAMath::Abs (yy - mirrordY)) {
271263 CADEBUG (printf (" - Mirroring!!!" ));
272- if (allowModification) {
273- AttachClustersMirror< 0 > (merger, cluster.sector , cluster.row , iTrk, yy, prop); // TODO: Never true, will always call FollowCircle above, really???
264+ if (allowModification && !(merger-> Param (). rec . tpc . disableRefitAttachment & 8 ) ) {
265+ StoreAttachMirror (merger, cluster.sector , cluster.row , iTrk, 0 , yy, 0 , - 1 , 0 , 0 , prop. GetAlpha ());
274266 }
275267 MirrorTo (prop, yy, zz, inFlyDirection, param, cluster.row , clusterState, true , cluster.sector );
276268 noFollowCircle = false ;
@@ -751,24 +743,15 @@ GPUdii() void GPUTPCGMTrackParam::RefitLoop(const GPUTPCGMMerger* GPUrestrict()
751743 GPUTPCGMLoopData& data = Merger->LoopData ()[loopIdx];
752744 prop.SetTrack (&data.param , data.alpha );
753745 if (data.toSector == -1 ) {
754- data.param .AttachClustersMirror < 1 > (Merger, data.sector , data.row , data.track , data.toY , prop, true );
746+ data.param .AttachClustersMirror (Merger, data.sector , data.row , data.track , data.toY , prop);
755747 } else {
756- data.param .FollowCircle < 1 > (Merger, prop, data.sector , data.row , data.track , data.toAlpha , data.toX , data.toY , data.toSector , data.toRow , data.inFlyDirection , true );
748+ data.param .FollowCircle (Merger, prop, data.sector , data.row , data.track , data.toAlpha , data.toX , data.toY , data.toSector , data.toRow , data.inFlyDirection );
757749 }
758750}
759751
760- template <int32_t I>
761- GPUdic (0 , 1 ) int32_t GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUrestrict () Merger, GPUTPCGMPropagator& GPUrestrict() prop, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toX, float toY, int32_t toSector, int32_t toRow, bool inFlyDirection, bool phase2)
752+ GPUdi () int32_t GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUrestrict () Merger, GPUTPCGMPropagator& GPUrestrict() prop, int32_t sector, int32_t iRow, int32_t iTrack, float toAlpha, float toX, float toY, int32_t toSector, int32_t toRow, bool inFlyDirection)
762753{
763754 static constexpr float kSectAngle = 2 * M_PI / 18 .f ;
764- if (Merger->Param ().rec .tpc .disableRefitAttachment & 4 ) {
765- return 1 ;
766- }
767- const bool inExtraPass = Merger->Param ().rec .tpc .looperInterpolationInExtraPass == -1 ? GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION : Merger->Param ().rec .tpc .looperInterpolationInExtraPass ;
768- if (inExtraPass && phase2 == false ) {
769- StoreAttachMirror (Merger, sector, iRow, iTrack, toAlpha, toY, toX, toSector, toRow, inFlyDirection, prop.GetAlpha ());
770- return 1 ;
771- }
772755 const GPUParam& GPUrestrict () param = Merger->Param ();
773756 bool right;
774757 float dAlpha = toAlpha - prop.GetAlpha ();
@@ -862,19 +845,9 @@ GPUdic(0, 1) int32_t GPUTPCGMTrackParam::FollowCircle(const GPUTPCGMMerger* GPUr
862845 return (0 );
863846}
864847
865- template <int32_t I>
866- GPUdni () void GPUTPCGMTrackParam::AttachClustersMirror(const GPUTPCGMMerger* GPUrestrict () Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toY, GPUTPCGMPropagator& GPUrestrict() prop, bool phase2)
848+ GPUdi () void GPUTPCGMTrackParam::AttachClustersMirror(const GPUTPCGMMerger* GPUrestrict () Merger, int32_t sector, int32_t iRow, int32_t iTrack, float toY, GPUTPCGMPropagator& GPUrestrict() prop)
867849{
868850 static constexpr float kSectAngle = 2 * M_PI / 18 .f ;
869-
870- if (Merger->Param ().rec .tpc .disableRefitAttachment & 8 ) {
871- return ;
872- }
873- const bool inExtraPass = Merger->Param ().rec .tpc .looperInterpolationInExtraPass == -1 ? GPUCA_PAR_MERGER_SPLIT_LOOP_INTERPOLATION : Merger->Param ().rec .tpc .looperInterpolationInExtraPass ;
874- if (inExtraPass && phase2 == false ) {
875- StoreAttachMirror (Merger, sector, iRow, iTrack, 0 , toY, 0 , -1 , 0 , 0 , prop.GetAlpha ());
876- return ;
877- }
878851 // Note that the coordinate system is rotated by 90 degree swapping X and Y!
879852 float X = mP [2 ] > 0 ? mP [0 ] : -mP [0 ];
880853 float toX = mP [2 ] > 0 ? toY : -toY;
0 commit comments