Bayeux  3.4.1
Core Foundation library for SuperNEMO
nuclear_decay_generator.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2014-06-18
4  * Last modified: 2014-06-18
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  * A generator that read primary events from some input files
27  * using an embedded dpp::input_module. The file format is the
28  * one produced by the genbb::save_to_file_wrapper class.
29  *
30  * History:
31  *
32  */
33 
34 #ifndef GENBB_HELP_NUCLEAR_DECAY_GENERATOR_H
35 #define GENBB_HELP_NUCLEAR_DECAY_GENERATOR_H 1
36 
37 // Third party:
38 // - Boost:
39 #include <boost/scoped_ptr.hpp>
40 
41 // This project:
42 #include <genbb_help/i_genbb.h>
43 // #include <genbb_help/nuclear_decay_manager.h>
44 // #include <genbb_help/nuclear_level.h>
45 
46 namespace genbb {
47 
48  // Forward declaration:
49  class nuclear_level;
50  class nuclear_decay_manager;
51 
54  {
55  public:
56 
59 
61  virtual ~nuclear_decay_generator();
62 
64  virtual void initialize(const datatools::properties & setup_,
65  datatools::service_manager & service_manager_,
66  detail::pg_dict_type & dictionary_);
67 
69  virtual void reset();
70 
72  virtual bool has_next();
73 
75  virtual bool is_initialized() const;
76 
78  unsigned long get_seed() const;
79 
81  virtual bool can_external_random() const;
82 
84  const mygsl::rng & get_random() const;
85 
88 
89  protected:
90 
92  virtual void _load_next(primary_event & event_, bool compute_classification_);
93 
94  private:
95 
96  bool _initialized_;
97  boost::scoped_ptr<nuclear_decay_manager> _ndm_;
98  const nuclear_level * _decaying_level_;
99  unsigned long _seed_;
100  boost::scoped_ptr<mygsl::rng> _random_;
101 
103 
104  };
105 
106 } // end of namespace genbb
107 
108 /***************
109  * OCD support *
110  ***************/
111 #include <datatools/ocd_macros.h>
113 
114 #endif // GENBB_HELP_NUCLEAR_DECAY_GENERATOR_H
115 
116 // Local Variables: --
117 // mode: c++ --
118 // End: --
unsigned long get_seed() const
Return the Local PRNG's seed.
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, detail::pg_dict_type &dictionary_)
Main initialization interface method.
virtual ~nuclear_decay_generator()
Destructor.
virtual bool can_external_random() const
Accept external PRNG.
virtual bool is_initialized() const
Check initialization status.
GENBB particle generator abstract base class.
Definition: i_genbb.h:59
A generator that shoot nuclear decays.
Definition: nuclear_decay_generator.h:53
virtual void reset()
Reset.
nuclear_decay_generator()
Default constructor.
mygsl::rng & grab_random()
Return the active PRNG.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
#define GENBB_PG_REGISTRATION_INTERFACE(GENBB_CLASS_NAME)
Definition: genbb_macros.h:22
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
virtual bool has_next()
Check if the generator has a next event.
A primary event from a Monte-Carlo generator.
Definition: primary_event.h:60
virtual void _load_next(primary_event &event_, bool compute_classification_)
Generate the next event:
const mygsl::rng & get_random() const
Return the active PRNG.
std::map< std::string, pg_entry_type > pg_dict_type
Definition: pg_tools.h:134
Description of a nuclear level.
Definition: nuclear_level.h:53
Service management class.
Definition: service_manager.h:57
Pseudo random number generator.
Definition: rng.h:53
A dictionary of arbitrary properties.
Definition: properties.h:125