Falaise  4.0.1
SuperNEMO Software Toolkit
base_tracker_clusterizer.h
Go to the documentation of this file.
1 /// \file falaise/snemo/processing/base_tracker_clusterizer.h
2 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2012-03-29
4  * Last modified : 2014-02-07
5  *
6  * Copyright (C) 2012-2014 François Mauger <mauger@lpccaen.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 #ifndef FALAISE_SNEMO_PROCESSING_BASE_TRACKER_CLUSTERIZER_H
28 #define FALAISE_SNEMO_PROCESSING_BASE_TRACKER_CLUSTERIZER_H 1
29 
30 // Standard library:
31 #include <map>
32 
33 // Third party:
34 // - Boost:
35 #include <boost/cstdint.hpp>
36 // - Bayeux/datatools:
39 // - Bayeux/geomtools:
41 
42 // Falaise:
44 
45 // Falaise module:
47 
48 // Forward declaration :
49 namespace datatools {
50 class properties;
51 }
52 
53 namespace geomtools {
54 class manager;
55 }
56 
57 namespace snemo {
58 
59 namespace geometry {
60 class gg_locator;
61 }
62 
63 namespace datamodel {
64 class tracker_clustering_data;
65 }
66 
67 namespace processing {
68 
69 /// \brief The base abstract class for all tracker clustering algorithms
71  public:
72  // Typedefs
78 
79  /// Set logging priority level
80  void set_logging_priority(datatools::logger::priority logging_priority_);
81 
82  /// Get logging priority
84 
85  /// Return the clusterizer ID
86  const std::string &get_id() const;
87 
88  /// Return the tracker 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_tracker_clusterizer(const std::string &id_ = "anonymous");
105 
106  /// Destructor
107  virtual ~base_tracker_clusterizer();
108 
109  /// Main clustering process
113 
114  // Smart print
115  void tree_dump(std::ostream &out_ = std::clog, const std::string &title_ = "",
116  const std::string &indent_ = "", bool inherit_ = false) const;
117 
118  /// Initialize the clusterizer through configuration properties
119  virtual void initialize(const datatools::properties &setup_) = 0;
120 
121  /// Reset the clusterizer
122  virtual void reset() = 0;
123 
124  /// OCD support
126  const std::string &prefix_ = "");
127 
128  protected:
129  /// Initialize the clusterizer through configuration properties
130  void _initialize(const datatools::properties &setup_);
131 
132  /// Reset the clusterizer
133  void _reset();
134 
135  /// Set default attribute values
136  void _set_defaults();
137 
138  /// Clear working arrays
139  void _clear_working_arrays();
140 
141  /// Set the initialization flag
142  void _set_initialized(bool);
143 
144  /// Prepare cluster for processing
148 
149  /// Specific clustering algorithm
153 
154  /// Post processing
158 
159  // /// Post processing of the ignored hits
160  // void _post_process_ignored_hits(snemo::datamodel::tracker_clustering_data & clustering_);
161 
162  /// Post processing to collect unclustered hits
166 
167  protected:
169 
170  private:
171  bool _initialized_; //!< Initialization status
172  std::string _id_; //!< Identifier of the clusterizer algorithm
173  const geomtools::manager *_geometry_manager_; //!< The SuperNEMO geometry manager
175  *_gg_locator_; //!< Locator dedicated to the SuperNEMO tracking chamber
176  geomtools::id_selector _cell_id_selector_; //!< A selector of GIDs
178  _tpc_setup_data_; //!< The configuration data for the time-clustering algorithm
179  TrackerPreClustering::pre_clusterizer _pc_; //!< The time-clustering algorithm
180 
181  // Internal work space:
183  _ignored_hits_; //!< Hits that are not used as input for any clustering algorithm
184  std::vector<hit_collection_type>
185  _prompt_time_clusters_; //!< Collection of pre-clusters of only prompt hits
186  std::vector<hit_collection_type>
187  _delayed_time_clusters_; //!< Collection of pre-clusters of only delayed hits
188 };
189 
190 } // end of namespace processing
191 
192 } // end of namespace snemo
193 
194 #endif // FALAISE_SNEMO_PROCESSING_BASE_TRACKER_CLUSTERIZER_H
195 
196 /*
197 ** Local Variables: --
198 ** mode: c++ --
199 ** c-file-style: "gnu" --
200 ** tab-width: 2 --
201 ** End: --
202 */
int process(const base_tracker_clusterizer::hit_collection_type &gg_hits_, const base_tracker_clusterizer::calo_hit_collection_type &calo_hits_, snemo::datamodel::tracker_clustering_data &clustering_)
Main clustering process.
snemo::datamodel::calibrated_tracker_hit hit_type
Definition: base_tracker_clusterizer.h:73
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
void set_logging_priority(datatools::logger::priority logging_priority_)
Set logging priority level.
void _reset()
Reset the clusterizer.
snemo::datamodel::calibrated_data::calorimeter_hit_collection_type calo_hit_collection_type
Definition: base_tracker_clusterizer.h:77
snemo::datamodel::calibrated_tracker_hit::handle_type hit_handle_type
Definition: base_tracker_clusterizer.h:74
const geomtools::manager & get_geometry_manager() const
Return a non-mutable reference to the geometry manager.
datatools::logger::priority get_logging_priority() const
Get logging priority.
base_tracker_clusterizer(const std::string &id_="anonymous")
Default constructor.
virtual void initialize(const datatools::properties &setup_)=0
Initialize the clusterizer through configuration properties.
virtual void reset()=0
Reset the clusterizer.
The base abstract class for all tracker clustering algorithms.
Definition: base_tracker_clusterizer.h:70
void _set_defaults()
Set default attribute values.
A pre-clusterizer of Geiger hits for the SuperNEMO detector.
Definition: pre_clusterizer.h:65
snemo::datamodel::calibrated_data::tracker_hit_collection_type hit_collection_type
Definition: base_tracker_clusterizer.h:75
datatools::logger::priority _logging_priority
Definition: base_tracker_clusterizer.h:168
void _set_initialized(bool)
Set the initialization flag.
bool has_geometry_manager() const
Check the geometry manager.
Model of a calibrated tracker hit (Geiger regime)
Definition: calibrated_tracker_hit.h:35
std::vector< calorimeter_hit_handle_type > calorimeter_hit_collection_type
Collection of handles on calibrated calorimeter hits.
Definition: calibrated_data.h:58
Setup data for the TrackerPreClustering algorithm.
Definition: interface.h:50
static void ocd_support(datatools::object_configuration_description &, const std::string &prefix_="")
OCD support.
Definition: calo_tapered_scin_box_model.h:54
void _post_process_collect_unclustered_hits(const base_tracker_clusterizer::hit_collection_type &gg_hits_, snemo::datamodel::tracker_clustering_data &clustering_)
Post processing to collect unclustered hits.
bool is_initialized() const
Check if theclusterizer is initialized.
virtual int _post_process(const base_tracker_clusterizer::hit_collection_type &gg_hits_, const base_tracker_clusterizer::calo_hit_collection_type &calo_hits_, snemo::datamodel::tracker_clustering_data &clustering_)
Post processing.
virtual int _prepare_process(const base_tracker_clusterizer::hit_collection_type &gg_hits_, const base_tracker_clusterizer::calo_hit_collection_type &calo_hits_, snemo::datamodel::tracker_clustering_data &clustering_)
Prepare cluster for processing.
void set_geometry_manager(const geomtools::manager &gmgr_)
Address the geometry manager.
std::vector< tracker_hit_handle_type > tracker_hit_collection_type
Collection of handles on calibrated tracker hits.
Definition: calibrated_data.h:55
SuperNEMO tracker clustering data model.
Definition: tracker_clustering_data.h:129
void _clear_working_arrays()
Clear working arrays.
const snemo::geometry::gg_locator & get_gg_locator() const
Return the tracker locator.
void _initialize(const datatools::properties &setup_)
Initialize the clusterizer through configuration properties.
const std::string & get_id() const
Return the clusterizer ID.
virtual int _process_algo(const base_tracker_clusterizer::hit_collection_type &gg_hits_, const base_tracker_clusterizer::calo_hit_collection_type &calo_hits_, snemo::datamodel::tracker_clustering_data &clustering_)=0
Specific clustering algorithm.
Fast locator class for SuperNEMO drift chamber volumes.
Definition: gg_locator.h:62