Skip to content

Commit 24d15d0

Browse files
ddobrigkalibuild
andauthored
Set default DCA in case of propagate call fail (#14729)
* Set default DCA in case of propagate call fail * Please consider the following formatting changes * Add missing setter lines for propagateToDCAs * Please consider the following formatting changes --------- Co-authored-by: David Dobrigkeit Chinellato <david.dobrigkeit.chinellato.cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 84d8383 commit 24d15d0

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-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

DataFormats/Reconstruction/src/TrackParametrization.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ GPUd() bool TrackParametrization<value_T>::propagateParamToDCA(const math_utils:
378378
// Estimate the impact parameter neglecting the track curvature
379379
value_t d = gpu::CAMath::Abs(x * snp - y * csp);
380380
if (d > maxD) {
381+
if (dca) { // provide default DCA for failed propag
382+
(*dca)[0] = o2::track::DefaultDCA;
383+
(*dca)[1] = o2::track::DefaultDCA;
384+
}
381385
return false;
382386
}
383387
value_t crv = getCurvature(b);
@@ -399,6 +403,10 @@ GPUd() bool TrackParametrization<value_T>::propagateParamToDCA(const math_utils:
399403
#else
400404
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << " for vertex " << vtx.X() << ' ' << vtx.Y() << ' ' << vtx.Z();
401405
#endif
406+
if (dca) { // provide default DCA for failed propag
407+
(*dca)[0] = o2::track::DefaultDCA;
408+
(*dca)[1] = o2::track::DefaultDCA;
409+
}
402410
return false;
403411
}
404412
*this = tmpT;

DataFormats/Reconstruction/src/TrackParametrizationWithError.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ GPUd() bool TrackParametrizationWithError<value_T>::propagateToDCA(const o2::dat
227227
// Estimate the impact parameter neglecting the track curvature
228228
value_t d = gpu::CAMath::Abs(x * snp - y * csp);
229229
if (d > maxD) {
230+
if (dca) { // provide default DCA for failed propag
231+
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
232+
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
233+
}
230234
return false;
231235
}
232236
value_t crv = this->getCurvature(b);
@@ -245,6 +249,10 @@ GPUd() bool TrackParametrizationWithError<value_T>::propagateToDCA(const o2::dat
245249
#if !defined(GPUCA_ALIGPUCODE)
246250
LOG(debug) << "failed to propagate to alpha=" << alp << " X=" << xv << vtx << " | Track is: " << tmpT.asString();
247251
#endif
252+
if (dca) { // provide default DCA for failed propag
253+
dca->set(o2::track::DefaultDCA, o2::track::DefaultDCA,
254+
o2::track::DefaultDCACov, o2::track::DefaultDCACov, o2::track::DefaultDCACov);
255+
}
248256
return false;
249257
}
250258
*this = tmpT;

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)