24 #include "marley/Parity.hh"
25 #include "marley/Particle.hh"
32 constexpr
int HEPEVT_INITIAL_STATE_STATUS_CODE = 3;
34 constexpr
int HEPEVT_FINAL_STATE_STATUS_CODE = 1;
37 constexpr
int HEPEVT_MARLEY_INFO_STATUS_CODE = 11;
153 inline double Ex()
const;
157 inline int twoJ()
const;
183 void write_hepevt(
size_t event_num,
double flux_avg_tot_xsec,
184 std::ostream& out)
const;
188 void print(std::ostream& out)
const;
200 void read(std::istream& in);
222 bool read_hepevt(std::istream& in,
double* flux_avg_tot_xsec =
nullptr);
269 int status,
int jmohep1 = 0,
int jmohep2 = 0)
const;
309 inline std::ostream& operator<<(std::ostream& out,
const marley::Event& e) {
314 inline std::istream& operator>>(std::istream& in,
marley::Event& e) {
Container for ingoing and outgoing momentum 4-vectors from a reaction.
Definition: Event.hh:66
const marley::Particle & final_particle(size_t idx) const
Returns a const reference to the final particle with the given index.
Definition: Event.hh:303
void print(std::ostream &out) const
Print this event to a std::ostream.
Definition: Event.cc:226
void dump_hepevt_particle(const marley::Particle &p, std::ostream &os, int status, int jmohep1=0, int jmohep2=0) const
Helper function for write_hepevt()
Definition: Event.cc:294
void from_json(const marley::JSON &json)
Replace the existing event contents with those read from a JSON representation.
Definition: Event.cc:574
size_t initial_particle_count() const
Returns the number of initial particles in the Event.
Definition: Event.hh:293
void add_initial_particle(const marley::Particle &p)
Add a Particle to the vector of initial particles.
Definition: Event.cc:202
const marley::Particle & residue() const
Get a const reference to the residue.
Definition: Event.cc:198
void delete_particles()
Deletes all owned Particle objects and clears the vectors of initial and final particles.
Definition: Event.cc:219
double Ex() const
Get the excitation energy of the residue just after the initial two-body reaction.
Definition: Event.hh:277
size_t final_particle_count() const
Returns the number of final particles in the Event.
Definition: Event.hh:296
const std::vector< marley::Particle * > & get_final_particles() const
Get a const reference to the vector of final particles.
Definition: Event.hh:287
const std::vector< marley::Particle * > & get_initial_particles() const
Get a const reference to the vector of initial particles.
Definition: Event.hh:281
Parity parity_
The parity of the residue immediately after the two-two scattering reaction.
Definition: Event.hh:257
void print_human_readable(std::ostream &out, int num=-1) const
Print this event to a std::ostream in an annotated format easily readable by humans.
Definition: Event.cc:641
double Ex_
Excitation energy (MeV) of the residue immediately after the two-two scattering reaction.
Definition: Event.hh:249
bool read_hepevt(std::istream &in, double *flux_avg_tot_xsec=nullptr)
Read in this event from a std::istream, assuming it will appear there in HEPEVT format....
Definition: Event.cc:380
const marley::Particle & target() const
Get a const reference to the target.
Definition: Event.cc:190
void clear()
Deletes all particles from the event and resets the nuclear excitation energy to zero.
Definition: Event.cc:212
const marley::Particle & ejectile() const
Get a const reference to the ejectile.
Definition: Event.cc:194
void add_final_particle(const marley::Particle &p)
Add a Particle to the vector of final particles.
Definition: Event.cc:207
std::vector< marley::Particle * > final_particles_
Vector of pointers to each of the final state particles.
Definition: Event.hh:243
Event & operator=(const Event &other_event)
Copy assignment operator.
Definition: Event.cc:116
std::vector< marley::Particle * > initial_particles_
Vector of pointers to each of the initial state particles.
Definition: Event.hh:240
Event(double Ex=0.)
Create an event with dummy particles.
Definition: Event.cc:58
void write_hepevt(size_t event_num, double flux_avg_tot_xsec, std::ostream &out) const
Write a HEPEVT record for this event to a std::ostream. Use the spacetime origin (t = 0 mm/c,...
Definition: Event.cc:313
marley::JSON to_json() const
Create a JSON representation of this event.
Definition: Event.cc:357
int twoJ() const
Get two times the spin of the residue just after the initial two-body reaction.
Definition: Event.hh:278
const marley::Particle & projectile() const
Get a const reference to the projectile.
Definition: Event.cc:186
marley::Parity parity() const
Get the intrinsic parity of the residue just after the initial two-body reaction.
Definition: Event.hh:279
int twoJ_
Two times the spin of the residue immediately after the two-two scattering reaction.
Definition: Event.hh:253
void read(std::istream &in)
Read in this event from a std::istream. Any previous contents of this event will be deleted.
Definition: Event.cc:243
const marley::Particle & initial_particle(size_t idx) const
Returns a const reference to the initial particle with the given index.
Definition: Event.hh:299
Type-safe representation of a parity value (either +1 or -1)
Definition: Parity.hh:25
Momentum four-vector for a simulated particle.
Definition: Particle.hh:32