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
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
22namespace HepMC3 {
23 class GenParticle;
24}
25
26namespace marley {
27
31
32 using ThreeVector = std::array< double, 3 >;
33 using ThreeThreeMatrix = std::array< ThreeVector, 3 >;
34
35 public:
36
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
55
56 protected:
57
59 ThreeThreeMatrix matrix_;
60 };
61
62}
Stores particle-related information.
Definition GenParticle.h:34
void rotate_inplace(ThreeVector &v)
Rotate a 3-vector v in place.
RotationMatrix()
Creates a 3×3 identity matrix.
void rotate_particle_inplace(HepMC3::GenParticle &p)
Rotate the 3-momentum of a marley::Particle in place.
ThreeVector rotate_copy(const ThreeVector &v)
Create a rotated copy of the 3-vector v.
ThreeThreeMatrix matrix_
3×3 rotation matrix