|
Celeritas 0.7.0-dev.245+develop.a7be925e
|
Read/write view to the physical properties of a single particle track. More...
#include <ParticleTrackView.hh>
Public Types | |
Type aliases | |
| using | ParamsRef = celeritas::NativeCRef< ParticleParamsData > |
| using | StateRef = celeritas::NativeRef< ParticleStateData > |
| using | Initializer_t = ParticleTrackInitializer |
| using | Charge = units::ElementaryCharge |
| using | Energy = units::MevEnergy |
| using | Mass = units::MevMass |
| using | Momentum = units::MevMomentum |
| using | MomentumSq = units::MevMomentumSq |
| using | Speed = units::LightSpeed |
Public Member Functions | |
| ParticleTrackView (ParamsRef const ¶ms, StateRef const &states, TrackSlotId id) | |
| Construct from dynamic and static particle properties. | |
| ParticleTrackView & | operator= (Initializer_t const &other) |
| Initialize the particle. | |
| void | energy (Energy) |
| Change the particle's kinetic energy. | |
| void | subtract_energy (Energy) |
| Reduce the particle's energy without undergoing a collision [MeV]. | |
| ParticleId | particle_id () const |
| Unique particle type identifier. | |
| Energy | energy () const |
| Kinetic energy [MeV]. | |
| bool | is_stopped () const |
| Whether the track is stopped (zero kinetic energy). | |
| ParticleView | particle_view () const |
| Get static particle properties for the current state. | |
| Mass | mass () const |
| Rest mass [MeV / c^2]. | |
| Charge | charge () const |
| Elementary charge. | |
| real_type | decay_constant () const |
| Decay constant in native units. | |
| bool | is_antiparticle () const |
| Whether it is an antiparticle. | |
| bool | is_stable () const |
| Whether particle is stable. | |
| bool | is_heavy () const |
| Distinguish between light (e-/e+) and heavy (muon/hadron) particles. | |
| Energy | total_energy () const |
| Kinetic energy plus rest energy [MeV]. | |
| real_type | beta_sq () const |
| Square of \( \beta \), which is the fraction of lightspeed [unitless]. | |
| Speed | speed () const |
| Speed [1/c]. | |
| real_type | lorentz_factor () const |
| Lorentz factor [unitless]. | |
| Momentum | momentum () const |
| Relativistic momentum [MeV / c]. | |
| MomentumSq | momentum_sq () const |
| Square of relativistic momentum [MeV^2 / c^2]. | |
Read/write view to the physical properties of a single particle track.
These functions should be used in each physics Process or Interactor or anything else that needs to access particle properties. Assume that all these functions are expensive: when using them as accessors, locally store the results rather than calling the function repeatedly. If any of the calculations prove to be hot spots we will experiment with caching some of the variables.
Change the particle's kinetic energy.
This should only be used when the particle is in a valid state. For HEP applications, the new energy should always be less than the starting energy.
|
inline |
Distinguish between light (e-/e+) and heavy (muon/hadron) particles.
Light and heavy charged particles have different parameters and treatment in continuous energy loss and Coulomb scattering. The choice of 1 MeV to distinguish between electrons and muons is arbitrary.
|
inline |
Lorentz factor [unitless].
The Lorentz factor can be viewed as a transformation from classical quantities to relativistic quantities. It's defined as
\[ \gamma = \frac{1}{\sqrt{1 - v^2 / c^2}} \]
Its value is infinite for the massless photon, and greater than or equal to 1 otherwise.
Gamma can also be calculated from the total (rest + kinetic) energy
\[ E = \gamma mc^2 = K + mc^2 \]
which we use here since K and m are the primary stored quantities of the particles:
\[ \gamma = 1 + \frac{K}{mc^2} \]
|
inline |
Relativistic momentum [MeV / c].
This is calculated by taking the root of the square of the momentum.
|
inline |
Square of relativistic momentum [MeV^2 / c^2].
Total energy:
\[ E = K + mc^2 \]
Relation between energy and momentum:
\[ E^2 = p^2 c^2 + m^2 c^4 \]
therefore
\[ p^2 = \frac{E^2}{c^2} - m^2 c^2 \]
or
\[ p^2 = \frac{K^2}{c^2} + 2 * m * K \]
|
inline |
Speed [1/c].
\( \beta = v/c \) is calculated using the equality
\[ pc/E = \beta ; \quad \beta^2 = \frac{p^2 c^2}{E^2} \]
. Using
\[ E^2 = p^2 c^2 + m^2 c^4 \]
and
\[ E = K + mc^2 \]
the fraction of lightspeed speed is
\[ \beta = \sqrt{1 - \left( \frac{mc^2}{K + mc^2} \right)^2} = \frac{\sqrt{K(K + 2mc^2)}}{K + mc^2} \]
.
This expression works for massless particles and is robust against round-off error at low energies.