Bayeux  3.4.1
Core Foundation library for SuperNEMO
track_history.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2011-09-18
4  * Last modified : 2013-06-03
5  *
6  * Copyright (C) 2011-2013 Francois 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  *
24  *
25  * Description:
26  *
27  * Track history.
28  *
29  * History:
30  *
31  */
32 
33 #ifndef MCTOOLS_G4_TRACK_HISTORY_H
34 #define MCTOOLS_G4_TRACK_HISTORY_H 1
35 
36 // Standard library:
37 #include <string>
38 #include <map>
39 
40 namespace mctools {
41 
42  namespace g4 {
43 
46  {
47  public:
48 
50  class track_info
51  {
52  public:
53 
55  static const int TRACK_ID_UNSET = 0;
56 
57  public:
58 
59  int get_id() const;
60 
61  void set_id(const int id_);
62 
63  int get_parent_id() const;
64 
65  void set_parent_id(const int id_);
66 
67  bool is_primary() const;
68 
69  const std::string & get_particle_name() const;
70 
71  void set_particle_name(const std::string & name_);
72 
73  const std::string & get_creator_process_name() const;
74 
75  void set_creator_process_name(const std::string & name_);
76 
78  const std::string & get_creator_sensitive_category() const;
79 
81  void set_creator_sensitive_category(const std::string & category_);
82 
84  track_info();
85 
87  ~track_info();
88 
90  void reset();
91 
92  private:
93 
94  int _id_;
95  int _parent_id_;
96  std::string _particle_name_;
97  std::string _creator_process_name_;
98  std::string _creator_sensitive_category_;
99 
100  };
101 
102  public:
103 
105  typedef std::map<int, track_info> track_info_dict_type;
106 
107  const track_info_dict_type & get_track_infos() const;
108 
110 
111  bool has_track_info(const int id_) const;
112 
113  const track_info & get_track_info(const int id_) const;
114 
115  track_info & grab_track_info(const int id_);
116 
117  void add_track_info(const int id_, const track_info & tinfo_);
118 
120  track_history();
121 
123  ~track_history();
124 
126  void reset();
127 
128  private:
129 
130  track_info_dict_type _track_infos_;
131 
132  };
133 
134  } // end of namespace g4
135 
136 }// end of namespace mctools
137 
138 #endif // MCTOOLS_G4_TRACK_HISTORY_H
139 
140 /*
141 ** Local Variables: --
142 ** mode: c++ --
143 ** c-file-style: "gnu" --
144 ** tab-width: 2 --
145 ** End: --
146 */
Definition: base_step_hit.h:32
const std::string & get_particle_name() const
track_info_dict_type & grab_track_infos()
void set_creator_process_name(const std::string &name_)
const track_info & get_track_info(const int id_) const
void set_creator_sensitive_category(const std::string &category_)
std::map< int, track_info > track_info_dict_type
Dictionary type of track info.
Definition: track_history.h:105
bool has_track_info(const int id_) const
track_info & grab_track_info(const int id_)
const std::string & get_creator_process_name() const
Recording of informations about a single track.
Definition: track_history.h:50
const std::string & get_creator_sensitive_category() const
void add_track_info(const int id_, const track_info &tinfo_)
void set_particle_name(const std::string &name_)
void reset()
Reset the track history object.
const track_info_dict_type & get_track_infos() const
static const int TRACK_ID_UNSET
Undefined Id for a track (parent track Id is 0 for a primary track)
Definition: track_history.h:55
Recording of tracks history.
Definition: track_history.h:45