Falaise  4.0.1
SuperNEMO Software Toolkit
tracker_trajectory_solution.h
Go to the documentation of this file.
1 /// \file falaise/snemo/datamodels/tracker_trajectory_solution.h
2 /* Author(s) : François Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-03-19
4  * Last modified: 2014-02-28
5  *
6  * Description: A trajectory solution
7  */
8 
9 #ifndef FALAISE_SNEMO_DATAMODELS_TRACKER_TRAJECTORY_SOLUTION_H
10 #define FALAISE_SNEMO_DATAMODELS_TRACKER_TRAJECTORY_SOLUTION_H 1
11 
12 // Third party:
13 // - Boost:
14 #include <boost/cstdint.hpp>
15 // - Bayeux/datatools:
16 #include <datatools/handle.h>
17 #include <datatools/i_clear.h>
19 #include <datatools/i_tree_dump.h>
20 #include <datatools/properties.h>
21 
22 // This project:
24 
25 namespace snemo {
26 
27 namespace datamodel {
28 
29 class tracker_clustering_solution;
30 class tracker_cluster;
31 
32 /// \brief A collection of tracker clusters , solution of a trajectory algorithm
35  public datatools::i_clear {
36  public:
37  /// Handle on tracker cluster
39 
40  /// Collection of handles on tracker clusters
41  typedef std::vector<trajectory_handle_type> trajectory_col_type;
42 
43  /// Handle on tracker cluster solution
45 
46  /// Handle on tracker trajectory solution
48 
49  /// Handle on tracker cluster
51 
52  /// Collection of handles on tracker clusters
53  typedef std::vector<cluster_handle_type> cluster_col_type;
54 
55  /// Default constructor
57 
58  /// Default constructor
60 
61  /// Reset the tracker cluster solution
62  void reset();
63 
64  /*** Solution ID ***/
65 
66  /// Check if there is a valid solution ID
67  bool has_solution_id() const;
68 
69  /// Get the solution ID
70  int get_solution_id() const;
71 
72  /// Set the solution ID
73  void set_solution_id(int32_t);
74 
75  /// Invalidate the solution ID
77 
78  /*** Reference clustering solution ***/
79 
80  /// Check if there is a valid reference clustering solution
81  bool has_clustering_solution() const;
82 
83  /// Set the reference clustering solution
84  void set_clustering_solution(const handle_clustering_solution_type& clustering_solution_);
85 
86  /// Reset the reference clustering solution
88 
89  /// Return a mutable reference on the reference clustering solution
91 
92  /// Return a non mutable reference on the reference clustering solution
94 
95  /*** Auxiliaries ***/
96 
97  /// Return a mutable reference on the container of auxiliary properties
99 
100  /// Return a non mutable reference on the container of auxiliary properties
101  const datatools::properties& get_auxiliaries() const;
102 
103  /// Check if there is trajectories
104  bool has_trajectories() const;
105 
106  /// Return a mutable reference on the container of trajectories
108 
109  /// Return a non mutable reference on the container of trajectories
110  const trajectory_col_type& get_trajectories() const;
111 
112  /// Reset the trajectories
114 
115  /// Check if there is unfitted clusters
116  bool has_unfitted_clusters() const;
117 
118  /// Return a mutable reference on the container of handles on unfitted clusters
120 
121  /// Return a non mutable reference on the container of handles on unfitted clusters
123 
124  /// Reset the unfitted clusters
126 
127  /// Empty the contents of the tracker trajectories solution
128  virtual void clear();
129 
130  /// Smart print
131  virtual void tree_dump(std::ostream& out_ = std::clog, const std::string& title_ = "",
132  const std::string& indent_ = "", bool inherit_ = false) const;
133 
134  private:
135  int32_t _solution_id_; //!< Unique solution ID
136  handle_clustering_solution_type _clustering_solution_; //!< The reference clustering solution
138  _trajectories_; //!< Collection of handles on trajectories associated to clusters
139  cluster_col_type _unfitted_clusters_; //!< Collection of handles on unfitted clusters
140  datatools::properties _auxiliaries_; //!< List of auxiliary properties
141 
143 };
144 
145 } // end of namespace datamodel
146 
147 } // end of namespace snemo
148 
149 #endif // FALAISE_SNEMO_DATAMODELS_TRACKER_TRAJECTORY_SOLUTION_H
150 
151 /*
152 ** Local Variables: --
153 ** mode: c++ --
154 ** c-file-style: "gnu" --
155 ** tab-width: 2 --
156 ** End: --
157 */
std::vector< cluster_handle_type > cluster_col_type
Collection of handles on tracker clusters.
Definition: tracker_trajectory_solution.h:53
virtual void clear()
Empty the contents of the tracker trajectories solution.
datatools::handle< tracker_clustering_solution > handle_clustering_solution_type
Handle on tracker cluster solution.
Definition: tracker_trajectory_solution.h:44
A collection of tracker clusters , solution of a trajectory algorithm.
Definition: tracker_trajectory_solution.h:33
void invalidate_clustering_solution()
Reset the reference clustering solution.
int get_solution_id() const
Get the solution ID.
datatools::handle< tracker_cluster > cluster_handle_type
Handle on tracker cluster.
Definition: tracker_trajectory_solution.h:50
#define DATATOOLS_SERIALIZATION_DECLARATION()
A collection of tracker clusters.
Definition: tracker_clustering_solution.h:88
const cluster_col_type & get_unfitted_clusters() const
Return a non mutable reference on the container of handles on unfitted clusters.
void invalidate_unfitted_clusters()
Reset the unfitted clusters.
std::vector< trajectory_handle_type > trajectory_col_type
Collection of handles on tracker clusters.
Definition: tracker_trajectory_solution.h:41
cluster_col_type & grab_unfitted_clusters()
Return a mutable reference on the container of handles on unfitted clusters.
tracker_trajectory::handle_type trajectory_handle_type
Handle on tracker cluster.
Definition: tracker_trajectory_solution.h:38
bool has_trajectories() const
Check if there is trajectories.
Definition: calo_tapered_scin_box_model.h:54
void reset()
Reset the tracker cluster solution.
void set_solution_id(int32_t)
Set the solution ID.
const tracker_clustering_solution & get_clustering_solution() const
Return a non mutable reference on the reference clustering solution.
datatools::properties & grab_auxiliaries()
Return a mutable reference on the container of auxiliary properties.
bool has_solution_id() const
Check if there is a valid solution ID.
void set_clustering_solution(const handle_clustering_solution_type &clustering_solution_)
Set the reference clustering solution.
virtual ~tracker_trajectory_solution()
Default constructor.
bool has_clustering_solution() const
Check if there is a valid reference clustering solution.
bool has_unfitted_clusters() const
Check if there is unfitted clusters.
const datatools::properties & get_auxiliaries() const
Return a non mutable reference on the container of auxiliary properties.
trajectory_col_type & grab_trajectories()
Return a mutable reference on the container of trajectories.
void invalidate_trajectories()
Reset the trajectories.
datatools::handle< tracker_trajectory_solution > handle_type
Handle on tracker trajectory solution.
Definition: tracker_trajectory_solution.h:47
void invalidate_solution_id()
Invalidate the solution ID.
const trajectory_col_type & get_trajectories() const
Return a non mutable reference on the container of trajectories.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
tracker_clustering_solution & grab_clustering_solution()
Return a mutable reference on the reference clustering solution.