Skip to content
Snippets Groups Projects
Commit 8f45dd6e authored by Moritz Kiehn's avatar Moritz Kiehn Committed by Fabian Klimpel
Browse files

remove FreeParsDim

parent 4ed4f666
No related branches found
No related tags found
1 merge request!785Clean up the parameter definitions
......@@ -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
......@@ -310,6 +310,5 @@ using par_type_t = typename detail::BoundParameterTraits<kIndex>::type;
// For backward compatibility. New code must use the
// `e{BoundParameters,FreeParameters,SpacePoint}Size` enum values.
inline constexpr unsigned int BoundParsDim = eBoundParametersSize;
inline constexpr unsigned int FreeParsDim = eFreeParametersSize;
} // namespace Acts
......@@ -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];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment