|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
If needed, rotates the coordinate system of a GenEvent so that the projectile 3-momentum lies along a desired direction. More...
#include <ProjectileDirectionRotator.hh>
Public Member Functions | |
| ProjectileDirectionRotator (const ThreeVector &dir={0., 0., 1.}) | |
| virtual void | process_event (HepMC3::GenEvent &ev, marley::Generator &gen) override |
| Rotates all 3-momenta in the input event so that the projectile 3-momentum lies along dir_vec_ in the new coordinate system. | |
| const ThreeVector & | projectile_direction () const |
| ThreeVector | sample_isotropic_direction (marley::Generator &gen) const |
| void | set_projectile_direction (const ThreeVector &dir) |
| void | set_randomize_directions (bool do_sampling) |
Protected Member Functions | |
| void | rotate_event (HepMC3::GenEvent &ev) |
| Helper function that does the coordinate system rotation. | |
Protected Attributes | |
| ThreeVector | dir_vec_ = {{ 0., 0., 1. }} |
| 3-vector that points in the desired direction of the projectile | |
| ThreeVector | last_pdir_ = {{ 0., 0., 1. }} |
| Stores the direction 3-vector for the last projectile that triggered a recalculation of the rotation matrix. | |
| bool | randomize_projectile_direction_ = false |
| Flag that indicates whether the (rotated) projectile direction should be sampled isotropically for each event (true) or kept fixed across all events (false) | |
| marley::RotationMatrix | rot_matrix_ |
| RotationMatrix used to rotate the coordinate system of the input GenEvent. | |
If needed, rotates the coordinate system of a GenEvent so that the projectile 3-momentum lies along a desired direction.
Definition at line 27 of file ProjectileDirectionRotator.hh.
| marley::ProjectileDirectionRotator::ProjectileDirectionRotator | ( | const ThreeVector & | dir = {0., 0., 1.} | ) |
| dir | A 3-vector pointing in the desired direction of the projectile in the rotated coordinate system |
Definition at line 28 of file ProjectileDirectionRotator.cc.
References dir_vec_.
|
overridevirtual |
Rotates all 3-momenta in the input event so that the projectile 3-momentum lies along dir_vec_ in the new coordinate system.
Implements marley::EventProcessor.
Definition at line 39 of file ProjectileDirectionRotator.cc.
References dir_vec_, last_pdir_, HepMC3::FourVector::p3mod(), HepMC3::FourVector::px(), HepMC3::FourVector::py(), HepMC3::FourVector::pz(), randomize_projectile_direction_, rot_matrix_, and rotate_event().
Referenced by marley::Generator::create_event().
|
inline |
Definition at line 45 of file ProjectileDirectionRotator.hh.
|
protected |
Helper function that does the coordinate system rotation.
| [in,out] | ev | GenEvent whose Particle 3-vectors will be rotated |
Definition at line 76 of file ProjectileDirectionRotator.cc.
References HepMC3::GenEvent::particles(), and rot_matrix_.
Referenced by process_event().
| marley::ProjectileDirectionRotator::ThreeVector marley::ProjectileDirectionRotator::sample_isotropic_direction | ( | marley::Generator & | gen | ) | const |
Definition at line 85 of file ProjectileDirectionRotator.cc.
|
inline |
Definition at line 48 of file ProjectileDirectionRotator.hh.
| void marley::ProjectileDirectionRotator::set_randomize_directions | ( | bool | do_sampling | ) |
Definition at line 104 of file ProjectileDirectionRotator.cc.
|
protected |
3-vector that points in the desired direction of the projectile
Definition at line 61 of file ProjectileDirectionRotator.hh.
Referenced by ProjectileDirectionRotator(), and process_event().
|
protected |
Stores the direction 3-vector for the last projectile that triggered a recalculation of the rotation matrix.
Using this information avoids unnecessary recalculations
Definition at line 66 of file ProjectileDirectionRotator.hh.
Referenced by process_event().
|
protected |
Flag that indicates whether the (rotated) projectile direction should be sampled isotropically for each event (true) or kept fixed across all events (false)
Definition at line 79 of file ProjectileDirectionRotator.hh.
Referenced by process_event().
|
protected |
RotationMatrix used to rotate the coordinate system of the input GenEvent.
Definition at line 70 of file ProjectileDirectionRotator.hh.
Referenced by process_event(), and rotate_event().