Bayeux  3.4.1
Core Foundation library for SuperNEMO
nuclear_decay_manager.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  * Nuclear decay manager.
27  *
28  * History:
29  *
30  */
31 
32 #ifndef GENBB_HELP_NUCLEAR_DECAY_MANAGER_H
33 #define GENBB_HELP_NUCLEAR_DECAY_MANAGER_H 1
34 
35 // Standard library:
36 #include <string>
37 #include <map>
38 
39 // Third party:
40 // - Bayeux/datatools:
41 #include <datatools/handle.h>
42 #include <datatools/logger.h>
43 #include <datatools/i_tree_dump.h>
44 
45 namespace datatools {
46  class properties;
47  class multi_properties;
48 }
49 
50 namespace genbb {
51 
52  // Forward declarations:
53  class nuclear_level;
54  class nuclear_decay;
55 
58  {
59  public:
60 
62  typedef std::map<std::string, datatools::handle<nuclear_level> > level_dict_type;
63 
65  typedef std::map<std::string, datatools::handle<nuclear_decay> > decay_dict_type;
66 
69 
72 
75 
77  virtual ~nuclear_decay_manager();
78 
80  void load_level(const std::string & level_name_,
81  const datatools::properties & level_config_);
83  void load_decay(const std::string & decay_name_,
84  const datatools::properties & decay_config_);
85 
87  void load_decay_table(const std::string & level_name_,
88  const datatools::properties & decay_table_config_);
89 
91  void load(const std::string & filename_);
92 
94  void load(const datatools::multi_properties & levels_and_decays_config_);
95 
97  bool is_initialized() const;
98 
100  void initialize(const datatools::properties & config_);
101 
103  void initialize_simple();
104 
106  void reset();
107 
109  const level_dict_type & get_levels() const;
110 
112  const decay_dict_type & get_decays() const;
113 
115  virtual void tree_dump(std::ostream & out_ = std::clog,
116  const std::string & title_ = "",
117  const std::string & indent_ = "",
118  bool inherit_ = false) const;
119 
120  protected:
121 
123  void _install_decay_tables();
124 
125  private:
126 
127  datatools::logger::priority _logging_;
128  bool _initialized_;
129  level_dict_type _levels_;
130  decay_dict_type _decays_;
131  bool _do_decay_tables_;
132 
133  };
134 
135 } // end of namespace genbb
136 
137 #endif // GENBB_HELP_NUCLEAR_DECAY_MANAGER_H
138 
139 // Local Variables: --
140 // mode: c++ --
141 // End: --
void _install_decay_tables()
Install decay tables associated to nuclear levels.
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
A container of mapped properties objects.
Definition: multi_properties.h:99
void load(const std::string &filename_)
Load levels and decays from a configuration file.
std::map< std::string, datatools::handle< nuclear_level > > level_dict_type
Dictionary of nuclear levels.
Definition: nuclear_decay_manager.h:62
An interface with utilities for printable objects.
Definition: i_tree_dump.h:36
const decay_dict_type & get_decays() const
Return decays.
A nuclear decay manager.
Definition: nuclear_decay_manager.h:57
datatools::logger::priority get_logging() const
Return the logging priority threshold.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void initialize(const datatools::properties &config_)
Initialization from a list of properties.
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
const level_dict_type & get_levels() const
Return levels.
void load_level(const std::string &level_name_, const datatools::properties &level_config_)
Load a nuclear level.
bool is_initialized() const
Check initialization.
std::map< std::string, datatools::handle< nuclear_decay > > decay_dict_type
Dictionary of nuclear decays.
Definition: nuclear_decay_manager.h:65
void load_decay_table(const std::string &level_name_, const datatools::properties &decay_table_config_)
Load a decay table for an existing level.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
Utilities for logging information.
void initialize_simple()
Initialization.
nuclear_decay_manager()
Default constructor.
void set_logging(datatools::logger::priority)
Set the logging priority threshold.
void load_decay(const std::string &decay_name_, const datatools::properties &decay_config_)
Load a nuclear decay.
virtual ~nuclear_decay_manager()
Destructor.
A dictionary of arbitrary properties.
Definition: properties.h:125