Physics Objects#
-
class ThreeVector#
ThreeVector is a container for dealing with three vectors.
The ThreeVector class provides an easy to use container to handle three component vectors, such as position and three-momentums
Constructors and Destructors
-
inline ThreeVector() noexcept#
Create an empty ThreeVector object.
-
inline constexpr ThreeVector(std::array<double, 3> p) noexcept#
Create a ThreeVector object with values given by p
- Parameters:
p – A std::array<double, 3> containing the values for the vector
-
inline constexpr ThreeVector(double pX, double pY, double pZ) noexcept#
Create a ThreeVector object with values pX, pY, and pZ
- Parameters:
pX – The x value of the vector
pY – The y value of the vector
pZ – The z value of the vector
-
ThreeVector(const ThreeVector &other) noexcept = default#
Create a copy of a ThreeVector object
- Parameters:
other – The vector to be copied
-
ThreeVector(ThreeVector &&other) noexcept = default#
Move a ThreeVector object to another
- Parameters:
other – The vector to be moved
-
ThreeVector &operator=(const ThreeVector&) noexcept = default#
Assign a vector to another vector object
- Parameters:
other – three vector to be assigned
- Returns:
ThreeVector: assigned new vector
-
~ThreeVector() = default#
Default destructor.
Setters
These functions provide access to setting the parameters of the ThreeVector
-
inline void SetXYZ(const std::array<double, 3> &position) noexcept#
Set position variable based on pased in array
- Parameters:
position – position to be stored
-
inline void SetXYZ(const double &x, const double &y, const double &z) noexcept#
Set position variable based on pased in array
- Parameters:
x – position in the x-direction to be stored
y – position in the y-direction to be stored
z – position in the z-direction to be stored
-
inline void SetPxPyPz(const std::array<double, 3> momentum) noexcept#
Set position variable based on pased in array
- Parameters:
momentum – three momentum to be stored
-
inline void SetPxPyPz(const double &pX, const double &pY, const double &pZ) noexcept#
Set momentum variable based on pased in array
- Parameters:
pX – momentum in the x-direction to be stored
pY – momentum in the y-direction to be stored
pZ – momentum in the z-direction to be stored
-
inline void SetX(const double &x) noexcept#
Set only the position in the x-direction
- Parameters:
x – value to be stored
-
inline void SetY(const double &y) noexcept#
Set only the position in the y-direction
- Parameters:
y – value to be stored
-
inline void SetZ(const double &z) noexcept#
Set only the position in the z-direction
- Parameters:
z – value to be stored
-
inline void SetPx(const double &pX) noexcept#
Set only the momentum in the x-direction
- Parameters:
pX – value to be stored
-
inline void SetPy(const double &pY) noexcept#
Set only the momentum in the y-direction
- Parameters:
pY – value to be stored
-
inline void SetPz(const double &pZ) noexcept#
Set only the position in the z-direction
- Parameters:
pZ – value to be stored
Getters
These functions provide get specific features from the ThreeVector object
-
inline const std::array<double, 3> &Position() const noexcept#
Return the position as an array
- Returns:
std::array<double, 3>: containing the position
-
inline const double &X() const noexcept#
Return the position in the x-direction
- Returns:
double: containing the position in the x-direction
-
inline const double &Y() const noexcept#
Return the position in the y-direction
- Returns:
double: containing the position in the y-direction
-
inline const double &Z() const noexcept#
Return the position in the z-direction
- Returns:
double: containing the position in the z-direction
-
inline const double &Px() const noexcept#
Return the momentum in the x-direction
- Returns:
double: containing the momentum in the x-direction
-
inline const double &Py() const noexcept#
Return the momentum in the y-direction
- Returns:
double: containing the momentum in the y-direction
-
inline const double &Pz() const noexcept#
Return the momentum in the z-direction
- Returns:
double: containing the momentum in the z-direction
-
inline double Pt2() const noexcept#
Return the transverse momentum squared
- Returns:
double: containing the transverse momentum squared
-
inline double Pt() const noexcept#
Return the transverse momentum
- Returns:
double: containing the transverse momentum
-
inline double P2() const noexcept#
Return the three momentum squared
- Returns:
double: containing the three momentum squared
-
inline double P() const noexcept#
Return the three momentum
- Returns:
double: containing the three momentum
-
inline double Magnitude2() const noexcept#
Return the magnitude squared of the vector
- Returns:
double: containing the magnitude squared of the vector
-
inline double Magnitude() const noexcept#
Return the magnitude of the vector
- Returns:
double: containing the magnitude of the vector
-
double Theta() const noexcept#
Return the angle between the z-component and the transverse component
- Returns:
double: containing the angle between the z and transverse components
-
double Phi() const noexcept#
Return the angle between the x and y components
- Returns:
double: containing the angle between the x and y components
-
ThreeVector Rotate(const std::array<double, 3>&) const noexcept#
Rotate the three vector to the frame given by the 3 angles
- Parameters:
angles – The rotation angles
- Returns:
FourVector: The vector in the corresponding frame
-
ThreeVector Rotate(const RotMat&) const noexcept#
Rotate the three vector to the frame given by the 3 angles
- Parameters:
angles – The rotation matrix
- Returns:
FourVector: The vector in the corresponding frame
-
RotMat Align(const ThreeVector&) const noexcept#
Obtain the rotation matrix to align the vector with a given axis
- Parameters:
axis – The axis to rotate to align with
- Returns:
std::array<double, 9>: The rotation matrix to align the vector with the given axis
-
RotMat AlignZ() const noexcept#
Get the rotation matrix to align the vector with the z-axis
- Returns:
std::array<double, 9>: The matrix needed to define the rotation
Functions
-
inline double Dot(const ThreeVector &other) const noexcept#
Calculate the dot product between two three vectors
- Parameters:
other – three vector to take dot product with
- Returns:
double: the value of the dot product
-
ThreeVector Cross(const ThreeVector&) const noexcept#
Calculate the cross product between two three vectors
- Parameters:
other – three vector to take cross product with
- Returns:
ThreeVector: the resultant cross product
-
ThreeVector Unit() const noexcept#
Return a unit vector in the direction of the vector
- Returns:
ThreeVector: a unit vector in the direction of the vector
-
std::string ToString() const noexcept#
Return a string representation of the vector
- Returns:
std::string: a string representation of the vector
Operator Overloads
Operator overloads of math functions for ease of use
-
ThreeVector &operator+=(const ThreeVector&) noexcept#
Add two three vectors together
- Parameters:
other – three vector to add to this one
- Returns:
ThreeVector: The sum of the two three vectors
-
ThreeVector &operator-=(const ThreeVector&) noexcept#
Subtract two three vectors together
- Parameters:
other – three vector to subtract from this one
- Returns:
ThreeVector: The difference of the two three vectors
-
ThreeVector &operator*=(const double&) noexcept#
Scale a three vector by a constant
- Parameters:
scale – value to scale three vector by
- Returns:
ThreeVector: The scaled three vector
-
ThreeVector &operator/=(const double&)#
Reduce the magnitude of a three vector by a constant
- Parameters:
scale – value to scale three vector by
- Returns:
ThreeVector: The scaled three vector
-
double operator*(const ThreeVector&) const noexcept#
Calculate dot product of two vectors
- Parameters:
other – The other vector to take the dot product with
- Returns:
double: The value of the dot product
-
ThreeVector operator-() const noexcept#
Negate a given vector
- Returns:
ThreeVector: The negative of the input vector
-
ThreeVector operator+() const noexcept#
Unary plus operator
- Returns:
ThreeVector: The input vector
-
ThreeVector operator*(const double&) const noexcept#
Scale a three vector by a constant
- Parameters:
scale – value to scale three vector by
- Returns:
ThreeVector: The scaled three vector
-
ThreeVector operator/(const double&) const#
Reduce the magnitude of a three vector by a constant
- Parameters:
scale – value to scale three vector by
- Returns:
ThreeVector: The scaled three vector
-
ThreeVector operator-(const ThreeVector&) const noexcept#
Calculate difference of two vectors
- Parameters:
other – The other vector to take the difference with
- Returns:
ThreeVector: The resulting difference vector
-
ThreeVector operator+(const ThreeVector&) const noexcept#
Calculate sum of two vectors
- Parameters:
other – The other vector to take the sum with
- Returns:
ThreeVector: The resulting sum vector
-
bool operator==(const ThreeVector&) const noexcept#
Determine if two three vectors are equivalent
- Parameters:
other – The vector to compare against
- Returns:
bool: True, if the vectors are equal otherwise False
-
inline bool operator!=(const ThreeVector &other) const noexcept#
Determine if two three vectors are not equivalent
- Parameters:
other – The vector to compare against
- Returns:
bool: False, if the vectors are equal otherwise True
-
inline double &operator[](const std::size_t &idx)#
Access a given index from the vector
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
-
inline const double &operator[](const std::size_t &idx) const#
Access a given index from the vector
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
-
inline double &at(const std::size_t &idx)#
Access a given index from the vector with range checks
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
-
inline const double &at(const std::size_t &idx) const#
Access a given index from the vector with range checks
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
Stream Operators
Stream operators for writing to and reading from streams
-
template<typename OStream>
inline friend OStream &operator<<(OStream &os, const ThreeVector &vec3)# Write out a vector to an output stream
- Parameters:
ostr – Output stream to write to
vec – The three vector to be written out
-
friend std::istream &operator>>(std::istream&, ThreeVector&)#
Write in a vector to an input stream
- Parameters:
istr – Input stream to read from
vec – The three vector to be read into
-
inline ThreeVector() noexcept#
-
class FourVector#
FourVector is a container for dealing with four vectors.
The FourVector class provides an easy to use container to handle four component vectors, such as four-position and four-momentum
Constructors and Destructors
-
inline constexpr FourVector() noexcept#
Create an empty FourVector object.
-
inline constexpr FourVector(std::array<double, 4> p) noexcept#
Create a ThreeVector object with values given by p
- Parameters:
p – A std::array<double, 4> containing the values for the vector
-
inline constexpr FourVector(double E, double pX, double pY, double pZ) noexcept#
Create a FourVector object with values pX, pY, pZ, and E
- Parameters:
pX – The px value of the vector
pY – The py value of the vector
pZ – The pz value of the vector
E – The E value of the vector
-
FourVector(const ThreeVector &other, const double &E) noexcept#
Create a FourVector object from a ThreeVector and an energy
- Parameters:
other – ThreeVector object containing 3-momentum information
E – Energy for the given vector
-
FourVector(const FourVector &other) noexcept = default#
Create a copy of a FourVector object
- Parameters:
other – The vector to be copied
-
FourVector(FourVector&&) noexcept = default#
Move a FourVector object to another
- Parameters:
other – The vector to be moved
-
~FourVector() = default#
Default destructor.
Setters
These functions provide access to setting the parameters of the FourVector
-
inline void SetPxPyPzE(const std::array<double, 4> p) noexcept#
Set momentum variable based on pased in array
- Parameters:
p – momentum to be stored
-
inline void SetPxPyPzE(const double &pX, const double &pY, const double &pZ, const double &E) noexcept#
Set momentum variable based on pased in array
- Parameters:
pX – momentum in the x-direction to be stored
pY – momentum in the y-direction to be stored
pZ – momentum in the z-direction to be stored
E – energy to be stored
-
void SetVectM(const ThreeVector &p, const double &mass) noexcept#
Set the four momentum variable given a three momentum and a mass
- Parameters:
p – The three momentum to use
mass – The invariant mass of the object
-
inline void SetPx(const double &pX) noexcept#
Set only the x momentum
- Parameters:
pX – momentum in the x-direction to be stored
-
inline void SetPy(const double &pY) noexcept#
Set only the y momentum
- Parameters:
pY – momentum in the y-direction to be stored
-
inline void SetPz(const double &pZ) noexcept#
Set only the z momentum
- Parameters:
pZ – momentum in the z-direction to be stored
-
inline void SetE(const double &E) noexcept#
Set only the energy
- Parameters:
E – the energy
Getters
These functions provide get specific features from the FourVector object
-
inline const std::array<double, 4> &Momentum() const noexcept#
Return the momentum as an array
- Returns:
std::array<double, 4>: An array containing the four momentum
-
inline const double &X() const noexcept#
Return the x-coordinate
- Returns:
double: the x-coordinate
-
inline const double &Y() const noexcept#
Return the y-coordinate
- Returns:
double: the y-coordinate
-
inline const double &Z() const noexcept#
Return the z-coordinate
- Returns:
double: the z-coordinate
-
inline const double &T() const noexcept#
Return the time
- Returns:
double: the time
-
inline const double &Px() const noexcept#
Return the momentum in the x-direction
- Returns:
double: the momentum in the x-direction
-
inline const double &Py() const noexcept#
Return the momentum in the y-direction
- Returns:
double: the momentum in the y-direction
-
inline const double &Pz() const noexcept#
Return the momentum in the z-direction
- Returns:
double: the momentum in the z-direction
-
inline const double &E() const noexcept#
Return the energy
- Returns:
double: the energy
-
inline double Pt2() const noexcept#
Return the transverse momentum squared
- Returns:
double: Transverse momentum squared
-
inline double Pt() const noexcept#
Return the transverse momentum
- Returns:
double: Transverse momentum
-
inline double P2() const noexcept#
Return the three momentum squared
- Returns:
double: Three momentum squared
-
inline double P() const noexcept#
Return the three momentum
- Returns:
double: Three momentum
-
inline double M2() const noexcept#
Return the invariant mass squared
- Returns:
double: The invariant mass squared
-
double M() const noexcept#
Return the invariant mass
- Returns:
double: The invariant mass
-
inline double Magnitude2() const noexcept#
Return the Minkowski magnitude squared
- Returns:
double: The magnitude squared
-
inline double Magnitude() const noexcept#
Return the Minkowski magnitude
- Returns:
double: The magnitude
-
double Theta() const noexcept#
Return the angle between the z-axis and the transverse plane
- Returns:
double: Angle between z-axis and transverse plane
-
inline double CosTheta() const noexcept#
Return cosine of the angle between the z-axis and the transverse plane
- Returns:
double: Angle between z-axis and transverse plane
-
double Phi() const noexcept#
Return the angle in the transverse plane
- Returns:
double: The angle in the transverse plane
-
double Rapidity() const noexcept#
Return the rapidity of the momentum
- Returns:
double: The rapidity associated with the momentum
-
double DeltaR(const FourVector&) const noexcept#
Return the distance in the Eta-Phi plane between two four vectors
- Returns:
double: Distance between two four vectors in Eta-Phi plane
-
ThreeVector Vec3() const noexcept#
Return the three momentum component
- Returns:
ThreeVector: The three momentum component
Functions
-
FourVector Boost(const ThreeVector&) const noexcept#
Boost the four vector to the frame given by the three vector velocities
- Parameters:
beta – The boost vector to determine the frame
- Returns:
FourVector: The vector in the corresponding frame
-
FourVector Boost(const double&, const double&, const double&) const noexcept#
Boost the four vector to the frame given by the three vector velocities
- Parameters:
beta_x – The boost in the x-direction
beta_y – The boost in the y-direction
beta_z – The boost in the z-direction
- Returns:
FourVector: The vector in the corresponding frame
-
FourVector Rotate(const RotMat&) const noexcept#
Rotate the four vector to the frame given by the 3 angles
- Parameters:
mat – The rotation matrix
- Returns:
FourVector: The vector in the corresponding frame
-
FourVector RotateBack(const RotMat&) const noexcept#
Rotate the four vector to the frame given by the 3 angles
- Parameters:
mat – The rotation matrix
- Returns:
FourVector: The vector in the corresponding frame
-
RotMat Align(const ThreeVector&) const noexcept#
Obtain the rotation matrix to align the vector with a given axis
- Parameters:
axis – The axis to rotate to align with
- Returns:
std::array<double, 9>: The rotation matrix to align the vector with the given axis
-
RotMat AlignZ() const noexcept#
Get the rotation matrix to align the vector with the z-axis
- Returns:
std::array<double, 9>: The matrix needed to define the rotation
-
FourVector Cross(const FourVector&) const noexcept#
Calculate the cross product between two four vectors
- Parameters:
other – The vector to take the cross product with respect to
- Returns:
FourVector: The vector perpendicular to the two inputs
-
ThreeVector BoostVector() const noexcept#
Return the the boost vector required to boost to the rest frame of a given four vector
- Returns:
ThreeVector: Boost vector
-
inline double Dot(const FourVector &other) const noexcept#
Calculate the dot product between two four vectors
- Parameters:
other – four vector to take dot product with
- Returns:
double: the value of the dot product
-
double CosAngle(const FourVector&) const noexcept#
Calculate the cosine of the angle between two four vectors
- Parameters:
other – four vector to take angle between
- Returns:
double: cos(angle) between the two four vectors in radians
-
double Angle(const FourVector&) const noexcept#
Calculate the angle between two four vectors
- Parameters:
other – four vector to take angle between
- Returns:
double: angle between the two four vectors in radians
-
std::string ToString() const noexcept#
Return a string representation of the vector
- Returns:
std::string: a string representation of the vector
Operator Overloads
Operator overloads of math functions for ease of use
-
FourVector &operator=(const FourVector&) noexcept = default#
Assign a vector to another vector object
- Parameters:
other – four vector to be assigned
- Returns:
FourVector: assigned new vector
-
FourVector &operator+=(const FourVector&) noexcept#
Add two four vectors together
- Parameters:
other – four vector to add to this one
- Returns:
FourVector: The sum of the two four vectors
-
FourVector &operator-=(const FourVector&) noexcept#
Subtract two four vectors together
- Parameters:
other – four vector to subtract from this one
- Returns:
FourVector: The difference of the two four vectors
-
FourVector &operator*=(const double&) noexcept#
Scale a four vector by a constant
- Parameters:
scale – value to scale four vector by
- Returns:
FourVector: The scaled four vector
-
FourVector &operator/=(const double&)#
Reduce the magnitude of a four vector by a constant
- Parameters:
scale – value to scale four vector by
- Returns:
FourVector: The scaled four vector
-
double operator*(const FourVector&) const noexcept#
Calculate dot product of two vectors
- Parameters:
other – The other vector to take the dot product with
- Returns:
double: The value of the dot product
-
FourVector operator-() const noexcept#
Negate a given vector
- Returns:
FourVector: The negative of the input vector
-
FourVector operator+() const noexcept#
Unary plus operator
- Returns:
FourVector: The input vector
-
FourVector operator*(const double&) const noexcept#
Scale a four vector by a constant
- Parameters:
scale – value to scale four vector by
- Returns:
FourVector: The scaled four vector
-
FourVector operator/(const double&) const#
Reduce the magnitude of a four vector by a constant
- Parameters:
scale – value to scale four vector by
- Returns:
FourVector: The scaled four vector
-
FourVector operator-(const FourVector&) const noexcept#
Calculate difference of two vectors
- Parameters:
other – The other vector to take the difference with
- Returns:
FourVector: The resulting difference vector
-
FourVector operator+(const FourVector&) const noexcept#
Calculate sum of two vectors
- Parameters:
other – The other vector to take the sum with
- Returns:
FourVector: The resulting sum vector
-
bool operator==(const FourVector&) const noexcept#
Determine if two four vectors are equivalent
- Parameters:
other – The vector to compare against
- Returns:
bool: True, if the vectors are equal otherwise False
-
inline bool operator!=(const FourVector &other) const noexcept#
Determine if two four vectors are not equivalent
- Parameters:
other – The vector to compare against
- Returns:
bool: False, if the vectors are equal otherwise True
-
bool Approx(const FourVector&, double eps = 1e-8) const noexcept#
- Parameters:
other – The vector to compare against
- Returns:
bool: True, if the vectors are equal otherwise False
-
inline double &operator[](const std::size_t &idx)#
Access a given index from the vector
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
-
inline const double &operator[](const std::size_t &idx) const#
Access a given index from the vector
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
-
inline double &at(const std::size_t &idx)#
Access a given index from the vector with range checks
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
-
inline const double &at(const std::size_t &idx) const#
Access a given index from the vector with range checks
- Parameters:
idx – Index to access
- Returns:
double: The value of the vector at the given index
Stream Operators
Stream operators for writing to and reading from streams
-
template<typename OStream>
inline friend OStream &operator<<(OStream &os, const FourVector &vec4)# Write out a vector to an output stream
- Parameters:
ostr – Output stream to write to
vec – The four vector to be written out
-
friend std::istream &operator>>(std::istream&, FourVector&)#
Write in a vector to an input stream
- Parameters:
istr – Input stream to read from
vec – The four vector to be read into
-
inline constexpr FourVector() noexcept#
-
class ParticleInfo#
-
class Particle#
The Particle class provides a container to handle information about the particle. The information includes the particle identification (PID), the momentum of the particle, the position of the particle, the status code associated with the particle, the particle’s mother particles, the particle’s daughter particles, and any other needed information. Currently, the status codes are as follows:
@rst
+———-—+——————–—+ | Status Code | Meaning | +=============+=======================+ | -1 | Propagating Particle | +———-—+——————–—+ | 0 | Background Particle | +———-—+——————–—+ | 1 | Escaped Particle | +———-—+——————–—+
@endrst
Constructors and Destructors
-
inline explicit Particle(const PID &pid = PID{0}, FourVector mom = FourVector(), ThreeVector pos = ThreeVector(), const ParticleStatus &_status = ParticleStatus::background, std::vector<Particle> _mothers = std::vector<Particle>(), std::vector<Particle> _daughters = std::vector<Particle>()) noexcept#
Create a particle
- Parameters:
pid – The PID of the particle (default = 0)
momentum – The momentum of the particle (default = FourVector())
position – The position of the particle (default = ThreeVector())
status – The status code of the particle (default = 0)
mothers – The mother particles of the particle (default = Empty)
daughters – The daughter particles of the particle (default = Empty)
-
~Particle() = default#
Default destructor.
Setters
These functions provide access to setting the parameters of the Particle object
-
inline void SetPosition(const ThreeVector &pos) noexcept#
Set the position of the particle
- Parameters:
ThreeVector – The position to be set
-
inline void SetMomentum(const FourVector &mom) noexcept#
Set the momentum of the particle
- Parameters:
FourVector – The momentum to be set
-
inline void SetMothers(const std::vector<Particle> &_mothers) noexcept#
Set the mother particles of the given particle
- Parameters:
std::vector<int> – A vector containing information about the mother particles
-
inline void SetDaughters(const std::vector<Particle> &_daughters) noexcept#
Set the daughter particles of the given particle
- Parameters:
std::vector<int> – A vector containing information about the daughter particles
-
inline void AddMother(const Particle &part) noexcept#
Add a new mother particle to an existing particle
- Parameters:
idx – The index of the mother particle to be set
-
inline void AddDaughter(const Particle &part) noexcept#
Add a new daughter particle to an existing particle
- Parameters:
idx – The index of the daughter particle to be set
-
void SetFormationZone(const FourVector&, const FourVector&) noexcept#
Set the formation zone of the particle. The formation zone is a time in which the particle is not allowed to interact. The formation zone is discussed in detail in:
L. Stodolsky, Formation Zone Description in Multiproduction, 1975
Phys. Rev. C. 86.015505.
The equation is given by:
\[ t_{f} = \frac{E}{|p\cdot q|}, \]where E is the energy of the incoming hadron, p and q are the momentum of the incoming (outgoing) hadron.- Parameters:
p – The momentum of the hadron before the interaction
q – The momentum of the hadron after the interaction
-
inline void UpdateFormationZone(const double &timeStep) noexcept#
Update the formation zone time by a given time step
- Parameters:
timeStep – The time step to update the formation zone by
Getters
These functions provide get specific features from the Particle object
-
inline PID ID() const noexcept#
Return the pid of the particle
- Returns:
int: PID of the particle
-
inline ThreeVector &Position() noexcept#
Returns the position of the particle
- Returns:
ThreeVector: The position of the particle
-
inline const FourVector &Momentum() const noexcept#
Returns the momentum of the particle
- Returns:
FourVector: The momentum of the particle
-
inline const ThreeVector Beta() const noexcept#
Gets the velocity / boost vector of a given particle
- Returns:
ThreeVector: Velocity of the particle in units of c
-
inline const ParticleStatus &Status() const noexcept#
Gets the current particle status
- Returns:
int: The status of the particle
-
inline ParticleStatus &Status() noexcept#
Set the status of the particle (See Particle description for details)
- Parameters:
int – The status to be set
-
inline const std::vector<Particle> &Mothers() const noexcept#
Return a vector of the mother particle indices
- Returns:
std::vector<Particle>: A vector of Particles referring to the mothers
-
inline const std::vector<Particle> &Daughters() const noexcept#
Return a vector of the daughter particle indices
- Returns:
std::vector<Particle>: A vector of Particles referring to the daughters
-
inline const double &FormationZone() const noexcept#
Return the current time remaining in the formation zone
- Returns:
double: Time left in formation zone
-
inline double Mass() const noexcept#
Return the mass of the given particle
- Returns:
double: The mass of the particle
-
inline double Px() const noexcept#
Return the momentum in the x-direction
- Returns:
double: Value of momentum in x-direction
-
inline double Py() const noexcept#
Return the momentum in the y-direction
- Returns:
double: Value of momentum in y-direction
-
inline double Pz() const noexcept#
Return the momentum in the z-direction
- Returns:
double: Value of momentum in z-direction
-
inline double E() const noexcept#
Return the energy
- Returns:
double: Value of energy
Functions
-
inline bool InFormationZone() const noexcept#
Check to see if the particle is in the formation zone
- Returns:
bool: True if in formation zone, False otherwise
-
inline bool IsBackground() const noexcept#
Check to see if the particle is a background particle
- Returns:
bool: True if a background particle, False otherwise
-
inline bool IsPropagating() const noexcept#
Check to see if the particle is a propagating particle in the nucleus
- Returns:
bool: True if a propagating particle, False otherwise
-
inline bool IsFinal() const noexcept#
Check to see if the particle is a final state particle
- Returns:
bool: True if a final state particle, False otherwise
-
inline bool IsInitial() const noexcept#
Check to see if the particle is a final state particle
- Returns:
bool: True if a final state particle, False otherwise
-
inline bool IsExternal() const noexcept#
Check to see if the particle should be written out
- Returns:
bool: True if the particle should be written out, False otherwise
-
void Propagate(const double&) noexcept#
Propagate the particle according to its momentum by a given time step
- Parameters:
timeStep – The amount of time to propagate the particle for
-
inline double GetDistanceTraveled() const#
Returns the distance travelled by the particle
- Returns:
double: the distance travelled by the particle
-
void BackPropagate(const double&) noexcept#
Propagate a particle back in time. Useful for testing purposes
- Parameters:
timeStep – The amount of time to propagate a particle back in time for
-
void Rotate(const std::array<double, 9>&) noexcept#
Rotate the particle’s spatial momentum using a 3x3 rotation matrix
- Parameters:
rot_mat – the 3x3 rotation matrix
-
std::string ToString() const noexcept#
Return a string representation of the particle
- Returns:
std::string: a string representation of the particle
-
inline explicit Particle(const PID &pid = PID{0}, FourVector mom = FourVector(), ThreeVector pos = ThreeVector(), const ParticleStatus &_status = ParticleStatus::background, std::vector<Particle> _mothers = std::vector<Particle>(), std::vector<Particle> _daughters = std::vector<Particle>()) noexcept#
-
class Nucleus#
The Nucleus class implements the physics needed to describe an arbitrary nucleus. It provides the ability to generate configurations of nucleons for the cascade, as well as perform checks on if nucleons are captured in the potential or escape.
Constructors and Destructors
-
Nucleus() = default#
Create a nucleus
- Parameters:
Z – The number of protons
A – The number of nucleons
binding – The binding energy of the nucleus
densityFile – The file containing density information for Pauli Blocking TODO: This should be added to the Nucleus class when we refactor to have the Nucleus passed in as an object
density – A function that generates nucleon configurations according to the density profile
-
~Nucleus() = default#
Default destructor.
Setters
These functions provide access to setting the parameters of the Nucleus object
-
inline void SetBindingEnergy(const double &energy) noexcept#
Set the binding energy of the nucleus in MeV
- Parameters:
energy – The binding energy to be set in MeV
-
inline void SetFermiMomentum(const double &mom) noexcept#
Set the Fermi Momentum of the nucleus in MeV
- Parameters:
mom – The Fermi Momentum to be set in MeV
-
inline void SetDensity(std::unique_ptr<Density> _density) noexcept#
Set the density function to use for configuration generation
- Parameters:
density – The function to be use for generating nucleons
-
inline void SetPotential(std::unique_ptr<Potential> _potential) noexcept#
Set the potential function used for propagation in the nucleus
- Parameters:
potential – The potential to use
Getters
These functions provide get specific features from the Nucleus object
-
inline PID ID() const#
Return the nuclear PID
- Returns:
PID: The pid for the given nucleus
-
inline Particle InitParticle() const#
Return a particle with initial momentum for at rest nucleus and correct PID
-
inline std::size_t NNucleons() const noexcept#
Return the number of nucleons in the nucleus
- Returns:
int: The number of nucleons in the nucleus
-
inline std::size_t NProtons() const noexcept#
Return the number of protons in the nucleus
- Returns:
int: The number of protons in the nucleus
-
inline std::size_t NNeutrons() const noexcept#
Return the number of neutrons in the nucleus
- Returns:
int: The number of neutrons in the nucleus
-
inline const double &BindingEnergy() const noexcept#
Return the current binding energy of the nucleus
- Returns:
double: The binding energy in MeV
-
inline const double &FermiMomentum() const noexcept#
Return the current Fermi Momentum of the nucleus
- Returns:
double: The Fermi Momentum in MeV
-
inline std::shared_ptr<Potential> GetPotential() const noexcept#
Return the phenomenological potential
- Returns:
std::shared_ptr<Potential>: The potential of the nucleus
-
inline const double &Radius() const noexcept#
Return the radius cutoff of the nucleus used for the cascade
- Returns:
double: The radius in femtometers
-
inline double Rho(const double &position) const noexcept#
Return the density of the nucleus at a given location
- Parameters:
position – The radius to calculate the density at
- Returns:
double: The density at the input radius
Functions
-
Particles GenerateConfig()#
Generate a configuration of the nucleus based on the density function.
-
const std::array<double, 3> GenerateMomentum(const double&, const PID&) noexcept#
Generate a random momentum for a nucleon in the nucleus
- Returns:
std::array<double, 3>: Random momentum generated using the Fermi momentum
-
const std::string ToString() const noexcept#
Return a string representation of the nucleus
- Returns:
std::string: a string representation of the nucleus
Stream Operators
These functions are currently not implemented for this class
Public Functions
-
inline void SetRadius(const double &_radius) noexcept#
Set the radius of the nucleus in fm
- Parameters:
radius – The radius to be set in fm
-
void SetDensityProfile(const std::vector<double> &radii, const std::vector<double> &proton_density, const std::vector<double> &neutron_density)#
Set the nucleon density profiles, tabulated against radius, instead of reading them from the density files the constructor takes
- Parameters:
radii – The radii in fm the densities are tabulated at
proton_density – The proton density in fm^-3 at each radius
neutron_density – The neutron density in fm^-3 at each radius
-
void Initialize(size_t protons, size_t nucleons)#
Setup basic properties for nuclei, needed to setup hydrogen correctly
- Parameters:
protons – Number of protons
nucleons – Number of nucleons
-
inline double ProtonRho(const double &position) const noexcept#
Return the density of the nucleus at a given location
- Parameters:
position – The radius to calculate the density at
- Returns:
double: The density at the input radius
-
inline double NeutronRho(const double &position) const noexcept#
Return the density of the nucleus at a given location
- Parameters:
position – The radius to calculate the density at
- Returns:
double: The density at the input radius
-
double FermiMomentum(const double&, const PID&) const#
Return the Fermi momentum according to a given FG model
- Parameters:
position – The radius to calculate the density
Public Static Functions
-
static Nucleus MakeNucleus(const std::string&, const double&, const double&, const std::string&, const std::string&, const FermiGas&, std::unique_ptr<Density>)#
Generate a nucleus based on an input string, a binding energy, a Fermi Momentum, and a density function. The format of the string has to be of the form, AX, where A represents the number of nucleons, and X represents the chemical symbol for the element. Currently, the following elements are available in the code:
@rst
+–—+–—+ | Z | X | +=====+=====+ | 1 | H | +–—+–—+ | 2 | He | +–—+–—+ | 3 | Li | +–—+–—+ | 6 | C | +–—+–—+ | 8 | O | +–—+–—+ | 13 | Al | +–—+–—+ | 18 | Ar | +–—+–—+ | 20 | Ca | +–—+–—+ | 26 | Fe | +–—+–—+
@endrst
- Parameters:
name – Nucleus in format discussed above
binding – The binding energy of the nucleus
densityFile – The file containing density information for Pauli Blocking TODO: This should be added to the Nucleus class when we refactor to have the Nucleus passed in as an object
density – The density function to use to generate configurations with
-
struct FermiGas#
-
Nucleus() = default#