@@ -1235,7 +1235,8 @@ bool TrackerTraits<nLayers>::trackFollowing(TrackITSExt* track, int rof, bool ou
12351235template <int nLayers>
12361236track::TrackParCov TrackerTraits<nLayers>::buildTrackSeed(const Cluster& cluster1, const Cluster& cluster2, const TrackingFrameInfo& tf3)
12371237{
1238- const float ca = o2::gpu::CAMath::Cos (tf3.alphaTrackingFrame ), sa = o2::gpu::CAMath::Sin (tf3.alphaTrackingFrame );
1238+ float ca{-999 .f }, sa{-999 .f };
1239+ o2::gpu::CAMath::SinCos (tf3.alphaTrackingFrame , sa, ca);
12391240 const float x1 = cluster1.xCoordinate * ca + cluster1.yCoordinate * sa;
12401241 const float y1 = -cluster1.xCoordinate * sa + cluster1.yCoordinate * ca;
12411242 const float z1 = cluster1.zCoordinate ;
@@ -1245,29 +1246,27 @@ track::TrackParCov TrackerTraits<nLayers>::buildTrackSeed(const Cluster& cluster
12451246 const float x3 = tf3.xTrackingFrame ;
12461247 const float y3 = tf3.positionTrackingFrame [0 ];
12471248 const float z3 = tf3.positionTrackingFrame [1 ];
1248-
1249- const bool zeroField{std::abs (getBz ()) < o2::constants::math::Almost0};
1250- const float tgp = zeroField ? o2::gpu::CAMath::ATan2 (y3 - y1, x3 - x1) : 1 .f ;
1251- const float crv = zeroField ? 1 .f : math_utils::computeCurvature (x3, y3, x2, y2, x1, y1);
1252- const float snp = zeroField ? tgp / o2::gpu::CAMath::Sqrt (1 .f + tgp * tgp) : crv * (x3 - math_utils::computeCurvatureCentreX (x3, y3, x2, y2, x1, y1));
1253- const float tgl12 = math_utils::computeTanDipAngle (x1, y1, x2, y2, z1, z2);
1254- const float tgl23 = math_utils::computeTanDipAngle (x2, y2, x3, y3, z2, z3);
1255- const float q2pt = zeroField ? 1 .f / o2::track::kMostProbablePt : crv / (getBz () * o2::constants::math::B2C);
1256- const float q2pt2 = crv * crv;
1257- const float sg2q2pt = track::kC1Pt2max * (q2pt2 > 0.0005 ? (q2pt2 < 1 ? q2pt2 : 1 ) : 0.0005 );
1258- return track::TrackParCov (tf3.xTrackingFrame , tf3.alphaTrackingFrame ,
1259- {y3, z3, snp, 0 .5f * (tgl12 + tgl23), q2pt},
1260- {tf3.covarianceTrackingFrame [0 ],
1261- tf3.covarianceTrackingFrame [1 ], tf3.covarianceTrackingFrame [2 ],
1262- 0 .f , 0 .f , track::kCSnp2max ,
1263- 0 .f , 0 .f , 0 .f , track::kCTgl2max ,
1264- 0 .f , 0 .f , 0 .f , 0 .f , sg2q2pt});
1249+ 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 };
1250+ if (mIsZeroField ) {
1251+ tgp = o2::gpu::CAMath::ATan2 (y3 - y1, x3 - x1);
1252+ snp = tgp / o2::gpu::CAMath::Sqrt (1 .f + tgp * tgp);
1253+ } else {
1254+ crv = math_utils::computeCurvature (x3, y3, x2, y2, x1, y1);
1255+ snp = crv * (x3 - math_utils::computeCurvatureCentreX (x3, y3, x2, y2, x1, y1));
1256+ q2pt = crv / (mBz * o2::constants::math::B2C);
1257+ q2pt2 = crv * crv;
1258+ }
1259+ tgl12 = math_utils::computeTanDipAngle (x1, y1, x2, y2, z1, z2);
1260+ tgl23 = math_utils::computeTanDipAngle (x2, y2, x3, y3, z2, z3);
1261+ sg2q2pt = track::kC1Pt2max * (q2pt2 > 0 .0005f ? (q2pt2 < 1 .f ? q2pt2 : 1 .f ) : 0 .0005f );
1262+ 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}};
12651263}
12661264
12671265template <int nLayers>
12681266void TrackerTraits<nLayers>::setBz(float bz)
12691267{
12701268 mBz = bz;
1269+ mIsZeroField = std::abs (mBz ) < 0.01 ;
12711270 mTimeFrame ->setBz (bz);
12721271}
12731272
0 commit comments