MARLEY (Model of Argon Reaction Low Energy Yields)
v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Simple rotation matrix implementation used to reorient Particle objects based on the incident neutrino direction. More...
#include <RotationMatrix.hh>
Public Member Functions | |
RotationMatrix () | |
Creates a 3×3 identity matrix. | |
RotationMatrix (const ThreeVector &from_vec, const ThreeVector &to_vec) | |
Create a 3×3 rotation matrix that rotates the 3-vector from_vec into the 3-vector to_vec. More... | |
ThreeVector | rotate_copy (const ThreeVector &v) |
Create a rotated copy of the 3-vector v. | |
void | rotate_inplace (ThreeVector &v) |
Rotate a 3-vector v in place. | |
void | rotate_particle_inplace (marley::Particle &p) |
Rotate the 3-momentum of a marley::Particle in place. | |
Static Public Member Functions | |
static ThreeVector | normalize (const ThreeVector &v) |
Protected Attributes | |
ThreeThreeMatrix | matrix_ |
3×3 rotation matrix | |
Simple rotation matrix implementation used to reorient Particle objects based on the incident neutrino direction.
marley::RotationMatrix::RotationMatrix | ( | const ThreeVector & | from_vec, |
const ThreeVector & | to_vec | ||
) |
Create a 3×3 rotation matrix that rotates the 3-vector from_vec into the 3-vector to_vec.
This function is a C++11 version of an original rotation matrix program by Möller & Hughes (see this GitHub page for details)
The vectors from_vec and to_vec do not need to be normalized, but both should be nonzero. If either vector is a null vector, then a marley::Error will be thrown.