Bayeux  3.4.1
Core Foundation library for SuperNEMO
wdecay0.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2013-05-04
4  * Last modified: 2013-05-05
5  *
6  * License:
7  * Copyright 2013 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  * C++ wrapper GENBB/Decay0 C++ port generator.
27  *
28  * History:
29  *
30  */
31 
32 #ifndef GENBB_HELP_WDECAY0_H
33 #define GENBB_HELP_WDECAY0_H
34 
35 // Standard library:
36 #include <iostream>
37 
38 // Third party:
39 // - Boost:
40 #include <boost/scoped_ptr.hpp>
41 // - Bayeux/datatools:
42 #include <datatools/properties.h>
43 // - Bayeux/mygsl:
44 #include <mygsl/rng.h>
45 
46 // This project:
47 #include <genbb_help/i_genbb.h>
48 
49 namespace genbb {
50 
52  namespace decay0 {
53  //struct bkgpars;
54  struct bbpars;
55  }
56 
58  class wdecay0 : public i_genbb
59  {
60  public:
61 
63  enum decay_type {
67  };
68 
70  static const int DBD_MODE_INVALID = -1;
71 
72  public:
73 
74  virtual bool can_external_random() const;
75 
76  const mygsl::rng & get_random() const;
77 
79 
80  size_t get_event_count() const;
81 
82  double get_to_all_events() const;
83 
84  wdecay0();
85 
86  virtual ~wdecay0();
87 
88  virtual void tree_dump(std::ostream& out = std::clog,
89  const std::string& title = "",
90  const std::string& indent = "",
91  bool inherit = false) const;
92 
93  void dump(std::ostream & = std::clog) const;
94 
95  virtual void initialize(const datatools::properties & setup_,
96  datatools::service_manager & service_manager_,
97  detail::pg_dict_type & dictionary_);
98 
99  virtual void reset();
100 
101  virtual bool has_next();
102 
103  virtual bool is_initialized() const;
104 
106 
107  protected:
108 
109  virtual void _load_next(primary_event & event_,
110  bool compute_classification_ = true);
111 
112  private:
113 
114  void _init_();
115 
116  void _reset_();
117 
118  void _set_decay_isotope_(const std::string & di_);
119 
120  void _set_decay_version_(int ver_);
121 
122  private:
123 
124  bool _initialized_;
125 
126  int _decay_type_;
127  std::string _decay_isotope_;
128  int _decay_version_;
129  int _decay_dbd_level_;
130  int _decay_dbd_mode_;
131  size_t _event_count_;
132 
133  double _energy_min_;
134  double _energy_max_;
135 
136  unsigned long _seed_;
137  mygsl::rng _random_;
138 
139  boost::scoped_ptr<genbb::decay0::bbpars> _bb_params_;
140 
142 
143  };
144 
145 } // end of namespace genbb
146 
147 /***************
148  * OCD support *
149  ***************/
150 #include <datatools/ocd_macros.h>
152 
153 #endif // GENBB_HELP_WDECAY0_H
154 
155 // Local Variables: --
156 // mode: c++ --
157 // End: --
virtual ~wdecay0()
virtual bool is_initialized() const
Check initialization status.
const mygsl::rng & get_random() const
void dump(std::ostream &=std::clog) const
GENBB particle generator abstract base class.
Definition: i_genbb.h:59
Decay0/GENBB (C++ port) generator wrapper.
Definition: wdecay0.h:58
Undefined decay type.
Definition: wdecay0.h:64
virtual void tree_dump(std::ostream &out=std::clog, const std::string &title="", const std::string &indent="", bool inherit=false) const
Smart print.
virtual bool has_next()
Returns true if the generator can provide one more generated event.
virtual void _load_next(primary_event &event_, bool compute_classification_=true)
Protected abstract interface to be invoked by the public 'load_next' method.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
double get_to_all_events() const
#define GENBB_PG_REGISTRATION_INTERFACE(GENBB_CLASS_NAME)
Definition: genbb_macros.h:22
size_t get_event_count() const
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
virtual void reset()
Reset method.
A primary event from a Monte-Carlo generator.
Definition: primary_event.h:60
genbb::decay0::bbpars & bb_params()
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, detail::pg_dict_type &dictionary_)
Main initialization interface method.
Definition: bb.h:131
Radioactive background decay.
Definition: wdecay0.h:66
std::map< std::string, pg_entry_type > pg_dict_type
Definition: pg_tools.h:134
static const int DBD_MODE_INVALID
Invalid decay mode.
Definition: wdecay0.h:70
Double beta decay.
Definition: wdecay0.h:65
Service management class.
Definition: service_manager.h:57
decay_type
Type of decay.
Definition: wdecay0.h:63
Pseudo random number generator.
Definition: rng.h:53
virtual bool can_external_random() const
Check if the generator accepts an external PRNG.
A dictionary of arbitrary properties.
Definition: properties.h:125
mygsl::rng & grab_random()