Falaise  4.0.1
SuperNEMO Software Toolkit
base_gamma_builder.h
Go to the documentation of this file.
1 /** \file falaise/snemo/processing/base_tracker_fitter.h
2  * Author(s) : Xavier Garrido <garrido@lal.in2p3.fr>
3  * Creation date : 2012-10-07
4  * Last modified : 2014-02-09
5  *
6  * Copyright (C) 2011-2014 Xavier Garrido <garrido@lal.in2p3.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  * Description:
24  *
25  * History:
26  */
27 
28 #ifndef FALAISE_SNEMO_PROCESSING_BASE_GAMMA_BUILDER_H
29 #define FALAISE_SNEMO_PROCESSING_BASE_GAMMA_BUILDER_H 1
30 
31 // Standard library:
32 #include <string>
33 
34 // Third party:
35 // - Boost:
36 // - Bayeux/datatools:
39 
40 // Falaise:
42 
43 // Forward declaration :
44 namespace datatools {
45 class properties;
46 }
47 
48 namespace geomtools {
49 class manager;
50 }
51 
52 namespace snemo {
53 
54 namespace datamodel {
55 class particle_track_data;
56 }
57 
58 namespace geometry {
59 class locator_plugin;
60 class calo_locator;
61 class xcalo_locator;
62 class gveto_locator;
63 } // namespace geometry
64 
65 namespace processing {
66 
67 /// \brief The base class for all gamma builder algorithms
69  public:
70  /// Typedef to calibrated calorimeter hits
72 
73  /// Set logging priority level
74  void set_logging_priority(datatools::logger::priority logging_priority_);
75 
76  /// Get logging priority
78 
79  /// Return the gamma builder ID
80  const std::string &get_id() const;
81 
82  /// Return the main wall calorimeter locator
84 
85  /// Return the X-wall calorimeter locator
87 
88  /// Return the gamma veto calorimeter locator
90 
91  /// Check the geometry manager
92  bool has_geometry_manager() const;
93 
94  /// Address the geometry manager
95  void set_geometry_manager(const geomtools::manager &gmgr_);
96 
97  /// Return a non-mutable reference to the geometry manager
99 
100  /// Check if theclusterizer is initialized
101  bool is_initialized() const;
102 
103  /// Default constructor
104  base_gamma_builder(const std::string &id_ = "anonymous");
105 
106  /// Destructor
107  virtual ~base_gamma_builder();
108 
109  /// Main tracker trajectory driver
110  int process(const base_gamma_builder::hit_collection_type &calo_hits_,
112 
113  /// Initialize the tracker trajectory fitter through configuration properties
114  virtual void initialize(const datatools::properties &setup_) = 0;
115 
116  /// Reset the tracker trajectory fitter
117  virtual void reset() = 0;
118 
119  /// Smart print
120  void tree_dump(std::ostream &out_ = std::clog, const std::string &title_ = "",
121  const std::string &indent_ = "", bool inherit_ = false) const;
122 
123  /// OCD support
125  const std::string &prefix_ = "");
126 
127  protected:
128  /// Initialize the clusterizer through configuration properties
129  void _initialize(const datatools::properties &setup_);
130 
131  /// Reset the clusterizer
132  void _reset();
133 
134  /// Set default attribute values
135  void _set_defaults();
136 
137  /// Set the initialization flag
138  void _set_initialized(bool);
139 
140  /// Clear working arrays
141  void _clear_working_arrays();
142 
143  /// Prepare data for processing
144  virtual int _prepare_process(const base_gamma_builder::hit_collection_type &calo_hits_,
146 
147  /// Specific algorithm
148  virtual int _process_algo(const base_gamma_builder::hit_collection_type &calo_hits_,
150 
151  /// Post processing
152  virtual int _post_process(const base_gamma_builder::hit_collection_type &calo_hits_,
154 
155  protected:
156  datatools::logger::priority _logging_priority; //!< Logging priority threshold
157 
158  private:
159  bool _initialized_; //!< Initialization status
160  std::string _id_; //!< Identifier of the gamma builder algorithm
161  const geomtools::manager *_geometry_manager_; //!< The SuperNEMO geometry manager
162  const snemo::geometry::locator_plugin *_locator_plugin_; //!< The SuperNEMO locator plugin
163 
164  hit_collection_type _used_hits_; //!< Hits that are used as input for any gamma algorithm
165  hit_collection_type _ignored_hits_; //!< Hits that are not used as input for any gamma algorithm
166 
167  bool _add_foil_vertex_extrapolation_; //!< Flag to enable foil vertex extrapolation
168  double _add_foil_vertex_minimal_probability_; //!< Minimal TOF internal probability to accept
169  //!< foil vertex extrapolation
170 
171  bool _add_gamma_from_annihilation_; //!< Flag to enable tagging of gamma from e+/e- annihilation
172  double _add_gamma_from_annihilation_minimal_probability_; //!< Minimal TOF probability to tag
173  //!< gamma from annihilation
174 
175  bool _select_calorimeter_hits_; //!< Flag to select calorimeter hits based on auxiliaries tags
176  std::vector<std::string>
177  _select_calorimeter_hits_tags_; //!< List of auxiliaries tags to select calorimeter hits
178 };
179 
180 } // end of namespace processing
181 
182 } // end of namespace snemo
183 
184 #endif // FALAISE_SNEMO_PROCESSING_BASE_GAMMA_BUILDER_H
185 
186 /*
187 ** Local Variables: --
188 ** mode: c++ --
189 ** c-file-style: "gnu" --
190 ** tab-width: 2 --
191 ** End: --
192 */
void set_geometry_manager(const geomtools::manager &gmgr_)
Address the geometry manager.
bool has_geometry_manager() const
Check the geometry manager.
virtual int _prepare_process(const base_gamma_builder::hit_collection_type &calo_hits_, snemo::datamodel::particle_track_data &ptd_)
Prepare data for processing.
const geomtools::manager & get_geometry_manager() const
Return a non-mutable reference to the geometry manager.
const snemo::geometry::xcalo_locator & get_xcalo_locator() const
Return the X-wall calorimeter locator.
The base class for all gamma builder algorithms.
Definition: base_gamma_builder.h:68
virtual ~base_gamma_builder()
Destructor.
void _set_initialized(bool)
Set the initialization flag.
snemo::datamodel::calibrated_data::calorimeter_hit_collection_type hit_collection_type
Typedef to calibrated calorimeter hits.
Definition: base_gamma_builder.h:71
Fast locator class for SuperNEMO X calorimeter scintillator block volumes.
Definition: xcalo_locator.h:61
void _set_defaults()
Set default attribute values.
void _reset()
Reset the clusterizer.
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual void reset()=0
Reset the tracker trajectory fitter.
A geometry manager plugin with embedded SuperNEMO locators.
Definition: locator_plugin.h:40
virtual void initialize(const datatools::properties &setup_)=0
Initialize the tracker trajectory fitter through configuration properties.
int process(const base_gamma_builder::hit_collection_type &calo_hits_, snemo::datamodel::particle_track_data &ptd_)
Main tracker trajectory driver.
const snemo::geometry::gveto_locator & get_gveto_locator() const
Return the gamma veto calorimeter locator.
virtual int _post_process(const base_gamma_builder::hit_collection_type &calo_hits_, snemo::datamodel::particle_track_data &ptd_)
Post processing.
bool is_initialized() const
Check if theclusterizer is initialized.
std::vector< calorimeter_hit_handle_type > calorimeter_hit_collection_type
Collection of handles on calibrated calorimeter hits.
Definition: calibrated_data.h:58
static void ocd_support(datatools::object_configuration_description &, const std::string &prefix_="")
OCD support.
virtual int _process_algo(const base_gamma_builder::hit_collection_type &calo_hits_, snemo::datamodel::particle_track_data &ptd_)=0
Specific algorithm.
Definition: calo_tapered_scin_box_model.h:54
const snemo::geometry::calo_locator & get_calo_locator() const
Return the main wall calorimeter locator.
Fast locator class for SuperNEMO gamma-veto scintillator block volumes.
Definition: gveto_locator.h:61
datatools::logger::priority _logging_priority
Logging priority threshold.
Definition: base_gamma_builder.h:156
base_gamma_builder(const std::string &id_="anonymous")
Default constructor.
void _clear_working_arrays()
Clear working arrays.
SuperNEMO particle track model.
Definition: particle_track_data.h:38
datatools::logger::priority get_logging_priority() const
Get logging priority.
void _initialize(const datatools::properties &setup_)
Initialize the clusterizer through configuration properties.
const std::string & get_id() const
Return the gamma builder ID.
Fast locator class for SuperNEMO main calorimeter scintillator block volumes.
Definition: calo_locator.h:63
void set_logging_priority(datatools::logger::priority logging_priority_)
Set logging priority level.