Bayeux  3.4.1
Core Foundation library for SuperNEMO
base_decay_driver.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2014-06-08
4  * Last modified: 2014-06-08
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  * Description of a nuclear decay.
27  *
28  * History:
29  *
30  */
31 
32 #ifndef GENBB_HELP_BASE_DECAY_DRIVER_H
33 #define GENBB_HELP_BASE_DECAY_DRIVER_H 1
34 
35 // Third party:
36 // - Bayeux/datatools:
38 #include <datatools/logger.h>
39 #include <datatools/i_tree_dump.h>
41 
42 namespace datatools {
43  // Forward declaration:
44  class properties;
45 }
46 
47 namespace mygsl {
48  // Forward declaration:
49  class rng;
50 }
51 
52 namespace genbb {
53 
54  // Forward declaration:
55  class primary_event;
56  class nuclear_level;
57  class nuclear_decay;
58 
61  {
62  public:
63 
66 
68  virtual ~base_decay_driver();
69 
72 
75 
77  virtual void tree_dump(std::ostream & out_ = std::clog,
78  const std::string & title_ = "",
79  const std::string & indent_ = "",
80  bool inherit_ = false) const;
81 
83  bool is_initialized() const;
84 
86  void initialize_simple();
87 
89  virtual void set_levels(const nuclear_level & level_initial_,
90  const nuclear_level & level_final_);
91 
93  virtual void initialize(const datatools::properties & setup_) = 0;
94 
96  virtual void reset() = 0;
97 
99  virtual int fill(mygsl::rng & prng_, primary_event & event_) = 0;
100 
101  protected:
102 
104  void _set_default();
105 
107  void _set_initialized(bool);
108 
110  void _initialize(const datatools::properties & setup_);
111 
112  private:
113 
114  datatools::logger::priority _logging_;
115  bool _initialized_;
116  const nuclear_decay * _decay_;
117 
118  // Factory stuff :
120 
121  };
122 
123 
126  {
127  public:
128 
129  static base_decay_driver * create(const std::string & driver_id_);
130 
131  };
132 
133 } // end of namespace genbb
134 
135 #endif // GENBB_HELP_BASE_DECAY_DRIVER_H
136 
137 // Local Variables: --
138 // mode: c++ --
139 // End: --
static base_decay_driver * create(const std::string &driver_id_)
void set_logging(datatools::logger::priority)
Set the logging priority threshold.
datatools::logger::priority get_logging() const
Return the logging priority threshold.
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
virtual void reset()=0
Reset.
An interface with utilities for printable objects.
Definition: i_tree_dump.h:36
void _initialize(const datatools::properties &setup_)
Initialization.
void initialize_simple()
Initialization.
Base decay driver.
Definition: base_decay_driver.h:60
virtual ~base_decay_driver()
Destructor.
void _set_default()
Set the default attributes.
void _set_initialized(bool)
Set the initialization flag.
virtual int fill(mygsl::rng &prng_, primary_event &event_)=0
Shoot the kinematics of the decay and fill a primary event.
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
bool is_initialized() const
Check initialization status.
A primary event from a Monte-Carlo generator.
Definition: primary_event.h:60
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
Utilities for logging information.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Description of a nuclear decay.
Definition: nuclear_decay.h:54
Decay driver factory methods.
Definition: base_decay_driver.h:125
#define DATATOOLS_FACTORY_SYSTEM_REGISTER_INTERFACE(BaseType)
Declaration of a system (allocator/functor) factory register as a static member of a base class and s...
Definition: factory_macros.h:52
virtual void initialize(const datatools::properties &setup_)=0
Initialize from configuration properties.
base_decay_driver()
Default constructor.
Description of a nuclear level.
Definition: nuclear_level.h:53
Pseudo random number generator.
Definition: rng.h:53
virtual void set_levels(const nuclear_level &level_initial_, const nuclear_level &level_final_)
Set the transition parameters from the initial and stop levels.
A dictionary of arbitrary properties.
Definition: properties.h:125