MARLEY (Model of Argon Reaction Low Energy Yields)  v1.0.0
A Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions in liquid argon
 All Classes Functions Variables Enumerations Pages
ExitChannel.hh
1 #pragma once
2 #include <vector>
3 
4 #include "marley/Fragment.hh"
5 #include "marley/Generator.hh"
6 #include "marley/IteratorToPointerMember.hh"
7 #include "marley/Level.hh"
8 #include "marley/MassTable.hh"
9 #include "marley/Parity.hh"
10 
11 namespace marley {
12 
14  class ExitChannel {
15 
16  public:
17 
19  ExitChannel(double width) : width_(width) {}
20 
23  virtual bool is_continuum() const = 0;
24 
27  virtual bool emits_fragment() const = 0;
28 
39  virtual void do_decay(double& Ex, int& two_J,
40  marley::Parity& Pi, marley::Particle& emitted_particle,
41  marley::Particle& residual_nucleus, marley::Generator& gen) = 0;
42 
47  template<typename It> static inline
50  {
52  double>(it, &marley::ExitChannel::width_);
53  }
54 
56  inline double width() const { return width_; }
57 
58  protected:
59 
61  double width_;
62  };
63 
67  public:
68 
73  marley::Particle residue) : ExitChannel(width), final_level_(flev),
74  residue_(residue) {}
75 
76  inline virtual bool is_continuum() const final override { return false; }
77 
79  inline const marley::Level& get_final_level() const
80  { return final_level_; }
83 
84  protected:
89  };
90 
94 
95  public:
96 
102  marley::Particle residue, const marley::Fragment& frag)
103  : DiscreteExitChannel(width, flev, residue), fragment_(frag) {}
104 
105  inline virtual bool emits_fragment() const final override { return true; }
106 
108  inline const marley::Fragment& get_fragment() const { return fragment_; }
109 
110  virtual void do_decay(double& Ex, int& two_J,
111  marley::Parity& Pi, marley::Particle& emitted_particle,
112  marley::Particle& residual_nucleus, marley::Generator& /*unused*/)
113  override;
114 
115  protected:
116 
119  };
120 
124 
125  public:
126 
131  marley::Particle residue) : DiscreteExitChannel(width, flev, residue) {}
132 
133  inline virtual bool emits_fragment() const final override
134  { return false; }
135 
136  virtual void do_decay(double& Ex, int& two_J,
137  marley::Parity& Pi, marley::Particle& emitted_particle,
138  marley::Particle& residual_nucleus, marley::Generator& /*unused*/)
139  override;
140  };
141 
142 
146  {
147  public:
148 
157  ContinuumExitChannel(double width, double Emin, double Emax,
158  marley::Particle gs_residue) : marley::ExitChannel(width),
159  Emin_(Emin), Emax_(Emax), gs_residue_(gs_residue) {}
160 
161  inline virtual bool is_continuum() const final override { return true; }
162 
163  protected:
164 
169 
173  SpinParityWidth(int twoJ, marley::Parity p, double w)
174  : twoJf(twoJ), Pf(p), width(w) {}
175 
176  int twoJf;
178  double width;
179  };
180 
181  double Emin_;
182  double Emax_;
184 
187  std::vector<SpinParityWidth> jpi_widths_table_;
188  };
189 
193  {
194  public:
195 
207  FragmentContinuumExitChannel(double width, double Emin, double Emax,
208  std::function<double(double&, double)> Epdf,
209  const marley::Fragment& frag, marley::Particle gs_residue)
210  : marley::ContinuumExitChannel(width, Emin, Emax, gs_residue),
211  Epdf_(Epdf), fragment_(frag) {}
212 
213  inline virtual bool emits_fragment() const final override { return true; }
214 
216  inline const marley::Fragment& get_fragment() const { return fragment_; }
217 
225  void sample_spin_parity(int& twoJ, marley::Parity& Pi,
226  marley::Generator& gen, double Exf, double Ea);
227 
228  virtual void do_decay(double& Ex, int& two_J,
229  marley::Parity& Pi, marley::Particle& emitted_particle,
230  marley::Particle& residual_nucleus, marley::Generator& gen)
231  override;
232 
233  protected:
241  std::function<double(double&, double)> Epdf_;
243  };
244 
248  {
249  public:
250 
261  GammaContinuumExitChannel(double width, double Emin, double Emax,
262  std::function<double(double)> Epdf, marley::Particle gs_residue)
263  : marley::ContinuumExitChannel(width, Emin, Emax, gs_residue),
264  Epdf_(Epdf) {}
265 
266  inline virtual bool emits_fragment() const final override
267  { return false; }
268 
278  void sample_spin_parity(int Z, int A, int& twoJ, marley::Parity& Pi,
279  double Exi, double Exf, marley::Generator& gen);
280 
281  virtual void do_decay(double& Ex, int& two_J,
282  marley::Parity& Pi, marley::Particle& emitted_particle,
283  marley::Particle& residual_nucleus, marley::Generator& gen)
284  override;
285 
286  protected:
287 
293  std::function<double(double)> Epdf_;
294 
295  private:
296 
307  double store_gamma_jpi_width(double Exf, int twoJf, marley::Parity Pi,
308  double tcE, double tcM, int mpol, marley::LevelDensityModel& ldm);
309  };
310 }