Bayeux  3.4.1
Core Foundation library for SuperNEMO
beta_decay.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2014-11-06
4  * Last modified: 2014-11-06
5  *
6  * License:
7  * Copyright 2014 F. Mauger
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or (at
12  * your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  *
24  * Description:
25  *
26  * Beta decay driver.
27  *
28  * History:
29  *
30  */
31 
32 #ifndef GENBB_HELP_BETA_DECAY_H
33 #define GENBB_HELP_BETA_DECAY_H 1
34 
35 // Standard library:
36 #include <string>
37 #include <fstream>
38 #include <vector>
39 
40 // Third party:
41 // - Boost:
42 #include <boost/scoped_ptr.hpp>
43 // - Bayeux/datatools:
44 #include <datatools/properties.h>
45 #include <datatools/i_tree_dump.h>
46 // - Bayeux/mygsl:
47 #include <mygsl/rng.h>
48 // - Bayeux/genbb_help:
53 
54 namespace genbb {
55 
56  // Forward declaration:
57  class fermi_function;
58 
61  {
62 
63  public:
64 
66  enum decay_type {
70  };
71 
73  static std::string label_from_decay_type(decay_type);
74 
76  static decay_type decay_type_from_label(const std::string &);
77 
87  };
88 
94  };
95 
97  static const int ESO_INVALID_FIXED_CHARGE = 0xFFFFFFFF;
98 
101  int charge;
102  double probability;
104  };
105 
106  typedef std::vector<electron_shakeoff_entry> electron_shakeoff_data_type;
107 
109  static std::string label_from_coupling(coupling_type);
110 
112  static coupling_type coupling_from_label(const std::string &);
113 
114  // Return the a value associated to a coupling
115  static double a_value(coupling_type);
116 
118  beta_decay();
119 
121  virtual ~beta_decay();
122 
124  void set_type(decay_type);
125 
127  decay_type get_type() const;
128 
130  bool is_beta_minus() const;
131 
133  bool is_beta_plus() const;
134 
136  bool has_q_beta() const;
137 
139  void set_q_beta(double);
140 
142  double get_q_beta() const;
143 
145  void set_A(int);
146 
148  int get_A() const;
149 
151  void set_Z_parent(int);
152 
154  int get_Z_parent() const;
155 
157  void set_Z_daughter(int);
158 
160  int get_Z_daughter() const;
161 
163  void set_mass_parent(double);
164 
166  double get_mass_parent() const;
167 
169  void set_mass_daughter(double);
170 
172  double get_mass_daughter() const;
173 
175  void set_energy_parent(double);
176 
178  double get_energy_parent() const;
179 
181  void set_energy_daughter(double);
182 
184  double get_energy_daughter() const;
185 
187  void set_coupling(coupling_type coupling_);
188 
190  coupling_type get_coupling() const;
191 
193  bool coupling_is_known() const;
194 
196  void set_a(double);
197 
199  double get_a() const;
200 
202  void set_ke_cut(double);
203 
205  double get_ke_cut() const;
206 
208  bool is_electron_shakeoff() const;
209 
212 
215 
218 
220  void set_electron_shakeoff_fixed_charge(int charge_);
221 
225  void add_electron_shakeoff_random(int charge_, double probability_);
226 
229 
231  void set_log_filename(const std::string &);
232 
234  const std::string & get_log_filename() const;
235 
237  bool is_beta_generated() const;
238 
240  void set_beta_generated(bool);
241 
243  bool is_neutrino_generated() const;
244 
246  void set_neutrino_generated(bool);
247 
249  bool is_daughter_generated() const;
250 
252  void set_daughter_generated(bool);
253 
255  double get_pr_max() const;
256 
258  double get_probability_max() const;
259 
261  double pdf_ke_pr(double ke_ , double pr_) const;
262 
264  static void compute_ke_limits(//double mass_parent_,
265  double q_beta_,
266  double pr_,
267  double & ke_min_,
268  double & ke_max_);
269 
271  virtual void tree_dump(std::ostream & out_ = std::clog,
272  const std::string & title_ = "",
273  const std::string & indent_ = "",
274  bool inherit_ = false) const;
275 
277  void display_pdf(const std::string & title_ = "") const;
278 
285  int fire_event_kinematics(mygsl::rng & prng_,
286  double & ke_,
287  double & pr_,
288  double & pnu_,
289  double & cer_,
290  double & cenu_) const;
291 
293  virtual void set_levels(const nuclear_level & level_start_,
294  const nuclear_level & level_stop_);
295 
297  virtual void initialize(const datatools::properties & config_);
298 
300  virtual void reset();
301 
303  virtual int fill(mygsl::rng & prng_, genbb::primary_event & event_);
304 
305  protected:
306 
308  void _compute_pr_max();
309 
311  void _compute_limits();
312 
314  void _init();
315 
318 
320  void _set_default();
321 
322  private:
323 
324  decay_type _type_;
325  double _q_beta_;
326  double _ke_cut_;
327  int _A_;
328  int _Z_parent_;
329  int _Z_daughter_;
330  double _mass_parent_;
331  double _energy_parent_;
332  double _mass_daughter_;
333  double _energy_daughter_;
334  coupling_type _coupling_;
335  double _a_;
336  electron_shakeoff_mode_type _electron_shakeoff_mode_;
337  int _electron_shakeoff_fixed_charge_;
338  electron_shakeoff_data_type _electron_shakeoff_data_random_;
339  std::string _log_filename_;
340  boost::scoped_ptr<std::ofstream> _log_file_;
341  boost::scoped_ptr<fermi_function> _F_;
342  bool _massive_neutrino_;
343  double _neutrino_mass_;
344  bool _beta_generated_;
345  bool _neutrino_generated_;
346  bool _daughter_generated_;
347 
348  // Working data:
349  double _M_;
350  double _m1_;
351  double _m2_;
352  double _m3_;
353  double _pr_max_;
354  double _kr_max_;
355  double _probability_max_;
356 
358 
359  };
360 
361 } // end of namespace genbb
362 
363 /***************
364  * OCD support *
365  ***************/
366 #include <datatools/ocd_macros.h>
368 
369 #endif // GENBB_HELP_BETA_DECAY_H
370 
371 // Local Variables: --
372 // mode: c++ --
373 // End: --
const std::string & get_log_filename() const
Return the name of the log file.
coupling_type get_coupling() const
Return the coupling of the beta decay.
void add_electron_shakeoff_random(int charge_, double probability_)
coupling_type
Type of the coupling.
Definition: beta_decay.h:79
static std::string label_from_coupling(coupling_type)
Return a label associated to a coupling.
int fire_event_kinematics(mygsl::rng &prng_, double &ke_, double &pr_, double &pnu_, double &cer_, double &cenu_) const
No electron shakeoff.
Definition: beta_decay.h:91
Force daughter recoil ion's charge state.
Definition: beta_decay.h:92
double get_energy_parent() const
Return the excitation energy of the parent nucleus.
int get_electron_shakeoff_fixed_charge() const
Return the fixed electron shakeoff charge of the daughter recoil ion.
Beta plus.
Definition: beta_decay.h:69
void _set_default()
Set default values (initialization)
void set_coupling(coupling_type coupling_)
Set the coupling of the beta decay.
bool is_daughter_generated() const
Check the daughter nucleus/ion generation flag.
int get_Z_parent() const
Return the Z of the parent nucleus.
void set_Z_parent(int)
Set the Z of the parent nucleus.
void set_Z_daughter(int)
Set the Z of the daughter nucleus.
double probability
Probability.
Definition: beta_decay.h:102
std::vector< electron_shakeoff_entry > electron_shakeoff_data_type
Definition: beta_decay.h:106
virtual void reset()
Reset.
void set_mass_daughter(double)
Set the isotopic mass of the daughter nucleus (not the atomic mass)
Base decay driver.
Definition: base_decay_driver.h:60
void set_log_filename(const std::string &)
Set the name of the file.
void set_neutrino_generated(bool)
Set the neutrino generation flag.
static double a_value(coupling_type)
bool is_neutrino_generated() const
Check the neutrino generation flag.
double get_energy_daughter() const
Return the isotopic mass of the daughter nucleus.
bool coupling_is_known() const
Check if coupling is known.
Vector coupling (pure Fermi)
Definition: beta_decay.h:84
static coupling_type coupling_from_label(const std::string &)
Return a coupling associated to a label.
Invalid beta decay type.
Definition: beta_decay.h:67
const electron_shakeoff_data_type & get_electron_shakeoff_data_random() const
Return the random for random electron shakeoff.
double pdf_ke_pr(double ke_, double pr_) const
Compute the probability density function for a given electron kinetic energy and a given recoil ion m...
void _compute_pr_max()
Compute the maximum value of the recoil ion momentum.
#define GENBB_BDD_REGISTRATION_INTERFACE(GENBB_CLASS_NAME)
Definition: genbb_macros.h:35
int charge
Daughter recoil ion's charge state.
Definition: beta_decay.h:101
static std::string label_from_decay_type(decay_type)
Return a label associated to a decay type.
static void compute_ke_limits(double q_beta_, double pr_, double &ke_min_, double &ke_max_)
Compute the bounds for the electron kinetic energy.
decay_type
Type of the beta decay.
Definition: beta_decay.h:66
void set_energy_daughter(double)
Set the excitation energy of the daughter nucleus.
void set_type(decay_type)
Set the type of the beta decay.
bool is_beta_generated() const
Check the beta generation flag.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual void initialize(const datatools::properties &config_)
Initialization.
void set_mass_parent(double)
Set the isotopic mass of the parent nucleus (not the atomic mass)
virtual void set_levels(const nuclear_level &level_start_, const nuclear_level &level_stop_)
Set the transition parameter from the start and stop levels.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
int get_A() const
Return the A of the decaying nucleus.
double cumul_probability
Cumulative probability.
Definition: beta_decay.h:103
Randomize daughter recoil ion's charge state.
Definition: beta_decay.h:93
void _compute_limits()
Compute some internal data.
void set_beta_generated(bool)
Set the beta generation flag.
bool is_electron_shakeoff() const
Check electron shakeoff mode.
decay_type get_type() const
Return the type of the beta decay.
void set_a(double)
Set the beta-neutrino angular correlation coefficient.
double get_mass_parent() const
Return the isotopic mass of the parent nucleus (not the atomic mass)
int get_Z_daughter() const
Return the Z of the daughter nucleus.
void _init()
Compute some internal data.
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
void _init_electron_shakeoff()
Initialize electron shakeoff.
void set_electron_shakeoff(electron_shakeoff_mode_type eso_mode_)
Set electron shakeoff mode.
Beta minus.
Definition: beta_decay.h:68
virtual ~beta_decay()
Destructor.
void set_electron_shakeoff_fixed_charge(int charge_)
Set fixed electron shakeoff charge of the daughter recoil ion.
Tensor coupling.
Definition: beta_decay.h:82
void set_daughter_generated(bool)
Set the daughter nucleus/ion generation flag.
double get_probability_max() const
Return the maximum value of the probability density for Von Neumann method.
bool is_beta_minus() const
Check if the decay is a beta minus.
double get_mass_daughter() const
Return the isotopic mass of the daughter nucleus (not the atomic mass)
bool has_q_beta() const
Check if Q beta is set.
bool has_electron_shakeoff_fixed_charge() const
Check the fixed electron shakeoff charge of the daughter recoil ion.
static const int ESO_INVALID_FIXED_CHARGE
Invalid electron shakeoff fixed charge.
Definition: beta_decay.h:97
static decay_type decay_type_from_label(const std::string &)
Return a coupling associated to a label.
A primary event from a Monte-Carlo generator.
Definition: primary_event.h:60
Scalar coupling.
Definition: beta_decay.h:83
virtual int fill(mygsl::rng &prng_, genbb::primary_event &event_)
Shoot the kinematics of the decay and fill a primary event.
Unknown coupling.
Definition: beta_decay.h:86
bool is_beta_plus() const
Check if the decay is a beta plus.
double get_a() const
Return the beta-neutrino angular correlation coefficient.
User defined coupling.
Definition: beta_decay.h:85
Entry for a given daughter recoil ion's charge state.
Definition: beta_decay.h:100
void set_energy_parent(double)
Set the excitation energy of the parent nucleus.
electron_shakeoff_mode_type
Daughter recoil ion's electron shakeoff mode.
Definition: beta_decay.h:90
double get_ke_cut() const
Return the cut on beta kinetic energy.
double get_q_beta() const
Return the Q beta of the decay.
void set_A(int)
Set the A of the decaying nucleus.
Description of a nuclear level.
Definition: nuclear_level.h:53
Description of a beta decay.
Definition: beta_decay.h:60
void set_q_beta(double)
Set the Q beta of the decay.
Invalid coupling.
Definition: beta_decay.h:80
beta_decay()
Default constructor.
Pseudo random number generator.
Definition: rng.h:53
Axial-vector coupling (pure Gamow-Teller)
Definition: beta_decay.h:81
double get_pr_max() const
Return the maximum value of the recoil ion momentum.
void set_ke_cut(double)
Set the cut on beta kinetic energy.
void display_pdf(const std::string &title_="") const
Display PDF.
A dictionary of arbitrary properties.
Definition: properties.h:125