32 template <
class ChargePolicy>
36 "ChargePolicy must either be 'Acts::ChargedPolicy' or "
37 "'Acts::NeutralPolicy");
52 template <
typename T = ChargePolicy,
56 : m_parameters(parValues),
57 m_oChargePolicy((0 < parValues(
eFreeQOverP)) ? 1. : -1.),
58 m_covariance(std::move(cov)) {}
65 template <
typename T = ChargePolicy,
69 : m_parameters(parValues),
71 m_covariance(std::move(cov)) {}
82 m_oChargePolicy = rhs.m_oChargePolicy;
83 m_parameters = rhs.m_parameters;
84 m_covariance = rhs.m_covariance;
98 m_oChargePolicy = std::move(rhs.m_oChargePolicy);
99 m_parameters = std::move(rhs.m_parameters);
100 m_covariance = std::move(rhs.m_covariance);
109 : m_parameters(copy.m_parameters),
110 m_oChargePolicy(copy.m_oChargePolicy),
111 m_covariance(copy.m_covariance) {}
131 template <
unsigned int par,
132 std::enable_if_t<par<eFreeParametersSize, int> = 0>
ParValue_t get()
134 return m_parameters(par);
143 template <
unsigned int par,
144 std::enable_if_t<par<eFreeParametersSize, int> = 0>
ParValue_t
145 uncertainty()
const {
146 return std::sqrt(m_covariance->coeff(par, par));
157 const std::optional<CovMatrix_t>& covariance()
const {
return m_covariance; }
168 return m_parameters.template segment<3>(4) /
std::abs(get<7>());
174 double charge()
const {
return m_oChargePolicy.getCharge(); }
179 double time()
const {
return m_parameters(3); }
188 auto casted =
dynamic_cast<decltype(this)
>(&rhs);
194 if ((m_covariance.has_value() && casted->m_covariance.has_value()) &&
195 (*m_covariance != *casted->m_covariance)) {
199 if ((m_covariance.has_value() && !casted->m_covariance.has_value()) ||
200 (!m_covariance.has_value() && casted->m_covariance.has_value())) {
204 return (m_oChargePolicy == casted->m_oChargePolicy &&
205 m_parameters == casted->m_parameters);
212 return !(*
this == rhs);
223 template <
unsigned int par,
224 std::enable_if_t<par<eFreeParametersSize, int> = 0>
void set(
226 m_parameters(par) = newValue;
234 std::ostream&
print(std::ostream& sl)
const {
236 auto old_precision = sl.precision(7);
237 auto old_flags = sl.setf(std::ios::fixed);
240 sl <<
" * FreeTrackParameters: ";
242 sl <<
" * charge: " <<
charge() << std::endl;
243 if (covariance().has_value()) {
244 sl <<
" * covariance matrix:\n" << *covariance() << std::endl;
246 sl <<
" * no covariance matrix stored" << std::endl;
250 sl.precision(old_precision);
263 friend std::ostream&
operator<<(std::ostream& out,
271 ChargePolicy m_oChargePolicy;
273 std::optional<CovMatrix_t> m_covariance;