File Charge.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

Functions

ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, Neutral)
ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, SinglyCharged)
ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, NonNeutralCharge)
ACTS_STATIC_CHECK_CONCEPT(ChargeConcept, AnyCharge)
class AnyCharge
#include <Acts/EventData/Charge.hpp>

Charge and momentum interpretation for arbitrarily charged particles.

Only a charge magnitude identical to zero is interpreted as representing a neutral particle. This avoids ambiguities that might arise from using an approximate comparison with an arbitrary epsilon.

Public Functions

inline constexpr AnyCharge(float absQ) noexcept

Construct with the magnitude of the input charge.

inline constexpr AnyCharge(SinglyCharged) noexcept
inline constexpr AnyCharge(Neutral) noexcept
inline constexpr float absQ() const noexcept
template<typename T>
inline constexpr auto extractCharge(T qOverP) const noexcept
template<typename T>
inline constexpr auto extractMomentum(T qOverP) const noexcept
template<typename P, typename Q>
inline constexpr auto qOverP(P momentum, Q signedQ) const noexcept

Private Members

float m_absQ = {}

Friends

inline friend constexpr bool operator==(AnyCharge lhs, AnyCharge rhs) noexcept

Compare for equality.

struct Neutral
#include <Acts/EventData/Charge.hpp>

Charge and momentum interpretation for neutral particles.

Public Functions

constexpr Neutral() = default
inline constexpr Neutral(float absQ) noexcept

Construct and verify the input charge magnitude (in debug builds).

This constructor is only provided to allow consistent construction.

inline constexpr float absQ() const noexcept
template<typename T>
inline constexpr auto extractCharge(T) const noexcept
template<typename T>
inline constexpr auto extractMomentum(T qOverP) const noexcept
template<typename P, typename Q>
inline constexpr auto qOverP(P momentum, Q signedQ) const noexcept

Friends

inline friend constexpr bool operator==(Neutral, Neutral) noexcept

Compare for equality.

This is always true as Neutral has no internal state. Must be available to provide a consistent interface.

class NonNeutralCharge
#include <Acts/EventData/Charge.hpp>

Charge and momentum interpretation for arbitrarily charged but not neutral particles.

Public Functions

inline constexpr NonNeutralCharge(float absQ) noexcept

Construct with the magnitude of the input charge.

inline constexpr NonNeutralCharge(SinglyCharged) noexcept
inline constexpr float absQ() const noexcept
template<typename T>
inline constexpr auto extractCharge(T qOverP) const noexcept
template<typename T>
inline constexpr auto extractMomentum(T qOverP) const noexcept
template<typename P, typename Q>
inline constexpr auto qOverP(P momentum, Q signedQ) const noexcept

Private Members

float m_absQ = {}

Friends

inline friend constexpr bool operator==(NonNeutralCharge lhs, NonNeutralCharge rhs) noexcept

Compare for equality.

struct SinglyCharged
#include <Acts/EventData/Charge.hpp>

Charge and momentum interpretation for particles with +-e charge.

Public Functions

constexpr SinglyCharged() = default
inline constexpr SinglyCharged(float absQ) noexcept

Construct and verify the input charge magnitude (in debug builds).

This constructor is only provided to allow consistent construction.

inline constexpr float absQ() const noexcept
template<typename T>
inline constexpr auto extractCharge(T qOverP) const noexcept
template<typename T>
inline constexpr auto extractMomentum(T qOverP) const noexcept
template<typename P, typename Q>
inline constexpr auto qOverP(P momentum, Q signedQ) const noexcept

Friends

inline friend constexpr bool operator==(SinglyCharged, SinglyCharged) noexcept

Compare for equality.

This is always true as SinglyCharged has no internal state. Must be available to provide a consistent interface.