MARLEY (Model of Argon Reaction Low Energy Yields)  v1.1.0 A Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions in liquid argon
marley::Event Class Reference

Container for ingoing and outgoing momentum 4-vectors from a reaction. More...

#include <Event.hh>

## Public Member Functions

Event (double Ex=0.)
Create an event with dummy particles.

Event (const marley::Particle &a, const marley::Particle &b, const marley::Particle &c, const marley::Particle &d, double Ex=0.)
Create a two-two scattering event. More...

Event (const Event &other_event)
Copy constructor.

Event (Event &&other_event)
Move constructor.

Add a Particle to the vector of final particles.

Add a Particle to the vector of initial particles.

const marley::Particleejectile () const
Get a const reference to the ejectile.

marley::Particleejectile ()
Get a non-const reference to the ejectile.

double Ex () const
Get the excitation energy of the residue just after the initial two-body reaction.

const std::vector
< marley::Particle * > &
get_final_particles () const
Get a const reference to the vector of final particles.

std::vector< marley::Particle * > & get_final_particles ()
Get a non-const reference to the vector of final particles.

const std::vector
< marley::Particle * > &
get_initial_particles () const
Get a const reference to the vector of initial particles.

std::vector< marley::Particle * > & get_initial_particles ()
Get a non-const reference to the vector of initial particles.

Eventoperator= (const Event &other_event)
Copy assignment operator.

Eventoperator= (Event &&other_event)
Move assignment operator.

void print (std::ostream &out) const
Print this event to a std::ostream. More...

const marley::Particleprojectile () const
Get a const reference to the projectile.

marley::Particleprojectile ()
Get a non-const reference to the projectile.

Read in this event from a std::istream. Any previous contents of this event will be deleted. More...

const marley::Particleresidue () const
Get a const reference to the residue.

marley::Particleresidue ()
Get a non-const reference to the residue.

const marley::Particletarget () const
Get a const reference to the target.

marley::Particletarget ()
Get a non-const reference to the target.

marley::JSON to_json () const
Create a JSON representation of this event.

void write_hepevt (size_t event_num, std::ostream &out) const
Write a HEPEvt record for this event to a std::ostream. Use the spacetime origin (t = 0 mm/c, x = 0 mm, y = 0 mm, z = 0 mm) as the initial position 4-vector for all particles. More...

## Protected Attributes

double Ex_
Excitation energy (MeV) of the residue. More...

std::vector< marley::Particle * > final_particles_
Vector of pointers to each of the final state particles.

std::vector< marley::Particle * > initial_particles_
Vector of pointers to each of the initial state particles.

## Detailed Description

Container for ingoing and outgoing momentum 4-vectors from a reaction.

For a two-two scattering reaction a + b → c + d, this class calls the ingoing particles the projectile (a) and target (b). The outgoing particles are called the ejectile (c) and residue (d). If the residue is a composite particle (e.g., a nucleus), then the class member Ex_ stores its excitation energy just after the two-two reaction occurred. After MARLEY simulates its de-excitation, the residue Particle object will be in its ground state, and the final_particles_ member of this class will include Particle objects representing the de-excitation products.

Note
This class manually manages memory (using the “rule of 5”) for the Particle objects that it owns. A better implementation from a modern C++ perspective would be to use vectors of std::unique_ptr<marley::Particle> objects and let those manage the memory (i.e., use the “rule of zero”). This design choice was made to ensure compatibility with ROOT 5, which cannot generate dictionaries for C++11 classes like std::unique_ptr.

## Constructor & Destructor Documentation

 marley::Event::Event ( const marley::Particle & a, const marley::Particle & b, const marley::Particle & c, const marley::Particle & d, double Ex = 0. )

Create a two-two scattering event.

Parameters
 a the projectile b the target c the ejectile d the residue Ex residue excitation energy (MeV) just after the two-two reaction

## Member Function Documentation

 void marley::Event::print ( std::ostream & out ) const

Print this event to a std::ostream.

Parameters
 out The std::ostream to which this event will be written
 void marley::Event::read ( std::istream & in )

Read in this event from a std::istream. Any previous contents of this event will be deleted.

Parameters
 in The std::istream from which this event will be read
 void marley::Event::write_hepevt ( size_t event_num, std::ostream & out ) const

Write a HEPEvt record for this event to a std::ostream. Use the spacetime origin (t = 0 mm/c, x = 0 mm, y = 0 mm, z = 0 mm) as the initial position 4-vector for all particles.

Parameters
 event_num The event number to use in the output HEPEvt record out The std::ostream to which the HEPEvt record will be written
Todo:
Alter marley::Event::write_hepevt() so that the user can specify a vertex position 4-vector to use.

## Member Data Documentation

 double marley::Event::Ex_
protected

Excitation energy (MeV) of the residue.

Note
The Ex_ class member is always zero for residues that have no excited states.

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