File Particle.hpp

namespace ActsFatras


std::ostream &operator<<(std::ostream &os, const Particle &particle)
class Particle
#include <ActsFatras/EventData/Particle.hpp>

Particle identity information and kinematic state.

Also stores some simulation-specific properties.

Public Types

using Scalar = Acts::ActsScalar
using Vector3 = Acts::ActsVector<3>
using Vector4 = Acts::ActsVector<4>

Public Functions

Particle() = default

Construct a default particle with invalid identity.

inline Particle(Barcode particleId, Acts::PdgParticle pdg, Scalar charge, Scalar mass)

Construct a particle at rest with explicit mass and charge.


It is the users responsibility that charge and mass match the PDG particle number.

  • particleId – Particle identifier within an event

  • pdg – PDG id

  • charge – Particle charge in native units

  • mass – Particle mass in native units

Particle(Barcode particleId, Acts::PdgParticle pdg)

Construct a particle at rest from a PDG particle number.

Charge and mass are retrieved from the particle data table.

  • particleId – Particle identifier within an event

  • pdg – PDG particle number

Particle(const Particle&) = default
Particle(Particle&&) = default
inline constexpr Scalar absoluteMomentum() const

Absolute momentum.

inline constexpr Scalar charge() const

Particle charge.

inline Particle &correctEnergy(Scalar delta)

Change the energy by the given amount.

Energy loss corresponds to a negative change. If the updated energy would result in an unphysical value, the particle is put to rest, i.e. its absolute momentum is set to zero.

inline Scalar energy() const

Total energy, i.e. norm of the four-momentum.

inline Vector4 fourMomentum() const

Energy-momentum four-vector.

inline constexpr const Vector4 &fourPosition() const

Space-time position four-vector.

inline constexpr Scalar mass() const

Particle mass.

inline constexpr operator bool() const

Check if the particle is alive, i.e. is not at rest.

inline constexpr bool operator!() const

Check if the particle is dead, i.e is at rest.

Particle &operator=(const Particle&) = default
Particle &operator=(Particle&&) = default
inline constexpr Barcode particleId() const

Particle identifier within an event.

inline constexpr Scalar pathInL0() const

Accumulated path within material measured in interaction lengths.

inline constexpr Scalar pathInX0() const

Accumulated path within material measured in radiation lengths.

inline constexpr Acts::PdgParticle pdg() const

PDG particle number that identifies the type.

inline auto position() const

Three-position, i.e. spatial coordinates without the time.

inline constexpr ProcessType process() const

Which type of process generated this particle.

inline constexpr Scalar properTime() const

Proper time in the particle rest frame.

inline Particle &setAbsoluteMomentum(Scalar absMomentum)

Set the absolute momentum.

inline Particle setCharge(Scalar charge)

Set the charge.

inline Particle &setDirection(const Vector3 &direction)

Set the direction three-vector.

inline Particle &setDirection(Scalar dx, Scalar dy, Scalar dz)

Set the direction three-vector from scalar components.

inline Particle setMass(Scalar mass)

Set the mass.

inline constexpr Particle &setMaterialPassed(Scalar pathInX0, Scalar pathInL0)

Set the accumulated material measured in radiation/interaction lengths.

  • pathInX0 – accumulated material measured in radiation lengths

  • pathInL0 – accumulated material measured in interaction lengths

inline Particle &setParticleId(Barcode barcode)

Set the particle ID.

inline Particle setPdg(Acts::PdgParticle pdg)

Set the pdg.

inline Particle &setPosition4(const Vector4 &pos4)

Set the space-time position four-vector.

inline Particle &setPosition4(const Vector3 &position, Scalar time)

Set the space-time position four-vector from three-position and time.

inline Particle &setPosition4(Scalar x, Scalar y, Scalar z, Scalar time)

Set the space-time position four-vector from scalar components.

inline Particle &setProcess(ProcessType proc)

Set the process type that generated this particle.

inline constexpr Particle &setProperTime(Scalar properTime)

Set the proper time in the particle rest frame.


properTime – passed proper time in the rest frame

inline Scalar time() const

Time coordinate.

inline Scalar transverseMomentum() const

Absolute momentum in the x-y plane.

inline const Vector3 &unitDirection() const

Unit three-direction, i.e. the normalized momentum three-vector.

inline Particle withParticleId(Barcode particleId) const

Construct a new particle with a new identifier but same kinematics.


This is intentionally not a regular setter. The particle id is used to identify the whole particle. Setting it on an existing particle is usually a mistake.

Private Members

Scalar m_absMomentum = Scalar(0)
Scalar m_charge = Scalar(0)
Scalar m_mass = Scalar(0)
Barcode m_particleId

Particle identifier within the event.

Scalar m_pathInL0 = Scalar(0)
Scalar m_pathInX0 = Scalar(0)
Acts::PdgParticle m_pdg = Acts::PdgParticle::eInvalid

PDG particle number.

Vector4 m_position4 = Vector4::Zero()
ProcessType m_process = ProcessType::eUndefined

Process type specifier.

Scalar m_properTime = Scalar(0)
Vector3 m_unitDirection = Vector3::UnitZ()