Falaise  4.0.1
SuperNEMO Software Toolkit
calorimeter_regime.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /** \file falaise/snemo/processing/calorimeter_regime.h
3  * Author (s) : Mathieu Bongrand <bongrand@lal.in2p3.fr>
4  * Xavier Garrido <garrido@lal.in2p3.fr>
5  * Creation date: 2011-01-12
6  * Last modified: 2014-02-24
7  *
8  * License:
9  *
10  * Description:
11  *
12  * Tools to model the calorimeter regime in SuperNEMO.
13  *
14  * History:
15  *
16  */
17 #ifndef FALAISE_SNEMO_PROCESSING_CALORIMETER_REGIME_H
18 #define FALAISE_SNEMO_PROCESSING_CALORIMETER_REGIME_H 1
19 
20 // Standard library:
21 #include <iostream>
22 #include <string>
23 
24 // Third party
25 // - Bayeux/datatools
26 #include <datatools/i_tree_dump.h>
27 
28 namespace datatools {
29 class properties;
30 }
31 
32 namespace mygsl {
33 class rng;
34 }
35 
36 namespace snemo {
37 
38 namespace processing {
39 
40 /// \brief Simple modelling of the energy and time measurement with the SuperNEMO calorimeter
41 /// optical lines
43  public:
44  /// Return the default energy resolution
45  static const double& default_energy_resolution();
46 
47  /// Return the default low energy threshold
48  static const double& default_low_energy_threshold();
49 
50  /// Return the default high energy threshold
51  static const double& default_high_energy_threshold();
52 
53  /// Return the default scintillator relaxation time
54  static const double& default_scintillator_relaxation_time();
55 
56  /// Check initialization flag
57  bool is_initialized() const;
58 
59  /// Default constructor
61 
62  /// Initialization from parameters
63  void initialize(const datatools::properties& config_);
64 
65  /// Reset
66  void reset();
67 
68  /// Randomize the measured energy value given the true energy
69  double randomize_energy(mygsl::rng& ran_, const double energy_) const;
70 
71  /// Return the error on energy
72  double get_sigma_energy(const double energy_) const;
73 
74  /// Compute the effective quenched energy for alpha particle
75  double quench_alpha_energy(const double energy_) const;
76 
77  /// Randomize the measured time value given the true time and energy
78  double randomize_time(mygsl::rng& ran_, const double time_, const double energy_) const;
79 
80  /// Return the error on time
81  double get_sigma_time(const double energy_) const;
82 
83  /// Check if a given energy passes the high threshold
84  bool is_high_threshold(const double energy_) const;
85 
86  /// Check if a given energy passes the low threshold
87  bool is_low_threshold(const double energy_) const;
88 
89  /// Set the category of the optical modules associated to this calorimeter regime
90  void set_category(const std::string& category_);
91 
92  /// Return the category of the optical modules associated to this calorimeter regime
93  const std::string& get_category() const;
94 
95  /// Smart print
96  virtual void tree_dump(std::ostream& a_out = std::clog, const std::string& a_title = "",
97  const std::string& a_indent = "", bool a_inherit = false) const;
98 
99  private:
100  void _init_defaults_();
101 
102  private:
103  bool _initialized_; //!< Initialization flag
104  double _resolution_; //!< Energy resolution for electrons at 1 MeV
105  double _high_threshold_; //!< High energy threshold
106  double _low_threshold_; //!< Low energy threshold
107  double _alpha_quenching_0_; //!< Parameter 0 for alpha quenching
108  double _alpha_quenching_1_; //!< Parameter 1 for alpha quenching
109  double _alpha_quenching_2_; //!< Parameter 2 for alpha quenching
110  double _scintillator_relaxation_time_; //!< Scintillator relaxation time
111  std::string
112  _category_; //!< The category of the optical modules associated to this calorimeter regime
113 };
114 
115 } // end of namespace processing
116 
117 } // end of namespace snemo
118 
119 /***************************
120  * OCD support : interface *
121  ***************************/
122 
123 #include <datatools/ocd_macros.h>
124 
125 // @arg snemo::processing::calorimeter_regime the name the registered class
127 
128 #endif // FALAISE_SNEMO_PROCESSING_CALORIMETER_REGIME_H
129 
130 // end of falaise/snemo/processing/calorimeter_regime.h
Simple modelling of the energy and time measurement with the SuperNEMO calorimeter optical lines.
Definition: calorimeter_regime.h:42
const std::string & get_category() const
Return the category of the optical modules associated to this calorimeter regime.
static const double & default_high_energy_threshold()
Return the default high energy threshold.
void initialize(const datatools::properties &config_)
Initialization from parameters.
double randomize_energy(mygsl::rng &ran_, const double energy_) const
Randomize the measured energy value given the true energy.
static const double & default_low_energy_threshold()
Return the default low energy threshold.
virtual void tree_dump(std::ostream &a_out=std::clog, const std::string &a_title="", const std::string &a_indent="", bool a_inherit=false) const
Smart print.
double quench_alpha_energy(const double energy_) const
Compute the effective quenched energy for alpha particle.
void set_category(const std::string &category_)
Set the category of the optical modules associated to this calorimeter regime.
bool is_high_threshold(const double energy_) const
Check if a given energy passes the high threshold.
DOCD_CLASS_DECLARATION(my::algo)
Definition: calo_tapered_scin_box_model.h:54
calorimeter_regime()
Default constructor.
bool is_low_threshold(const double energy_) const
Check if a given energy passes the low threshold.
bool is_initialized() const
Check initialization flag.
double randomize_time(mygsl::rng &ran_, const double time_, const double energy_) const
Randomize the measured time value given the true time and energy.
double get_sigma_energy(const double energy_) const
Return the error on energy.
static const double & default_energy_resolution()
Return the default energy resolution.
double get_sigma_time(const double energy_) const
Return the error on time.
static const double & default_scintillator_relaxation_time()
Return the default scintillator relaxation time.