diff --git a/CMakeLists.txt b/CMakeLists.txt index db0ed3980922d8882b3f93fec80b6b35ceebb8e8..166041948f561b6ef28099782ac49d626a3351b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,10 +30,9 @@ option(ACTS_BUILD_EXAMPLES "Build examples" OFF) option(ACTS_BUILD_UNITTESTS "Build unit tests" OFF) option(ACTS_BUILD_INTEGRATIONTESTS "Build integration tests" OFF) option(ACTS_BUILD_DOC "Build documentation" OFF) - # all other compile-time parameters must be defined here for clear visibility # and to avoid forgotten options somewhere deep in the hierarchy -set(ACTS_PARAMETER_DEFINITIONS_PLUGIN "Acts/Utilities/detail/DefaultParameterDefinitions.hpp" CACHE FILEPATH "Default track parameter definition") +set(ACTS_PARAMETER_DEFINITIONS_HEADER "" CACHE FILEPATH "Use a different (track) parameter definitions header") # handle inter-plugin dependencies # DD4hepPlugin depends on TGeoPlugin diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index d022d9373388ebb947b9eaeb24bd31220ba20e42..63acfd031d3ae40b4b650671f6a93509268407ee 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -8,9 +8,6 @@ add_library( target_compile_features( ActsCore PUBLIC cxx_std_17) -target_compile_definitions( - ActsCore - PUBLIC -DACTS_PARAMETER_DEFINITIONS_PLUGIN="${ACTS_PARAMETER_DEFINITIONS_PLUGIN}") target_include_directories( ActsCore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} @@ -23,6 +20,12 @@ target_link_libraries( ActsCore PUBLIC Boost::boost) +if(ACTS_PARAMETER_DEFINITIONS_HEADER) + target_compile_definitions( + ActsCore + PUBLIC -DACTS_PARAMETER_DEFINITIONS_HEADER="${ACTS_PARAMETER_DEFINITIONS_HEADER}") +endif() + install( TARGETS ActsCore EXPORT ActsCoreTargets diff --git a/Core/include/Acts/EventData/Measurement.hpp b/Core/include/Acts/EventData/Measurement.hpp index fc1848060735608bfc0180a405c20b0d76cf61bb..b54584f55cbc10f9365cad895719abe3eed9deaf 100644 --- a/Core/include/Acts/EventData/Measurement.hpp +++ b/Core/include/Acts/EventData/Measurement.hpp @@ -301,7 +301,8 @@ struct fittable_measurement_helper { using type = Measurement<source_link_t, pars...>; }; - using type = typename detail::type_generator_t<meas_factory, BoundParsDim>; + using type = + typename detail::type_generator_t<meas_factory, eBoundParametersSize>; }; /** diff --git a/Core/include/Acts/EventData/MeasurementHelpers.hpp b/Core/include/Acts/EventData/MeasurementHelpers.hpp index 15e8ab46de89579132985b5b07be75f62f485b27..09ede4c67f5ff343c272a0e8d88ec9df4ee36c6f 100644 --- a/Core/include/Acts/EventData/MeasurementHelpers.hpp +++ b/Core/include/Acts/EventData/MeasurementHelpers.hpp @@ -97,8 +97,8 @@ struct visit_measurement_callable { /// @param lambda The lambda to call with the statically sized subsets template <typename L, typename A, typename B> auto visit_measurement(A&& param, B&& cov, size_t dim, L&& lambda) { - return template_switch<detail::visit_measurement_callable, 1, BoundParsDim>( - dim, param, cov, lambda); + return template_switch<detail::visit_measurement_callable, 1, + eBoundParametersSize>(dim, param, cov, lambda); } } // namespace Acts diff --git a/Core/include/Acts/EventData/MultiTrajectory.hpp b/Core/include/Acts/EventData/MultiTrajectory.hpp index f290c1029191bea386a1bedce8dda194eaf124f1..5185fc20dc87a05617b24638113d636a4091db05 100644 --- a/Core/include/Acts/EventData/MultiTrajectory.hpp +++ b/Core/include/Acts/EventData/MultiTrajectory.hpp @@ -537,8 +537,8 @@ template <typename source_link_t> class MultiTrajectory { public: enum { - ParametersSize = BoundParsDim, - MeasurementSizeMax = BoundParsDim, + ParametersSize = eBoundParametersSize, + MeasurementSizeMax = eBoundParametersSize, }; using SourceLink = source_link_t; using ConstTrackStateProxy = diff --git a/Core/include/Acts/EventData/ParameterSet.hpp b/Core/include/Acts/EventData/ParameterSet.hpp index 9201366d1ee8679838ad5f600002224b3903a6c5..f7f4da11521dc72b57925e9858e24ea7e0cdf066 100644 --- a/Core/include/Acts/EventData/ParameterSet.hpp +++ b/Core/include/Acts/EventData/ParameterSet.hpp @@ -58,7 +58,7 @@ using FullParameterSet = typename detail::full_parset::type; * The template parameter pack @c params must be given in a strictly ascending * order. The parameter pack must * be non-empty and it cannot contain more elements than - * <tt>Acts::BoundParsDim</tt>. + * <tt>Acts::eBoundParametersSize</tt>. * * @test The behavior of this class is tested in the following unit tests: * - \link Acts::Test::BOOST_AUTO_TEST_CASE(parset_consistency_tests) @@ -89,20 +89,20 @@ class ParameterSet { static_assert(detail::are_sorted<true, true, ParID_t, params...>::value, "parameter identifiers are not sorted"); static_assert( - detail::are_within<unsigned int, 0, BoundParsDim, + detail::are_within<unsigned int, 0, eBoundParametersSize, static_cast<unsigned int>(params)...>::value, "parameter identifiers must be greater or " "equal to zero and smaller than the total number of parameters"); static_assert(NPars > 0, "number of stored parameters can not be zero"); static_assert( - NPars <= BoundParsDim, + NPars <= eBoundParametersSize, "number of stored parameters can not exceed number of total parameters"); public: // public typedefs /// matrix type for projecting full parameter vector onto local parameter /// space - using Projection_t = ActsMatrix<ParValue_t, NPars, BoundParsDim>; + using Projection_t = ActsMatrix<ParValue_t, NPars, eBoundParametersSize>; /// vector type for stored parameters using ParVector_t = ActsVector<ParValue_t, NPars>; /// type of covariance matrix @@ -269,8 +269,8 @@ class ParameterSet { */ template <ParID_t parameter> void setParameter(ParValue_t value) { - using parameter_type = typename par_type<parameter>::type; - m_vValues(getIndex<parameter>()) = parameter_type::getValue(value); + m_vValues(getIndex<parameter>()) = + BoundParameterType<parameter>::getValue(value); } /** @@ -502,10 +502,10 @@ class ParameterSet { * the sub-space * spanned by the parameters defined in this ParameterSet object. * - * @return constant matrix with @c #NPars rows and @c #Acts::BoundParsDim - * columns + * @return constant matrix with @c #NPars rows and @c + * #Acts::eBoundParametersSize columns */ - static const ActsMatrix<ParValue_t, NPars, BoundParsDim> projector() { + static const ActsMatrix<ParValue_t, NPars, eBoundParametersSize> projector() { return sProjector; } @@ -549,5 +549,5 @@ constexpr unsigned int ParameterSet<params...>::NPars; template <ParID_t... params> const typename ParameterSet<params...>::Projection_t ParameterSet<params...>::sProjector = detail::make_projection_matrix< - BoundParsDim, static_cast<unsigned int>(params)...>::init(); -} // namespace Acts \ No newline at end of file + eBoundParametersSize, static_cast<unsigned int>(params)...>::init(); +} // namespace Acts diff --git a/Core/include/Acts/EventData/SingleBoundTrackParameters.hpp b/Core/include/Acts/EventData/SingleBoundTrackParameters.hpp index 5a46dc7b29b6d8fc0e4009ca471ae9d469ce0665..ce20fb295b08ba0b402ed1d1d7aa29dd82dd7d11 100644 --- a/Core/include/Acts/EventData/SingleBoundTrackParameters.hpp +++ b/Core/include/Acts/EventData/SingleBoundTrackParameters.hpp @@ -205,7 +205,7 @@ class SingleBoundTrackParameters : public SingleTrackParameters<ChargePolicy> { template <ParID_t par> void set(const GeometryContext& gctx, ParValue_t newValue) { this->getParameterSet().template setParameter<par>(newValue); - this->updateGlobalCoordinates(gctx, typename par_type<par>::type()); + this->updateGlobalCoordinates(gctx, BoundParameterType<par>()); } /// @brief access method to the reference surface diff --git a/Core/include/Acts/EventData/SingleCurvilinearTrackParameters.hpp b/Core/include/Acts/EventData/SingleCurvilinearTrackParameters.hpp index 83fb14480a4747894ee3323b643826f55c008654..c613937168b8706e2d49b35d95b42413d9342e11 100644 --- a/Core/include/Acts/EventData/SingleCurvilinearTrackParameters.hpp +++ b/Core/include/Acts/EventData/SingleCurvilinearTrackParameters.hpp @@ -127,14 +127,14 @@ class SingleCurvilinearTrackParameters /// /// For curvilinear parameters the local parameters are forced to be /// (0,0), hence an update is an effective shift of the reference - template <ParID_t par, - std::enable_if_t<std::is_same<typename par_type<par>::type, - local_parameter>::value, - int> = 0> + template < + ParID_t par, + std::enable_if_t<std::is_same_v<BoundParameterType<par>, local_parameter>, + int> = 0> void set(const GeometryContext& gctx, ParValue_t newValue) { // set the parameter & update the new global position this->getParameterSet().template setParameter<par>(newValue); - this->updateGlobalCoordinates(gctx, typename par_type<par>::type()); + this->updateGlobalCoordinates(gctx, BoundParameterType<par>()); // recreate the surface m_upSurface = Surface::makeShared<PlaneSurface>( this->position(), this->momentum().normalized()); @@ -153,12 +153,12 @@ class SingleCurvilinearTrackParameters /// For curvilinear parameters the directional change of parameters /// causes a recalculation of the surface template <ParID_t par, - std::enable_if_t<not std::is_same<typename par_type<par>::type, - local_parameter>::value, - int> = 0> + std::enable_if_t< + not std::is_same_v<BoundParameterType<par>, local_parameter>, + int> = 0> void set(const GeometryContext& gctx, ParValue_t newValue) { this->getParameterSet().template setParameter<par>(newValue); - this->updateGlobalCoordinates(gctx, typename par_type<par>::type()); + this->updateGlobalCoordinates(gctx, BoundParameterType<par>()); // recreate the surface m_upSurface = Surface::makeShared<PlaneSurface>( this->position(), this->momentum().normalized()); @@ -183,4 +183,4 @@ class SingleCurvilinearTrackParameters private: std::shared_ptr<PlaneSurface> m_upSurface; }; -} // namespace Acts \ No newline at end of file +} // namespace Acts diff --git a/Core/include/Acts/EventData/SingleFreeParameters.hpp b/Core/include/Acts/EventData/SingleFreeParameters.hpp index def1eeba74edbf78df5629d92889a9994491ffc0..890f274b31d2c3a86b31a8d6f26271ec11a95330 100644 --- a/Core/include/Acts/EventData/SingleFreeParameters.hpp +++ b/Core/include/Acts/EventData/SingleFreeParameters.hpp @@ -7,11 +7,10 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #pragma once -// STL include(s) + #include <iomanip> #include <ostream> -// Acts includes #include "Acts/EventData/detail/coordinate_transformations.hpp" #include "Acts/Utilities/Definitions.hpp" @@ -55,7 +54,7 @@ class SingleFreeParameters { SingleFreeParameters(std::optional<CovMatrix_t> cov, const FreeVector& parValues) : m_parameters(parValues), - m_oChargePolicy((parValues(FreeParsDim - 1) > 0.) ? 1. : -1.), + m_oChargePolicy((0 < parValues(eFreeQOverP)) ? 1. : -1.), m_covariance(std::move(cov)) {} /// @brief Standard constructor for track parameters of neutral particles @@ -137,7 +136,8 @@ class SingleFreeParameters { /// /// @return Value of the requested parameter template <unsigned int par, - std::enable_if_t<par<FreeParsDim, int> = 0> ParValue_t get() const { + std::enable_if_t<par<eFreeParametersSize, int> = 0> ParValue_t get() + const { return m_parameters(par); } @@ -147,8 +147,9 @@ class SingleFreeParameters { /// retrieved /// /// @return Value of the requested parameter uncertainty - template <unsigned int par, std::enable_if_t<par<FreeParsDim, int> = 0> - ParValue_t uncertainty() const { + template <unsigned int par, + std::enable_if_t<par<eFreeParametersSize, int> = 0> ParValue_t + uncertainty() const { return std::sqrt(m_covariance->coeff(par, par)); } @@ -227,7 +228,7 @@ class SingleFreeParameters { /// @note The context is not used here but makes the API consistent with @c /// SingleCurvilinearTrackParameters and @c SingleBoundTrackParameters template <unsigned int par, - std::enable_if_t<par<FreeParsDim, int> = 0> void set( + std::enable_if_t<par<eFreeParametersSize, int> = 0> void set( const GeometryContext& /*gctx*/, ParValue_t newValue) { m_parameters(par) = newValue; } @@ -279,4 +280,4 @@ class SingleFreeParameters { std::optional<CovMatrix_t> m_covariance; ///< Covariance matrix }; -} // namespace Acts \ No newline at end of file +} // namespace Acts diff --git a/Core/include/Acts/EventData/SingleTrackParameters.hpp b/Core/include/Acts/EventData/SingleTrackParameters.hpp index 9251897a32354d8e78bd1628c02cf9ab3aba6c17..40b557dc14e7ee31d03a8b285a6792ab7fb86c6e 100644 --- a/Core/include/Acts/EventData/SingleTrackParameters.hpp +++ b/Core/include/Acts/EventData/SingleTrackParameters.hpp @@ -112,8 +112,8 @@ class SingleTrackParameters { /// @brief access track parameters /// - /// @return Eigen vector of dimension Acts::BoundParsDim with values of the - /// track parameters + /// @return Eigen vector of dimension Acts::eBoundParametersSize with values + /// of the track parameters /// (in the order as defined by the ParID_t enumeration) ParVector_t parameters() const { return getParameterSet().getParameters(); } @@ -294,4 +294,4 @@ class SingleTrackParameters { Vector3D m_vPosition; ///< 3D vector with global position Vector3D m_vMomentum; ///< 3D vector with global momentum }; -} // namespace Acts \ No newline at end of file +} // namespace Acts diff --git a/Core/include/Acts/EventData/detail/covariance_helper.hpp b/Core/include/Acts/EventData/detail/covariance_helper.hpp index 87e58c3dd83f1b600f8a22f4e0afe8e28911208d..9c21ec90cbb664694ce7124f32be62df75323253 100644 --- a/Core/include/Acts/EventData/detail/covariance_helper.hpp +++ b/Core/include/Acts/EventData/detail/covariance_helper.hpp @@ -7,8 +7,10 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. #pragma once + #include <type_traits> -#include "Acts/Utilities/detail/DefaultParameterDefinitions.hpp" + +#include "Acts/Utilities/ParameterDefinitions.hpp" namespace Acts { namespace detail { diff --git a/Core/include/Acts/EventData/detail/full_parameter_set.hpp b/Core/include/Acts/EventData/detail/full_parameter_set.hpp index 5e6574f4f322058a254cb558fbfb18902f3f7fd8..7f21a8a01527d5881812d9e4d19d0f94463c0647 100644 --- a/Core/include/Acts/EventData/detail/full_parameter_set.hpp +++ b/Core/include/Acts/EventData/detail/full_parameter_set.hpp @@ -57,7 +57,7 @@ struct full_parset { }; using type = typename converter< - typename tparam_generator<ParID_t, BoundParsDim - 1>::type>::type; + typename tparam_generator<ParID_t, eBoundParametersSize - 1>::type>::type; }; } // namespace detail /// @endcond diff --git a/Core/include/Acts/EventData/detail/residual_calculator.hpp b/Core/include/Acts/EventData/detail/residual_calculator.hpp index 3cdd686b2d7b29f7c34098c7731bcc4c59818960..b1d4f5031c5409f39da1353394b746ce6cdfc347 100644 --- a/Core/include/Acts/EventData/detail/residual_calculator.hpp +++ b/Core/include/Acts/EventData/detail/residual_calculator.hpp @@ -47,8 +47,7 @@ template <typename R, ParID_t first, ParID_t... others> struct residual_calculator_impl<R, first, others...> { static void calculate(R& result, const R& test, const R& ref, unsigned int pos) { - using parameter_type = typename par_type<first>::type; - result(pos) = parameter_type::getDifference(test(pos), ref(pos)); + result(pos) = BoundParameterType<first>::getDifference(test(pos), ref(pos)); residual_calculator_impl<R, others...>::calculate(result, test, ref, pos + 1); } @@ -58,8 +57,7 @@ template <typename R, ParID_t last> struct residual_calculator_impl<R, last> { static void calculate(R& result, const R& test, const R& ref, unsigned int pos) { - using parameter_type = typename par_type<last>::type; - result(pos) = parameter_type::getDifference(test(pos), ref(pos)); + result(pos) = BoundParameterType<last>::getDifference(test(pos), ref(pos)); } }; /// @endcond diff --git a/Core/include/Acts/EventData/detail/value_corrector.hpp b/Core/include/Acts/EventData/detail/value_corrector.hpp index ddd50d7d82de9d050caae1def5fe9532df1b42c3..db14f90445823dfea4315d53008bba27acbebc4c 100644 --- a/Core/include/Acts/EventData/detail/value_corrector.hpp +++ b/Core/include/Acts/EventData/detail/value_corrector.hpp @@ -48,7 +48,7 @@ struct value_corrector { template <typename R, ParID_t first, ParID_t... others> struct value_corrector_impl<R, first, others...> { static void calculate(R& values, unsigned int pos) { - using parameter_type = typename par_type<first>::type; + using parameter_type = BoundParameterType<first>; if (parameter_type::may_modify_value) { values(pos) = parameter_type::getValue(values(pos)); } @@ -59,7 +59,7 @@ struct value_corrector_impl<R, first, others...> { template <typename R, ParID_t last> struct value_corrector_impl<R, last> { static void calculate(R& values, unsigned int pos) { - using parameter_type = typename par_type<last>::type; + using parameter_type = BoundParameterType<last>; if (parameter_type::may_modify_value) { values(pos) = parameter_type::getValue(values(pos)); } diff --git a/Core/include/Acts/Fitter/GainMatrixUpdater.hpp b/Core/include/Acts/Fitter/GainMatrixUpdater.hpp index e31adc5fc8a361e9bf5ad106a9e5d6d10a238aed..a02b1cbe745a1099d1e7e8d89cb399a31473451b 100644 --- a/Core/include/Acts/Fitter/GainMatrixUpdater.hpp +++ b/Core/include/Acts/Fitter/GainMatrixUpdater.hpp @@ -101,13 +101,13 @@ class GainMatrixUpdater { ACTS_VERBOSE("Calibrated measurement covariance:\n" << calibrated_covariance); - const ActsMatrixD<measdim, BoundParsDim> H = + const ActsMatrixD<measdim, eBoundParametersSize> H = trackState.projector() - .template topLeftCorner<measdim, BoundParsDim>(); + .template topLeftCorner<measdim, eBoundParametersSize>(); ACTS_VERBOSE("Measurement projector H:\n" << H); - const ActsMatrixD<BoundParsDim, measdim> K = + const ActsMatrixD<eBoundParametersSize, measdim> K = predicted_covariance * H.transpose() * (H * predicted_covariance * H.transpose() + calibrated_covariance) .inverse(); diff --git a/Core/include/Acts/Propagator/AtlasStepper.hpp b/Core/include/Acts/Propagator/AtlasStepper.hpp index 36c5b9b3886c0074ddefd53e99d1d799e684c2a6..fd8841066b9d27420cd27d1ac6a03ab7db10151c 100644 --- a/Core/include/Acts/Propagator/AtlasStepper.hpp +++ b/Core/include/Acts/Propagator/AtlasStepper.hpp @@ -102,7 +102,8 @@ class AtlasStepper { // prepare the jacobian if we have a covariance if (pars.covariance()) { // copy the covariance matrix - covariance = new ActsSymMatrixD<BoundParsDim>(*pars.covariance()); + covariance = + new ActsSymMatrixD<eBoundParametersSize>(*pars.covariance()); covTransport = true; useJacobian = true; const auto transform = pars.referenceSurface().referenceFrame( @@ -262,11 +263,11 @@ class AtlasStepper { /// Cache: P[56] - P[59] // result - double parameters[BoundParsDim] = {0., 0., 0., 0., 0., 0.}; + double parameters[eBoundParametersSize] = {0., 0., 0., 0., 0., 0.}; const Covariance* covariance; Covariance cov = Covariance::Zero(); bool covTransport = false; - double jacobian[BoundParsDim * BoundParsDim]; + double jacobian[eBoundParametersSize * eBoundParametersSize]; // accummulated path length cache double pathAccumulated = 0.; @@ -501,7 +502,8 @@ class AtlasStepper { // prepare the jacobian if we have a covariance if (pars.covariance()) { // copy the covariance matrix - state.covariance = new ActsSymMatrixD<BoundParsDim>(*pars.covariance()); + state.covariance = + new ActsSymMatrixD<eBoundParametersSize>(*pars.covariance()); state.covTransport = true; state.useJacobian = true; const auto transform = pars.referenceFrame(state.geoContext); @@ -800,8 +802,8 @@ class AtlasStepper { state.jacobian[34] = P[43]; // dT/dCM state.jacobian[35] = P[51]; // dT/dT - Eigen::Map< - Eigen::Matrix<double, BoundParsDim, BoundParsDim, Eigen::RowMajor>> + Eigen::Map<Eigen::Matrix<double, eBoundParametersSize, eBoundParametersSize, + Eigen::RowMajor>> J(state.jacobian); state.cov = J * (*state.covariance) * J.transpose(); } @@ -1061,8 +1063,8 @@ class AtlasStepper { state.jacobian[34] = state.pVector[43]; // dT/dCM state.jacobian[35] = state.pVector[51]; // dT/dT - Eigen::Map< - Eigen::Matrix<double, BoundParsDim, BoundParsDim, Eigen::RowMajor>> + Eigen::Map<Eigen::Matrix<double, eBoundParametersSize, eBoundParametersSize, + Eigen::RowMajor>> J(state.jacobian); state.cov = J * (*state.covariance) * J.transpose(); } diff --git a/Core/include/Acts/Propagator/EigenStepper.ipp b/Core/include/Acts/Propagator/EigenStepper.ipp index 97329488c49c30612e67af39cf67e63e27de2e96..0a2b11c2497bb1dcffd04227fbb88d1249e03f4d 100644 --- a/Core/include/Acts/Propagator/EigenStepper.ipp +++ b/Core/include/Acts/Propagator/EigenStepper.ipp @@ -129,7 +129,8 @@ void Acts::EigenStepper<B, E, A>::covarianceTransport(State& state, // Transport the covariance ActsRowVectorD<3> normVec(state.dir); const BoundRowVector sfactors = - normVec * state.jacToGlobal.template topLeftCorner<3, BoundParsDim>(); + normVec * + state.jacToGlobal.template topLeftCorner<3, eBoundParametersSize>(); // The full jacobian is ([to local] jacobian) * ([transport] jacobian) const Jacobian jacFull = jacToCurv * (state.jacToGlobal - state.derivative * sfactors); diff --git a/Core/include/Acts/Propagator/RiddersPropagator.hpp b/Core/include/Acts/Propagator/RiddersPropagator.hpp index 01a7987200765c499f34f74aae9d774621d9da38..be6814483ba0468a5e994ad72177388d128a90e0 100644 --- a/Core/include/Acts/Propagator/RiddersPropagator.hpp +++ b/Core/include/Acts/Propagator/RiddersPropagator.hpp @@ -146,7 +146,8 @@ class RiddersPropagator { /// /// @return Propagated covariance matrix const Covariance calculateCovariance( - const std::array<std::vector<BoundVector>, BoundParsDim>& derivatives, + const std::array<std::vector<BoundVector>, eBoundParametersSize>& + derivatives, const Covariance& startCov, const std::vector<double>& deviations) const; /// @brief This function fits a linear function through the final state @@ -163,4 +164,4 @@ class RiddersPropagator { }; } // namespace Acts -#include "Acts/Propagator/RiddersPropagator.ipp" \ No newline at end of file +#include "Acts/Propagator/RiddersPropagator.ipp" diff --git a/Core/include/Acts/Propagator/RiddersPropagator.ipp b/Core/include/Acts/Propagator/RiddersPropagator.ipp index 7ce6163facbf729b92cc8c1d7c8128bafb07273b..6b782a6e52db3ed095193b469662ee278f9b9693 100644 --- a/Core/include/Acts/Propagator/RiddersPropagator.ipp +++ b/Core/include/Acts/Propagator/RiddersPropagator.ipp @@ -28,10 +28,10 @@ auto Acts::RiddersPropagator<propagator_t>::propagate( opts.pathLimit *= 2.; // Derivations of each parameter around the nominal parameters - std::array<std::vector<BoundVector>, BoundParsDim> derivatives; + std::array<std::vector<BoundVector>, eBoundParametersSize> derivatives; // Wiggle each dimension individually - for (unsigned int i = 0; i < BoundParsDim; i++) { + for (unsigned int i = 0; i < eBoundParametersSize; i++) { derivatives[i] = wiggleDimension(opts, start, i, surface, nominalParameters, deviations); } @@ -79,10 +79,10 @@ auto Acts::RiddersPropagator<propagator_t>::propagate( opts.pathLimit *= 2.; // Derivations of each parameter around the nominal parameters - std::array<std::vector<BoundVector>, BoundParsDim> derivatives; + std::array<std::vector<BoundVector>, eBoundParametersSize> derivatives; // Wiggle each dimension individually - for (unsigned int i = 0; i < BoundParsDim; i++) { + for (unsigned int i = 0; i < eBoundParametersSize; i++) { derivatives[i] = wiggleDimension(opts, start, i, target, nominalParameters, deviations); } @@ -208,8 +208,8 @@ Acts::RiddersPropagator<propagator_t>::wiggleDimension( template <typename propagator_t> auto Acts::RiddersPropagator<propagator_t>::calculateCovariance( - const std::array<std::vector<Acts::BoundVector>, Acts::BoundParsDim>& - derivatives, + const std::array<std::vector<Acts::BoundVector>, + Acts::eBoundParametersSize>& derivatives, const Acts::BoundSymMatrix& startCov, const std::vector<double>& deviations) const -> const Covariance { Jacobian jacobian; @@ -246,4 +246,4 @@ Acts::BoundVector Acts::RiddersPropagator<propagator_t>::fitLinear( BoundVector a = (C - B * b) / N; return a; -} \ No newline at end of file +} diff --git a/Core/include/Acts/Surfaces/detail/LineSurface.ipp b/Core/include/Acts/Surfaces/detail/LineSurface.ipp index 7d27e86f676d55001c9a5ee4b124dc82234f217d..0129ac6d20f82dfe0597dd62188f4c71c7c97670 100644 --- a/Core/include/Acts/Surfaces/detail/LineSurface.ipp +++ b/Core/include/Acts/Surfaces/detail/LineSurface.ipp @@ -199,15 +199,18 @@ inline const BoundRowVector LineSurface::derivativeFactors( ActsRowVectorD<3> norm_vec = direction.transpose() - long_c * locz; // calculate the s factors for the dependency on X const BoundRowVector s_vec = - norm_vec * jacobian.topLeftCorner<3, BoundParsDim>(); + norm_vec * jacobian.topLeftCorner<3, eBoundParametersSize>(); // calculate the d factors for the dependency on Tx - const BoundRowVector d_vec = locz * jacobian.block<3, BoundParsDim>(4, 0); + const BoundRowVector d_vec = + locz * jacobian.block<3, eBoundParametersSize>(4, 0); // normalisation of normal & longitudinal components double norm = 1. / (1. - long_c * long_c); // create a matrix representation - ActsMatrixD<3, BoundParsDim> long_mat = ActsMatrixD<3, BoundParsDim>::Zero(); + ActsMatrixD<3, eBoundParametersSize> long_mat = + ActsMatrixD<3, eBoundParametersSize>::Zero(); long_mat.colwise() += locz.transpose(); // build the combined normal & longitudinal components - return (norm * (s_vec - pc * (long_mat * d_vec.asDiagonal() - - jacobian.block<3, BoundParsDim>(4, 0)))); + return (norm * + (s_vec - pc * (long_mat * d_vec.asDiagonal() - + jacobian.block<3, eBoundParametersSize>(4, 0)))); } diff --git a/Core/include/Acts/Surfaces/detail/Surface.ipp b/Core/include/Acts/Surfaces/detail/Surface.ipp index e87c1a1259dac31450277d94480c87c683f34962..ac5df14bb90f0c26ba18adea53bacaf1a0812f7f 100644 --- a/Core/include/Acts/Surfaces/detail/Surface.ipp +++ b/Core/include/Acts/Surfaces/detail/Surface.ipp @@ -114,7 +114,7 @@ inline const BoundRowVector Surface::derivativeFactors( ActsRowVectorD<3> norm_vec = rft.template block<1, 3>(2, 0); norm_vec /= (norm_vec * direction); // calculate the s factors - return (norm_vec * jacobian.topLeftCorner<3, BoundParsDim>()); + return (norm_vec * jacobian.topLeftCorner<3, eBoundParametersSize>()); } inline const DetectorElementBase* Surface::associatedDetectorElement() const { diff --git a/Core/include/Acts/Utilities/Helpers.hpp b/Core/include/Acts/Utilities/Helpers.hpp index 359b2ff1bb09114d8f16a130ed62652332150632..e06ad59c73f165ddf5d5d35883ddb931f87c1e75 100644 --- a/Core/include/Acts/Utilities/Helpers.hpp +++ b/Core/include/Acts/Utilities/Helpers.hpp @@ -23,8 +23,8 @@ #include "Acts/Utilities/BinningType.hpp" #include "Acts/Utilities/Definitions.hpp" +#include "Acts/Utilities/ParameterDefinitions.hpp" #include "Acts/Utilities/TypeTraits.hpp" -#include "Acts/Utilities/detail/DefaultParameterDefinitions.hpp" #define ACTS_CHECK_BIT(value, mask) ((value & mask) == mask) diff --git a/Core/include/Acts/Utilities/ParameterDefinitions.hpp b/Core/include/Acts/Utilities/ParameterDefinitions.hpp index 0eb272ee8366c0e4909e2faa98a1e5ea67ce1337..66e78cea93e0362c054bbb38105d28ecebd5031a 100644 --- a/Core/include/Acts/Utilities/ParameterDefinitions.hpp +++ b/Core/include/Acts/Utilities/ParameterDefinitions.hpp @@ -1,54 +1,313 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project +// Copyright (C) 2016-2020 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. #pragma once -#ifdef ACTS_PARAMETER_DEFINITIONS_PLUGIN -#include ACTS_PARAMETER_DEFINITIONS_PLUGIN -#endif -/// testing requirements on parameter definitions +#include <cmath> #include <type_traits> -/// typedefs for parameter identifier and parameter value must be present -static_assert(std::is_enum<Acts::ParID_t>::value, - "'ParID_t' is not an enum type"); -static_assert(std::is_floating_point<Acts::ParValue_t>::value, - "'ParValue_t' is not floating point type"); - -/// parameter ID type must be convertible to size_t -static_assert(std::is_convertible<Acts::ParID_t, size_t>::value, - "'ParID_t' is not convertible to size_t"); - -/// number of global parameter must be at least 2 (for the two local parameters) -static_assert(Acts::BoundParsDim > 1, - "total number of global parameters must be >= 2"); - -/// several constants for the local parameters need to be defined -static_assert(Acts::eLOC_0 != Acts::eLOC_1, - "local parameters must have different IDs"); -static_assert(Acts::eLOC_R == Acts::eLOC_0 or Acts::eLOC_R == Acts::eLOC_1, - "local radius must be a local parameter"); -static_assert(Acts::eLOC_PHI == Acts::eLOC_0 or Acts::eLOC_PHI == Acts::eLOC_1, - "local phi must be a local parameter"); -static_assert(Acts::eLOC_RPHI == Acts::eLOC_0 or - Acts::eLOC_RPHI == Acts::eLOC_1, - "local r x phi must be a local parameter"); -static_assert(Acts::eLOC_Z == Acts::eLOC_0 or Acts::eLOC_Z == Acts::eLOC_1, - "local z must be a local parameter"); -static_assert(Acts::eLOC_X == Acts::eLOC_0 or Acts::eLOC_X == Acts::eLOC_1, - "local x must be a local parameter"); -static_assert(Acts::eLOC_Y == Acts::eLOC_0 or Acts::eLOC_Y == Acts::eLOC_1, - "local y must be a local parameter"); -static_assert(Acts::eLOC_D0 == Acts::eLOC_0 or Acts::eLOC_D0 == Acts::eLOC_1, - "d0 must be a local parameter"); -static_assert(Acts::eLOC_Z0 == Acts::eLOC_0 or Acts::eLOC_Z0 == Acts::eLOC_1, - "z0 must be a local parameter"); - -/// check for par_type_t definition -static_assert(sizeof(Acts::par_type_t<Acts::eLOC_0>) > 0, - "'par_type_t' is not defined"); \ No newline at end of file +#include "Acts/Utilities/Definitions.hpp" +#include "Acts/Utilities/ParameterTypes.hpp" + +// The user can override the (track) parameter ordering and underlying scalar +// type. If the variable is defined, it must point to a header file that +// contains the same enum and type definitions for bound and free track +// parameters as well as space points as given below. +#ifdef ACTS_PARAMETER_DEFINITIONS_HEADER +#include ACTS_PARAMETER_DEFINITIONS_HEADER +#else +namespace Acts { + +// Note: +// The named indices are use to access raw data vectors and matrices at the +// lowest level. Since the interpretation of some of the components, e.g. local +// position and the inverse-momentum-like component, depend on additional +// information the names have some ambiguity. This can only be resolved at a +// higher logical level and no attempt is made to resolve it here. + +/// Components of a bound track parameters vector. +/// +/// To be used to access components by named indices instead of just numbers. +/// This must be a regular `enum` and not a scoped `enum class` to allow +/// implicit conversion to an integer. The enum value are thus visible directly +/// in `namespace Acts` and are prefixed to avoid naming collisions. +enum BoundParametersIndices : unsigned int { + // Local position on the reference surface. + // This is intentionally named different from the position components in + // the other data vectors, to clarify that this is defined on a surface + // while the others are defined in free space. + eBoundLoc0 = 0, + eBoundLoc1 = 1, + // Direction angles + eBoundPhi = 2, + eBoundTheta = 3, + // Global inverse-momentum-like parameter, i.e. q/p or 1/p + // The naming is inconsistent for the case of neutral track parameters where + // the value is interpreted as 1/p not as q/p. This is intentional to avoid + // having multiple aliases for the same element and for lack of an acceptable + // common name. + eBoundQOverP = 4, + eBoundTime = 5, + // Last uninitialized value contains the total number of components + eBoundParametersSize, + // The following aliases without prefix exist for historical reasons + // Generic spatial coordinates on the local surface + eLOC_0 = eBoundLoc0, + eLOC_1 = eBoundLoc1, + // Spatial coordinates on a disk in polar coordinates + eLOC_R = eLOC_0, + eLOC_PHI = eLOC_1, + // Spatial coordinates on a disk in Cartesian coordinates + eLOC_X = eLOC_0, + eLOC_Y = eLOC_1, + // Spatial coordinates on a cylinder + eLOC_RPHI = eLOC_0, + eLOC_Z = eLOC_1, + // Closest approach coordinates on a virtual perigee surface + eLOC_D0 = eLOC_0, + eLOC_Z0 = eLOC_1, + // Direction angles + ePHI = eBoundPhi, + eTHETA = eBoundTheta, + eQOP = eBoundQOverP, + eT = eBoundTime, +}; + +/// Components of a free track parameters vector. +/// +/// To be used to access components by named indices instead of just numbers. +/// This must be a regular `enum` and not a scoped `enum class` to allow +/// implicit conversion to an integer. The enum value are thus visible directly +/// in `namespace Acts` and are prefixed to avoid naming collisions. +enum FreeParametersIndices : unsigned int { + // Spatial position + // The spatial position components must be stored as one continous block. + eFreePos0 = 0u, + eFreePos1 = eFreePos0 + 1u, + eFreePos2 = eFreePos0 + 2u, + // Time + eFreeTime = 3u, + // (Unit) direction + // The direction components must be stored as one continous block. + eFreeDir0 = 4u, + eFreeDir1 = eFreeDir0 + 1u, + eFreeDir2 = eFreeDir0 + 2u, + // Global inverse-momentum-like parameter, i.e. q/p or 1/p + // See BoundParametersIndices for further information + eFreeQOverP = 7u, + // Last uninitialized value contains the total number of components + eFreeParametersSize, +}; + +/// Components of a space point vector. +/// +/// To be used to access components by named indices instead of just numbers. +/// This must be a regular `enum` and not a scoped `enum class` to allow +/// implicit conversion to an integer. The enum value are thus visible directly +/// in `namespace Acts` and are prefixed to avoid naming collisions. +/// +/// Within the same context either the position-like or the momentum-like +/// indices must be used exclusively. +enum SpacePointIndices : unsigned int { + // For position four-vectors + // The spatial position components must be stored as one continous block. + eSpacePos0 = 0u, + eSpacePos1 = eSpacePos0 + 1u, + eSpacePos2 = eSpacePos0 + 2u, + eSpaceTime = 3u, + // Last uninitialized value contains the total number of components + eSpacePointSize, + // Aliases for momentum four-vectors to allow clearer code + eSpaceMom0 = eSpacePos0, + eSpaceMom1 = eSpacePos1, + eSpaceMom2 = eSpacePos2, + eSpaceEnergy = eSpaceTime, +}; + +/// Underlying fundamental scalar type for bound track parameters. +using BoundParametersScalar = double; +/// Underlying fundamental scalar type for free track parameters. +using FreeParametersScalar = double; +/// Underlying fundamental scalar type for space points. +using SpacePointScalar = double; + +} // namespace Acts +#endif + +namespace Acts { + +// Ensure bound track parameters definition is valid. +static_assert(std::is_enum_v<BoundParametersIndices>, + "'BoundParametersIndices' must be an enum type"); +static_assert(std::is_convertible_v<BoundParametersIndices, size_t>, + "'BoundParametersIndices' must be convertible to size_t"); +static_assert(2 <= BoundParametersIndices::eBoundParametersSize, + "Bound track parameters must have at least two components"); +static_assert(std::is_floating_point_v<BoundParametersScalar>, + "'BoundParametersScalar' must be a floating point type"); + +// Ensure free track parameters definition is valid. +static_assert(std::is_enum_v<FreeParametersIndices>, + "'FreeParametersIndices' must be an enum type"); +static_assert(std::is_convertible_v<FreeParametersIndices, size_t>, + "'FreeParametersIndices' must be convertible to size_t"); +static_assert(6 <= FreeParametersIndices::eFreeParametersSize, + "Free track parameters must have at least six components"); +static_assert(std::is_floating_point_v<FreeParametersScalar>, + "'FreeParametersScalar' must be a floating point type"); + +// Ensure space point definition is valid. +static_assert(std::is_enum_v<SpacePointIndices>, + "'SpacePointIndices' is not an enum type"); +static_assert(std::is_convertible_v<SpacePointIndices, size_t>, + "'SpacePointIndices' is not convertible to size_t"); +static_assert(3 <= SpacePointIndices::eSpacePointSize, + "Space points must have at least three components"); +static_assert(std::is_floating_point_v<SpacePointScalar>, + "'SpacePointScalar' must be a floating point type"); + +// Ensure bound track parameter components/ indices are consistently defined. +static_assert(eLOC_0 != eLOC_1, "Local parameters must be differents"); +static_assert(eLOC_R == eLOC_0 or eLOC_R == eLOC_1, + "Local radius must be a local parameter"); +static_assert(eLOC_PHI == eLOC_0 or eLOC_PHI == eLOC_1, + "Local phi must be a local parameter"); +static_assert(eLOC_RPHI == eLOC_0 or eLOC_RPHI == eLOC_1, + "Local r*phi must be a local parameter"); +static_assert(eLOC_Z == eLOC_0 or eLOC_Z == eLOC_1, + "Local z must be a local parameter"); +static_assert(eLOC_X == eLOC_0 or eLOC_X == eLOC_1, + "Local x must be a local parameter"); +static_assert(eLOC_Y == eLOC_0 or eLOC_Y == eLOC_1, + "Local y must be a local parameter"); +static_assert(eLOC_D0 == eLOC_0 or eLOC_D0 == eLOC_1, + "D0 must be a local parameter"); +static_assert(eLOC_Z0 == eLOC_0 or eLOC_Z0 == eLOC_1, + "Z0 must be a local parameter"); + +// Ensure free track parameter components/ indices are consistently defined. +static_assert(eFreePos1 == eFreePos0 + 1u, "Position must be continous"); +static_assert(eFreePos2 == eFreePos0 + 2u, "Position must be continous"); +static_assert(eFreeDir1 == eFreeDir0 + 1u, "Direction must be continous"); +static_assert(eFreeDir2 == eFreeDir0 + 2u, "Direction must be continous"); + +// Ensure space point components/ indices are consistently defined. +static_assert(eSpacePos1 == eSpacePos0 + 1u, "Position must be continous"); +static_assert(eSpacePos2 == eSpacePos0 + 2u, "Position must be continous"); +static_assert(eSpacePos0 == eSpaceMom0, "Inconsisten position and momentum"); +static_assert(eSpacePos1 == eSpaceMom1, "Inconsisten position and momentum"); +static_assert(eSpacePos2 == eSpaceMom2, "Inconsisten position and momentum"); +static_assert(eSpaceTime == eSpaceEnergy, "Inconsistent time and energy"); + +namespace detail { +template <BoundParametersIndices> +struct BoundParameterTraits; +template <> +struct BoundParameterTraits<BoundParametersIndices::eBoundLoc0> { + using type = local_parameter; +}; +template <> +struct BoundParameterTraits<BoundParametersIndices::eBoundLoc1> { + using type = local_parameter; +}; +template <> +struct BoundParameterTraits<BoundParametersIndices::eBoundPhi> { + static constexpr double pMin() { return -M_PI; } + static constexpr double pMax() { return M_PI; } + using type = cyclic_parameter<double, pMin, pMax>; +}; +template <> +struct BoundParameterTraits<BoundParametersIndices::eBoundTheta> { + static constexpr double pMin() { return 0; } + static constexpr double pMax() { return M_PI; } + using type = bound_parameter<double, pMin, pMax>; +}; +template <> +struct BoundParameterTraits<BoundParametersIndices::eBoundQOverP> { + using type = unbound_parameter; +}; +template <> +struct BoundParameterTraits<BoundParametersIndices::eBoundTime> { + using type = unbound_parameter; +}; +} // namespace detail + +/// Single bound track parameter type for value constrains. +/// +/// The singular name is not a typo since this describes individual components. +template <BoundParametersIndices kIndex> +using BoundParameterType = typename detail::BoundParameterTraits<kIndex>::type; + +// The following matrix and vector types are automatically derived from the +// indices enums and scalar typedefs. + +// Matrix and vector types related to bound track parameters. + +using BoundVector = ActsVector<BoundParametersScalar, eBoundParametersSize>; +using BoundRowVector = + ActsRowVector<BoundParametersScalar, eBoundParametersSize>; +using BoundMatrix = ActsMatrix<BoundParametersScalar, eBoundParametersSize, + eBoundParametersSize>; +using BoundSymMatrix = + ActsSymMatrix<BoundParametersScalar, eBoundParametersSize>; + +// Matrix and vector types related to free track parameters. + +using FreeVector = ActsVector<FreeParametersScalar, eFreeParametersSize>; +using FreeRowVector = ActsRowVector<FreeParametersScalar, eFreeParametersSize>; +using FreeMatrix = + ActsMatrix<FreeParametersScalar, eFreeParametersSize, eFreeParametersSize>; +using FreeSymMatrix = ActsSymMatrix<FreeParametersScalar, eFreeParametersSize>; + +// Matrix and vector types related to space points. + +using SpacePointVector = ActsVector<SpacePointScalar, eSpacePointSize>; +using SpacePointRowVector = ActsRowVector<SpacePointScalar, eSpacePointSize>; +using SpacePointSymMatrix = + ActsMatrix<SpacePointScalar, eSpacePointSize, eSpacePointSize>; +using SpacePointSymMatrix = ActsSymMatrix<SpacePointScalar, eSpacePointSize>; + +// Mapping to bound track parameters. +// +// Assumes that matrices represent maps from another space into the space of +// bound track parameters. Thus, the bound parameters scalar type is sufficient +// to retain accuracy. + +using FreeToBoundMatrix = ActsMatrix<BoundParametersScalar, + eBoundParametersSize, eFreeParametersSize>; +using SpacePointToBoundMatrix = + ActsMatrix<BoundParametersScalar, eBoundParametersSize, eSpacePointSize>; + +// Mapping to free track parameters. +// +// Assumes that matrices represent maps from another space into the space of +// free track parameters. Thus, the free parameters scalar type is sufficient +// to retain accuracy. + +using BoundToFreeMatrix = + ActsMatrix<FreeParametersScalar, eFreeParametersSize, eBoundParametersSize>; +using SpacePointToFreeMatrix = + ActsMatrix<FreeParametersScalar, eFreeParametersSize, eSpacePointSize>; + +// Mapping to space points. +// +// Assumes that matrices represent maps from another space into the space point +// space. Thus, the space point scalar type is sufficient to retain accuracy. + +using BoundToSpacePointMatrix = + ActsMatrix<SpacePointScalar, eSpacePointSize, eBoundParametersSize>; +using FreeToSpacePointMatrix = + ActsMatrix<SpacePointScalar, eSpacePointSize, eFreeParametersSize>; + +// For backward compatibility. New code must use the more explicit +// `BoundParameters{Indices,Scalar,Traits}...` types. +using ParDef = BoundParametersIndices; +using ParID_t = BoundParametersIndices; +using ParValue_t = BoundParametersScalar; + +} // namespace Acts diff --git a/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp b/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp deleted file mode 100644 index 4663c06acccfa79aa1243cb8c72845a8f0039ede..0000000000000000000000000000000000000000 --- a/Core/include/Acts/Utilities/detail/DefaultParameterDefinitions.hpp +++ /dev/null @@ -1,138 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2016-2019 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once -// STL include(s) -#include <cmath> - -// Acts includes -#include "Acts/Utilities/Definitions.hpp" -#include "Acts/Utilities/ParameterTypes.hpp" - -namespace Acts { -enum ParDef : unsigned int { - eLOC_0 = 0, ///< first coordinate in local surface frame - eLOC_1 = 1, ///< second coordinate in local surface frame - eLOC_R = eLOC_0, - eLOC_PHI = eLOC_1, - eLOC_RPHI = eLOC_0, - eLOC_Z = eLOC_1, - eLOC_X = eLOC_0, - eLOC_Y = eLOC_1, - eLOC_D0 = eLOC_0, - eLOC_Z0 = eLOC_1, - ePHI = 2, ///< phi direction of momentum in global frame - eTHETA = 3, ///< theta direction of momentum in global frame - eQOP = 4, ///< charge/momentum for charged tracks, for neutral tracks it is - /// 1/momentum - eT = 5, /// < The time of the particle - BoundParsDim /// < The local dimensions -}; - -/// The dimensions of tracks in free coordinates -constexpr unsigned int FreeParsDim = 8; - -/// The dimension of a space point -constexpr unsigned int SpacePointDim = 4; - -using ParID_t = ParDef; -using ParValue_t = double; - -/// -/// Type namings with bound parameters -/// - -/// Vector of bound parameters -using BoundVector = ActsVector<ParValue_t, BoundParsDim>; -/// Row vector of bound parameters -using BoundRowVector = ActsRowVector<ParValue_t, BoundParsDim>; -/// Matrix of bound-to-bound parameters -using BoundMatrix = ActsMatrix<ParValue_t, BoundParsDim, BoundParsDim>; -/// Symmetrical matrix of bound-to-bound parameters -using BoundSymMatrix = ActsSymMatrix<ParValue_t, BoundParsDim>; - -/// -/// Type naming with free parameters -/// - -/// Vector of free track parameters -using FreeVector = ActsVector<ParValue_t, FreeParsDim>; -/// Matrix of free-to-free parameters -using FreeMatrix = ActsMatrix<ParValue_t, FreeParsDim, FreeParsDim>; -/// Symmetrical matrix of free-to-free parameters -using FreeSymMatrix = ActsSymMatrix<ParValue_t, FreeParsDim>; - -/// -/// Type namings with bound & free parameters -/// - -/// Matrix of bound-to-free parameters -using BoundToFreeMatrix = ActsMatrix<ParValue_t, FreeParsDim, BoundParsDim>; -/// Matrix of free-to-bound parameters -using FreeToBoundMatrix = ActsMatrix<ParValue_t, BoundParsDim, FreeParsDim>; - -/// -/// Type namings with space points -/// - -/// Vector with space point parameters -using SpacePointVector = ActsVector<ParValue_t, SpacePointDim>; -/// Symmetrical matrix of space point-to-space point -using SpacePointSymMatrix = ActsSymMatrix<ParValue_t, SpacePointDim>; - -/// -/// Type namings with space points & bound parameters -/// - -/// Matrix of space point-to-bound parameters -using SpacePointToBoundMatrix = - ActsMatrix<ParValue_t, BoundParsDim, SpacePointDim>; -/// Matrix with bound parameters-to-space point -using BoundToSpacePointMatrix = - ActsMatrix<ParValue_t, SpacePointDim, BoundParsDim>; - -template <ParID_t> -struct par_type; - -template <ParID_t par> -using par_type_t = typename par_type<par>::type; - -template <> -struct par_type<ParDef::eLOC_0> { - using type = local_parameter; -}; - -template <> -struct par_type<ParDef::eLOC_1> { - using type = local_parameter; -}; - -template <> -struct par_type<ParDef::ePHI> { - static constexpr double pMin() { return -M_PI; } - static constexpr double pMax() { return M_PI; } - using type = cyclic_parameter<double, pMin, pMax>; -}; - -template <> -struct par_type<ParDef::eTHETA> { - static constexpr double pMin() { return 0; } - static constexpr double pMax() { return M_PI; } - using type = bound_parameter<double, pMin, pMax>; -}; - -template <> -struct par_type<ParDef::eQOP> { - using type = unbound_parameter; -}; - -template <> -struct par_type<ParDef::eT> { - using type = unbound_parameter; -}; -} // namespace Acts \ No newline at end of file diff --git a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp index 5ee028ada573aca71bc4593de3c2c2ab01929119..00f79b1c9f5a32690e102aa121d75df09b7fb7cd 100644 --- a/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp +++ b/Core/include/Acts/Vertexing/FullBilloirVertexFitter.ipp @@ -29,8 +29,8 @@ struct BilloirTrack { const input_track_t* originalTrack; Acts::LinearizedTrack linTrack; double chi2; - Jacobian DiMat; // position jacobian - Acts::ActsMatrixD<Acts::BoundParsDim, 3> EiMat; // momentum jacobian + Jacobian DiMat; // position jacobian + Acts::ActsMatrixD<Acts::eBoundParametersSize, 3> EiMat; // momentum jacobian Acts::ActsSymMatrixD<3> CiMat; // = EtWmat * Emat (see below) Acts::ActsMatrixD<4, 3> BiMat; // = DiMat^T * Wi * EiMat Acts::ActsSymMatrixD<3> CiInv; // = (EiMat^T * Wi * EiMat)^-1 @@ -141,11 +141,11 @@ Acts::FullBilloirVertexFitter<input_track_t, linearizer_t>::fit( Dmat = linTrack.positionJacobian; // momentum jacobian (E matrix) - ActsMatrixD<BoundParsDim, 3> Emat; + ActsMatrixD<eBoundParametersSize, 3> Emat; Emat = linTrack.momentumJacobian; // cache some matrix multiplications BoundToSpacePointMatrix DtWmat; - ActsMatrixD<3, BoundParsDim> EtWmat; + ActsMatrixD<3, eBoundParametersSize> EtWmat; BoundSymMatrix Wi = linTrack.weightAtPCA; DtWmat = Dmat.transpose() * Wi; @@ -232,7 +232,7 @@ Acts::FullBilloirVertexFitter<input_track_t, linearizer_t>::fit( // calculate 5x5 covdelta_P matrix // d(d0,z0,phi,theta,qOverP, t)/d(x,y,z,phi,theta,qOverP, // t)-transformation matrix - ActsMatrixD<BoundParsDim, 7> transMat; + ActsMatrixD<eBoundParametersSize, 7> transMat; transMat.setZero(); transMat(0, 0) = bTrack.DiMat(0, 0); transMat(0, 1) = bTrack.DiMat(0, 1); diff --git a/Core/include/Acts/Vertexing/HelicalTrackLinearizer.ipp b/Core/include/Acts/Vertexing/HelicalTrackLinearizer.ipp index 4f75c4c9581069e74697e1582570ffc16c13e52c..9b5989a00945adb9e2662f33dba3a01c52cce9a3 100644 --- a/Core/include/Acts/Vertexing/HelicalTrackLinearizer.ipp +++ b/Core/include/Acts/Vertexing/HelicalTrackLinearizer.ipp @@ -131,7 +131,7 @@ Acts::Result<Acts::LinearizedTrack> Acts:: positionJacobian(5, 3) = 1; // Fill momentum jacobian (E_k matrix), Eq. 5.37 in Ref(1) - ActsMatrixD<BoundParsDim, 3> momentumJacobian; + ActsMatrixD<eBoundParametersSize, 3> momentumJacobian; momentumJacobian.setZero(); double R = X * cosPhiV + Y * sinPhiV; diff --git a/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.hpp b/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.hpp index b069b2bb50c6398874a93febd9695959231ae24a..6be0a73461808be5b537e405f347230a55c1d131 100644 --- a/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.hpp +++ b/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.hpp @@ -41,7 +41,7 @@ namespace detail { /// @param newTrkParams New track parameter BoundMatrix createFullTrackCovariance( const ActsSymMatrixD<3>& sMat, - const ActsMatrixD<SpacePointDim, 3>& newTrkCov, + const ActsMatrixD<eSpacePointSize, 3>& newTrkCov, const SpacePointSymMatrix& vtxWeight, const SpacePointSymMatrix& vtxCov, const BoundVector& newTrkParams); @@ -50,4 +50,4 @@ BoundMatrix createFullTrackCovariance( } // Namespace KalmanVertexTrackUpdater } // Namespace Acts -#include "Acts/Vertexing/KalmanVertexTrackUpdater.ipp" \ No newline at end of file +#include "Acts/Vertexing/KalmanVertexTrackUpdater.ipp" diff --git a/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp b/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp index 2e28a2c3fee0293595f464af68aac0a8c365c1d8..6dba0d9ae3a41da14d96d164157a3a1a7f001c8b 100644 --- a/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp +++ b/Core/include/Acts/Vertexing/KalmanVertexTrackUpdater.ipp @@ -84,8 +84,8 @@ void Acts::KalmanVertexTrackUpdater::update(const GeometryContext& gctx, // Not yet 4d ready. This can be removed together will all head<> statements, // once time is consistently introduced to vertexing - ActsMatrixD<SpacePointDim, 3> newFullTrkCov( - ActsMatrixD<SpacePointDim, 3>::Zero()); + ActsMatrixD<eSpacePointSize, 3> newFullTrkCov( + ActsMatrixD<eSpacePointSize, 3>::Zero()); newFullTrkCov.block<3, 3>(0, 0) = newTrkCov; SpacePointSymMatrix vtxFullWeight(SpacePointSymMatrix::Zero()); @@ -116,7 +116,7 @@ void Acts::KalmanVertexTrackUpdater::update(const GeometryContext& gctx, Acts::BoundMatrix Acts::KalmanVertexTrackUpdater::detail::createFullTrackCovariance( const ActsSymMatrixD<3>& sMat, - const ActsMatrixD<SpacePointDim, 3>& newTrkCov, + const ActsMatrixD<eSpacePointSize, 3>& newTrkCov, const SpacePointSymMatrix& vtxWeight, const SpacePointSymMatrix& vtxCov, const BoundVector& newTrkParams) { // Now new momentum covariance diff --git a/Core/include/Acts/Vertexing/LinearizedTrack.hpp b/Core/include/Acts/Vertexing/LinearizedTrack.hpp index 5facd966b68e09b7dc25a88870bf9c4abd044b40..6e26ff03507b53f88edb9c8eee4930f1b83825d6 100644 --- a/Core/include/Acts/Vertexing/LinearizedTrack.hpp +++ b/Core/include/Acts/Vertexing/LinearizedTrack.hpp @@ -49,7 +49,7 @@ struct LinearizedTrack { const BoundSymMatrix& parWeightAtPCA, const SpacePointVector& linPoint, const SpacePointToBoundMatrix& posJacobian, - const ActsMatrixD<BoundParsDim, 3>& momJacobian, + const ActsMatrixD<eBoundParametersSize, 3>& momJacobian, const SpacePointVector& position, const Vector3D& momentum, const BoundVector& constTerm) : parametersAtPCA(paramsAtPCA), @@ -67,8 +67,8 @@ struct LinearizedTrack { BoundSymMatrix weightAtPCA{BoundSymMatrix::Zero()}; SpacePointVector linearizationPoint{SpacePointVector::Zero()}; SpacePointToBoundMatrix positionJacobian{SpacePointToBoundMatrix::Zero()}; - ActsMatrixD<BoundParsDim, 3> momentumJacobian{ - ActsMatrixD<BoundParsDim, 3>::Zero()}; + ActsMatrixD<eBoundParametersSize, 3> momentumJacobian{ + ActsMatrixD<eBoundParametersSize, 3>::Zero()}; SpacePointVector positionAtPCA{SpacePointVector::Zero()}; Vector3D momentumAtPCA{Vector3D::Zero()}; BoundVector constantTerm{BoundVector::Zero()}; diff --git a/Core/src/Propagator/StraightLineStepper.cpp b/Core/src/Propagator/StraightLineStepper.cpp index d874fe7edbfd1be2b303e8597adbf4dc9c6b9263..6c7bbfe3ee262e38652ac410ea530bb85321bd87 100644 --- a/Core/src/Propagator/StraightLineStepper.cpp +++ b/Core/src/Propagator/StraightLineStepper.cpp @@ -122,7 +122,8 @@ void StraightLineStepper::covarianceTransport(State& state, // Transport the covariance ActsRowVectorD<3> normVec(state.dir); const BoundRowVector sfactors = - normVec * state.jacToGlobal.template topLeftCorner<3, BoundParsDim>(); + normVec * + state.jacToGlobal.template topLeftCorner<3, eBoundParametersSize>(); // The full jacobian is ([to local] jacobian) * ([transport] jacobian) const Jacobian jacFull = jacToCurv * (state.jacToGlobal - state.derivative * sfactors); @@ -192,4 +193,4 @@ void StraightLineStepper::covarianceTransport(State& state, // Store The global and bound jacobian (duplication for the moment) state.jacobian = jacFull * state.jacobian; } -} // namespace Acts \ No newline at end of file +} // namespace Acts diff --git a/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp b/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp index 6ee55462c38f3e25f5510a780bddcd21d154ce78..983c310d9dff42fefe7ee0e363990395fc353dca 100644 --- a/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp +++ b/Tests/UnitTests/Core/EventData/MeasurementHelpersTests.cpp @@ -93,31 +93,27 @@ BOOST_AUTO_TEST_CASE(MinimalSourceLinkTest) { BOOST_AUTO_TEST_CASE(visit_measurement_test) { // Overallocated full size parameter vector and covariance - ActsVectorD<BoundParsDim> parFull; - parFull.setRandom(); - - ActsSymMatrixD<BoundParsDim> covFull; - covFull.setRandom(); - + BoundVector parFull = BoundVector::Random(); + BoundMatrix covFull = BoundMatrix::Random(); + // constant variants const auto& parFullConst = parFull; const auto& covFullConst = covFull; - for (size_t i = 1; i <= BoundParsDim; i++) { - visit_measurement(parFull, covFull, i, [&](auto param, auto cov) { - BOOST_CHECK_EQUAL(param, parFull.head(i)); - BOOST_CHECK_EQUAL(cov, covFull.topLeftCorner(i, i)); + for (BoundVector::Index dim = 1; dim <= parFull.size(); ++dim) { + visit_measurement(parFull, covFull, dim, [&](auto param, auto cov) { + BOOST_CHECK_EQUAL(param, parFull.head(dim)); + BOOST_CHECK_EQUAL(cov, covFull.topLeftCorner(dim, dim)); }); - - visit_measurement( - parFullConst, covFullConst, i, [&](const auto param, const auto cov) { - BOOST_CHECK_EQUAL(param, parFullConst.head(i)); - BOOST_CHECK_EQUAL(cov, covFullConst.topLeftCorner(i, i)); - }); - - visit_measurement(parFull, covFull, i, - [&](const auto param, const auto cov) { - BOOST_CHECK_EQUAL(param, parFull.head(i)); - BOOST_CHECK_EQUAL(cov, covFull.topLeftCorner(i, i)); + visit_measurement(parFull, covFull, dim, + [&](const auto& param, const auto& cov) { + BOOST_CHECK_EQUAL(param, parFull.head(dim)); + BOOST_CHECK_EQUAL(cov, covFull.topLeftCorner(dim, dim)); + }); + visit_measurement(parFullConst, covFullConst, dim, + [&](const auto& param, const auto& cov) { + BOOST_CHECK_EQUAL(param, parFullConst.head(dim)); + BOOST_CHECK_EQUAL(cov, + covFullConst.topLeftCorner(dim, dim)); }); } } diff --git a/Tests/UnitTests/Core/EventData/ParameterSetTests.cpp b/Tests/UnitTests/Core/EventData/ParameterSetTests.cpp index d19cbb8579b772e09043d1cc66b4e4c47a897c04..898db7f283ef288f7cdee8ae109cd512e44aacb5 100644 --- a/Tests/UnitTests/Core/EventData/ParameterSetTests.cpp +++ b/Tests/UnitTests/Core/EventData/ParameterSetTests.cpp @@ -49,16 +49,16 @@ double get_cyclic_difference(double a, double b, double min, double max) { } void check_residuals_for_bound_parameters() { - const double max = par_type_t<ParID_t::eTHETA>::max; - const double min = par_type_t<ParID_t::eTHETA>::min; + const double max = BoundParameterType<eBoundTheta>::max; + const double min = BoundParameterType<eBoundTheta>::min; double theta_1 = 0.7 * M_PI; double theta_2 = 0.4 * M_PI; ActsVectorD<1> dTheta; dTheta << (theta_1 - theta_2); // both parameters inside bounds, difference is positive - ParameterSet<ParID_t::eTHETA> bound1(std::nullopt, theta_1); - ParameterSet<ParID_t::eTHETA> bound2(std::nullopt, theta_2); + ParameterSet<eBoundTheta> bound1(std::nullopt, theta_1); + ParameterSet<eBoundTheta> bound2(std::nullopt, theta_2); CHECK_CLOSE_REL(bound1.residual(bound2), dTheta, tol); // both parameters inside bound, difference negative @@ -67,7 +67,7 @@ void check_residuals_for_bound_parameters() { // one parameter above upper bound, difference positive theta_1 = max + 1; - bound1.setParameter<ParID_t::eTHETA>(theta_1); + bound1.setParameter<eBoundTheta>(theta_1); dTheta << max - theta_2; CHECK_CLOSE_REL(bound1.residual(bound2), dTheta, tol); @@ -77,7 +77,7 @@ void check_residuals_for_bound_parameters() { // one parameter below lower bound, difference positive theta_1 = min - 1; - bound1.setParameter<ParID_t::eTHETA>(theta_1); + bound1.setParameter<eBoundTheta>(theta_1); dTheta << theta_2 - min; CHECK_CLOSE_REL(bound2.residual(bound1), dTheta, tol); @@ -88,22 +88,22 @@ void check_residuals_for_bound_parameters() { // both parameters outside bounds, both below theta_1 = min - 1; theta_2 = min - 2; - bound1.setParameter<ParID_t::eTHETA>(theta_1); - bound2.setParameter<ParID_t::eTHETA>(theta_2); + bound1.setParameter<eBoundTheta>(theta_1); + bound2.setParameter<eBoundTheta>(theta_2); CHECK_SMALL(bound1.residual(bound2), tol); // both parameters outside bounds, both above theta_1 = max + 1; theta_2 = max + 2; - bound1.setParameter<ParID_t::eTHETA>(theta_1); - bound2.setParameter<ParID_t::eTHETA>(theta_2); + bound1.setParameter<eBoundTheta>(theta_1); + bound2.setParameter<eBoundTheta>(theta_2); CHECK_SMALL(bound1.residual(bound2), tol); // both parameters outside bounds, one above, one below theta_1 = max + 1; theta_2 = min - 2; - bound1.setParameter<ParID_t::eTHETA>(theta_1); - bound2.setParameter<ParID_t::eTHETA>(theta_2); + bound1.setParameter<eBoundTheta>(theta_1); + bound2.setParameter<eBoundTheta>(theta_2); dTheta << max - min; CHECK_CLOSE_REL(bound1.residual(bound2), dTheta, tol); dTheta << min - max; @@ -111,16 +111,16 @@ void check_residuals_for_bound_parameters() { } void check_residuals_for_cyclic_parameters() { - const double max = par_type_t<ParID_t::ePHI>::max; - const double min = par_type_t<ParID_t::ePHI>::min; + const double max = BoundParameterType<eBoundPhi>::max; + const double min = BoundParameterType<eBoundPhi>::min; double phi_1 = 0.7 * M_PI; double phi_2 = 0.4 * M_PI; ActsVectorD<1> dPhi; dPhi << (phi_1 - phi_2); - ParameterSet<ParID_t::ePHI> cyclic1(std::nullopt, phi_1); - ParameterSet<ParID_t::ePHI> cyclic2(std::nullopt, phi_2); + ParameterSet<eBoundPhi> cyclic1(std::nullopt, phi_1); + ParameterSet<eBoundPhi> cyclic2(std::nullopt, phi_2); // no boundary crossing, difference is positive CHECK_CLOSE_REL(cyclic1.residual(cyclic2), dPhi, tol); @@ -130,7 +130,7 @@ void check_residuals_for_cyclic_parameters() { // forward boundary crossing phi_1 = -0.9 * M_PI; - cyclic1.setParameter<ParID_t::ePHI>(phi_1); + cyclic1.setParameter<eBoundPhi>(phi_1); dPhi << get_cyclic_difference(phi_1, phi_2, min, max); CHECK_CLOSE_REL(cyclic1.residual(cyclic2), dPhi, tol); CHECK_CLOSE_REL(cyclic2.residual(cyclic1), -dPhi, tol); @@ -138,8 +138,8 @@ void check_residuals_for_cyclic_parameters() { // backward boundary crossing phi_1 = 0.7 * M_PI; phi_2 = -0.9 * M_PI; - cyclic1.setParameter<ParID_t::ePHI>(phi_1); - cyclic2.setParameter<ParID_t::ePHI>(phi_2); + cyclic1.setParameter<eBoundPhi>(phi_1); + cyclic2.setParameter<eBoundPhi>(phi_2); dPhi << get_cyclic_difference(phi_1, phi_2, min, max); CHECK_CLOSE_REL(cyclic1.residual(cyclic2), dPhi, tol); CHECK_CLOSE_REL(cyclic2.residual(cyclic1), -dPhi, tol); @@ -150,10 +150,10 @@ void random_residual_tests() { std::default_random_engine e; std::uniform_real_distribution<float> uniform_dist(-1000, 300); - const double theta_max = par_type_t<ParID_t::eTHETA>::max; - const double theta_min = par_type_t<ParID_t::eTHETA>::min; - const double phi_max = par_type_t<ParID_t::ePHI>::max; - const double phi_min = par_type_t<ParID_t::ePHI>::min; + const double theta_max = BoundParameterType<eBoundTheta>::max; + const double theta_min = BoundParameterType<eBoundTheta>::min; + const double phi_max = BoundParameterType<eBoundPhi>::max; + const double phi_min = BoundParameterType<eBoundPhi>::min; BoundVector parValues_1; BoundVector parValues_2; @@ -242,7 +242,7 @@ void random_residual_tests() { */ BOOST_AUTO_TEST_CASE(parset_consistency_tests) { // check template parameter based information - BOOST_CHECK((ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1>::size() == 2)); + BOOST_CHECK((ParameterSet<eBoundLoc0, eBoundLoc1>::size() == 2)); // covariance matrix ActsSymMatrixD<3> cov; @@ -256,42 +256,39 @@ BOOST_AUTO_TEST_CASE(parset_consistency_tests) { ActsVectorD<3> parValues(loc0, loc1, phi); // parameter set with covariance matrix - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> parSet_with_cov( - cov, loc0, loc1, phi); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> parSet_with_cov(cov, loc0, + loc1, phi); // check number and type of stored parameters BOOST_CHECK(parSet_with_cov.size() == 3); - BOOST_CHECK(parSet_with_cov.contains<ParID_t::eLOC_0>()); - BOOST_CHECK(parSet_with_cov.contains<ParID_t::eLOC_1>()); - BOOST_CHECK(parSet_with_cov.contains<ParID_t::ePHI>()); - BOOST_CHECK(not parSet_with_cov.contains<ParID_t::eTHETA>()); - BOOST_CHECK(not parSet_with_cov.contains<ParID_t::eQOP>()); - BOOST_CHECK(not parSet_with_cov.contains<ParID_t::eT>()); + BOOST_CHECK(parSet_with_cov.contains<eBoundLoc0>()); + BOOST_CHECK(parSet_with_cov.contains<eBoundLoc1>()); + BOOST_CHECK(parSet_with_cov.contains<eBoundPhi>()); + BOOST_CHECK(not parSet_with_cov.contains<eBoundTheta>()); + BOOST_CHECK(not parSet_with_cov.contains<eBoundQOverP>()); + BOOST_CHECK(not parSet_with_cov.contains<eBoundTime>()); // check stored parameter values - BOOST_CHECK(parSet_with_cov.getParameter<ParID_t::eLOC_0>() == loc0); - BOOST_CHECK(parSet_with_cov.getParameter<ParID_t::eLOC_1>() == loc1); - BOOST_CHECK(parSet_with_cov.getParameter<ParID_t::ePHI>() == phi); + BOOST_CHECK(parSet_with_cov.getParameter<eBoundLoc0>() == loc0); + BOOST_CHECK(parSet_with_cov.getParameter<eBoundLoc1>() == loc1); + BOOST_CHECK(parSet_with_cov.getParameter<eBoundPhi>() == phi); BOOST_CHECK(parSet_with_cov.getParameters() == parValues); // check stored covariance BOOST_CHECK(parSet_with_cov.getCovariance()); BOOST_CHECK(*parSet_with_cov.getCovariance() == cov); - BOOST_CHECK(parSet_with_cov.getUncertainty<ParID_t::eLOC_0>() == - sqrt(cov(0, 0))); - BOOST_CHECK(parSet_with_cov.getUncertainty<ParID_t::eLOC_1>() == - sqrt(cov(1, 1))); - BOOST_CHECK(parSet_with_cov.getUncertainty<ParID_t::ePHI>() == - sqrt(cov(2, 2))); + BOOST_CHECK(parSet_with_cov.getUncertainty<eBoundLoc0>() == sqrt(cov(0, 0))); + BOOST_CHECK(parSet_with_cov.getUncertainty<eBoundLoc1>() == sqrt(cov(1, 1))); + BOOST_CHECK(parSet_with_cov.getUncertainty<eBoundPhi>() == sqrt(cov(2, 2))); // same parameter set without covariance matrix - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> - parSet_without_cov(std::nullopt, parValues); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> parSet_without_cov( + std::nullopt, parValues); BOOST_CHECK(!parSet_without_cov.getCovariance()); - BOOST_CHECK(parSet_without_cov.getUncertainty<ParID_t::eLOC_0>() < 0); - BOOST_CHECK(parSet_without_cov.getUncertainty<ParID_t::eLOC_1>() < 0); - BOOST_CHECK(parSet_without_cov.getUncertainty<ParID_t::ePHI>() < 0); + BOOST_CHECK(parSet_without_cov.getUncertainty<eBoundLoc0>() < 0); + BOOST_CHECK(parSet_without_cov.getUncertainty<eBoundLoc1>() < 0); + BOOST_CHECK(parSet_without_cov.getUncertainty<eBoundPhi>() < 0); BOOST_CHECK(parSet_without_cov.getParameters() == parSet_with_cov.getParameters()); @@ -306,13 +303,13 @@ BOOST_AUTO_TEST_CASE(parset_consistency_tests) { double newLoc1 = 0.6; double newPhi = -0.15 * M_PI; parValues << newLoc0, newLoc1, newPhi; - parSet_with_cov.setParameter<ParID_t::eLOC_0>(newLoc0); - parSet_with_cov.setParameter<ParID_t::eLOC_1>(newLoc1); - parSet_with_cov.setParameter<ParID_t::ePHI>(newPhi); + parSet_with_cov.setParameter<eBoundLoc0>(newLoc0); + parSet_with_cov.setParameter<eBoundLoc1>(newLoc1); + parSet_with_cov.setParameter<eBoundPhi>(newPhi); - BOOST_CHECK(parSet_with_cov.getParameter<ParID_t::eLOC_0>() == newLoc0); - BOOST_CHECK(parSet_with_cov.getParameter<ParID_t::eLOC_1>() == newLoc1); - BOOST_CHECK(parSet_with_cov.getParameter<ParID_t::ePHI>() == newPhi); + BOOST_CHECK(parSet_with_cov.getParameter<eBoundLoc0>() == newLoc0); + BOOST_CHECK(parSet_with_cov.getParameter<eBoundLoc1>() == newLoc1); + BOOST_CHECK(parSet_with_cov.getParameter<eBoundPhi>() == newPhi); BOOST_CHECK(parSet_with_cov.getParameters() == parValues); } @@ -337,42 +334,37 @@ BOOST_AUTO_TEST_CASE(parset_copy_assignment_tests) { ActsVectorD<3> first_parValues(loc0, loc1, phi); // parameter set with covariance matrix - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> first( - cov, loc0, loc1, phi); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> first(cov, loc0, loc1, phi); // check copy constructor - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> copy(first); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> copy(first); BOOST_CHECK(first == copy); // check move constructor - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> moved( - std::move(copy)); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> moved(std::move(copy)); BOOST_CHECK(first == moved); // check assignment operator - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> assigned = - moved; + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> assigned = moved; BOOST_CHECK(assigned == moved); - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> other( - std::nullopt, 0, 1.7, -0.15); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> other(std::nullopt, 0, 1.7, + -0.15); BOOST_CHECK(assigned != other); assigned = other; BOOST_CHECK(assigned == other); // check move assignment BOOST_CHECK(first != assigned); - first = - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI>(assigned); + first = ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi>(assigned); BOOST_CHECK(first == assigned); // check swap method - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> lhs(cov, loc0, - loc1, phi); - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> rhs( - std::nullopt, 2 * loc0, 2 * loc1, 2 * phi); - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> lhs_copy = lhs; - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> rhs_copy = rhs; + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> lhs(cov, loc0, loc1, phi); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> rhs(std::nullopt, 2 * loc0, + 2 * loc1, 2 * phi); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> lhs_copy = lhs; + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> rhs_copy = rhs; BOOST_CHECK(lhs != rhs && lhs == lhs_copy && rhs == rhs_copy); using std::swap; @@ -397,10 +389,9 @@ BOOST_AUTO_TEST_CASE(parset_comparison_tests) { // failed tests due to angle range corrections // parameter set with covariance matrix - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> first( - cov, loc0, loc1, phi); - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI> second( - std::nullopt, 2 * loc0, 2 * loc1, 2 * phi); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> first(cov, loc0, loc1, phi); + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi> second(std::nullopt, 2 * loc0, + 2 * loc1, 2 * phi); // check self comparison BOOST_CHECK(first == first); @@ -413,17 +404,17 @@ BOOST_AUTO_TEST_CASE(parset_comparison_tests) { BOOST_CHECK(first == second); // check that comparison fails for unequal parameter values - second.setParameter<ParID_t::eLOC_0>(3 * loc0); + second.setParameter<eBoundLoc0>(3 * loc0); BOOST_CHECK(first != second); first = second; BOOST_CHECK(first == second); - second.setParameter<ParID_t::eLOC_1>(3 * loc1); + second.setParameter<eBoundLoc1>(3 * loc1); BOOST_CHECK(first != second); first = second; BOOST_CHECK(first == second); - second.setParameter<ParID_t::ePHI>(3 * phi); + second.setParameter<eBoundPhi>(3 * phi); BOOST_CHECK(first != second); first = second; BOOST_CHECK(first == second); @@ -451,47 +442,47 @@ BOOST_AUTO_TEST_CASE(parset_comparison_tests) { * @sa ParameterSet::projector */ BOOST_AUTO_TEST_CASE(parset_projection_tests) { - ActsMatrixD<1, BoundParsDim> phi_proj; + ActsMatrixD<1, eBoundParametersSize> phi_proj; phi_proj << 0, 0, 1, 0, 0, 0; - ActsMatrixD<2, BoundParsDim> loc0_qop_proj; + ActsMatrixD<2, eBoundParametersSize> loc0_qop_proj; loc0_qop_proj << 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0; - ActsMatrixD<2, BoundParsDim> loc1_theta_proj; + ActsMatrixD<2, eBoundParametersSize> loc1_theta_proj; loc1_theta_proj << 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0; - ActsMatrixD<3, BoundParsDim> loc0_loc1_phi_proj; + ActsMatrixD<3, eBoundParametersSize> loc0_loc1_phi_proj; loc0_loc1_phi_proj << 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0; - ActsMatrixD<4, BoundParsDim> loc0_phi_theta_qop_proj; + ActsMatrixD<4, eBoundParametersSize> loc0_phi_theta_qop_proj; loc0_phi_theta_qop_proj << 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0; - ActsMatrixD<5, BoundParsDim> loc0_loc1_phi_theta_qop_proj; + ActsMatrixD<5, eBoundParametersSize> loc0_loc1_phi_theta_qop_proj; loc0_loc1_phi_theta_qop_proj << 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0; - ActsMatrixD<BoundParsDim, BoundParsDim> loc0_loc1_phi_theta_qop_t_proj; + ActsMatrixD<eBoundParametersSize, eBoundParametersSize> + loc0_loc1_phi_theta_qop_t_proj; loc0_loc1_phi_theta_qop_t_proj << 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1; - BOOST_CHECK((ParameterSet<ParID_t::ePHI>::projector() == phi_proj)); - BOOST_CHECK((ParameterSet<ParID_t::eLOC_0, ParID_t::eQOP>::projector() == - loc0_qop_proj)); - BOOST_CHECK((ParameterSet<ParID_t::eLOC_1, ParID_t::eTHETA>::projector() == - loc1_theta_proj)); - BOOST_CHECK((ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, - ParID_t::ePHI>::projector() == loc0_loc1_phi_proj)); + BOOST_CHECK((ParameterSet<eBoundPhi>::projector() == phi_proj)); BOOST_CHECK( - (ParameterSet<ParID_t::eLOC_0, ParID_t::ePHI, ParID_t::eTHETA, - ParID_t::eQOP>::projector() == loc0_phi_theta_qop_proj)); - BOOST_CHECK((ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI, - ParID_t::eTHETA, ParID_t::eQOP>::projector() == - loc0_loc1_phi_theta_qop_proj)); + (ParameterSet<eBoundLoc0, eBoundQOverP>::projector() == loc0_qop_proj)); + BOOST_CHECK( + (ParameterSet<eBoundLoc1, eBoundTheta>::projector() == loc1_theta_proj)); + BOOST_CHECK((ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi>::projector() == + loc0_loc1_phi_proj)); BOOST_CHECK( - (ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::ePHI, - ParID_t::eTHETA, ParID_t::eQOP, ParID_t::eT>::projector() == - loc0_loc1_phi_theta_qop_t_proj)); + (ParameterSet<eBoundLoc0, eBoundPhi, eBoundTheta, + eBoundQOverP>::projector() == loc0_phi_theta_qop_proj)); + BOOST_CHECK((ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundTheta, + eBoundQOverP>::projector() == + loc0_loc1_phi_theta_qop_proj)); + BOOST_CHECK((ParameterSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundTheta, + eBoundQOverP, eT>::projector() == + loc0_loc1_phi_theta_qop_t_proj)); } /** @@ -510,47 +501,45 @@ BOOST_AUTO_TEST_CASE(parset_residual_tests) { const double large_number = 12443534120; const double small_number = -924342675; const double normal_number = 1.234; - ParameterSet<ParID_t::eLOC_0, ParID_t::eLOC_1, ParID_t::eQOP> unbound( + ParameterSet<eBoundLoc0, eBoundLoc1, eBoundQOverP> unbound( std::nullopt, small_number, large_number, normal_number); - BOOST_CHECK(unbound.getParameter<ParID_t::eLOC_0>() == small_number); - BOOST_CHECK(unbound.getParameter<ParID_t::eLOC_1>() == large_number); - BOOST_CHECK(unbound.getParameter<ParID_t::eQOP>() == normal_number); + BOOST_CHECK(unbound.getParameter<eBoundLoc0>() == small_number); + BOOST_CHECK(unbound.getParameter<eBoundLoc1>() == large_number); + BOOST_CHECK(unbound.getParameter<eBoundQOverP>() == normal_number); // check bound parameter type - ParameterSet<ParID_t::eTHETA> bound(std::nullopt, small_number); - BOOST_CHECK((bound.getParameter<ParID_t::eTHETA>() == - par_type_t<ParID_t::eTHETA>::min)); - bound.setParameter<ParID_t::eTHETA>(large_number); - BOOST_CHECK((bound.getParameter<ParID_t::eTHETA>() == - par_type_t<ParID_t::eTHETA>::max)); - bound.setParameter<ParID_t::eTHETA>(normal_number); - BOOST_CHECK((bound.getParameter<ParID_t::eTHETA>() == normal_number)); + ParameterSet<eBoundTheta> bound(std::nullopt, small_number); + BOOST_CHECK((bound.getParameter<eBoundTheta>() == + BoundParameterType<eBoundTheta>::min)); + bound.setParameter<eBoundTheta>(large_number); + BOOST_CHECK((bound.getParameter<eBoundTheta>() == + BoundParameterType<eBoundTheta>::max)); + bound.setParameter<eBoundTheta>(normal_number); + BOOST_CHECK((bound.getParameter<eBoundTheta>() == normal_number)); // check cyclic parameter type - ParameterSet<ParID_t::ePHI> cyclic(std::nullopt, small_number); + ParameterSet<eBoundPhi> cyclic(std::nullopt, small_number); // calculate expected results - const double min = par_type_t<ParID_t::ePHI>::min; - const double max = par_type_t<ParID_t::ePHI>::max; + const double min = BoundParameterType<eBoundPhi>::min; + const double max = BoundParameterType<eBoundPhi>::max; // check that difference between original phi and stored phi is a multiple // of the cyclic period double multiple = - (cyclic.getParameter<ParID_t::ePHI>() - small_number) / (max - min); - BOOST_CHECK(cyclic.getParameter<ParID_t::ePHI>() >= min); - BOOST_CHECK(cyclic.getParameter<ParID_t::ePHI>() < max); + (cyclic.getParameter<eBoundPhi>() - small_number) / (max - min); + BOOST_CHECK(cyclic.getParameter<eBoundPhi>() >= min); + BOOST_CHECK(cyclic.getParameter<eBoundPhi>() < max); BOOST_CHECK(std::abs(multiple - std::floor(multiple + 0.5)) < tol); - cyclic.setParameter<ParID_t::ePHI>(large_number); - multiple = - (cyclic.getParameter<ParID_t::ePHI>() - large_number) / (max - min); - BOOST_CHECK(cyclic.getParameter<ParID_t::ePHI>() >= min); - BOOST_CHECK(cyclic.getParameter<ParID_t::ePHI>() < max); + cyclic.setParameter<eBoundPhi>(large_number); + multiple = (cyclic.getParameter<eBoundPhi>() - large_number) / (max - min); + BOOST_CHECK(cyclic.getParameter<eBoundPhi>() >= min); + BOOST_CHECK(cyclic.getParameter<eBoundPhi>() < max); BOOST_CHECK(std::abs(multiple - std::floor(multiple + 0.5)) < tol); - cyclic.setParameter<ParID_t::ePHI>(normal_number); - multiple = - (cyclic.getParameter<ParID_t::ePHI>() - normal_number) / (max - min); - BOOST_CHECK(cyclic.getParameter<ParID_t::ePHI>() >= min); - BOOST_CHECK(cyclic.getParameter<ParID_t::ePHI>() < max); + cyclic.setParameter<eBoundPhi>(normal_number); + multiple = (cyclic.getParameter<eBoundPhi>() - normal_number) / (max - min); + BOOST_CHECK(cyclic.getParameter<eBoundPhi>() >= min); + BOOST_CHECK(cyclic.getParameter<eBoundPhi>() < max); BOOST_CHECK(std::abs(multiple - std::floor(multiple + 0.5)) < tol); // check residual calculation @@ -571,9 +560,9 @@ BOOST_AUTO_TEST_CASE(parset_residual_tests) { const double delta_theta = second_theta - first_theta; ActsVectorD<3> residuals(delta_loc0, delta_phi, delta_theta); - ParameterSet<ParID_t::eLOC_0, ParID_t::ePHI, ParID_t::eTHETA> first( + ParameterSet<eBoundLoc0, eBoundPhi, eBoundTheta> first( std::nullopt, first_loc0, first_phi, first_theta); - ParameterSet<ParID_t::eLOC_0, ParID_t::ePHI, ParID_t::eTHETA> second( + ParameterSet<eBoundLoc0, eBoundPhi, eBoundTheta> second( std::nullopt, second_loc0, second_phi, second_theta); CHECK_CLOSE_REL(residuals, second.residual(first), 1e-6); @@ -598,22 +587,28 @@ using ParSet = ParameterSet<params...>; */ BOOST_AUTO_TEST_CASE(parset_parID_mapping) { // check logic for type-based access - BOOST_CHECK( - (ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getIndex<eLOC_0>() == 0)); - BOOST_CHECK( - (ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getIndex<eLOC_1>() == 1)); - BOOST_CHECK((ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getIndex<ePHI>() == 2)); - BOOST_CHECK((ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getIndex<eQOP>() == 3)); - BOOST_CHECK((ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getIndex<eT>() == 4)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getIndex<eBoundLoc0>() == 0)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getIndex<eBoundLoc1>() == 1)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getIndex<eBoundPhi>() == 2)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getIndex<eBoundQOverP>() == 3)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getIndex<eT>() == 4)); // check logic for index-based access - BOOST_CHECK( - (ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getParID<0>() == eLOC_0)); - BOOST_CHECK( - (ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getParID<1>() == eLOC_1)); - BOOST_CHECK((ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getParID<2>() == ePHI)); - BOOST_CHECK((ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getParID<3>() == eQOP)); - BOOST_CHECK((ParSet<eLOC_0, eLOC_1, ePHI, eQOP, eT>::getParID<4>() == eT)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getParID<0>() == eBoundLoc0)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getParID<1>() == eBoundLoc1)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getParID<2>() == eBoundPhi)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getParID<3>() == eBoundQOverP)); + BOOST_CHECK((ParSet<eBoundLoc0, eBoundLoc1, eBoundPhi, eBoundQOverP, + eT>::getParID<4>() == eT)); // check consistency using FullSet = FullParameterSet; @@ -624,20 +619,24 @@ BOOST_AUTO_TEST_CASE(parset_parID_mapping) { BOOST_CHECK((FullSet::getIndex<FullSet::getParID<4>()>() == 4)); BOOST_CHECK((FullSet::getIndex<FullSet::getParID<5>()>() == 5)); - BOOST_CHECK((FullSet::getParID<FullSet::getIndex<eLOC_0>()>() == eLOC_0)); - BOOST_CHECK((FullSet::getParID<FullSet::getIndex<eLOC_1>()>() == eLOC_1)); - BOOST_CHECK((FullSet::getParID<FullSet::getIndex<ePHI>()>() == ePHI)); - BOOST_CHECK((FullSet::getParID<FullSet::getIndex<eTHETA>()>() == eTHETA)); - BOOST_CHECK((FullSet::getParID<FullSet::getIndex<eQOP>()>() == eQOP)); + BOOST_CHECK( + (FullSet::getParID<FullSet::getIndex<eBoundLoc0>()>() == eBoundLoc0)); + BOOST_CHECK( + (FullSet::getParID<FullSet::getIndex<eBoundLoc1>()>() == eBoundLoc1)); + BOOST_CHECK( + (FullSet::getParID<FullSet::getIndex<eBoundPhi>()>() == eBoundPhi)); + BOOST_CHECK( + (FullSet::getParID<FullSet::getIndex<eBoundTheta>()>() == eBoundTheta)); + BOOST_CHECK( + (FullSet::getParID<FullSet::getIndex<eBoundQOverP>()>() == eBoundQOverP)); BOOST_CHECK((FullSet::getParID<FullSet::getIndex<eT>()>() == eT)); // consistency of types - BOOST_CHECK( - (std::is_same< - std::remove_cv<decltype(at_index<ParID_t, 0, eLOC_0>::value)>::type, - decltype(eLOC_0)>::value)); - BOOST_CHECK(( - std::is_same<decltype(FullSet::getParID<0>()), decltype(eLOC_0)>::value)); + BOOST_CHECK((std::is_same<std::remove_cv<decltype( + at_index<ParID_t, 0, eBoundLoc0>::value)>::type, + decltype(eBoundLoc0)>::value)); + BOOST_CHECK((std::is_same<decltype(FullSet::getParID<0>()), + decltype(eBoundLoc0)>::value)); } } // namespace Test } // namespace Acts diff --git a/Tests/UnitTests/Core/EventData/ParametersTestHelper.hpp b/Tests/UnitTests/Core/EventData/ParametersTestHelper.hpp index faf12cb5961a28edaa0d825dcbba03aadb809e1d..f6152628c593dcd360b7ee6e2bc9677fd7881e7c 100644 --- a/Tests/UnitTests/Core/EventData/ParametersTestHelper.hpp +++ b/Tests/UnitTests/Core/EventData/ParametersTestHelper.hpp @@ -19,7 +19,7 @@ namespace Test { template <typename Parameter> void consistencyCheck(const Parameter& pars, const Vector3D& position, const Vector3D& momentum, double charge, double time, - std::array<double, BoundParsDim> values) { + std::array<double, eBoundParametersSize> values) { // check parameter vector CHECK_CLOSE_ABS(pars.parameters()[eLOC_0], values[0], s_onSurfaceTolerance); CHECK_CLOSE_ABS(pars.parameters()[eLOC_1], values[1], s_onSurfaceTolerance); diff --git a/Tests/UnitTests/Core/Propagator/JacobianTests.cpp b/Tests/UnitTests/Core/Propagator/JacobianTests.cpp index 30c18484a160e386c660b7037ce70d84bcbb00d9..ab7fc6421702e39228337baa3d6001fa61582c5a 100644 --- a/Tests/UnitTests/Core/Propagator/JacobianTests.cpp +++ b/Tests/UnitTests/Core/Propagator/JacobianTests.cpp @@ -108,9 +108,9 @@ std::shared_ptr<Transform3D> createPlanarTransform(const Vector3D& nposition, BoundToFreeMatrix convertToMatrix(const std::array<double, 60> P) { // initialize to zero BoundToFreeMatrix jMatrix = BoundToFreeMatrix::Zero(); - for (size_t j = 0; j < BoundParsDim; ++j) { - for (size_t i = 0; i < FreeParsDim; ++i) { - size_t ijc = FreeParsDim + j * FreeParsDim + i; + for (size_t j = 0; j < eBoundParametersSize; ++j) { + for (size_t i = 0; i < eFreeParametersSize; ++i) { + size_t ijc = eFreeParametersSize + j * eFreeParametersSize + i; jMatrix(i, j) = P[ijc]; } } diff --git a/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp b/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp index c450d6bf706859f3842ebecbcd8d454037105015..c62c86ed46228befcb11c0e0a7d5c69905daf839 100644 --- a/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp @@ -130,8 +130,8 @@ BOOST_AUTO_TEST_CASE(linearized_track_factory_test) { BoundSymMatrix matBoundZero = BoundSymMatrix::Zero(); SpacePointVector vecSPZero = SpacePointVector::Zero(); SpacePointToBoundMatrix matBound2SPZero = SpacePointToBoundMatrix::Zero(); - ActsMatrixD<BoundParsDim, 3> matBound2MomZero = - ActsMatrixD<BoundParsDim, 3>::Zero(); + ActsMatrixD<eBoundParametersSize, 3> matBound2MomZero = + ActsMatrixD<eBoundParametersSize, 3>::Zero(); for (const BoundParameters& parameters : tracks) { LinearizedTrack linTrack = @@ -221,8 +221,8 @@ BOOST_AUTO_TEST_CASE(linearized_track_factory_straightline_test) { BoundSymMatrix matBoundZero = BoundSymMatrix::Zero(); SpacePointVector vecSPZero = SpacePointVector::Zero(); SpacePointToBoundMatrix matBound2SPZero = SpacePointToBoundMatrix::Zero(); - ActsMatrixD<BoundParsDim, 3> matBound2MomZero = - ActsMatrixD<BoundParsDim, 3>::Zero(); + ActsMatrixD<eBoundParametersSize, 3> matBound2MomZero = + ActsMatrixD<eBoundParametersSize, 3>::Zero(); for (const BoundParameters& parameters : tracks) { LinearizedTrack linTrack =