@@ -862,30 +862,31 @@ GPUd() void GPUTPCGMTrackParam::ShiftZ(const GPUTPCGMMerger* GPUrestrict() merge
862862 if (!merger->Param ().par .continuousTracking ) {
863863 return ;
864864 }
865- const float r1 = CAMath::Max (0 .0001f , CAMath::Abs (mP [4 ] * merger->Param ().polynomialField .GetNominalBz ()));
866-
867- const float dist2 = mX * mX + mP [0 ] * mP [0 ];
868- const float dist1r2 = dist2 * r1 * r1;
869865 float deltaZ = 0 .f ;
870866 bool beamlineReached = false ;
871- if (dist1r2 < 4 ) {
872- const float alpha = CAMath::ACos (1 - 0 .5f * dist1r2); // Angle of a circle, such that |(cosa, sina) - (1,0)| == dist
873- const float beta = CAMath::ATan2 (mP [0 ], mX );
874- const int32_t comp = mP [2 ] > CAMath::Sin (beta);
875- const float sinab = CAMath::Sin ((comp ? 0 .5f : -0 .5f ) * alpha + beta); // Angle of circle through origin and track position, to be compared to Snp
876- const float res = CAMath::Abs (sinab - mP [2 ]);
877-
878- if (res < 0.2 ) {
879- const float r = 1 .f / r1;
880- const float dS = alpha * r;
881- float z0 = dS * mP [3 ];
882- if (CAMath::Abs (z0) > GPUTPCGeometry::TPCLength ()) {
883- z0 = z0 > 0 ? GPUTPCGeometry::TPCLength () : -GPUTPCGeometry::TPCLength ();
884- }
885- deltaZ = mP [1 ] - z0;
886- beamlineReached = true ;
867+ const float r1 = CAMath::Max (0 .0001f , CAMath::Abs (mP [4 ] * merger->Param ().polynomialField .GetNominalBz ()));
868+ if (r1 < 0.01501 ) { // 100 MeV @ 0.5T ~ 0.66m cutof
869+ const float dist2 = mX * mX + mP [0 ] * mP [0 ];
870+ const float dist1r2 = dist2 * r1 * r1;
871+ if (dist1r2 < 4 ) {
872+ const float alpha = CAMath::ACos (1 - 0 .5f * dist1r2); // Angle of a circle, such that |(cosa, sina) - (1,0)| == dist
873+ const float beta = CAMath::ATan2 (mP [0 ], mX );
874+ const int32_t comp = mP [2 ] > CAMath::Sin (beta);
875+ const float sinab = CAMath::Sin ((comp ? 0 .5f : -0 .5f ) * alpha + beta); // Angle of circle through origin and track position, to be compared to Snp
876+ const float res = CAMath::Abs (sinab - mP [2 ]);
877+
878+ if (res < 0.2 ) {
879+ const float r = 1 .f / r1;
880+ const float dS = alpha * r;
881+ float z0 = dS * mP [3 ];
882+ if (CAMath::Abs (z0) > GPUTPCGeometry::TPCLength ()) {
883+ z0 = z0 > 0 ? GPUTPCGeometry::TPCLength () : -GPUTPCGeometry::TPCLength ();
884+ }
885+ deltaZ = mP [1 ] - z0;
886+ beamlineReached = true ;
887887
888- // printf("X %9.3f Y %9.3f QPt %9.3f R %9.3f --> Alpha %9.3f Snp %9.3f Snab %9.3f Res %9.3f dS %9.3f z0 %9.3f\n", mX, mP[0], mP[4], r, alpha / 3.1415 * 180, mP[2], sinab, res, dS, z0);
888+ // printf("X %9.3f Y %9.3f QPt %9.3f R %9.3f --> Alpha %9.3f Snp %9.3f Snab %9.3f Res %9.3f dS %9.3f z0 %9.3f\n", mX, mP[0], mP[4], r, alpha / 3.1415 * 180, mP[2], sinab, res, dS, z0);
889+ }
889890 }
890891 }
891892
0 commit comments