ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches

Charge and momentum interpretation for arbitrarily charged particles. More...

#include <Acts/EventData/Charge.hpp>

Public Member Functions

constexpr AnyCharge (float absQ) noexcept
 Construct with the magnitude of the input charge.
constexpr AnyCharge (Neutral) noexcept
 Construct from a Neutral particle.
constexpr AnyCharge (SinglyCharged) noexcept
 Construct from a SinglyCharged particle.
constexpr float absQ () const noexcept
 Get the absolute charge magnitude.
constexpr float extractCharge (double qOverP) const noexcept
 Extract the signed charge from q/p.
constexpr double extractMomentum (double qOverP) const noexcept
 Extract momentum magnitude from q/p.
constexpr double qOverP (double momentum, float signedQ) const noexcept
 Compute q/p from momentum and signed charge.

Detailed Description

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.

Constructor & Destructor Documentation

◆ AnyCharge() [1/3]

Acts::AnyCharge::AnyCharge ( float absQ)
explicitconstexprnoexcept

Construct with the magnitude of the input charge.

Parameters
absQThe absolute value of the charge magnitude

◆ AnyCharge() [2/3]

Acts::AnyCharge::AnyCharge ( SinglyCharged )
explicitconstexprnoexcept

Construct from a SinglyCharged particle.

◆ AnyCharge() [3/3]

Acts::AnyCharge::AnyCharge ( Neutral )
explicitconstexprnoexcept

Construct from a Neutral particle.

Member Function Documentation

◆ absQ()

float Acts::AnyCharge::absQ ( ) const
constexprnoexcept

Get the absolute charge magnitude.

Returns
Absolute charge magnitude (0 for neutral particles)

◆ extractCharge()

float Acts::AnyCharge::extractCharge ( double qOverP) const
constexprnoexcept

Extract the signed charge from q/p.

Parameters
qOverPCharge over momentum
Returns
Signed charge with correct magnitude (0 for neutral)

◆ extractMomentum()

double Acts::AnyCharge::extractMomentum ( double qOverP) const
constexprnoexcept

Extract momentum magnitude from q/p.

Parameters
qOverPCharge over momentum
Returns
Momentum magnitude (handles both charged and neutral particles)

◆ qOverP()

double Acts::AnyCharge::qOverP ( double momentum,
float signedQ ) const
constexprnoexcept

Compute q/p from momentum and signed charge.

Parameters
momentumParticle momentum magnitude
signedQSigned charge (must match stored charge magnitude)
Returns
Charge over momentum (handles both charged and neutral particles)