Falaise  4.0.1
SuperNEMO Software Toolkit
cosmic_muon_generator.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /** \file falaise/snemo/simulation/cosmic_muon_generator.h
3  * Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4  * Creation date: 2010-10-01
5  * Last modified: 2014-01-27
6  *
7  * License:
8  *
9  * Copyright 2010-2014 F. Mauger
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or (at
14  * your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
24  * Boston, MA 02110-1301, USA.
25  *
26  * Description:
27  * cosmic muon event generator based on event generators
28  * provided by the 'genbb_help' package
29  *
30  * History:
31  *
32  */
33 
34 #ifndef FALAISE_SNEMO_SIMULATION_COSMIC_MUON_GENERATOR_H
35 #define FALAISE_SNEMO_SIMULATION_COSMIC_MUON_GENERATOR_H 1
36 
37 // Standard library:
38 #include <string>
39 
40 // Third party:
41 // - Bayeux/mygsl:
42 #include <mygsl/rng.h>
43 // - Bayeux/genbb_help:
44 #include <genbb_help/i_genbb.h>
45 
46 namespace mygsl {
47 class i_unary_function;
48 class von_neumann_method;
49 } // namespace mygsl
50 namespace datatools {
51 class properties;
52 class multi_properties;
53 } // namespace datatools
54 
55 namespace snemo {
56 
57 namespace simulation {
58 
59 /// Generator for cosmic muons
61  public:
63 
65 
67  double energy_mean; //!< ~ 4 GeV
68  double energy_sigma; //!< ~ 1 GeV
69  double muon_ratio; //!< Ratio (Nmu+/Nmu-) ~ 1.1
70  double maximum_theta; //!< Maximum azimuthal angle (70 degree)
74  void set_defaults();
75  void reset();
76  };
77 
80  void set_defaults();
81  void reset();
82  };
83 
85  std::string underground_lab;
88  void set_defaults();
89  void reset();
90  };
91 
92  public:
93  bool is_initialized() const;
94  int get_mode() const;
95  void set_mode(int);
96  const mygsl::rng& get_random() const;
98  bool can_external_random() const;
99 
100  /// Constructor
102 
103  /// Destructor
104  virtual ~cosmic_muon_generator();
105 
106  /// Main initialization interface method
107  virtual void initialize(const datatools::properties& setup_,
108  datatools::service_manager& service_manager_,
109  ::genbb::detail::pg_dict_type& dictionary_);
110 
111  /// Reset the object
112  virtual void reset();
113 
114  /// Check if some next primary event is available
115  virtual bool has_next();
116 
117  static double energy_spectrum_at_sea_level_HE(double muon_cos_theta, double muon_energy);
118 
119  protected:
120  virtual void _load_next(::genbb::primary_event& event_, bool compute_classification_ = true);
121 
122  private:
123  void _at_init_();
124 
125  void _at_reset_();
126 
127  private:
128  bool _initialized_; //!< Initialization flag
129  int _mode_; //!< Mode
130 
131  // muon generator at sea level :
132  int _sea_level_mode_;
134  _sea_level_toy_setup_; //!< Using inputs from JPG 37, 075021 (2010) (http://pdg.lbl.gov)
135  sea_level_pdg_setup _sea_level_pdg_setup_; //!< [not implemented yet]
136 
137  // muon generator in an underground location :
138  underground_setup _underground_setup_; //!< [not implemented yet]
139 
140  unsigned long _seed_; //!< Local PRNG's seed
141  mygsl::rng _random_; //!< Local PRNG
142 
144 };
145 
146 } // end of namespace simulation
147 
148 } // end of namespace snemo
149 
150 #endif // FALAISE_SNEMO_SIMULATION_COSMIC_MUON_GENERATOR_H
151 
152 // end of falaise/snemo/simulation/cosmic_muon_generator.h
const mygsl::rng & get_random() const
static double energy_spectrum_at_sea_level_HE(double muon_cos_theta, double muon_energy)
double underground_depth
Definition: cosmic_muon_generator.h:86
double energy_sigma
~ 1 GeV
Definition: cosmic_muon_generator.h:68
Generator for cosmic muons.
Definition: cosmic_muon_generator.h:60
double maximum_theta
Maximum azimuthal angle (70 degree)
Definition: cosmic_muon_generator.h:70
virtual bool has_next()
Check if some next primary event is available.
Definition: cosmic_muon_generator.h:62
virtual void initialize(const datatools::properties &setup_, datatools::service_manager &service_manager_, ::genbb::detail::pg_dict_type &dictionary_)
Main initialization interface method.
Definition: cosmic_muon_generator.h:64
mygsl::von_neumann_method * angular_VNM
Definition: cosmic_muon_generator.h:72
virtual void reset()
Reset the object.
mode_type
Definition: cosmic_muon_generator.h:62
std::string underground_lab
Definition: cosmic_muon_generator.h:85
virtual void _load_next(::genbb::primary_event &event_, bool compute_classification_=true)
#define GENBB_PG_REGISTRATION_INTERFACE(GENBB_CLASS_NAME)
double energy_mean
~ 4 GeV
Definition: cosmic_muon_generator.h:67
Definition: calo_tapered_scin_box_model.h:54
sea_level_mode_type
Definition: cosmic_muon_generator.h:64
virtual ~cosmic_muon_generator()
Destructor.
Definition: cosmic_muon_generator.h:62
double muon_ratio
Ratio (Nmu+/Nmu-) ~ 1.1.
Definition: cosmic_muon_generator.h:69
mygsl::i_unary_function * theta_density_function
Definition: cosmic_muon_generator.h:71
Definition: cosmic_muon_generator.h:64
std::map< std::string, pg_entry_type > pg_dict_type