From cfff620c288f56ae77d6b6b606ec40071a681bc6 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 24 Feb 2023 19:49:19 +0000 Subject: [PATCH] Added cascade levels to event object. --- include/marley/Event.hh | 17 +++++++++++++++++ src/DecayScheme.cc | 2 ++ src/Event.cc | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/include/marley/Event.hh b/include/marley/Event.hh index 9d47af77..21d06637 100644 --- a/include/marley/Event.hh +++ b/include/marley/Event.hh @@ -23,6 +23,7 @@ // MARLEY includes #include "marley/Parity.hh" #include "marley/Particle.hh" +#include "marley/Level.hh" namespace marley { @@ -128,6 +129,10 @@ namespace marley { /// @brief Get a non-const reference to the vector of final particles inline std::vector& get_final_particles(); + inline const std::vector& get_cascade_levels() const; + + inline std::vector& get_cascade_levels(); + /// @brief Returns the number of initial particles in the Event inline size_t initial_particle_count() const; @@ -148,6 +153,8 @@ namespace marley { /// equal to the size of the vector of final particles inline const marley::Particle& final_particle( size_t idx ) const; + inline const marley::Level& cascade_level( size_t idx ) const; + /// @brief Get the excitation energy of the residue just after the /// initial two-body reaction inline double Ex() const; @@ -166,6 +173,8 @@ namespace marley { /// @brief Add a Particle to the vector of final particles void add_final_particle(const marley::Particle& p); + void add_cascade_level(const marley::Level& l); + /// @brief Write a /// /// HEPEVT record for this event to a std::ostream. Use the spacetime @@ -242,6 +251,8 @@ namespace marley { /// @brief Vector of pointers to each of the final state particles std::vector final_particles_; + std::vector cascade_levels_; + /// @brief Excitation energy (MeV) of the residue immediately after the /// two-two scattering reaction /// @note The Ex_ class member is always zero for residues that have no @@ -290,6 +301,12 @@ namespace marley { inline std::vector& Event::get_final_particles() { return final_particles_; } + inline const std::vector& Event::get_cascade_levels() + const { return cascade_levels_; } + + inline std::vector& Event::get_cascade_levels() + { return cascade_levels_; } + inline size_t Event::initial_particle_count() const { return initial_particles_.size(); } diff --git a/src/DecayScheme.cc b/src/DecayScheme.cc index d718bbac..4156e0f5 100644 --- a/src/DecayScheme.cc +++ b/src/DecayScheme.cc @@ -105,6 +105,8 @@ void marley::DecayScheme::do_cascade(marley::Level& initial_level, // post-gamma-emission mass. double Exf = p_current_level->energy(); + event.add_cascade_level(*p_gamma->start_level()); + // Create new particle objects to represent the emitted gamma and // recoiling nucleus marley::Particle gamma(marley_utils::PHOTON, 0); diff --git a/src/Event.cc b/src/Event.cc index 6a1172ca..e263e863 100644 --- a/src/Event.cc +++ b/src/Event.cc @@ -209,6 +209,11 @@ void marley::Event::add_final_particle(const marley::Particle& p) final_particles_.push_back(new marley::Particle(p)); } +void marley::Event::add_cascade_level(const marley::Level& l) +{ + cascade_levels_.push_back(new marley::Level(l)); +} + void marley::Event::clear() { this->delete_particles(); Ex_ = 0.;