MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
marley::RotationMatrix Class Reference

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
 

Detailed Description

Simple rotation matrix implementation used to reorient Particle objects based on the incident neutrino direction.

Constructor & Destructor Documentation

◆ RotationMatrix()

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.


The documentation for this class was generated from the following files: