Bayeux  3.4.1
Core Foundation library for SuperNEMO
nuclear_decay.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_NUCLEAR_DECAY_H
33 #define GENBB_HELP_NUCLEAR_DECAY_H 1
34 
35 // Standard library:
36 #include <string>
37 
38 // Third party:
39 // - Boost:
40 #include <boost/scoped_ptr.hpp>
41 // - Bayeux/datatools:
42 #include <datatools/properties.h>
43 #include <datatools/handle.h>
44 #include <datatools/logger.h>
45 #include <datatools/i_tree_dump.h>
46 
47 namespace genbb {
48 
49  // Forward declaration
50  class nuclear_level;
51  class base_decay_driver;
52 
55  {
56  public:
57 
60 
62  nuclear_decay();
63 
65  virtual ~nuclear_decay();
66 
68  bool is_valid() const;
69 
71  bool check_decay(std::string &) const;
72 
74  bool has_decay_id() const;
75 
77  const std::string & get_decay_id() const;
78 
80  void set_decay_id(const std::string &);
81 
83  void set_level_initial(const nuclear_level &);
84 
86  const nuclear_level & get_level_initial() const;
87 
89  void set_level_final(const nuclear_level &);
90 
92  const nuclear_level & get_level_final() const;
93 
95  const datatools::properties & get_auxiliaries() const;
96 
99 
101  bool is_initialized() const;
102 
104  void initialize(const datatools::properties & config_,
105  const std::map<std::string, datatools::handle<nuclear_level> > * levels_ = 0);
106 
108  void initialize_simple();
109 
111  void reset();
112 
114  std::string to_string(unsigned int = 0) const;
115 
117  virtual void tree_dump(std::ostream & out_ = std::clog,
118  const std::string & title_ = "",
119  const std::string & indent_ = "",
120  bool inherit_ = false) const;
121 
123  bool has_decay_driver() const;
124 
127 
130 
133 
134  protected:
135 
138 
140  void _set_default();
141 
142  private:
143 
144  bool _initialized_;
145  datatools::logger::priority _logging_;
146  std::string _decay_id_;
147  const nuclear_level * _level_initial_;
148  const nuclear_level * _level_final_;
149  datatools::properties _auxiliaries_;
150 
151  boost::scoped_ptr<base_decay_driver> _decay_driver_;
152 
153  };
154 
155 } // end of namespace genbb
156 
157 #endif // GENBB_HELP_NUCLEAR_DECAY_H
158 
159 // Local Variables: --
160 // mode: c++ --
161 // End: --
void set_logging(datatools::logger::priority)
Set the logging priority threshold.
datatools::handle< nuclear_decay > handle_type
Handle type.
Definition: nuclear_decay.h:59
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
const nuclear_level & get_level_initial() const
Return the parent level.
An interface with utilities for printable objects.
Definition: i_tree_dump.h:36
void initialize(const datatools::properties &config_, const std::map< std::string, datatools::handle< nuclear_level > > *levels_=0)
Initialize from a list of parameters and a dictionary of nuclear levels.
const datatools::properties & get_auxiliaries() const
Return auxiliary properties.
Base decay driver.
Definition: base_decay_driver.h:60
bool check_decay(std::string &) const
Check if the decay mode is compatible with parent and daughter levels.
bool is_initialized() const
Check initialization flag.
void _set_default()
Set attributes' default values.
void initialize_simple()
Standalone initialization.
datatools::properties & grab_auxiliaries()
Return auxiliary properties.
nuclear_decay()
Default constructor.
void reset()
Reset.
bool has_decay_id() const
Check if the decay identifier is set.
const nuclear_level & get_level_final() const
Return the daughter level.
virtual ~nuclear_decay()
Destructor.
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
bool is_valid() const
Check validity.
void set_decay_id(const std::string &)
Set the decay identifier.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Utilities for logging information.
void set_level_final(const nuclear_level &)
Set the daughter level.
void _init_decay_driver(const datatools::properties &)
Initialization of the embedded decay driver.
void set_level_initial(const nuclear_level &)
Set the parent level.
Description of a nuclear decay.
Definition: nuclear_decay.h:54
std::string to_string(unsigned int=0) const
Return a descriptive string.
datatools::logger::priority get_logging() const
Return the logging priority threshold.
const std::string & get_decay_id() const
Return the decay identifier.
bool has_decay_driver() const
Check the decay driver avaibility.
Description of a nuclear level.
Definition: nuclear_level.h:53
base_decay_driver & grab_decay_driver()
Return the decay driver.
A dictionary of arbitrary properties.
Definition: properties.h:125