Skip to content

Commit e59a3f8

Browse files
author
David Dobrigkeit Chinellato
committed
Set default DCA in case of propagate call fail
1 parent e440f48 commit e59a3f8

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ constexpr float MaxPT = 100000.; // do not allow pTs exceeding
119119
constexpr float MinPTInv = 1. / MaxPT; // do not allow q/pTs less this value (to avoid NANs)
120120
constexpr float ELoss2EKinThreshInv = 1. / 0.025; // do not allow E.Loss correction step with dE/Ekin above the inverse of this value
121121
constexpr int MaxELossIter = 50; // max number of iteration for the ELoss to account for BB dependence on beta*gamma
122+
constexpr float DefaultDCA = 999.f; // default DCA value
123+
constexpr float DefaultDCACov = 999.f; // default DCA cov value
124+
122125
// uncomment this to enable correction for BB dependence on beta*gamma via BB derivative
123126
// #define _BB_NONCONST_CORR_
124127

Detectors/Base/src/Propagator.cxx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCA(const o2::dataformats::Verte
564564
// Estimate the impact parameter neglecting the track curvature
565565
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
566566
if (d > maxD) {
567+
if (dca) { // provide default DCA for failed propag
568+
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
569+
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
570+
}
567571
return false;
568572
}
569573
value_type crv = track.getCurvature(bZ);
@@ -584,6 +588,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCA(const o2::dataformats::Verte
584588
#elif !defined(GPUCA_NO_FMT)
585589
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx;
586590
#endif
591+
if (dca) { // provide default DCA for failed propag
592+
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
593+
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
594+
}
587595
return false;
588596
}
589597
track = tmpT;
@@ -613,6 +621,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCABxByBz(const o2::dataformats:
613621
// Estimate the impact parameter neglecting the track curvature
614622
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
615623
if (d > maxD) {
624+
if (dca) { // provide default DCA for failed propag
625+
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
626+
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
627+
}
616628
return false;
617629
}
618630
value_type crv = track.getCurvature(mNominalBz);
@@ -633,6 +645,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCABxByBz(const o2::dataformats:
633645
#elif !defined(GPUCA_NO_FMT)
634646
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx;
635647
#endif
648+
if (dca) { // provide default DCA for failed propag
649+
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
650+
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
651+
}
636652
return false;
637653
}
638654
track = tmpT;
@@ -662,6 +678,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCA(const math_utils::Point3D<va
662678
// Estimate the impact parameter neglecting the track curvature
663679
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
664680
if (d > maxD) {
681+
if (dca) { // provide default DCA for failed propag
682+
(*dca)[0] = o2::track::DefaultDCA;
683+
(*dca)[1] = o2::track::DefaultDCA;
684+
}
665685
return false;
666686
}
667687
value_type crv = track.getCurvature(bZ);
@@ -683,6 +703,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCA(const math_utils::Point3D<va
683703
#else
684704
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex " << vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z();
685705
#endif
706+
if (dca) { // provide default DCA for failed propag
707+
(*dca)[0] = o2::track::DefaultDCA;
708+
(*dca)[1] = o2::track::DefaultDCA;
709+
}
686710
return false;
687711
}
688712
track = tmpT;
@@ -710,6 +734,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCABxByBz(const math_utils::Poin
710734
// Estimate the impact parameter neglecting the track curvature
711735
value_type d = math_utils::detail::abs<value_type>(x * snp - y * csp);
712736
if (d > maxD) {
737+
if (dca) { // provide default DCA for failed propag
738+
(*dca)[0] = o2::track::DefaultDCA;
739+
(*dca)[1] = o2::track::DefaultDCA;
740+
}
713741
return false;
714742
}
715743
value_type crv = track.getCurvature(mNominalBz);
@@ -731,6 +759,10 @@ GPUd() bool PropagatorImpl<value_T>::propagateToDCABxByBz(const math_utils::Poin
731759
#else
732760
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex " << vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z();
733761
#endif
762+
if (dca) { // provide default DCA for failed propag
763+
(*dca)[0] = o2::track::DefaultDCA;
764+
(*dca)[1] = o2::track::DefaultDCA;
765+
}
734766
return false;
735767
}
736768
track = tmpT;

0 commit comments

Comments
 (0)