|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Generic 4-vector. More...
#include <FourVector.h>
Public Member Functions | |
| FourVector () | |
| Default constructor. | |
| FourVector (const FourVector &)=default | |
| Copy constructor. | |
| FourVector (double xx, double yy, double zz, double ee) | |
| Sets all FourVector fields. | |
| FourVector (FourVector &&)=default | |
| Move constructor. | |
| FourVector & | operator= (const FourVector &)=default |
| = | |
| FourVector & | operator= (FourVector &&)=default |
| = | |
Component accessors | |
| void | set (double x1, double x2, double x3, double x4) |
| Set all FourVector fields, in order x,y,z,t. | |
| void | set_component (const int i, const double x) |
| set component of position/displacement | |
| double | get_component (const int i) const |
| get component of position/displacement | |
| double | x () const |
| x-component of position/displacement | |
| void | set_x (double xx) |
| Set x-component of position/displacement. | |
| void | setX (double xx) |
| double | y () const |
| y-component of position/displacement | |
| void | set_y (double yy) |
| Set y-component of position/displacement. | |
| void | setY (double yy) |
| double | z () const |
| z-component of position/displacement | |
| void | set_z (double zz) |
| Set z-component of position/displacement. | |
| void | setZ (double zz) |
| double | t () const |
| Time component of position/displacement. | |
| void | set_t (double tt) |
| Set time component of position/displacement. | |
| void | setT (double tt) |
| double | px () const |
| x-component of momentum | |
| void | set_px (double pxx) |
| Set x-component of momentum. | |
| void | setPx (double pxx) |
| double | py () const |
| y-component of momentum | |
| void | set_py (double pyy) |
| Set y-component of momentum. | |
| void | setPy (double pyy) |
| double | pz () const |
| z-component of momentum | |
| void | set_pz (double pzz) |
| Set z-component of momentum. | |
| void | setPz (double pzz) |
| double | e () const |
| Energy component of momentum. | |
| void | set_e (double ee) |
| Set energy component of momentum. | |
| void | setE (double ee) |
Computed properties | |
| double | length2 () const |
| Squared magnitude of (x, y, z) 3-vector. | |
| double | length () const |
| Magnitude of spatial (x, y, z) 3-vector. | |
| double | rho () const |
| Magnitude of spatial (x, y, z) 3-vector, for HepMC2 compatibility. | |
| double | perp2 () const |
| Squared magnitude of (x, y) vector. | |
| double | perp () const |
| Magnitude of (x, y) vector. | |
| double | interval () const |
| Spacetime invariant interval s^2 = t^2 - x^2 - y^2 - z^2. | |
| double | p3mod2 () const |
| Squared magnitude of p3 = (px, py, pz) vector. | |
| double | p3mod () const |
| Magnitude of p3 = (px, py, pz) vector. | |
| double | pt2 () const |
| Squared transverse momentum px^2 + py^2. | |
| double | pt () const |
| Transverse momentum. | |
| double | m2 () const |
| Squared invariant mass m^2 = E^2 - px^2 - py^2 - pz^2. | |
| double | m () const |
| Invariant mass. Returns -sqrt(-m) if e^2 - P^2 is negative. | |
| double | phi () const |
| Azimuthal angle. | |
| double | theta () const |
| Polar angle w.r.t. z direction. | |
| double | eta () const |
| Pseudorapidity. | |
| double | rap () const |
| Rapidity. | |
| double | abs_eta () const |
| Absolute pseudorapidity. | |
| double | abs_rap () const |
| Absolute rapidity. | |
| double | pseudoRapidity () const |
Comparisons to another FourVector | |
| bool | is_zero () const |
| Check if the length of this vertex is zero. | |
| double | delta_phi (const FourVector &v) const |
| Signed azimuthal angle separation in [-pi, pi]. | |
| double | delta_eta (const FourVector &v) const |
| Pseudorapidity separation. | |
| double | delta_rap (const FourVector &v) const |
| Rapidity separation. | |
| double | delta_r2_eta (const FourVector &v) const |
| R_eta^2-distance separation dR^2 = dphi^2 + deta^2. | |
| double | delta_r_eta (const FourVector &v) const |
| R_eta-distance separation dR = sqrt(dphi^2 + deta^2) | |
| double | delta_r2_rap (const FourVector &v) const |
| R_rap^2-distance separation dR^2 = dphi^2 + drap^2. | |
| double | delta_r_rap (const FourVector &v) const |
| R-rap-distance separation dR = sqrt(dphi^2 + drap^2) | |
Operators | |
| bool | operator== (const FourVector &rhs) const |
| Equality. | |
| bool | operator!= (const FourVector &rhs) const |
| Inequality. | |
| FourVector | operator+ (const FourVector &rhs) const |
| Arithmetic operator +. | |
| FourVector | operator- (const FourVector &rhs) const |
| Arithmetic operator -. | |
| FourVector | operator* (const double rhs) const |
| Arithmetic operator * by scalar. | |
| FourVector | operator/ (const double rhs) const |
| Arithmetic operator / by scalar. | |
| void | operator+= (const FourVector &rhs) |
| Arithmetic operator +=. | |
| void | operator-= (const FourVector &rhs) |
| Arithmetic operator -=. | |
| void | operator*= (const double rhs) |
| Arithmetic operator *= by scalar. | |
| void | operator/= (const double rhs) |
| Arithmetic operator /= by scalar. | |
Static Public Member Functions | |
| static const FourVector & | ZERO_VECTOR () |
| Static null FourVector = (0,0,0,0) | |
Generic 4-vector.
Interpretation of its content depends on accessors used: it's much simpler to do this than to distinguish between space and momentum vectors via the type system (especially given the need for backward compatibility with HepMC2). Be sensible and don't call energy functions on spatial vectors! To avoid duplication, most definitions are only implemented on the spatial function names, with the energy-momentum functions as aliases.
This is not intended to be a fully featured 4-vector, but does contain the majority of common non-boosting functionality, as well as a few support operations on 4-vectors.
The implementations in this class are fully inlined.
Definition at line 36 of file FourVector.h.
|
inline |
Default constructor.
Definition at line 40 of file FourVector.h.
Referenced by FourVector(), FourVector(), delta_eta(), delta_phi(), delta_r2_eta(), delta_r2_rap(), delta_r_eta(), delta_r_rap(), delta_rap(), operator!=(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator=(), operator=(), operator==(), and ZERO_VECTOR().
|
inline |
Sets all FourVector fields.
Definition at line 43 of file FourVector.h.
|
inline |
|
inline |
|
inline |
Pseudorapidity separation.
Definition at line 218 of file FourVector.h.
References FourVector(), and eta().
Referenced by delta_r2_eta().
|
inline |
Signed azimuthal angle separation in [-pi, pi].
Definition at line 209 of file FourVector.h.
References FourVector(), and phi().
Referenced by delta_r2_eta(), and delta_r2_rap().
|
inline |
R_eta^2-distance separation dR^2 = dphi^2 + deta^2.
Definition at line 224 of file FourVector.h.
References FourVector(), delta_eta(), and delta_phi().
Referenced by delta_r_eta().
|
inline |
R_rap^2-distance separation dR^2 = dphi^2 + drap^2.
Definition at line 234 of file FourVector.h.
References FourVector(), delta_phi(), and delta_rap().
Referenced by delta_r_rap().
|
inline |
R_eta-distance separation dR = sqrt(dphi^2 + deta^2)
Definition at line 229 of file FourVector.h.
References FourVector(), and delta_r2_eta().
|
inline |
R-rap-distance separation dR = sqrt(dphi^2 + drap^2)
Definition at line 239 of file FourVector.h.
References FourVector(), and delta_r2_rap().
|
inline |
Rapidity separation.
Definition at line 221 of file FourVector.h.
References FourVector(), and rap().
Referenced by delta_r2_rap().
|
inline |
Energy component of momentum.
Definition at line 135 of file FourVector.h.
References t().
Referenced by HepMC3::GenEvent::boost(), marley::ContinuumNuclearReaction::create_event(), HepMC3::Print::line(), rap(), and HepMC3::GenEvent::rotate().
|
inline |
Pseudorapidity.
Definition at line 178 of file FourVector.h.
Referenced by abs_eta(), delta_eta(), and pseudoRapidity().
|
inline |
get component of position/displacement
Definition at line 74 of file FourVector.h.
|
inline |
Spacetime invariant interval s^2 = t^2 - x^2 - y^2 - z^2.
Definition at line 158 of file FourVector.h.
References length2(), and t().
Referenced by m2().
|
inline |
Check if the length of this vertex is zero.
Definition at line 206 of file FourVector.h.
References t(), x(), y(), and z().
Referenced by HepMC3::GenEvent::rotate(), HepMC3::GenEvent::set_units(), and HepMC3::WriterAscii::write_event().
|
inline |
|
inline |
Squared magnitude of (x, y, z) 3-vector.
Definition at line 148 of file FourVector.h.
Referenced by HepMC3::GenEvent::boost(), interval(), length(), and p3mod2().
|
inline |
Invariant mass. Returns -sqrt(-m) if e^2 - P^2 is negative.
Definition at line 171 of file FourVector.h.
References m2().
|
inline |
Squared invariant mass m^2 = E^2 - px^2 - py^2 - pz^2.
Definition at line 169 of file FourVector.h.
References interval().
Referenced by m().
|
inline |
Inequality.
Definition at line 254 of file FourVector.h.
References FourVector().
|
inline |
Arithmetic operator * by scalar.
Definition at line 265 of file FourVector.h.
References FourVector(), t(), x(), y(), and z().
|
inline |
|
inline |
Arithmetic operator +.
Definition at line 257 of file FourVector.h.
References FourVector(), t(), x(), y(), and z().
|
inline |
|
inline |
Arithmetic operator -.
Definition at line 261 of file FourVector.h.
References FourVector(), t(), x(), y(), and z().
|
inline |
|
inline |
Arithmetic operator / by scalar.
Definition at line 269 of file FourVector.h.
References FourVector(), t(), x(), y(), and z().
|
inline |
|
inline |
|
inline |
Magnitude of p3 = (px, py, pz) vector.
Definition at line 163 of file FourVector.h.
References length().
Referenced by eta(), and marley::ProjectileDirectionRotator::process_event().
|
inline |
Squared magnitude of p3 = (px, py, pz) vector.
Definition at line 161 of file FourVector.h.
References length2().
|
inline |
Magnitude of (x, y) vector.
Definition at line 156 of file FourVector.h.
References perp2().
|
inline |
|
inline |
|
inline |
Same as eta()
Definition at line 197 of file FourVector.h.
References eta().
|
inline |
|
inline |
Squared transverse momentum px^2 + py^2.
Definition at line 165 of file FourVector.h.
References perp2().
|
inline |
x-component of momentum
Definition at line 114 of file FourVector.h.
References x().
Referenced by marley::ContinuumNuclearReaction::create_event(), marley::ProjectileDirectionRotator::process_event(), and marley::RotationMatrix::rotate_particle_inplace().
|
inline |
y-component of momentum
Definition at line 121 of file FourVector.h.
References y().
Referenced by marley::ContinuumNuclearReaction::create_event(), marley::ProjectileDirectionRotator::process_event(), and marley::RotationMatrix::rotate_particle_inplace().
|
inline |
z-component of momentum
Definition at line 128 of file FourVector.h.
References z().
Referenced by marley::ContinuumNuclearReaction::create_event(), eta(), marley::ProjectileDirectionRotator::process_event(), rap(), and marley::RotationMatrix::rotate_particle_inplace().
|
inline |
Rapidity.
Definition at line 184 of file FourVector.h.
Referenced by abs_rap(), and delta_rap().
|
inline |
Magnitude of spatial (x, y, z) 3-vector, for HepMC2 compatibility.
Definition at line 152 of file FourVector.h.
References length().
|
inline |
Set all FourVector fields, in order x,y,z,t.
Definition at line 58 of file FourVector.h.
|
inline |
|
inline |
Set energy component of momentum.
Definition at line 137 of file FourVector.h.
References set_t().
Referenced by setE().
|
inline |
Set x-component of momentum.
Definition at line 116 of file FourVector.h.
References set_x().
Referenced by marley::RotationMatrix::rotate_particle_inplace(), and setPx().
|
inline |
Set y-component of momentum.
Definition at line 123 of file FourVector.h.
References set_y().
Referenced by marley::RotationMatrix::rotate_particle_inplace(), and setPy().
|
inline |
Set z-component of momentum.
Definition at line 130 of file FourVector.h.
References set_z().
Referenced by marley::RotationMatrix::rotate_particle_inplace(), and setPz().
|
inline |
Set time component of position/displacement.
Definition at line 108 of file FourVector.h.
|
inline |
Set x-component of position/displacement.
Definition at line 87 of file FourVector.h.
|
inline |
Set y-component of position/displacement.
Definition at line 94 of file FourVector.h.
|
inline |
Set z-component of position/displacement.
Definition at line 101 of file FourVector.h.
|
inline |
Definition at line 139 of file FourVector.h.
References set_e().
|
inline |
Definition at line 118 of file FourVector.h.
References set_px().
|
inline |
Definition at line 125 of file FourVector.h.
References set_py().
|
inline |
Definition at line 132 of file FourVector.h.
References set_pz().
|
inline |
Definition at line 110 of file FourVector.h.
References set_t().
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), and HepMC3::GenEvent::reflect().
|
inline |
Definition at line 89 of file FourVector.h.
References set_x().
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), and HepMC3::GenEvent::reflect().
|
inline |
Definition at line 96 of file FourVector.h.
References set_y().
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), and HepMC3::GenEvent::reflect().
|
inline |
Definition at line 103 of file FourVector.h.
References set_z().
Referenced by operator*=(), operator+=(), operator-=(), operator/=(), and HepMC3::GenEvent::reflect().
|
inline |
Time component of position/displacement.
Definition at line 106 of file FourVector.h.
Referenced by e(), interval(), is_zero(), HepMC3::Print::listing(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator==(), HepMC3::GenEvent::rotate(), and HepMC3::WriterAscii::write_event().
|
inline |
|
inline |
x-component of position/displacement
Definition at line 85 of file FourVector.h.
Referenced by HepMC3::GenEvent::boost(), is_zero(), length2(), HepMC3::Print::line(), HepMC3::Print::listing(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator==(), perp2(), phi(), px(), HepMC3::GenEvent::rotate(), set_component(), and HepMC3::WriterAscii::write_event().
|
inline |
y-component of position/displacement
Definition at line 92 of file FourVector.h.
Referenced by HepMC3::GenEvent::boost(), is_zero(), length2(), HepMC3::Print::line(), HepMC3::Print::listing(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator==(), perp2(), phi(), py(), HepMC3::GenEvent::rotate(), and HepMC3::WriterAscii::write_event().
|
inline |
z-component of position/displacement
Definition at line 99 of file FourVector.h.
Referenced by HepMC3::GenEvent::boost(), is_zero(), length2(), HepMC3::Print::line(), HepMC3::Print::listing(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator==(), pz(), HepMC3::GenEvent::rotate(), theta(), and HepMC3::WriterAscii::write_event().
|
inlinestatic |
Static null FourVector = (0,0,0,0)
Definition at line 306 of file FourVector.h.
References FourVector().
Referenced by HepMC3::GenVertex::position().