|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.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. | |
| 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 (HepMC3::GenParticle &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.
Definition at line 30 of file RotationMatrix.hh.
| marley::RotationMatrix::RotationMatrix | ( | ) |
Creates a 3×3 identity matrix.
Definition at line 63 of file RotationMatrix.cc.
References matrix_.
| 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.
Definition at line 122 of file RotationMatrix.cc.
References matrix_.
|
static |
Definition at line 68 of file RotationMatrix.cc.
| ThreeVector marley::RotationMatrix::rotate_copy | ( | const ThreeVector & | v | ) |
Create a rotated copy of the 3-vector v.
Definition at line 83 of file RotationMatrix.cc.
References matrix_.
| void marley::RotationMatrix::rotate_inplace | ( | ThreeVector & | v | ) |
Rotate a 3-vector v in place.
Definition at line 91 of file RotationMatrix.cc.
References matrix_.
| void marley::RotationMatrix::rotate_particle_inplace | ( | HepMC3::GenParticle & | p | ) |
Rotate the 3-momentum of a marley::Particle in place.
Definition at line 99 of file RotationMatrix.cc.
References matrix_, HepMC3::GenParticle::momentum(), HepMC3::FourVector::px(), HepMC3::FourVector::py(), HepMC3::FourVector::pz(), HepMC3::GenParticle::set_momentum(), HepMC3::FourVector::set_px(), HepMC3::FourVector::set_py(), and HepMC3::FourVector::set_pz().
|
protected |
3×3 rotation matrix
Definition at line 59 of file RotationMatrix.hh.
Referenced by RotationMatrix(), RotationMatrix(), rotate_copy(), rotate_inplace(), and rotate_particle_inplace().