@@ -314,24 +314,25 @@ class strangenessBuilderHelper
314314 if constexpr (calculateProngDCAtoPV) {
315315 // Calculate DCA with respect to the collision associated to the V0
316316 std::array<float , 2 > dcaInfo;
317- dcaInfo[0 ] = dcaInfo[1 ] = 0 .0f ; // invalid
318317
319318 // do DCA to PV on TrackPar copies and not TrackParCov
320319 // TrackPar preferred: don't calculate multiple scattering / CovMat changes
321320 // Spares CPU since variables not checked
322321 o2::track::TrackPar positiveTrackParamCopy (positiveTrackParam);
323322 o2::track::TrackPar negativeTrackParamCopy (negativeTrackParam);
324323
324+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
325325 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, positiveTrackParamCopy, 2 .f , fitter.getMatCorrType (), &dcaInfo);
326326 v0.positiveDCAxy = dcaInfo[0 ];
327327
328328 if constexpr (useSelections) {
329- if (std::fabs (v0.positiveDCAxy ) < v0selections.dcanegtopv ) {
329+ if (std::fabs (v0.positiveDCAxy ) < v0selections.dcapostopv ) {
330330 v0 = {};
331331 return false ;
332332 }
333333 }
334334
335+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
335336 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, negativeTrackParamCopy, 2 .f , fitter.getMatCorrType (), &dcaInfo);
336337 v0.negativeDCAxy = dcaInfo[0 ];
337338
@@ -369,6 +370,7 @@ class strangenessBuilderHelper
369370 std::array<float , 2 > dcaV0Info;
370371
371372 // propagate to collision vertex
373+ dcaV0Info[0 ] = dcaV0Info[1 ] = 999 .0f ; // default DCA: large, use with care if propagation fails
372374 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, V0Temp, 2 .f , fitter.getMatCorrType (), &dcaV0Info);
373375 v0.v0DCAToPVxy = dcaV0Info[0 ];
374376 v0.v0DCAToPVz = dcaV0Info[1 ];
@@ -513,14 +515,14 @@ class strangenessBuilderHelper
513515
514516 // Calculate DCA with respect to the collision associated to the V0
515517 std::array<float , 2 > dcaInfo;
516- dcaInfo[0 ] = dcaInfo[1 ] = 0 .0f ; // invalid
517518
518519 // do DCA to PV on TrackPar copies and not TrackParCov
519520 // TrackPar preferred: don't calculate multiple scattering / CovMat changes
520521 // Spares CPU since variables not checked
521522 o2::track::TrackPar positiveTrackParamCopy (positiveTrackParam);
522523 o2::track::TrackPar negativeTrackParamCopy (negativeTrackParam);
523524
525+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
524526 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, positiveTrackParamCopy, 2 .f , fitter.getMatCorrType (), &dcaInfo);
525527 v0.positiveDCAxy = dcaInfo[0 ];
526528
@@ -529,6 +531,7 @@ class strangenessBuilderHelper
529531 return false ;
530532 }
531533
534+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // reset to default value
532535 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, negativeTrackParamCopy, 2 .f , fitter.getMatCorrType (), &dcaInfo);
533536 v0.negativeDCAxy = dcaInfo[0 ];
534537
@@ -744,7 +747,7 @@ class strangenessBuilderHelper
744747 // bachelor DCA track to PV
745748 // Calculate DCA with respect to the collision associated to the V0, not individual tracks
746749 std::array<float , 2 > dcaInfo;
747- dcaInfo[0 ] = dcaInfo[1 ] = 0 .0f ; // invalid
750+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
748751
749752 auto bachTrackPar = getTrackPar (bachelorTrack);
750753 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, bachTrackPar, 2 .f , fitter.getMatCorrType (), &dcaInfo);
@@ -969,13 +972,18 @@ class strangenessBuilderHelper
969972 // bachelor DCA track to PV
970973 // Calculate DCA with respect to the collision associated to the V0, not individual tracks
971974 std::array<float , 2 > dcaInfo;
975+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
972976
973977 auto bachTrackPar = getTrackPar (bachelorTrack);
974978 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, bachTrackPar, 2 .f , fitter.getMatCorrType (), &dcaInfo);
975979 cascade.bachelorDCAxy = dcaInfo[0 ];
980+
981+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
976982 o2::track::TrackParCov posTrackParCovForDCA = getTrackParCov (positiveTrack);
977983 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, posTrackParCovForDCA, 2 .f , fitter.getMatCorrType (), &dcaInfo);
978984 cascade.positiveDCAxy = dcaInfo[0 ];
985+
986+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value to make sure candidate accepted
979987 o2::track::TrackParCov negTrackParCovForDCA = getTrackParCov (negativeTrack);
980988 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, negTrackParCovForDCA, 2 .f , fitter.getMatCorrType (), &dcaInfo);
981989 cascade.negativeDCAxy = dcaInfo[0 ];
@@ -1291,8 +1299,7 @@ class strangenessBuilderHelper
12911299 o2::track::TrackPar wrongV0 = fitter.createParentTrackPar ();
12921300 wrongV0.setAbsCharge (0 ); // charge zero
12931301 std::array<float , 2 > dcaInfo;
1294- dcaInfo[0 ] = 999 ;
1295- dcaInfo[1 ] = 999 ;
1302+ dcaInfo[0 ] = dcaInfo[1 ] = 999 .0f ; // by default, take large value
12961303
12971304 // bachelor-baryon DCAxy to PV
12981305 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({pvX, pvY, pvZ}, wrongV0, 2 .f , fitter.getMatCorrType (), &dcaInfo);
0 commit comments