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 | Protected Member Functions | Protected Attributes | List of all members
marley::ProjectileDirectionRotator Class Reference

If needed, rotates the coordinate system of an Event so that the projectile 3-momentum lies along a desired direction. More...

#include <ProjectileDirectionRotator.hh>

Inheritance diagram for marley::ProjectileDirectionRotator:
marley::EventProcessor

Public Member Functions

 ProjectileDirectionRotator (const ThreeVector &dir={0., 0., 1.})
 
virtual void process_event (marley::Event &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 (marley::Event &ev)
 Helper function that does the coordinate system rotation. More...
 

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. More...
 
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 Event.
 

Detailed Description

If needed, rotates the coordinate system of an Event so that the projectile 3-momentum lies along a desired direction.

Constructor & Destructor Documentation

◆ ProjectileDirectionRotator()

marley::ProjectileDirectionRotator::ProjectileDirectionRotator ( const ThreeVector &  dir = {0., 0., 1.})
Parameters
dirA 3-vector pointing in the desired direction of the projectile in the rotated coordinate system

Member Function Documentation

◆ rotate_event()

void marley::ProjectileDirectionRotator::rotate_event ( marley::Event ev)
protected

Helper function that does the coordinate system rotation.

Parameters
[in,out]evEvent whose Particle 3-vectors will be rotated

Member Data Documentation

◆ last_pdir_

ThreeVector marley::ProjectileDirectionRotator::last_pdir_ = {{ 0., 0., 1. }}
protected

Stores the direction 3-vector for the last projectile that triggered a recalculation of the rotation matrix.

Using this information avoids unnecessary recalculations


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