@@ -1055,7 +1055,8 @@ bool TrackerTraits<nLayers>::trackFollowing(TrackITSExt* track, int rof, bool ou
10551055template <int nLayers>
10561056track::TrackParCov TrackerTraits<nLayers>::buildTrackSeed(const Cluster& cluster1, const Cluster& cluster2, const TrackingFrameInfo& tf3)
10571057{
1058- const float ca = o2::gpu::CAMath::Cos (tf3.alphaTrackingFrame ), sa = o2::gpu::CAMath::Sin (tf3.alphaTrackingFrame );
1058+ float ca{-999 .f }, sa{-999 .f };
1059+ o2::gpu::CAMath::SinCos (tf3.alphaTrackingFrame , sa, ca);
10591060 const float x1 = cluster1.xCoordinate * ca + cluster1.yCoordinate * sa;
10601061 const float y1 = -cluster1.xCoordinate * sa + cluster1.yCoordinate * ca;
10611062 const float z1 = cluster1.zCoordinate ;
@@ -1065,29 +1066,27 @@ track::TrackParCov TrackerTraits<nLayers>::buildTrackSeed(const Cluster& cluster
10651066 const float x3 = tf3.xTrackingFrame ;
10661067 const float y3 = tf3.positionTrackingFrame [0 ];
10671068 const float z3 = tf3.positionTrackingFrame [1 ];
1068-
1069- const bool zeroField{std::abs (getBz ()) < o2::constants::math::Almost0};
1070- const float tgp = zeroField ? o2::gpu::CAMath::ATan2 (y3 - y1, x3 - x1) : 1 .f ;
1071- const float crv = zeroField ? 1 .f : math_utils::computeCurvature (x3, y3, x2, y2, x1, y1);
1072- const float snp = zeroField ? tgp / o2::gpu::CAMath::Sqrt (1 .f + tgp * tgp) : crv * (x3 - math_utils::computeCurvatureCentreX (x3, y3, x2, y2, x1, y1));
1073- const float tgl12 = math_utils::computeTanDipAngle (x1, y1, x2, y2, z1, z2);
1074- const float tgl23 = math_utils::computeTanDipAngle (x2, y2, x3, y3, z2, z3);
1075- const float q2pt = zeroField ? 1 .f / o2::track::kMostProbablePt : crv / (getBz () * o2::constants::math::B2C);
1076- const float q2pt2 = crv * crv;
1077- const float sg2q2pt = track::kC1Pt2max * (q2pt2 > 0.0005 ? (q2pt2 < 1 ? q2pt2 : 1 ) : 0.0005 );
1078- return track::TrackParCov (tf3.xTrackingFrame , tf3.alphaTrackingFrame ,
1079- {y3, z3, snp, 0 .5f * (tgl12 + tgl23), q2pt},
1080- {tf3.covarianceTrackingFrame [0 ],
1081- tf3.covarianceTrackingFrame [1 ], tf3.covarianceTrackingFrame [2 ],
1082- 0 .f , 0 .f , track::kCSnp2max ,
1083- 0 .f , 0 .f , 0 .f , track::kCTgl2max ,
1084- 0 .f , 0 .f , 0 .f , 0 .f , sg2q2pt});
1069+ float tgp{1 .f }, crv{1 .f }, snp{-999 .f }, tgl12{-999 .f }, tgl23{-999 .f }, q2pt{1 .f / track::kMostProbablePt }, q2pt2{1 .f }, sg2q2pt{-999 .f };
1070+ if (mIsZeroField ) {
1071+ tgp = o2::gpu::CAMath::ATan2 (y3 - y1, x3 - x1);
1072+ snp = tgp / o2::gpu::CAMath::Sqrt (1 .f + tgp * tgp);
1073+ } else {
1074+ crv = math_utils::computeCurvature (x3, y3, x2, y2, x1, y1);
1075+ snp = crv * (x3 - math_utils::computeCurvatureCentreX (x3, y3, x2, y2, x1, y1));
1076+ q2pt = crv / (mBz * o2::constants::math::B2C);
1077+ q2pt2 = crv * crv;
1078+ }
1079+ tgl12 = math_utils::computeTanDipAngle (x1, y1, x2, y2, z1, z2);
1080+ tgl23 = math_utils::computeTanDipAngle (x2, y2, x3, y3, z2, z3);
1081+ sg2q2pt = track::kC1Pt2max * (q2pt2 > 0 .0005f ? (q2pt2 < 1 .f ? q2pt2 : 1 .f ) : 0 .0005f );
1082+ return {tf3.xTrackingFrame , tf3.alphaTrackingFrame , {y3, z3, snp, 0 .5f * (tgl12 + tgl23), q2pt}, {tf3.covarianceTrackingFrame [0 ], tf3.covarianceTrackingFrame [1 ], tf3.covarianceTrackingFrame [2 ], 0 .f , 0 .f , track::kCSnp2max , 0 .f , 0 .f , 0 .f , track::kCTgl2max , 0 .f , 0 .f , 0 .f , 0 .f , sg2q2pt}};
10851083}
10861084
10871085template <int nLayers>
10881086void TrackerTraits<nLayers>::setBz(float bz)
10891087{
10901088 mBz = bz;
1089+ mIsZeroField = std::abs (mBz ) < 0.01 ;
10911090 mTimeFrame ->setBz (bz);
10921091}
10931092
0 commit comments