Falaise  4.0.1
SuperNEMO Software Toolkit
interface.h
Go to the documentation of this file.
1 /// \file falaise/TrackerPreClustering/interface.h
2 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-03-30
4  * Last modified: 2014-02-07
5  *
6  * Copyright 2012-2014 F. Mauger
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  * Description of the setup/input/output interface data for the
26  * Tracker Pre-Clustering templatized algorithm.
27  *
28  */
29 
30 #ifndef FALAISE_TRACKERPRECLUSTERING_INTERFACE_H
31 #define FALAISE_TRACKERPRECLUSTERING_INTERFACE_H 1
32 
33 // Standard library:
34 #include <algorithm>
35 #include <iostream>
36 #include <limits>
37 #include <sstream>
38 #include <string>
39 #include <vector>
40 
41 // Third party:
42 // - Boost:
43 #include <boost/cstdint.hpp>
44 // - Bayeux/datatools:
46 
47 namespace TrackerPreClustering {
48 
49 /// \brief Setup data for the TrackerPreClustering algorithm
50 struct setup_data {
51  /// Return the last error message
52  const std::string &get_last_error_message() const;
53 
54  /// Set the last error message
55  void set_last_error_message(const std::string &message_);
56 
57  /// Default constructor
58  setup_data();
59 
60  /// Reset
61  void reset();
62 
63  /// Check the setup data
64  bool check() const;
65 
66  // Attributes:
68  double cell_size; //!< The dimension of a cell
69  double delayed_hit_cluster_time; //!< Delayed hit cluster time
70  bool processing_prompt_hits; //!< Flag for processing of prompt hits
71  bool processing_delayed_hits; //!< Flag for processing of delayed hits
72  bool split_chamber; //!< Flag to split the chamber
73 
74  protected:
75  std::string _last_error_message; /// The last error message
76 };
77 
78 /// \brief Input data structure
79 template <class Hit>
80 struct input_data {
81  // Typedefs:
82  typedef Hit hit_type;
83  typedef std::vector<const hit_type *> hit_collection_type;
84 
85  /// Return the last error message
86  const std::string &get_last_error_message() const;
87 
88  /// Set the last error message
89  void set_last_error_message(const std::string &message_);
90 
91  /// Default constructor
92  input_data();
93 
94  /// Reset
95  void reset();
96 
97  /// Check
98  bool check() const;
99 
100  // Attributes:
101  hit_collection_type hits; //!< Collection of Geiger hits
102 
103  protected:
104  std::string _last_error_message; //!< The last error message at check
105 };
106 
107 /// \brief Output data structure
108 template <class Hit>
109 struct output_data {
110  // Typedefs:
111  typedef Hit hit_type;
112  typedef std::vector<const hit_type *> hit_collection_type;
113  typedef std::vector<hit_collection_type> cluster_collection_type;
114 
115  /// Default constructor
116  output_data();
117 
118  /// Reset
119  void reset();
120 
121  /// Print
122  void dump(std::ostream &out_) const;
123 
124  // Attributes:
125  hit_collection_type ignored_hits; //!< Collection of ignored hits
126  cluster_collection_type prompt_clusters; //!< Collection of prompt clusters
127  cluster_collection_type delayed_clusters; //!< Collection of delayed clusters
128 };
129 
130 } // end of namespace TrackerPreClustering
131 
132 #include "falaise/TrackerPreClustering/interface.tpp"
133 
134 #endif // FALAISE_TRACKERPRECLUSTERING_INTERFACE_H
135 
136 /*
137 ** Local Variables: --
138 ** mode: c++ --
139 ** c-file-style: "gnu" --
140 ** tab-width: 2 --
141 ** End: --
142 */
input_data()
Default constructor.
Output data structure.
Definition: interface.h:109
Hit hit_type
Definition: interface.h:82
setup_data()
Default constructor.
bool processing_prompt_hits
Flag for processing of prompt hits.
Definition: interface.h:70
double cell_size
The dimension of a cell.
Definition: interface.h:68
void set_last_error_message(const std::string &message_)
Set the last error message.
std::vector< const hit_type * > hit_collection_type
Definition: interface.h:83
std::vector< hit_collection_type > cluster_collection_type
Definition: interface.h:113
hit_collection_type hits
Collection of Geiger hits.
Definition: interface.h:101
std::string _last_error_message
Definition: interface.h:75
Setup data for the TrackerPreClustering algorithm.
Definition: interface.h:50
const std::string & get_last_error_message() const
Return the last error message.
std::vector< const hit_type * > hit_collection_type
Definition: interface.h:112
hit_collection_type ignored_hits
Collection of ignored hits.
Definition: interface.h:125
double delayed_hit_cluster_time
Delayed hit cluster time.
Definition: interface.h:69
bool split_chamber
Flag to split the chamber.
Definition: interface.h:72
Hit hit_type
Definition: interface.h:111
std::string _last_error_message
The last error message at check.
Definition: interface.h:104
Definition: event_display.h:40
const std::string & get_last_error_message() const
Return the last error message.
bool check() const
Check the setup data.
void set_last_error_message(const std::string &message_)
Set the last error message.
cluster_collection_type prompt_clusters
Collection of prompt clusters.
Definition: interface.h:126
bool processing_delayed_hits
Flag for processing of delayed hits.
Definition: interface.h:71
output_data()
Default constructor.
datatools::logger::priority logging
Logging flag.
Definition: interface.h:67
void dump(std::ostream &out_) const
Print.
Input data structure.
Definition: interface.h:80
cluster_collection_type delayed_clusters
Collection of delayed clusters.
Definition: interface.h:127