MARLEY (Model of Argon Reaction Low Energy Yields)
v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
include
marley
RotationMatrix.hh
1
//
5
// This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6
//
7
// MARLEY is free software: you can redistribute it and/or modify it under the
8
// terms of version 3 of the GNU General Public License as published by the
9
// Free Software Foundation.
10
//
11
// For the full text of the license please see COPYING or
12
// visit http://opensource.org/licenses/GPL-3.0
13
//
14
// Please respect the MCnet academic usage guidelines. See GUIDELINES
15
// or visit https://www.montecarlonet.org/GUIDELINES for details.
16
17
#pragma once
18
19
// Standard library includes
20
#include <array>
21
22
// MARLEY includes
23
#include "marley/Particle.hh"
24
25
namespace
marley {
26
29
class
RotationMatrix
{
30
31
using
ThreeVector = std::array<double, 3>;
32
using
ThreeThreeMatrix = std::array<ThreeVector, 3>;
33
34
public
:
35
37
RotationMatrix
();
38
41
RotationMatrix
(
const
ThreeVector& from_vec,
const
ThreeVector& to_vec);
42
44
ThreeVector
rotate_copy
(
const
ThreeVector& v);
45
46
// Returns a copy of the 3-vector v normalized to have unit magnitude
47
static
ThreeVector normalize(
const
ThreeVector& v);
48
50
void
rotate_inplace
(ThreeVector& v);
51
53
void
rotate_particle_inplace
(
marley::Particle
& p);
54
55
protected
:
56
58
ThreeThreeMatrix
matrix_
;
59
};
60
61
}
marley::Particle
Momentum four-vector for a simulated particle.
Definition:
Particle.hh:32
marley::RotationMatrix
Simple rotation matrix implementation used to reorient Particle objects based on the incident neutrin...
Definition:
RotationMatrix.hh:29
marley::RotationMatrix::rotate_inplace
void rotate_inplace(ThreeVector &v)
Rotate a 3-vector v in place.
Definition:
RotationMatrix.cc:84
marley::RotationMatrix::RotationMatrix
RotationMatrix()
Creates a 3×3 identity matrix.
Definition:
RotationMatrix.cc:56
marley::RotationMatrix::rotate_copy
ThreeVector rotate_copy(const ThreeVector &v)
Create a rotated copy of the 3-vector v.
Definition:
RotationMatrix.cc:76
marley::RotationMatrix::matrix_
ThreeThreeMatrix matrix_
3×3 rotation matrix
Definition:
RotationMatrix.hh:58
marley::RotationMatrix::rotate_particle_inplace
void rotate_particle_inplace(marley::Particle &p)
Rotate the 3-momentum of a marley::Particle in place.
Definition:
RotationMatrix.cc:92
Generated by
1.9.1