Skip to content

Commit

Permalink
Merge branch 'main' into fastTrackITk
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisFelipeCoelho authored Jul 28, 2023
2 parents a1baf02 + 75b6eb2 commit ce24ad3
Show file tree
Hide file tree
Showing 80 changed files with 420 additions and 412 deletions.
2 changes: 1 addition & 1 deletion .policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ approval_rules:
options:
allow_author: false # just for completeness
allow_contributor: true # Update button 'contributions' should be ignored
invalidate_on_push: false
invalidate_on_push: true
ignore_update_merges: true
if:
targets_branch:
Expand Down
Binary file modified CI/physmon/reference/performance_amvf_orthogonal_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_seeded_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_estimated_hist.root
Binary file not shown.
Binary file modified CI/physmon/reference/performance_amvf_truth_smeared_hist.root
Binary file not shown.
38 changes: 20 additions & 18 deletions Core/include/Acts/Definitions/Units.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ namespace Acts {

namespace UnitConstants {
// Length, native unit mm
constexpr double fm = 1e-12;
constexpr double pm = 1e-9;
constexpr double um = 1e-3;
constexpr double nm = 1e-6;
constexpr double mm = 1.0;
constexpr double cm = 10.0;
constexpr double m = 1e3;
constexpr double km = 1e6;
constexpr double fm = 1e-12 * mm;
constexpr double pm = 1e-9 * mm;
constexpr double nm = 1e-6 * mm;
constexpr double um = 1e-3 * mm;
constexpr double cm = 1e1 * mm;
constexpr double m = 1e3 * mm;
constexpr double km = 1e6 * mm;
// Shortcuts for commonly used area and volume units. This intentionally
// contains not all possible combinations to avoid cluttering the namespace.
// Missing area or volume units can always be defined on the fly using the
Expand All @@ -158,7 +158,8 @@ constexpr double mm3 = mm * mm * mm;
constexpr double cm3 = cm * cm * cm;
constexpr double m3 = m * m * m;
// Time, native unit mm = [speed-of-light * time] = mm/s * s
constexpr double s = 299792458000.0;
/// @note Depends on speed of light in SI units
constexpr double s = 299792458000.0; // = 299792458.0 * (m / 1.0) * 1.0;
constexpr double fs = 1e-15 * s;
constexpr double ps = 1e-12 * s;
constexpr double ns = 1e-9 * s;
Expand All @@ -169,29 +170,30 @@ constexpr double h = 3600.0 * s;
// Angles, native unit radian
constexpr double mrad = 1e-3;
constexpr double rad = 1.0;
constexpr double degree = 0.017453292519943295; // pi / 180
constexpr double degree = 0.017453292519943295; // = M_PI / 180.0 * rad;
// Energy/mass/momentum, native unit GeV
constexpr double eV = 1e-9;
constexpr double keV = 1e-6;
constexpr double MeV = 1e-3;
constexpr double GeV = 1.0;
constexpr double TeV = 1e3;
constexpr double eV = 1e-9 * GeV;
constexpr double keV = 1e-6 * GeV;
constexpr double MeV = 1e-3 * GeV;
constexpr double TeV = 1e3 * GeV;
constexpr double J = 6241509074.460763 * GeV;
// atomic mass unit u
/// atomic mass unit u
constexpr double u = 0.93149410242;
// 1eV/c² == 1.782662e-36kg
// 1GeV/c² == 1.782662e-27kg
// -> 1kg == (1/1.782662e-27)GeV/c²
// -> 1g == (1/(1e3*1.782662e-27))GeV/c²
constexpr double g = 1.0 / 1.782662e-24;
constexpr double kg = 1.0 / 1.782662e-27;
// Charge, native unit e (elementary charge)
/// Charge, native unit e (elementary charge)
constexpr double e = 1.0;
// Magnetic field, native unit GeV/(e*mm)
constexpr double T = 0.000299792458; // equivalent to c in appropriate SI units
/// Magnetic field, native unit (eV*s)/(e*m²)
/// @note Depends on speed of light in SI units
constexpr double T = 0.000299792458; // = eV * s / (e * m2);
constexpr double Gauss = 1e-4 * T;
constexpr double kGauss = 1e-1 * T;
// Amount of substance, native unit mol
/// Amount of substance, native unit mol
constexpr double mol = 1.0;
} // namespace UnitConstants

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Acts {
///
/// @note This class holds shared ownership on its reference surface.
template <class charge_t>
class SingleBoundTrackParameters {
class GenericBoundTrackParameters {
public:
using Scalar = ActsScalar;
using ParametersVector = BoundVector;
Expand All @@ -51,9 +51,9 @@ class SingleBoundTrackParameters {
/// an input here to be consistent with the other constructors below that
/// that also take the charge as an input. The charge sign is only used in
/// debug builds to check for consistency with the q/p parameter.
SingleBoundTrackParameters(std::shared_ptr<const Surface> surface,
const ParametersVector& params, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
GenericBoundTrackParameters(
std::shared_ptr<const Surface> surface, const ParametersVector& params,
Scalar q, std::optional<CovarianceMatrix> cov = std::nullopt)
: m_params(params),
m_cov(std::move(cov)),
m_surface(std::move(surface)),
Expand All @@ -74,9 +74,9 @@ class SingleBoundTrackParameters {
/// ambiguities, i.e. the charge type is default-constructible.
template <typename T = charge_t,
std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
SingleBoundTrackParameters(std::shared_ptr<const Surface> surface,
const ParametersVector& params,
std::optional<CovarianceMatrix> cov = std::nullopt)
GenericBoundTrackParameters(
std::shared_ptr<const Surface> surface, const ParametersVector& params,
std::optional<CovarianceMatrix> cov = std::nullopt)
: m_params(params), m_cov(std::move(cov)), m_surface(std::move(surface)) {
assert(m_surface);
normalizePhiTheta();
Expand All @@ -95,7 +95,7 @@ class SingleBoundTrackParameters {
///
/// @note The returned result indicates whether the free parameters could
/// successfully be converted to on-surface parameters.
static Result<SingleBoundTrackParameters<charge_t>> create(
static Result<GenericBoundTrackParameters<charge_t>> create(
std::shared_ptr<const Surface> surface, const GeometryContext& geoCtx,
const Vector4& pos4, const Vector3& dir, Scalar p, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt) {
Expand All @@ -107,8 +107,8 @@ class SingleBoundTrackParameters {
return bound.error();
}

return SingleBoundTrackParameters<charge_t>{std::move(surface), *bound, q,
std::move(cov)};
return GenericBoundTrackParameters<charge_t>{std::move(surface), *bound, q,
std::move(cov)};
}

/// Factory to construct from four-position, direction, and
Expand All @@ -128,7 +128,7 @@ class SingleBoundTrackParameters {
/// successfully be converted to on-surface parameters.
template <typename T = charge_t,
std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
static Result<SingleBoundTrackParameters<charge_t>> create(
static Result<GenericBoundTrackParameters<charge_t>> create(
std::shared_ptr<const Surface> surface, const GeometryContext& geoCtx,
const Vector4& pos4, const Vector3& dir, Scalar qOverP,
std::optional<CovarianceMatrix> cov = std::nullopt) {
Expand All @@ -138,18 +138,19 @@ class SingleBoundTrackParameters {
return bound.error();
}

return SingleBoundTrackParameters<charge_t>{std::move(surface), *bound,
std::move(cov)};
return GenericBoundTrackParameters<charge_t>{std::move(surface), *bound,
std::move(cov)};
}

/// Parameters are not default constructible due to the charge type.
SingleBoundTrackParameters() = delete;
SingleBoundTrackParameters(const SingleBoundTrackParameters&) = default;
SingleBoundTrackParameters(SingleBoundTrackParameters&&) = default;
~SingleBoundTrackParameters() = default;
SingleBoundTrackParameters& operator=(const SingleBoundTrackParameters&) =
GenericBoundTrackParameters() = delete;
GenericBoundTrackParameters(const GenericBoundTrackParameters&) = default;
GenericBoundTrackParameters(GenericBoundTrackParameters&&) = default;
~GenericBoundTrackParameters() = default;
GenericBoundTrackParameters& operator=(const GenericBoundTrackParameters&) =
default;
GenericBoundTrackParameters& operator=(GenericBoundTrackParameters&&) =
default;
SingleBoundTrackParameters& operator=(SingleBoundTrackParameters&&) = default;

/// Parameters vector.
ParametersVector& parameters() { return m_params; }
Expand Down Expand Up @@ -263,20 +264,20 @@ class SingleBoundTrackParameters {
/// of equality in different contexts. None of that can be handled by
/// this operator. Users should think really hard if this is what they
/// want and we might decided that we will remove this in the future.
friend bool operator==(const SingleBoundTrackParameters<charge_t>& lhs,
const SingleBoundTrackParameters<charge_t>& rhs) {
friend bool operator==(const GenericBoundTrackParameters<charge_t>& lhs,
const GenericBoundTrackParameters<charge_t>& rhs) {
return (lhs.m_params == rhs.m_params) and (lhs.m_cov == rhs.m_cov) and
(lhs.m_surface == rhs.m_surface) and
(lhs.m_chargeInterpreter == rhs.m_chargeInterpreter);
}
/// Compare two bound track parameters for bitwise in-equality.
friend bool operator!=(const SingleBoundTrackParameters<charge_t>& lhs,
const SingleBoundTrackParameters<charge_t>& rhs) {
friend bool operator!=(const GenericBoundTrackParameters<charge_t>& lhs,
const GenericBoundTrackParameters<charge_t>& rhs) {
return not(lhs == rhs);
}
/// Print information to the output stream.
friend std::ostream& operator<<(std::ostream& os,
const SingleBoundTrackParameters& tp) {
const GenericBoundTrackParameters& tp) {
detail::printBoundParameters(
os, tp.referenceSurface(), tp.parameters(),
tp.covariance().has_value() ? &tp.covariance().value() : nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#include "Acts/EventData/SingleBoundTrackParameters.hpp"
#include "Acts/EventData/GenericBoundTrackParameters.hpp"
#include "Acts/Surfaces/PlaneSurface.hpp"

namespace Acts {
Expand All @@ -22,11 +22,11 @@ namespace Acts {
/// parameters and their corresponding covariance matrix are stored in
/// curvilinear parametrization.
///
/// @see SingleBoundTrackParameters
/// @see GenericBoundTrackParameters
template <typename charge_t>
class SingleCurvilinearTrackParameters
: public SingleBoundTrackParameters<charge_t> {
using Base = SingleBoundTrackParameters<charge_t>;
class GenericCurvilinearTrackParameters
: public GenericBoundTrackParameters<charge_t> {
using Base = GenericBoundTrackParameters<charge_t>;

public:
using Scalar = ActsScalar;
Expand All @@ -40,7 +40,7 @@ class SingleCurvilinearTrackParameters
/// @param p Absolute momentum
/// @param q Particle charge
/// @param cov Curvilinear bound parameters covariance matrix
SingleCurvilinearTrackParameters(
GenericCurvilinearTrackParameters(
const Vector4& pos4, const Vector3& dir, Scalar p, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
: Base(Surface::makeShared<PlaneSurface>(pos4.segment<3>(ePos0), dir),
Expand All @@ -61,7 +61,7 @@ class SingleCurvilinearTrackParameters
/// ambiguities, i.e. the charge interpretation type is default-constructible.
template <typename T = charge_t,
std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
SingleCurvilinearTrackParameters(
GenericCurvilinearTrackParameters(
const Vector4& pos4, const Vector3& dir, Scalar qOverP,
std::optional<CovarianceMatrix> cov = std::nullopt)
: Base(Surface::makeShared<PlaneSurface>(pos4.segment<3>(ePos0), dir),
Expand All @@ -77,7 +77,7 @@ class SingleCurvilinearTrackParameters
/// @param p Absolute momentum
/// @param q Particle charge
/// @param cov Curvilinear bound parameters covariance matrix
SingleCurvilinearTrackParameters(
GenericCurvilinearTrackParameters(
const Vector4& pos4, Scalar phi, Scalar theta, Scalar p, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
: Base(Surface::makeShared<PlaneSurface>(
Expand All @@ -101,7 +101,7 @@ class SingleCurvilinearTrackParameters
/// ambiguities, i.e. the charge interpretation type is default-constructible.
template <typename T = charge_t,
std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
SingleCurvilinearTrackParameters(
GenericCurvilinearTrackParameters(
const Vector4& pos4, Scalar phi, Scalar theta, Scalar qOverP,
std::optional<CovarianceMatrix> cov = std::nullopt)
: Base(Surface::makeShared<PlaneSurface>(
Expand All @@ -112,16 +112,16 @@ class SingleCurvilinearTrackParameters
std::move(cov)) {}

/// Parameters are not default constructible due to the charge type.
SingleCurvilinearTrackParameters() = delete;
SingleCurvilinearTrackParameters(const SingleCurvilinearTrackParameters&) =
GenericCurvilinearTrackParameters() = delete;
GenericCurvilinearTrackParameters(const GenericCurvilinearTrackParameters&) =
default;
SingleCurvilinearTrackParameters(SingleCurvilinearTrackParameters&&) =
GenericCurvilinearTrackParameters(GenericCurvilinearTrackParameters&&) =
default;
~SingleCurvilinearTrackParameters() = default;
SingleCurvilinearTrackParameters& operator=(
const SingleCurvilinearTrackParameters&) = default;
SingleCurvilinearTrackParameters& operator=(
SingleCurvilinearTrackParameters&&) = default;
~GenericCurvilinearTrackParameters() = default;
GenericCurvilinearTrackParameters& operator=(
const GenericCurvilinearTrackParameters&) = default;
GenericCurvilinearTrackParameters& operator=(
GenericCurvilinearTrackParameters&&) = default;
};

} // namespace Acts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Acts {
/// Parameters and covariance matrix are stored using the free parametrization
/// defined in `enum FreeIndices`.
template <class charge_t>
class SingleFreeTrackParameters {
class GenericFreeTrackParameters {
public:
using Scalar = ActsScalar;
using ParametersVector = FreeVector;
Expand All @@ -45,8 +45,8 @@ class SingleFreeTrackParameters {
/// an input here to be consistent with the other constructors below that
/// that also take the charge as an input. The charge sign is only used in
/// debug builds to check for consistency with the q/p parameter.
SingleFreeTrackParameters(const ParametersVector& params, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
GenericFreeTrackParameters(const ParametersVector& params, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
: m_params(params),
m_cov(std::move(cov)),
m_chargeInterpreter(std::abs(q)) {
Expand All @@ -63,8 +63,8 @@ class SingleFreeTrackParameters {
/// ambiguities, i.e. the charge interpretation type is default-constructible.
template <typename T = charge_t,
std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
SingleFreeTrackParameters(const ParametersVector& params,
std::optional<CovarianceMatrix> cov = std::nullopt)
GenericFreeTrackParameters(const ParametersVector& params,
std::optional<CovarianceMatrix> cov = std::nullopt)
: m_params(params), m_cov(std::move(cov)) {}

/// Construct from four-position, angles, absolute momentum, and charge.
Expand All @@ -75,9 +75,9 @@ class SingleFreeTrackParameters {
/// @param p Absolute momentum
/// @param q Particle charge
/// @param cov Free parameters covariance matrix
SingleFreeTrackParameters(const Vector4& pos4, Scalar phi, Scalar theta,
Scalar p, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
GenericFreeTrackParameters(const Vector4& pos4, Scalar phi, Scalar theta,
Scalar p, Scalar q,
std::optional<CovarianceMatrix> cov = std::nullopt)
: m_params(FreeVector::Zero()),
m_cov(std::move(cov)),
m_chargeInterpreter(std::abs(q)) {
Expand Down Expand Up @@ -106,9 +106,9 @@ class SingleFreeTrackParameters {
/// ambiguities, i.e. the charge interpretation type is default-constructible.
template <typename T = charge_t,
std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
SingleFreeTrackParameters(const Vector4& pos4, Scalar phi, Scalar theta,
Scalar qOverP,
std::optional<CovarianceMatrix> cov = std::nullopt)
GenericFreeTrackParameters(const Vector4& pos4, Scalar phi, Scalar theta,
Scalar qOverP,
std::optional<CovarianceMatrix> cov = std::nullopt)
: m_params(FreeVector::Zero()), m_cov(std::move(cov)) {
auto dir = makeDirectionUnitFromPhiTheta(phi, theta);
m_params[eFreePos0] = pos4[ePos0];
Expand All @@ -122,13 +122,13 @@ class SingleFreeTrackParameters {
}

/// Parameters are not default constructible due to the charge type.
SingleFreeTrackParameters() = delete;
SingleFreeTrackParameters(const SingleFreeTrackParameters&) = default;
SingleFreeTrackParameters(SingleFreeTrackParameters&&) = default;
~SingleFreeTrackParameters() = default;
SingleFreeTrackParameters& operator=(const SingleFreeTrackParameters&) =
GenericFreeTrackParameters() = delete;
GenericFreeTrackParameters(const GenericFreeTrackParameters&) = default;
GenericFreeTrackParameters(GenericFreeTrackParameters&&) = default;
~GenericFreeTrackParameters() = default;
GenericFreeTrackParameters& operator=(const GenericFreeTrackParameters&) =
default;
SingleFreeTrackParameters& operator=(SingleFreeTrackParameters&&) = default;
GenericFreeTrackParameters& operator=(GenericFreeTrackParameters&&) = default;

/// Parameters vector.
const ParametersVector& parameters() const { return m_params; }
Expand Down Expand Up @@ -194,7 +194,7 @@ class SingleFreeTrackParameters {

/// Print information to the output stream.
friend std::ostream& operator<<(std::ostream& os,
const SingleFreeTrackParameters& tp) {
const GenericFreeTrackParameters& tp) {
detail::printFreeParameters(
os, tp.parameters(),
tp.covariance().has_value() ? &tp.covariance().value() : nullptr);
Expand Down
Loading

0 comments on commit ce24ad3

Please sign in to comment.