@@ -312,19 +312,30 @@ class TrackPropagationModule
312312 trackType = o2::aod::track::Track;
313313 }
314314 } else {
315- if (fillTracksDCA || fillTracksDCACov) {
315+ if (fillTracksCov || fillTracksDCA || fillTracksDCACov) {
316316 if (track.has_collision ()) {
317317 auto const & collision = collisions.rawIteratorAt (track.collisionId ());
318318 mVtx .setPos ({collision.posX (), collision.posY (), collision.posZ ()});
319- if (fillTracksDCACov) {
319+ if (fillTracksCov || fillTracksDCACov) {
320320 mVtx .setCov (collision.covXX (), collision.covXY (), collision.covYY (), collision.covXZ (), collision.covYZ (), collision.covZZ ());
321321 }
322322 } else {
323323 mVtx .setPos ({ccdbLoader.mMeanVtx ->getX (), ccdbLoader.mMeanVtx ->getY (), ccdbLoader.mMeanVtx ->getZ ()});
324- if (fillTracksDCACov) {
324+ if (fillTracksCov || fillTracksDCACov) {
325325 mVtx .setCov (ccdbLoader.mMeanVtx ->getSigmaX () * ccdbLoader.mMeanVtx ->getSigmaX (), 0 .0f , ccdbLoader.mMeanVtx ->getSigmaY () * ccdbLoader.mMeanVtx ->getSigmaY (), 0 .0f , 0 .0f , ccdbLoader.mMeanVtx ->getSigmaZ () * ccdbLoader.mMeanVtx ->getSigmaZ ());
326326 }
327327 }
328+ if (fillTracksCov) {
329+ if constexpr (isMc) { // checking MC and fillCovMat block begins
330+ if (cGroup.useTrackTuner .value ) {
331+ bool hasMcParticle = track.has_mcParticle ();
332+ if (hasMcParticle) {
333+ isPropagationOK = o2::base::Propagator::Instance ()->propagateToDCABxByBz (mVtx , mTrackParCov , 2 .f , matCorr, &mDcaInfoCov );
334+ }
335+ }
336+ } // MC and fillCovMat block ends
337+ }
338+
328339
329340 if (fillTracksDCACov) {
330341 calculateDCA (mTrackParCov , mVtx , o2::base::Propagator::Instance ()->getNominalBz (), &mDcaInfoCov , 999 .f );
@@ -388,27 +399,15 @@ class TrackPropagationModule
388399 bool calculateDCA (TTrackPar& trackPar, const TVertex& vtx, double b, TDCA* dca, double maxD)
389400 {
390401 // propagate track to DCA to the vertex
391- double sn, cs, alp = trackPar.getAlpha ();
402+ float sn, cs, alp = trackPar.getAlpha ();
392403 o2::math_utils::detail::sincos (alp, sn, cs);
393- double x = trackPar.getX (), y = trackPar.getY (), snp = trackPar.getSnp (), csp = gpu::CAMath::Sqrt ((1 .f - snp) * (1 .f + snp));
394- double xv = vtx.getX () * cs + vtx.getY () * sn, yv = -vtx.getX () * sn + vtx.getY () * cs, zv = vtx.getZ ();
404+ float x = trackPar.getX (), y = trackPar.getY (), snp = trackPar.getSnp (), csp = gpu::CAMath::Sqrt ((1 .f - snp) * (1 .f + snp));
405+ float xv = vtx.getX () * cs + vtx.getY () * sn, yv = -vtx.getX () * sn + vtx.getY () * cs, zv = vtx.getZ ();
395406 x -= xv;
396407 y -= yv;
397- // Estimate the impact parameter neglecting the track curvature
398- double d = gpu::CAMath::Abs (x * snp - y * csp);
399- if (d > maxD) {
400- // provide default DCA for failed propag
401- if constexpr (requires { trackPar.getSigmaY2 (); vtx.getSigmaX2 (); }) {
402- dca->set (o2::track::DefaultDCA, o2::track::DefaultDCA,
403- o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
404- } else {
405- (*dca)[0 ] = o2::track::DefaultDCA;
406- (*dca)[1 ] = o2::track::DefaultDCA;
407- }
408- return false ;
409- }
410- double crv = trackPar.getCurvature (b);
411- double tgfv = -(crv * x - snp) / (crv * y + csp);
408+
409+ float crv = trackPar.getCurvature (b);
410+ float tgfv = -(crv * x - snp) / (crv * y + csp);
412411 sn = tgfv / gpu::CAMath::Sqrt (1 .f + tgfv * tgfv);
413412 cs = gpu::CAMath::Sqrt ((1 .f - sn) * (1 .f + sn));
414413 cs = (gpu::CAMath::Abs (tgfv) > constants::math::Almost0) ? sn / tgfv : constants::math::Almost1;
0 commit comments