Falaise  4.0.1
SuperNEMO Software Toolkit
tracker_cluster.h
Go to the documentation of this file.
1 /// \file falaise/snemo/datamodels/tracker_cluster.h
2 /* Author (s) : François Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2012-03-05
4  * Last modified: 2014-01-27
5  *
6  * Description: A cluster of Geiger calibrated hits referenced by handles
7  */
8 
9 #ifndef FALAISE_SNEMO_DATAMODELS_TRACKER_CLUSTER_H
10 #define FALAISE_SNEMO_DATAMODELS_TRACKER_CLUSTER_H 1
11 
12 // Third party:
13 // - Boost:
14 #include <boost/cstdint.hpp>
15 // - Bayeux/datatools:
16 #include <datatools/handle.h>
17 // - Bayeux/geomtools:
18 #include <geomtools/base_hit.h>
19 
20 // This project:
22 
23 namespace snemo {
24 
25 namespace datamodel {
26 
27 /// \brief A cluster of Geiger calibrated hits referenced by handles
29  public:
30  /// Handle on tracker cluster
32 
33  /// Flag for a auxiliary property
34  static const std::string& delayed_cluster_flag();
35 
36  /// Check if the cluster is associated to delayed hits
37  bool is_delayed() const;
38 
39  /// Check if the cluster is associated to prompt hits
40  bool is_prompt() const;
41 
42  /// Mark the cluster as associated to delayed hits
43  void make_delayed();
44 
45  /// Mark the cluster as associated to prompt hits
46  void make_prompt();
47 
48  /// Default constructor
50 
51  /// Destructor
52  virtual ~tracker_cluster();
53 
54  /// Check if there is a valid cluster ID
55  bool has_cluster_id() const;
56 
57  /// Get the cluster ID
58  int get_cluster_id() const;
59 
60  /// Set the cluster ID
61  void set_cluster_id(int32_t);
62 
63  /// Invalidate the cluster ID
64  void invalidate_cluster_id();
65 
66  /// Return a mutable reference on the container of handles on calibrated tracker hits
68 
69  /// Return a non mutable reference on the container of handles on calibrated tracker hits
71 
72  /// Return the number of hits in the cluster
73  unsigned int get_number_of_hits() const;
74 
75  /// Return a non mutable reference on the calibrated tracker hit given its index
76  const calibrated_tracker_hit& get_hit(int i_) const;
77 
78  /// Reset/invalidate the contents of the tracker cluster
79  void clear();
80 
81  /// Reset/invalidate the tracker cluster(see clear)
82  void reset();
83 
84  /// Smart print
85  virtual void tree_dump(std::ostream& out_ = std::clog, const std::string& title_ = "",
86  const std::string& indent_ = "", bool inherit_ = false) const;
87 
88  private:
89  calibrated_tracker_hit::collection_type _hits_; //!< Collection of Geiger hit handles
90 
92 };
93 
94 } // end of namespace datamodel
95 
96 } // end of namespace snemo
97 
98 #endif // FALAISE_SNEMO_DATAMODELS_TRACKER_CLUSTER_H
99 /*
100 ** Local Variables: --
101 ** mode: c++ --
102 ** c-file-style: "gnu" --
103 ** tab-width: 2 --
104 ** End: --
105 */
static const std::string & delayed_cluster_flag()
Flag for a auxiliary property.
calibrated_tracker_hit::collection_type & grab_hits()
Return a mutable reference on the container of handles on calibrated tracker hits.
const calibrated_tracker_hit & get_hit(int i_) const
Return a non mutable reference on the calibrated tracker hit given its index.
virtual ~tracker_cluster()
Destructor.
bool is_delayed() const
Check if the cluster is associated to delayed hits.
A cluster of Geiger calibrated hits referenced by handles.
Definition: tracker_cluster.h:28
void invalidate_cluster_id()
Invalidate the cluster ID.
#define DATATOOLS_SERIALIZATION_DECLARATION()
bool is_prompt() const
Check if the cluster is associated to prompt hits.
void make_prompt()
Mark the cluster as associated to prompt hits.
void make_delayed()
Mark the cluster as associated to delayed hits.
Model of a calibrated tracker hit (Geiger regime)
Definition: calibrated_tracker_hit.h:35
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
datatools::handle< tracker_cluster > handle_type
Handle on tracker cluster.
Definition: tracker_cluster.h:31
int get_cluster_id() const
Get the cluster ID.
Definition: calo_tapered_scin_box_model.h:54
unsigned int get_number_of_hits() const
Return the number of hits in the cluster.
void clear()
Reset/invalidate the contents of the tracker cluster.
bool has_cluster_id() const
Check if there is a valid cluster ID.
const calibrated_tracker_hit::collection_type & get_hits() const
Return a non mutable reference on the container of handles on calibrated tracker hits.
tracker_cluster()
Default constructor.
void set_cluster_id(int32_t)
Set the cluster ID.
std::vector< handle_type > collection_type
Alias for a collection of handles on calibrated tracker hits.
Definition: calibrated_tracker_hit.h:54
void reset()
Reset/invalidate the tracker cluster(see clear)