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
ExitChannel.hh
1
4//
5// This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6//
7// MARLEY is free software: you can redistribute it and/or modify it under the
8// terms of version 3 of the GNU General Public License as published by the
9// Free Software Foundation.
10//
11// For the full text of the license please see COPYING or
12// visit http://opensource.org/licenses/GPL-3.0
13//
14// Please respect the MCnet academic usage guidelines. See GUIDELINES
15// or visit https://www.montecarlonet.org/GUIDELINES for details.
16
17#pragma once
18
19// standard library includes
20#include <memory>
21#include <vector>
22
23// MARLEY includes
24#include "marley/ChebyshevInterpolatingFunction.hh"
25#include "marley/Fragment.hh"
26#include "marley/Generator.hh"
27#include "marley/IteratorToPointerMember.hh"
28#include "marley/Level.hh"
29#include "marley/MassTable.hh"
30#include "marley/Parity.hh"
31#include "marley/marley_utils.hh"
32
33namespace marley {
34
37
38 public:
39
41 ExitChannel() = default;
42
55 ExitChannel( int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi,
56 double rho_i, marley::StructureDatabase& sdb ) : pdgi_( pdgi ),
57 qi_( qi ), Exi_( Exi ), twoJi_( twoJi ), Pi_( Pi ), sdb_( &sdb )
58 {
59 one_over_two_pi_rho_i_ = std::pow( 2. * marley_utils::pi * rho_i, -1 );
60 }
61
62 virtual ~ExitChannel() = default;
63
66 virtual bool is_continuum() const = 0;
67
70 virtual bool emits_fragment() const = 0;
71
83
85 virtual void do_decay( double& Exf, int& two_Jf,
86 marley::Parity& Pf, const std::shared_ptr< HepMC3::GenParticle >&
87 compound_nucleus, std::shared_ptr< HepMC3::GenParticle >&
88 emitted_particle, std::shared_ptr< HepMC3::GenParticle >&
89 residual_nucleus, int& qIon, marley::Generator& gen ) const = 0;
90
95 template< typename It > static inline
101
103 inline double width() const { return width_; }
104
107 virtual int emitted_particle_pdg() const = 0;
108
110 virtual int final_nucleus_pdg() const = 0;
111
112 protected:
113
116 virtual void compute_total_width() = 0;
117
128 virtual void prepare_products(
129 const std::shared_ptr< HepMC3::GenParticle >& compound_nucleus,
130 std::shared_ptr< HepMC3::GenParticle >& emitted_particle,
131 std::shared_ptr< HepMC3::GenParticle >& residual_nucleus,
132 double Exf, int& qf, marley::Generator& gen ) const;
133
135 int pdgi_;
136
139 int qi_;
140
142 double Exi_;
143
146
149
158
160 double width_;
161
164 };
165
168 class DiscreteExitChannel : virtual public ExitChannel {
169 public:
170
173
174 virtual void do_decay( double& Ex, int& two_J,
175 marley::Parity& Pi, const std::shared_ptr< HepMC3::GenParticle >&
176 compound_nucleus, std::shared_ptr< HepMC3::GenParticle >&
177 emitted_particle, std::shared_ptr< HepMC3::GenParticle >&
178 residual_nucleus, int& qIon, marley::Generator& gen )
179 const final override;
180
181 inline virtual bool is_continuum() const final override { return false; }
182
184 inline const marley::Level& get_final_level() const
185 { return final_level_; }
186
187 protected:
188
191 };
192
195 class FragmentExitChannel : virtual public ExitChannel {
196 public:
197
200 : fragment_pdg_( fragment.get_pid() ) {}
201
202 virtual int emitted_particle_pdg() const final override
203 { return fragment_pdg_; }
204
205 virtual bool emits_fragment() const final override
206 { return true; }
207
208 virtual int final_nucleus_pdg() const final override;
209
210 protected:
211
214 double max_Exf() const;
215
218 };
219
222 class GammaExitChannel : virtual public ExitChannel {
223 public:
224
225 GammaExitChannel() {}
226
227 virtual int emitted_particle_pdg() const final override
228 { return marley_utils::PHOTON; }
229
230 virtual bool emits_fragment() const final override
231 { return false; }
232
233 inline virtual int final_nucleus_pdg() const final override
234 { return pdgi_; }
235
236 protected:
237
238 // Returns the gamma-ray energy corresponding to a particular
239 // final nuclear excitation energy
240 // @param Exf Final nuclear excitation energy (MeV)
241 // @return Energy of the gamma-ray emitted in this exit channel (MeV)
242 double gamma_energy( double Exf ) const;
243
245 int mpol, marley::Parity Pf ) const;
246 };
247
250 class ContinuumExitChannel : virtual public ExitChannel
251 {
252 public:
253
260 ContinuumExitChannel( double Ec_min, int lmax ) : E_c_min_( Ec_min ),
261 l_max_( lmax ) {}
262
265 virtual void compute_total_width() final override;
266
267 virtual void do_decay( double& Ex, int& two_J,
268 marley::Parity& Pi, const std::shared_ptr< HepMC3::GenParticle >&
269 compound_nucleus, std::shared_ptr< HepMC3::GenParticle >&
270 emitted_particle, std::shared_ptr< HepMC3::GenParticle >&
271 residual_nucleus, int& qIon, marley::Generator& gen )
272 const final override;
273
274 virtual double differential_width( double Exf,
275 bool store_jpi_widths = false ) const = 0;
276
277 inline virtual bool is_continuum() const final override { return true; }
278
283 inline void set_skip_jpi_sampling( bool skip_it ) const
284 { skip_jpi_sampling_ = skip_it; }
285
290
294 SpinParityWidth( int twoJ, marley::Parity p, double w )
295 : twoJf( twoJ ), Pf( p ), diff_width( w ) {}
296
297 virtual ~SpinParityWidth() {}
298
299 int twoJf;
301 double diff_width;
302 };
303
304 double sample_Exf( marley::Generator& gen ) const;
305
306 void sample_spin_parity( double Exf, int& two_Jf, marley::Parity& Pf,
307 marley::Generator& gen ) const;
308
310 inline double E_c_min() const { return E_c_min_; }
311
314 virtual double E_c_max() const = 0;
315
318 { return last_sampled_spw_; }
319
321 inline const std::vector< std::unique_ptr< SpinParityWidth > >&
323
324 protected:
325
327 double E_c_min_;
328
332
335 mutable std::vector< std::unique_ptr< SpinParityWidth > >
337
340 mutable bool skip_jpi_sampling_ = false;
341
346 mutable std::unique_ptr<marley::ChebyshevInterpolatingFunction> Exf_cdf_;
347
351
354 void clear_jpi_widths() const;
355 };
356
361 {
362 public:
363
367 FragmentDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi,
368 marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
369 const marley::Level& flev, const marley::Fragment& frag)
370 : ExitChannel( pdgi, qi, Exi, twoJi, Pi, rho_i, sdb ),
372 {
373 this->compute_total_width();
374 }
375
376 virtual void compute_total_width() final override;
377 };
378
382 public GammaExitChannel
383 {
384 public:
385
389 GammaDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi,
390 marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
391 const marley::Level& flev) : ExitChannel( pdgi, qi, Exi, twoJi, Pi,
392 rho_i, sdb ), DiscreteExitChannel( flev ), GammaExitChannel()
393 {
394 this->compute_total_width();
395 }
396
397 virtual void compute_total_width() final override;
398 };
399
400
405 {
406 public:
407
410 {
415 int two_j_fr, int ell )
416 : SpinParityWidth( twoJ, p, w ), two_j_frag( two_j_fr ),
417 orb_l( ell ) {}
418
419 virtual ~FragmentSpinParityWidth() {}
420
422 int orb_l;
423 };
424
428 FragmentContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi,
429 marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
430 double Ec_min, const marley::Fragment& frag)
431 : ExitChannel( pdgi, qi, Exi, twoJi, Pi, rho_i, sdb ),
432 ContinuumExitChannel( Ec_min, sdb.get_fragment_l_max() ),
433 FragmentExitChannel( frag )
434 {
435 this->compute_total_width();
436 }
437
438 virtual double differential_width( double Exf,
439 bool store_jpi_widths = false ) const final override;
440
441 inline virtual double E_c_max() const final override
442 { return this->max_Exf(); }
443 };
444
448 public GammaExitChannel
449 {
450 public:
451
454 {
458 GammaSpinParityWidth( int twoJ, marley::Parity p, double w, int mpol )
459 : SpinParityWidth( twoJ, p, w ), multipolarity( mpol ) {}
460
462 };
463
467 GammaContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi,
468 marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
469 double Ec_min) : ExitChannel( pdgi, qi, Exi, twoJi, Pi, rho_i, sdb ),
470 ContinuumExitChannel( Ec_min, sdb.get_gamma_l_max() ),
471 GammaExitChannel()
472 {
473 this->compute_total_width();
474 }
475
476 virtual double differential_width( double Exf,
477 bool store_jpi_widths = false ) const final override;
478
479 inline virtual double E_c_max() const final override
480 { return Exi_; }
481 };
482}
const std::vector< std::unique_ptr< SpinParityWidth > > & get_spw_table() const
Grants const access to the vector of SpinParityWidth objects.
ContinuumExitChannel(double Ec_min, int lmax)
std::vector< std::unique_ptr< SpinParityWidth > > jpi_widths_table_
Table of possible final-state spin-parities together with their partial differential decay widths.
void set_skip_jpi_sampling(bool skip_it) const
Sets the flag that will skip sampling of a final-state nuclear spin-parity value in do_decay()
virtual void compute_total_width() final override
bool skip_jpi_sampling_
Flag that allows skipping the sampling of a final nuclear spin-parity (useful only for testing purpos...
SpinParityWidth * last_sampled_spw_
Points to the last SpinParityWidth object sampled in a previous call to sample_spin_parity()
double E_c_min() const
Returns the minimum excitation energy bound for the continuum.
virtual double E_c_max() const =0
Returns the maximum accessible excitation energy to be used when integrating over the continuum.
const SpinParityWidth * get_last_sampled_spw() const
Returns a pointer to the last sampled SpinParityWidth object.
void clear_jpi_widths() const
Helper function that resets the table of SpinParityWidth objects.
double E_c_min_
Minimum accessible nuclear excitation energy (MeV) in the continuum.
virtual bool is_continuum() const final override
Returns true if this channel accesses the particle-unbound continuum of nuclear levels or false other...
std::unique_ptr< marley::ChebyshevInterpolatingFunction > Exf_cdf_
Chebyshev polynomial interpolant to the cumulative density function for the final-state nuclear excit...
const marley::Level & final_level_
Reference to the final-state nuclear level.
virtual void do_decay(double &Ex, int &two_J, marley::Parity &Pi, const std::shared_ptr< HepMC3::GenParticle > &compound_nucleus, std::shared_ptr< HepMC3::GenParticle > &emitted_particle, std::shared_ptr< HepMC3::GenParticle > &residual_nucleus, int &qIon, marley::Generator &gen) const final override
Simulates a nuclear decay into this channel.
virtual bool is_continuum() const final override
Returns true if this channel accesses the particle-unbound continuum of nuclear levels or false other...
const marley::Level & get_final_level() const
Get a const reference to the final-state nuclear level.
DiscreteExitChannel(const marley::Level &flev)
Abstract base class for compound nucleus de-excitation channels.
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_...
int twoJi_
Two times the initial nuclear spin .
virtual bool emits_fragment() const =0
Returns true if this channel involves fragment emission or false if it involves gamma-ray emission.
int pdgi_
PDG code for the initial nucleus.
double width_
Total decay width into this channel (MeV)
marley::StructureDatabase * sdb_
StructureDatabase to use in calculations.
marley::Parity Pi_
Initial nuclear parity .
double width() const
Get the total decay width into this channel (MeV)
ExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb)
virtual void compute_total_width()=0
virtual void prepare_products(const std::shared_ptr< HepMC3::GenParticle > &compound_nucleus, std::shared_ptr< HepMC3::GenParticle > &emitted_particle, std::shared_ptr< HepMC3::GenParticle > &residual_nucleus, double Exf, int &qf, marley::Generator &gen) const
Helper function that prepares Particle objects representing the products of the two-body decay.
virtual int emitted_particle_pdg() const =0
Returns the PDG code for the particle (gamma-ray or nuclear fragment) emitted by decays into this Exi...
virtual void do_decay(double &Exf, int &two_Jf, marley::Parity &Pf, const std::shared_ptr< HepMC3::GenParticle > &compound_nucleus, std::shared_ptr< HepMC3::GenParticle > &emitted_particle, std::shared_ptr< HepMC3::GenParticle > &residual_nucleus, int &qIon, marley::Generator &gen) const =0
Simulates a nuclear decay into this channel.
virtual bool is_continuum() const =0
Returns true if this channel accesses the particle-unbound continuum of nuclear levels or false other...
double Exi_
Initial nuclear excitation energy (MeV)
virtual int final_nucleus_pdg() const =0
Returns the PDG code for the final nucleus.
FragmentContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb, double Ec_min, const marley::Fragment &frag)
virtual double E_c_max() const final override
Returns the maximum accessible excitation energy to be used when integrating over the continuum.
virtual void compute_total_width() final override
FragmentDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb, const marley::Level &flev, const marley::Fragment &frag)
FragmentExitChannel(const marley::Fragment &fragment)
virtual int emitted_particle_pdg() const final override
Returns the PDG code for the particle (gamma-ray or nuclear fragment) emitted by decays into this Exi...
int fragment_pdg_
PDG code identifying the emitted fragment.
virtual int final_nucleus_pdg() const final override
Returns the PDG code for the final nucleus.
double max_Exf() const
Helper function that returns that maximum possible excitation energy for the daughter nucleus after e...
virtual bool emits_fragment() const final override
Returns true if this channel involves fragment emission or false if it involves gamma-ray emission.
Simple container for storing reference data about each of the nuclear fragments considered by MARLEY'...
Definition Fragment.hh:27
virtual double E_c_max() const final override
Returns the maximum accessible excitation energy to be used when integrating over the continuum.
GammaContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb, double Ec_min)
virtual void compute_total_width() final override
GammaDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb, const marley::Level &flev)
virtual bool emits_fragment() const final override
Returns true if this channel involves fragment emission or false if it involves gamma-ray emission.
virtual int emitted_particle_pdg() const final override
Returns the PDG code for the particle (gamma-ray or nuclear fragment) emitted by decays into this Exi...
virtual int final_nucleus_pdg() const final override
Returns the PDG code for the final nucleus.
TransitionType
Electromagnetic transitions in nuclei may be classified by their multipolarity (electric vs....
The MARLEY Event generator.
Definition Generator.hh:54
Template class that creates an iterator to a class member based on an iterator to a pointer (either b...
A discrete nuclear energy level.
Definition Level.hh:29
Type-safe representation of a parity value (either +1 or -1)
Definition Parity.hh:25
Container for nuclear structure information organized by nuclide.
A spin-parity value with its corresponding partial decay width.
SpinParityWidth(int twoJ, marley::Parity p, double w)
double diff_width
Partial differential decay width (MeV)
marley::Parity Pf
Final nuclear parity.
int two_j_frag
Two times the fragment total angular momentum.
FragmentSpinParityWidth(int twoJ, marley::Parity p, double w, int two_j_fr, int ell)
int multipolarity
Multipolarity of this gamma-ray emission.
GammaSpinParityWidth(int twoJ, marley::Parity p, double w, int mpol)