12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/definitions/units.hpp"
23template <concepts::scalar scalar_t>
36 m_mass(static_cast<scalar_t>(
mass)),
37 m_charge(static_cast<scalar_t>(
charge)) {}
41 constexpr std::int32_t
pdg_num()
const {
return m_pdg_num; }
53 constexpr bool is_valid()
const {
return m_pdg_num != 0; }
56 std::int32_t m_pdg_num;
64template <concepts::scalar scalar_t>
77template <concepts::scalar scalar_t,
typename track_t>
88#define DETRAY_DECLARE_PARTICLE(PARTICLE_NAME, PDG_NUM, MASS, CHARGE) \
89 template <concepts::scalar scalar_t> \
90 struct PARTICLE_NAME final : public pdg_particle<scalar_t> { \
92 using base_type = pdg_particle<scalar_t>; \
94 constexpr PARTICLE_NAME() : base_type(PDG_NUM, MASS, CHARGE) {} \
99DETRAY_DECLARE_PARTICLE(invalid, 0, 0.f, 0.f);
125DETRAY_DECLARE_PARTICLE(photon, 22, 0.f, 0.f);
Detray include(s).
Definition array_operators.hpp:18
constexpr pdg_particle< scalar_t > charge_conjugation(const pdg_particle< scalar_t > &ptc)
Apply the charge conjugation operator to a particle hypothesis ptc.
Definition pdg_particle.hpp:65
constexpr pdg_particle< scalar_t > update_particle_hypothesis(const pdg_particle< scalar_t > &ptc, const track_t ¶ms)
Select the hypothesis matching the sign of the track charge over momentum.
Definition pdg_particle.hpp:78
Positive muon hypothesis.
Definition pdg_particle.hpp:114
static constexpr scalar_t m_e
Electron rest energy expressed in the internal energy unit.
Definition units.hpp:168
Electron hypothesis.
Definition pdg_particle.hpp:103
Negative muon hypothesis.
Definition pdg_particle.hpp:111
Particle hypothesis identified by PDG number, mass, and electric charge.
Definition pdg_particle.hpp:24
constexpr bool is_valid() const
Definition pdg_particle.hpp:53
constexpr std::int32_t pdg_num() const
Definition pdg_particle.hpp:41
constexpr pdg_particle(const std::int32_t pdg_num, const T mass, const T charge)
Construct a particle hypothesis.
Definition pdg_particle.hpp:33
constexpr scalar_type mass() const
Definition pdg_particle.hpp:45
constexpr scalar_type charge() const
Definition pdg_particle.hpp:49
scalar_t scalar_type
Scalar representation of mass and charge.
Definition pdg_particle.hpp:26
Negative pion hypothesis.
Definition pdg_particle.hpp:123
Positive pion hypothesis.
Definition pdg_particle.hpp:120
Positron hypothesis.
Definition pdg_particle.hpp:106
static constexpr scalar_t e
Charge, native unit e (elementary charge).
Definition units.hpp:105
static constexpr scalar_t MeV
Megaelectronvolt expressed in GeV.
Definition units.hpp:79