Falaise  4.0.1
SuperNEMO Software Toolkit
particle_track_data.h
Go to the documentation of this file.
1 /// \file falaise/snemo/datamodels/particle_track_data.h
2 /* Author (s) : Mathieu Bongrand <bongrand@lal.in2p3.fr>
3  Xavier Garrido <garrido@lal.in2p3.fr>
4  * Creation date: 2012-04-18
5  * Last modified: 2014-06-03
6  *
7  * Description: SuperNEMO Particle Track data model
8  *
9  * History:
10  *
11  */
12 
13 #ifndef FALAISE_SNEMO_DATAMODELS_PARTICLE_TRACK_DATA_H
14 #define FALAISE_SNEMO_DATAMODELS_PARTICLE_TRACK_DATA_H 1
15 
16 // Standard library:
17 #include <vector>
18 
19 // Third party:
20 // - Boost:
21 #include <boost/serialization/access.hpp>
22 // - Bayeux/datatools:
23 #include <datatools/i_clear.h>
25 #include <datatools/i_tree_dump.h>
26 #include <datatools/properties.h>
27 
28 // This project:
31 
32 namespace snemo {
33 
34 namespace datamodel {
35 
36 /// \brief SuperNEMO particle track model
37 // To be done...
40  public datatools::i_clear {
41  public:
42  /// Collection of handles on particle tracks
43  typedef std::vector<particle_track::handle_type> particle_collection_type;
44 
45  /// Default constructor
47 
48  /// Destructor:
49  virtual ~particle_track_data();
50 
51  /// Check if there are some particles
52  bool has_particles() const;
53 
54  /// Returns the number of particle
55  size_t get_number_of_particles() const;
56 
57  /// Add a particle track
58  void add_particle(const particle_track::handle_type& handle_);
59 
60  /// Return a non mutable reference to a particle by index
61  const particle_track& get_particle(size_t index_) const;
62 
63  /// Return a mutable reference to particles
65 
66  /// Return a non mutable reference to particles
68 
69  /// Remove a particle given its index
70  void remove_particle(size_t index_);
71 
72  /// Remove particles given a list of indexes
73  void remove_particles(std::vector<size_t>& indexes_);
74 
75  /// Reset the particle tracks
76  void invalidate_particles();
77 
78  /// Retrieve particles given their charge
79  size_t fetch_particles(particle_collection_type& particles_, const uint32_t flags_,
80  const bool clear_ = false) const;
81 
82  /// Check if there are some non associated calorimeters
84 
85  /// Return a non mutable reference to non associated calorimeters
87 
88  /// Return a mutable reference to non associated calorimeters
90 
91  /// Reset the non associated calorimeters
93 
94  /// Reset the internals
95  void reset();
96 
97  /// Check if the object has a valid internal structure
98  bool is_valid() const;
99 
100  /// Return a mutable reference on the container of auxiliary properties
101  const datatools::properties& get_auxiliaries() const;
102 
103  /// Return a non mutable reference on the container of auxiliary properties
105 
106  /// Clear the object
107  virtual void clear();
108 
109  /// Smart print
110  virtual void tree_dump(std::ostream& out_ = std::clog, const std::string& title_ = "",
111  const std::string& indent_ = "", bool inherit_ = false) const;
112 
113  private:
114  particle_collection_type _particles_; //!< Collection of particle track handles
116  _non_associated_calorimeters_; //!< Collection of calorimeter hit handles
117  datatools::properties _auxiliaries_; //!< Auxiliary properties
118 
120 };
121 
122 } // end of namespace datamodel
123 
124 } // end of namespace snemo
125 
126 #include <boost/serialization/export.hpp>
127 BOOST_CLASS_EXPORT_KEY2(snemo::datamodel::particle_track_data,
128  "snemo::datamodel::particle_track_data")
129 
130 #endif // FALAISE_SNEMO_DATAMODELS_PARTICLE_TRACK_DATA_H
131 
132 /*
133 ** Local Variables: --
134 ** mode: c++ --
135 ** c-file-style: "gnu" --
136 ** tab-width: 2 --
137 ** End: --
138 */
void reset_non_associated_calorimeters()
Reset the non associated calorimeters.
bool has_particles() const
Check if there are some particles.
void invalidate_particles()
Reset the particle tracks.
const calibrated_calorimeter_hit::collection_type & get_non_associated_calorimeters() const
Return a non mutable reference to non associated calorimeters.
datatools::properties & grab_auxiliaries()
Return a non mutable reference on the container of auxiliary properties.
void remove_particles(std::vector< size_t > &indexes_)
Remove particles given a list of indexes.
const particle_track & get_particle(size_t index_) const
Return a non mutable reference to a particle by index.
#define DATATOOLS_SERIALIZATION_DECLARATION()
virtual ~particle_track_data()
Destructor:
size_t get_number_of_particles() const
Returns the number of particle.
const datatools::properties & get_auxiliaries() const
Return a mutable reference on the container of auxiliary properties.
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
void reset()
Reset the internals.
calibrated_calorimeter_hit::collection_type & grab_non_associated_calorimeters()
Return a mutable reference to non associated calorimeters.
Definition: calo_tapered_scin_box_model.h:54
void add_particle(const particle_track::handle_type &handle_)
Add a particle track.
std::vector< particle_track::handle_type > particle_collection_type
Collection of handles on particle tracks.
Definition: particle_track_data.h:43
bool has_non_associated_calorimeters() const
Check if there are some non associated calorimeters.
void remove_particle(size_t index_)
Remove a particle given its index.
particle_track_data()
Default constructor.
bool is_valid() const
Check if the object has a valid internal structure.
SuperNEMO particle track.
Definition: particle_track.h:34
std::vector< handle_type > collection_type
Collection of handles of calibrated calorimeter hit.
Definition: calibrated_calorimeter_hit.h:51
virtual void clear()
Clear the object.
particle_collection_type & grab_particles()
Return a mutable reference to particles.
SuperNEMO particle track model.
Definition: particle_track_data.h:38
size_t fetch_particles(particle_collection_type &particles_, const uint32_t flags_, const bool clear_=false) const
Retrieve particles given their charge.
const particle_collection_type & get_particles() const
Return a non mutable reference to particles.