Bayeux  3.4.1
Core Foundation library for SuperNEMO
from_file_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_FROM_FILE_GENERATOR_H
35 #define GENBB_HELP_FROM_FILE_GENERATOR_H 1
36 
37 // This project:
38 #include <genbb_help/i_genbb.h>
39 
40 namespace genbb {
41 
44  {
45  public:
46 
47  // Forward PIMPL declaration
48  struct pimpl_imp;
49 
51  void set_primary_event_bank_label(const std::string &);
52 
55 
57  virtual ~from_file_generator();
58 
60  virtual void initialize(const datatools::properties & setup_,
61  datatools::service_manager & service_manager_,
62  detail::pg_dict_type & dictionary_);
63 
65  virtual void reset();
66 
68  virtual bool has_next();
69 
71  virtual bool is_initialized() const;
72 
73  protected:
74 
75  virtual void _load_next(primary_event & event_,
76  bool compute_classification_ = true);
77 
78  private:
79 
80  bool _initialized_;
81  std::string _PE_label_;
82  boost::scoped_ptr<pimpl_imp> _pimpl_;
83 
85 
86  };
87 
88 } // end of namespace genbb
89 
90 /***************
91  * OCD support *
92  ***************/
93 #include <datatools/ocd_macros.h>
95 
96 #endif // GENBB_HELP_FROM_FILE_GENERATOR_H
97 
98 // Local Variables: --
99 // mode: c++ --
100 // End: --
GENBB particle generator abstract base class.
Definition: i_genbb.h:59
A generator that loads primary events from a file.
Definition: from_file_generator.h:43
virtual void reset()
Reset.
virtual ~from_file_generator()
Destructor.
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, detail::pg_dict_type &dictionary_)
Main initialization interface method.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
virtual bool has_next()
Check if the generator has a next event.
#define GENBB_PG_REGISTRATION_INTERFACE(GENBB_CLASS_NAME)
Definition: genbb_macros.h:22
from_file_generator()
Default constructor.
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
void set_primary_event_bank_label(const std::string &)
Set the label of the primary event bank.
virtual bool is_initialized() const
Check initialization status.
A primary event from a Monte-Carlo generator.
Definition: primary_event.h:60
virtual void _load_next(primary_event &event_, bool compute_classification_=true)
Protected abstract interface to be invoked by the public 'load_next' method.
std::map< std::string, pg_entry_type > pg_dict_type
Definition: pg_tools.h:134
Service management class.
Definition: service_manager.h:57
A dictionary of arbitrary properties.
Definition: properties.h:125