MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
marley::HauserFeshbachDecay Class Reference

Monte Carlo implementation of the Hauser-Feshbach statistical model for decays of highly-excited nuclei. More...

#include <HauserFeshbachDecay.hh>

Public Member Functions

 HauserFeshbachDecay (const std::shared_ptr< HepMC3::GenParticle > &compound_nucleus, double Exi, int twoJi, marley::Parity Pi, marley::StructureDatabase &sdb)
 
const marley::ExitChanneldo_decay (double &Exf, int &twoJf, marley::Parity &Pf, std::shared_ptr< HepMC3::GenParticle > &emitted_particle, std::shared_ptr< HepMC3::GenParticle > &residual_nucleus, int &qIon, marley::Generator &gen)
 Simulates a decay of the compound nucleus.
 
std::vector< std::unique_ptr< marley::ExitChannel > > & exit_channels ()
 Get a non-const reference to the owned vector of ExitChannel pointers.
 
const std::vector< std::unique_ptr< marley::ExitChannel > > & exit_channels () const
 Get a const reference to the owned vector of ExitChannel pointers.
 
void print (std::ostream &out) const
 Print information about the possible decay channels to a std::ostream.
 
const std::unique_ptr< marley::ExitChannel > & sample_exit_channel (marley::Generator &gen) const
 Helper function for do_decay(). Samples an ExitChannel using the partial decay widths as weights.
 
double total_width () const
 

Detailed Description

Monte Carlo implementation of the Hauser-Feshbach statistical model for decays of highly-excited nuclei.

Definition at line 34 of file HauserFeshbachDecay.hh.

Constructor & Destructor Documentation

◆ HauserFeshbachDecay()

marley::HauserFeshbachDecay::HauserFeshbachDecay ( const std::shared_ptr< HepMC3::GenParticle > & compound_nucleus,
double Exi,
int twoJi,
marley::Parity Pi,
marley::StructureDatabase & sdb )
Parameters
compound_nucleusGenParticle object that represents the excited nucleus
ExiInitial excitation energy (MeV)
twoJiTwo times the initial nuclear spin
PiInitial nuclear parity
sdbReference to the StructureDatabase to use in calculations

Definition at line 28 of file HauserFeshbachDecay.cc.

31 : compound_nucleus_( compound_nucleus ),
32 Exi_( Exi ), twoJi_( twoJi ), Pi_( Pi )
33{
34 build_exit_channels( sdb );
35}

Member Function Documentation

◆ do_decay()

const marley::ExitChannel & marley::HauserFeshbachDecay::do_decay ( double & Exf,
int & twoJf,
marley::Parity & Pf,
std::shared_ptr< HepMC3::GenParticle > & emitted_particle,
std::shared_ptr< HepMC3::GenParticle > & residual_nucleus,
int & qIon,
marley::Generator & gen )

Simulates a decay of the compound nucleus.

Parameters
[out]ExfFinal nuclear excitation energy (MeV)
[out]twoJfTwo times the final nuclear spin
[out]PfFinal nuclear parity
[out]emitted_particleGenParticle object representing the nuclear fragment or γ-ray emitted during the decay
[out]residual_nucleusGenParticle object representing the final-state nucleus (ion)
[out]qIonCharge (in units of the elementary charge) of the residual nucleus (ion)
genGenerator to use for random sampling
Returns
The ExitChannel object that was chosen while simulating the decay

Definition at line 229 of file HauserFeshbachDecay.cc.

234{
235 const auto& ec = this->sample_exit_channel( gen );
236
237 ec->do_decay( Exf, twoJf, Pf, compound_nucleus_, emitted_particle,
238 residual_nucleus, qIon, gen );
239
240 return *ec;
241}
const std::unique_ptr< marley::ExitChannel > & sample_exit_channel(marley::Generator &gen) const
Helper function for do_decay(). Samples an ExitChannel using the partial decay widths as weights.

References sample_exit_channel().

Referenced by marley::NucleusDecayer::process_event().

◆ exit_channels() [1/2]

std::vector< std::unique_ptr< marley::ExitChannel > > & marley::HauserFeshbachDecay::exit_channels ( )
inline

Get a non-const reference to the owned vector of ExitChannel pointers.

Definition at line 110 of file HauserFeshbachDecay.hh.

110{ return exit_channels_; }

Referenced by marley::OMPWeightCalculator::weight().

◆ exit_channels() [2/2]

const std::vector< std::unique_ptr< marley::ExitChannel > > & marley::HauserFeshbachDecay::exit_channels ( ) const
inline

Get a const reference to the owned vector of ExitChannel pointers.

Definition at line 113 of file HauserFeshbachDecay.hh.

113{ return exit_channels_; }

◆ print()

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

Print information about the possible decay channels to a std::ostream.

Definition at line 243 of file HauserFeshbachDecay.cc.

243 {
244
245 out << "Compound nucleus " << compound_nucleus_->pid()
246 << " with Ex = " << Exi_ << ", spin = " << twoJi_ / 2;
247 if (twoJi_ % 2) out << ".5";
248 out << ", and parity = " << Pi_ << '\n';
249 out << "Total width = " << total_width_ << " MeV\n";
250 out << "Mean lifetime = " << marley_utils::hbar / total_width_ << " s\n";
251 for (const auto& ec : exit_channels_) {
252 double width = ec->width();
253 bool continuum = ec->is_continuum();
254 bool frag = ec->emits_fragment();
255 int pdg = ec->emitted_particle_pdg();
256 std::string symbol = marley_utils::particle_symbols.at( pdg );
257 out << " ";
258 if ( frag ) out << symbol;
259 else out << "gamma-ray";
260 if ( continuum ) out << " emission to the continuum width = ";
261 else {
262 auto* dec = dynamic_cast< marley::DiscreteExitChannel* >( ec.get() );
263 if ( !dec ) throw marley::Error( "Dynamic cast failed in marley::"
264 "HauserFeshbachDecay::print()" );
265 out << " emission to level at " << dec->get_final_level().energy()
266 << " MeV width = ";
267 }
268 out << width << " MeV\n";
269 }
270}

◆ sample_exit_channel()

const std::unique_ptr< marley::ExitChannel > & marley::HauserFeshbachDecay::sample_exit_channel ( marley::Generator & gen) const

Helper function for do_decay(). Samples an ExitChannel using the partial decay widths as weights.

Definition at line 273 of file HauserFeshbachDecay.cc.

275{
276 // Throw an error if all decays are impossible
277 if ( total_width_ <= 0. ) throw marley::Error( "Cannot sample an exit channel"
278 " for a Hauser-Feshbach decay. All partial decay widths are zero." );
279
280 // Sample an exit channel using a std::discrete distribution and a table of
281 // partial decay widths
282 const auto widths_begin
283 = marley::ExitChannel::make_width_iterator( exit_channels_.cbegin() );
284 const auto widths_end
285 = marley::ExitChannel::make_width_iterator( exit_channels_.cend() );
286
287 std::discrete_distribution<size_t> exit_channel_dist( widths_begin,
288 widths_end );
289 size_t exit_channel_index = gen.sample_from_distribution( exit_channel_dist );
290
291 const auto& ec = exit_channels_.at( exit_channel_index );
292
293 // Log which exit channel was selected and its branching fraction
294 double width_ec = ec->width();
295 double branching = ( total_width_ > 0. ) ? ( width_ec / total_width_ ) : 0.;
296 int ec_pdg = ec->emitted_particle_pdg();
297 std::string ec_symbol = marley_utils::particle_symbols.count( ec_pdg )
298 ? marley_utils::particle_symbols.at( ec_pdg ) : std::to_string( ec_pdg );
299 MARLEY_LOG( DEBUG, "physics.deexcitation.hauser" ) << "Selected exit channel:"
300 " emits " << ec_symbol
301 << ( ec->is_continuum() ? " to continuum" : " to discrete level" )
302 << ", width = " << width_ec << " MeV"
303 << ", branching fraction = " << branching;
304
305 return ec;
306}
static marley::IteratorToPointerMember< It, double > make_width_iterator(It it)
Convert an iterator that points to an ExitChannel object into an iterator to the ExitChannel's width_...
auto sample_from_distribution(RandomNumberDistribution &rnd) -> decltype(std::declval< RandomNumberDistribution & >().operator()(std::declval< std::mt19937_64 & >()))
Sample from an arbitrary probability distribution (defined here as any object that implements an oper...
Definition Generator.hh:193

References marley::ExitChannel::make_width_iterator(), and marley::Generator::sample_from_distribution().

Referenced by do_decay().

◆ total_width()

double marley::HauserFeshbachDecay::total_width ( ) const
inline

Definition at line 115 of file HauserFeshbachDecay.hh.

116 { return total_width_; }

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