MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
ExitChannel.hh
1 //
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 
33 namespace marley {
34 
36  class ExitChannel {
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 
82  virtual void do_decay(double& Exf, int& two_Jf,
83  marley::Parity& Pf, const marley::Particle& compound_nucleus,
84  marley::Particle& emitted_particle, marley::Particle& residual_nucleus,
85  marley::Generator& gen) const = 0;
86 
91  template<typename It> static inline
93  {
95  double>(it, &marley::ExitChannel::width_);
96  }
97 
99  inline double width() const { return width_; }
100 
103  virtual int emitted_particle_pdg() const = 0;
104 
106  virtual int final_nucleus_pdg() const = 0;
107 
108  protected:
109 
112  virtual void compute_total_width() = 0;
113 
123  virtual void prepare_products(const marley::Particle& compound_nucleus,
124  marley::Particle& emitted_particle, marley::Particle& residual_nucleus,
125  double Exf, marley::Generator& gen) const;
126 
128  int pdgi_;
129 
132  int qi_;
133 
135  double Exi_;
136 
138  int twoJi_;
139 
142 
150 
152  double width_;
153 
156  };
157 
160  class DiscreteExitChannel : virtual public ExitChannel {
161  public:
162 
164  DiscreteExitChannel( const marley::Level& flev ) : final_level_( flev ) {}
165 
166  virtual void do_decay(double& Ex, int& two_J,
167  marley::Parity& Pi, const marley::Particle& compound_nucleus,
168  marley::Particle& emitted_particle, marley::Particle& residual_nucleus,
169  marley::Generator& gen) const final override;
170 
171  inline virtual bool is_continuum() const final override { return false; }
172 
174  inline const marley::Level& get_final_level() const
175  { return final_level_; }
176 
177  protected:
178 
181  };
182 
185  class FragmentExitChannel : virtual public ExitChannel {
186  public:
187 
190  : fragment_pdg_( fragment.get_pid() ) {}
191 
192  virtual int emitted_particle_pdg() const final override
193  { return fragment_pdg_; }
194 
195  virtual bool emits_fragment() const final override
196  { return true; }
197 
198  virtual int final_nucleus_pdg() const final override;
199 
200  protected:
201 
204  double max_Exf() const;
205 
208  };
209 
212  class GammaExitChannel : virtual public ExitChannel {
213  public:
214 
215  GammaExitChannel() {}
216 
217  virtual int emitted_particle_pdg() const final override
218  { return marley_utils::PHOTON; }
219 
220  virtual bool emits_fragment() const final override
221  { return false; }
222 
223  inline virtual int final_nucleus_pdg() const final override
224  { return pdgi_; }
225 
226  protected:
227 
228  // Returns the gamma-ray energy corresponding to a particular
229  // final nuclear excitation energy
230  // @param Exf Final nuclear excitation energy (MeV)
231  // @return Energy of the gamma-ray emitted in this exit channel (MeV)
232  double gamma_energy( double Exf ) const;
233 
235  int mpol, marley::Parity Pf ) const;
236  };
237 
240  class ContinuumExitChannel : virtual public ExitChannel
241  {
242  public:
243 
250  ContinuumExitChannel(double Ec_min, int lmax) : E_c_min_( Ec_min ),
251  l_max_( lmax ) {}
252 
255  virtual void compute_total_width() final override;
256 
257  virtual void do_decay(double& Ex, int& two_J,
258  marley::Parity& Pi, const marley::Particle& compound_nucleus,
259  marley::Particle& emitted_particle, marley::Particle& residual_nucleus,
260  marley::Generator& gen) const final override;
261 
262  virtual double differential_width( double Exf,
263  bool store_jpi_widths = false ) const = 0;
264 
265  inline virtual bool is_continuum() const final override { return true; }
266 
271  inline void set_skip_jpi_sampling(bool skip_it) const
272  { skip_jpi_sampling_ = skip_it; }
273 
278 
282  SpinParityWidth(int twoJ, marley::Parity p, double w)
283  : twoJf(twoJ), Pf(p), diff_width(w) {}
284 
285  int twoJf;
287  double diff_width;
288  };
289 
290  double sample_Exf(marley::Generator& gen) const;
291 
292  void sample_spin_parity(double Exf, int& two_Jf, marley::Parity& Pf,
293  marley::Generator& gen) const;
294 
296  inline double E_c_min() const { return E_c_min_; }
297 
300  virtual double E_c_max() const = 0;
301 
302  protected:
303 
305  double E_c_min_;
306 
309  int l_max_;
310 
313  mutable std::vector<SpinParityWidth> jpi_widths_table_;
314 
317  mutable bool skip_jpi_sampling_ = false;
318 
323  mutable std::unique_ptr<marley::ChebyshevInterpolatingFunction> Exf_cdf_;
324  };
325 
329  public FragmentExitChannel
330  {
331  public:
332 
336  FragmentDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi,
337  marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
338  const marley::Level& flev, const marley::Fragment& frag)
339  : ExitChannel( pdgi, qi, Exi, twoJi, Pi, rho_i, sdb ),
341  {
342  this->compute_total_width();
343  }
344 
345  virtual void compute_total_width() final override;
346  };
347 
351  public GammaExitChannel
352  {
353  public:
354 
358  GammaDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi,
359  marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
360  const marley::Level& flev) : ExitChannel( pdgi, qi, Exi, twoJi, Pi,
361  rho_i, sdb ), DiscreteExitChannel( flev ), GammaExitChannel()
362  {
363  this->compute_total_width();
364  }
365 
366  virtual void compute_total_width() final override;
367  };
368 
369 
373  public FragmentExitChannel
374  {
375  public:
376 
380  FragmentContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi,
381  marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
382  double Ec_min, const marley::Fragment& frag)
383  : ExitChannel( pdgi, qi, Exi, twoJi, Pi, rho_i, sdb ),
384  ContinuumExitChannel( Ec_min, sdb.get_fragment_l_max() ),
385  FragmentExitChannel( frag )
386  {
387  this->compute_total_width();
388  }
389 
390  virtual double differential_width( double Exf,
391  bool store_jpi_widths = false ) const final override;
392 
393  inline virtual double E_c_max() const final override
394  { return this->max_Exf(); }
395  };
396 
400  public GammaExitChannel
401  {
402  public:
403 
407  GammaContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi,
408  marley::Parity Pi, double rho_i, marley::StructureDatabase& sdb,
409  double Ec_min) : ExitChannel( pdgi, qi, Exi, twoJi, Pi, rho_i, sdb ),
410  ContinuumExitChannel( Ec_min, sdb.get_gamma_l_max() ),
412  {
413  this->compute_total_width();
414  }
415 
416  virtual double differential_width( double Exf,
417  bool store_jpi_widths = false ) const final override;
418 
419  inline virtual double E_c_max() const final override
420  { return Exi_; }
421  };
422 }
Abstract base class for ExitChannel objects that lead to the unbound continuum in the final state.
Definition: ExitChannel.hh:241
ContinuumExitChannel(double Ec_min, int lmax)
Definition: ExitChannel.hh:250
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()
Definition: ExitChannel.hh:271
double E_c_min() const
Returns the minimum excitation energy bound for the continuum.
Definition: ExitChannel.hh:296
virtual double E_c_max() const =0
Returns the maximum accessible excitation energy to be used when integrating over the continuum.
double E_c_min_
Minimum accessible nuclear excitation energy (MeV) in the continuum.
Definition: ExitChannel.hh:305
int l_max_
Definition: ExitChannel.hh:309
std::vector< SpinParityWidth > jpi_widths_table_
Table of possible final-state spin-parities together with their partial differential decay widths.
Definition: ExitChannel.hh:313
std::unique_ptr< marley::ChebyshevInterpolatingFunction > Exf_cdf_
Chebyshev polynomial interpolant to the cumulative density function for the final-state nuclear excit...
Definition: ExitChannel.hh:323
Abstract base class for ExitChannel objects that lead to discrete nuclear levels in the final state.
Definition: ExitChannel.hh:160
const marley::Level & final_level_
Reference to the final-state nuclear level.
Definition: ExitChannel.hh:180
virtual bool is_continuum() const final override
Returns true if this channel accesses the particle-unbound continuum of nuclear levels or false other...
Definition: ExitChannel.hh:171
const marley::Level & get_final_level() const
Get a const reference to the final-state nuclear level.
Definition: ExitChannel.hh:174
virtual void do_decay(double &Ex, int &two_J, marley::Parity &Pi, const marley::Particle &compound_nucleus, marley::Particle &emitted_particle, marley::Particle &residual_nucleus, marley::Generator &gen) const final override
Simulates a nuclear decay into this channel.
Definition: ExitChannel.cc:368
DiscreteExitChannel(const marley::Level &flev)
Definition: ExitChannel.hh:164
Abstract base class for compound nucleus de-excitation channels.
Definition: ExitChannel.hh:36
int twoJi_
Two times the initial nuclear spin .
Definition: ExitChannel.hh:138
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.
Definition: ExitChannel.hh:128
double width_
Total decay width into this channel (MeV)
Definition: ExitChannel.hh:152
marley::StructureDatabase * sdb_
StructureDatabase to use in calculations.
Definition: ExitChannel.hh:155
virtual void do_decay(double &Exf, int &two_Jf, marley::Parity &Pf, const marley::Particle &compound_nucleus, marley::Particle &emitted_particle, marley::Particle &residual_nucleus, marley::Generator &gen) const =0
Simulates a nuclear decay into this channel.
marley::Parity Pi_
Initial nuclear parity .
Definition: ExitChannel.hh:141
double width() const
Get the total decay width into this channel (MeV)
Definition: ExitChannel.hh:99
ExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb)
Definition: ExitChannel.hh:55
int qi_
Definition: ExitChannel.hh:132
virtual void compute_total_width()=0
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 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)
Definition: ExitChannel.hh:135
virtual void prepare_products(const marley::Particle &compound_nucleus, marley::Particle &emitted_particle, marley::Particle &residual_nucleus, double Exf, marley::Generator &gen) const
Helper function that prepares Particle objects representing the products of the two-body decay.
Definition: ExitChannel.cc:380
virtual int final_nucleus_pdg() const =0
Returns the PDG code for the final nucleus.
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_...
Definition: ExitChannel.hh:92
double one_over_two_pi_rho_i_
Definition: ExitChannel.hh:149
Fragment emission ExitChannel that leads to the unbound continuum in the final state
Definition: ExitChannel.hh:374
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)
Definition: ExitChannel.hh:380
Fragment emission ExitChannel that leads to a discrete nuclear level in the final state
Definition: ExitChannel.hh:330
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)
Definition: ExitChannel.hh:336
Abstract base class for ExitChannel objects that represent emission of a nuclear fragment.
Definition: ExitChannel.hh:185
FragmentExitChannel(const marley::Fragment &fragment)
Definition: ExitChannel.hh:189
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...
Definition: ExitChannel.hh:192
int fragment_pdg_
PDG code identifying the emitted fragment.
Definition: ExitChannel.hh:207
virtual int final_nucleus_pdg() const final override
Returns the PDG code for the final nucleus.
Definition: ExitChannel.cc:60
double max_Exf() const
Helper function that returns that maximum possible excitation energy for the daughter nucleus after e...
Definition: ExitChannel.cc:74
virtual bool emits_fragment() const final override
Returns true if this channel involves fragment emission or false if it involves gamma-ray emission.
Definition: ExitChannel.hh:195
Simple container for storing reference data about each of the nuclear fragments considered by MARLEY'...
Definition: Fragment.hh:27
Gamma emission exit channel that leads to the unbound continuum in the final state
Definition: ExitChannel.hh:401
GammaContinuumExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb, double Ec_min)
Definition: ExitChannel.hh:407
Gamma emission exit channel that leads to a discrete nuclear level in the final state
Definition: ExitChannel.hh:352
GammaDiscreteExitChannel(int pdgi, int qi, double Exi, int twoJi, marley::Parity Pi, double rho_i, marley::StructureDatabase &sdb, const marley::Level &flev)
Definition: ExitChannel.hh:358
Abstract base class for ExitChannel objects that represent emission of a gamma-ray.
Definition: ExitChannel.hh:212
virtual bool emits_fragment() const final override
Returns true if this channel involves fragment emission or false if it involves gamma-ray emission.
Definition: ExitChannel.hh:220
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...
Definition: ExitChannel.hh:217
virtual int final_nucleus_pdg() const final override
Returns the PDG code for the final nucleus.
Definition: ExitChannel.hh:223
TransitionType
Electromagnetic transitions in nuclei may be classified by their multipolarity (electric vs....
Definition: GammaStrengthFunctionModel.hh:43
The MARLEY Event generator.
Definition: Generator.hh:42
Template class that creates an iterator to a class member based on an iterator to a pointer (either b...
Definition: IteratorToPointerMember.hh:31
A discrete nuclear energy level.
Definition: Level.hh:29
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
Container for nuclear structure information organized by nuclide.
Definition: StructureDatabase.hh:39
A spin-parity value with its corresponding partial decay width.
Definition: ExitChannel.hh:277
SpinParityWidth(int twoJ, marley::Parity p, double w)
Definition: ExitChannel.hh:282
double diff_width
Partial differential decay width (MeV)
Definition: ExitChannel.hh:287
marley::Parity Pf
Final nuclear parity.
Definition: ExitChannel.hh:286
int twoJf
Final nuclear spin.
Definition: ExitChannel.hh:285