MARLEY (Model of Argon Reaction Low Energy Yields)
v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
include
marley
RotationMatrix.hh
1
4
//
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
namespace
HepMC3 {
23
class
GenParticle
;
24
}
25
26
namespace
marley {
27
30
class
RotationMatrix
{
31
32
using
ThreeVector = std::array< double, 3 >;
33
using
ThreeThreeMatrix = std::array< ThreeVector, 3 >;
34
35
public
:
36
38
RotationMatrix
();
39
42
RotationMatrix
(
const
ThreeVector& from_vec,
const
ThreeVector& to_vec );
43
45
ThreeVector
rotate_copy
(
const
ThreeVector& v );
46
47
// Returns a copy of the 3-vector v normalized to have unit magnitude
48
static
ThreeVector normalize(
const
ThreeVector& v );
49
51
void
rotate_inplace
( ThreeVector& v );
52
54
void
rotate_particle_inplace
(
HepMC3::GenParticle
& p );
55
56
protected
:
57
59
ThreeThreeMatrix
matrix_
;
60
};
61
62
}
HepMC3::GenParticle
Stores particle-related information.
Definition
GenParticle.h:34
marley::RotationMatrix::rotate_inplace
void rotate_inplace(ThreeVector &v)
Rotate a 3-vector v in place.
Definition
RotationMatrix.cc:91
marley::RotationMatrix::RotationMatrix
RotationMatrix()
Creates a 3×3 identity matrix.
Definition
RotationMatrix.cc:63
marley::RotationMatrix::rotate_particle_inplace
void rotate_particle_inplace(HepMC3::GenParticle &p)
Rotate the 3-momentum of a marley::Particle in place.
Definition
RotationMatrix.cc:99
marley::RotationMatrix::rotate_copy
ThreeVector rotate_copy(const ThreeVector &v)
Create a rotated copy of the 3-vector v.
Definition
RotationMatrix.cc:83
marley::RotationMatrix::matrix_
ThreeThreeMatrix matrix_
3×3 rotation matrix
Definition
RotationMatrix.hh:59
Generated by
1.13.2