diff --git a/algo/ca/core/data/CaMeasurementXy.h b/algo/ca/core/data/CaMeasurementXy.h index 426f6b6b9526508f80214c7759799bd437a9d7f2..a705fb05edd6d0b1d076985026573aa258cd1956 100644 --- a/algo/ca/core/data/CaMeasurementXy.h +++ b/algo/ca/core/data/CaMeasurementXy.h @@ -175,18 +175,23 @@ namespace cbm::algo::ca ///------------------------------ /// Data members - DataT fX {constants::Undef<DataT>}; ///< x coordinate of the measurement - DataT fY {constants::Undef<DataT>}; ///< y coordinate of the measurement - DataT fDx2 {constants::Undef<DataT>}; ///< rms^2 of the x coordinate measurement - DataT fDy2 {constants::Undef<DataT>}; ///< rms^2 of the y coordinate measurement - DataT fDxy {constants::Undef<DataT>}; ///< covariance of the x and y coordinate measurements + // Initializing parameters with NANs spoils the track fit where + // the masked-out SIMD entries are suppressed by a multication by 0. + // Therefore, we initialize the data members here with finite numbers. + // For the numerical safety, with some reasonable numbers. + + DataT fX {0.}; ///< x coordinate of the measurement + DataT fY {0.}; ///< y coordinate of the measurement + DataT fDx2 {1.}; ///< rms^2 of the x coordinate measurement + DataT fDy2 {1.}; ///< rms^2 of the y coordinate measurement + DataT fDxy {0.}; ///< covariance of the x and y coordinate measurements /// number of degrees of freedom (used for chi2 calculation) /// if ndf == 1, the measurement is used in the chi2 calculation /// if ndf == 0, the measurement is not used in the chi2 calculation - DataT fNdfX = constants::Undef<DataT>; ///< ndf for the x coordinate measurement - DataT fNdfY = constants::Undef<DataT>; ///< ndf for the y coordinate measurement + DataT fNdfX = 0.; ///< ndf for the x coordinate measurement + DataT fNdfY = 0.; ///< ndf for the y coordinate measurement } _fvecalignment; diff --git a/algo/ca/core/data/CaTrackParam.h b/algo/ca/core/data/CaTrackParam.h index 8f1cf3a425f7d68a5939ccb4a472327121db94d2..b09731e47e4f36f94fc94110df5f01ba7da13089 100644 --- a/algo/ca/core/data/CaTrackParam.h +++ b/algo/ca/core/data/CaTrackParam.h @@ -537,26 +537,34 @@ namespace cbm::algo::ca /// --------------------------------------------------------------------------------------------------------------------- /// Class members - // ! CI tests are failing by timeout when using undef values - // TODO: fix it and uncomment the line below - //static constexpr auto kUndef = cbm::algo::ca::constants::Undef<DataT>; - static constexpr auto kUndef = 0.; - - CovMatrix_t fCovMatrix {kUndef}; ///< covariance matrix - - DataT fX {kUndef}; ///< x-position [cm] - DataT fY {kUndef}; ///< y-position [cm] - DataT fZ {kUndef}; ///< z-position [cm] - DataT fTx {kUndef}; ///< slope along x-axis - DataT fTy {kUndef}; ///< slope along y-axis - DataT fQp {kUndef}; ///< charge over momentum [ec/GeV] - DataT fT {kUndef}; ///< time [ns] - DataT fVi {kUndef}; ///< inverse velocity in downstream direction [ns/cm] - - DataT fChiSq {kUndef}; ///< chi^2 of track fit, spatial measurements - DataT fNdf {kUndef}; ///< NDF of track fit, spatial measurements - DataT fChiSqTime {kUndef}; ///< chi^2 of track fit, time measurements - DataT fNdfTime {kUndef}; ///< NDF of track fit, time measurements + // Initializing parameters with NANs spoils the track fit where + // the masked-out SIMD entries are suppressed by a multication by 0. + // Therefore, we initialize the data members here with finite numbers. + // For the numerical safety, with some reasonable numbers. + + // clang-format off + CovMatrix_t fCovMatrix {1., + 0., 1., + 0., 0., 1., + 0., 0., 0., 1., + 0., 0., 0., 0., 1., + 0., 0., 0., 0., 0., 1., + 0., 0., 0., 0., 0., 0., 1.}; ///< covariance matrix + // clang-format on + + DataT fX {0.}; ///< x-position [cm] + DataT fY {0.}; ///< y-position [cm] + DataT fZ {0.}; ///< z-position [cm] + DataT fTx {0.}; ///< slope along x-axis + DataT fTy {0.}; ///< slope along y-axis + DataT fQp {0.}; ///< charge over momentum [ec/GeV] + DataT fT {0.}; ///< time [ns] + DataT fVi {0.}; ///< inverse velocity in downstream direction [ns/cm] + + DataT fChiSq {0.}; ///< chi^2 of track fit, spatial measurements + DataT fNdf {0.}; ///< NDF of track fit, spatial measurements + DataT fChiSqTime {0.}; ///< chi^2 of track fit, time measurements + DataT fNdfTime {0.}; ///< NDF of track fit, time measurements } _fvecalignment; // class TrackParamBase