Geant4Particle.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef DD4POD_Geant4Particle_H
4 #define DD4POD_Geant4Particle_H
5 
8 
9 #include <array>
10 #include <vector>
11 #include "podio/ObjectID.h"
12 #include <ostream>
13 
14 
15 
16 namespace dd4pod {
17 
18 
19 class Geant4ParticleCollection;
20 class Geant4ParticleCollectionIterator;
21 class ConstGeant4Particle;
22 
28 
31  friend ConstGeant4Particle;
32 
33 public:
34 
37  Geant4Particle(int ID, int g4Parent, int reason, int mask, int steps, int secondaries, int pdgID, int status, std::array<int, 2> colorFlow, int genStatus, int charge, std::array<int, 1> spare, std::array<float, 3> spin, double vsx, double vsy, double vsz, double vex, double vey, double vez, double psx, double psy, double psz, double pex, double pey, double pez, double mass, double time, double properTime);
38 
41 
43  Geant4Particle(const Geant4Particle& other);
44 
47 
49  Geant4Particle clone() const;
50 
53 
55  operator ConstGeant4Particle() const;
56 
57 public:
58 
60  const int& ID() const;
61 
63  const int& g4Parent() const;
64 
66  const int& reason() const;
67 
69  const int& mask() const;
70 
72  const int& steps() const;
73 
75  const int& secondaries() const;
76 
78  const int& pdgID() const;
79 
81  const int& status() const;
82 
84  const std::array<int, 2>& colorFlow() const;
86  const int& colorFlow(size_t i) const;
88  const int& genStatus() const;
89 
91  const int& charge() const;
92 
94  const std::array<int, 1>& spare() const;
96  const int& spare(size_t i) const;
98  const std::array<float, 3>& spin() const;
100  const float& spin(size_t i) const;
102  const double& vsx() const;
103 
105  const double& vsy() const;
106 
108  const double& vsz() const;
109 
111  const double& vex() const;
112 
114  const double& vey() const;
115 
117  const double& vez() const;
118 
120  const double& psx() const;
121 
123  const double& psy() const;
124 
126  const double& psz() const;
127 
129  const double& pex() const;
130 
132  const double& pey() const;
133 
135  const double& pez() const;
136 
138  const double& mass() const;
139 
141  const double& time() const;
142 
144  const double& properTime() const;
145 
146 
147 
149  void ID(int value);
150 
152  void g4Parent(int value);
153 
155  void reason(int value);
156 
158  void mask(int value);
159 
161  void steps(int value);
162 
164  void secondaries(int value);
165 
167  void pdgID(int value);
168 
170  void status(int value);
171 
173  void colorFlow(std::array<int, 2> value);
174  void colorFlow(size_t i, int value);
176  std::array<int, 2>& colorFlow();
177 
179  void genStatus(int value);
180 
182  void charge(int value);
183 
185  void spare(std::array<int, 1> value);
186  void spare(size_t i, int value);
188  std::array<int, 1>& spare();
189 
191  void spin(std::array<float, 3> value);
192  void spin(size_t i, float value);
194  std::array<float, 3>& spin();
195 
197  void vsx(double value);
198 
200  void vsy(double value);
201 
203  void vsz(double value);
204 
206  void vex(double value);
207 
209  void vey(double value);
210 
212  void vez(double value);
213 
215  void psx(double value);
216 
218  void psy(double value);
219 
221  void psz(double value);
222 
224  void pex(double value);
225 
227  void pey(double value);
228 
230  void pez(double value);
231 
233  void mass(double value);
234 
236  void time(double value);
237 
239  void properTime(double value);
240 
241 
242 
243  void addparents(int);
244  unsigned int parents_size() const;
245  int parents(unsigned int) const;
246  std::vector<int>::const_iterator parents_begin() const;
247  std::vector<int>::const_iterator parents_end() const;
248  podio::RelationRange<int> parents() const;
249  void adddaughters(int);
250  unsigned int daughters_size() const;
251  int daughters(unsigned int) const;
252  std::vector<int>::const_iterator daughters_begin() const;
253  std::vector<int>::const_iterator daughters_end() const;
254  podio::RelationRange<int> daughters() const;
255 
256  double Px() const {return psx();}
257  double Py() const {return psy();}
258  double Pz() const {return psz();}
259  double Px2() const {return psx()*psx();}
260  double Py2() const {return psy()*psy();}
261  double Pz2() const {return psz()*psz();}
262  //ROOT::Math::XYZTVector PVec() const { return ROOT::Math::XYZTVector(Px(),Py(),Pz(),std::sqrt(Px2()+Py2()+Pz2()+mass()*mass())); }
263  //double theta() const { return ROOT::Math::XYZVector(Px(),Py(),Pz()).Theta();}
264 
265 
266 
268  bool isAvailable() const;
270  void unlink() { m_obj = nullptr; }
271 
272  bool operator==(const Geant4Particle& other) const { return m_obj == other.m_obj; }
273  bool operator==(const ConstGeant4Particle& other) const;
274 
275  // less comparison operator, so that objects can be e.g. stored in sets.
276  bool operator<(const Geant4Particle& other) const { return m_obj < other.m_obj; }
277 
278  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
279 
280  const podio::ObjectID getObjectID() const;
281 
282 private:
283  Geant4ParticleObj* m_obj;
284 };
285 
286 std::ostream& operator<<(std::ostream& o, const ConstGeant4Particle& value);
287 
288 } // namespace dd4pod
289 
290 
291 #endif
unsigned int daughters_size() const
const double & vex() const
Access the endpoint x.
Geant4Particle & operator=(const Geant4Particle &other)
copy-assignment operator
podio::RelationRange< int > daughters() const
parameter value(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2094
const int & steps() const
Access the x.
const int & genStatus() const
Access the x.
const std::array< int, 2 > & colorFlow() const
Access the x.
const double & pey() const
Access the endpoint x.
const double & vez() const
Access the endpoint x.
const int & reason() const
Access the x.
const podio::ObjectID getObjectID() const
bool operator==(const Geant4Particle &other) const
const int & g4Parent() const
Access the x.
const int & charge() const
Access the x.
const double & mass() const
Access the x.
podio::RelationRange< int > parents() const
const double & psy() const
Access the startpoint py.
const double & psx() const
Access the startpoint x.
const double & vey() const
Access the endpoint x.
Geant4Particle()
default constructor
const double & properTime() const
Access the x.
const int & secondaries() const
Access the x.
const double & vsy() const
Access the startpoint x.
Geant4Particle clone() const
support cloning (deep-copy)
const double & vsz() const
Access the startpoint x.
std::vector< int >::const_iterator daughters_end() const
const int & pdgID() const
Access the x.
const std::array< float, 3 > & spin() const
Access the x.
const int & mask() const
Access the x.
std::vector< int >::const_iterator parents_end() const
const std::array< int, 1 > & spare() const
Access the x.
bool isAvailable() const
check whether the object is actually available
const double & psz() const
Access the startpoint pz.
std::vector< int >::const_iterator parents_begin() const
bool operator<(const Geant4Particle &other) const
std::ostream & operator<<(std::ostream &o, const ConstCalorimeterHit &value)
const double & time() const
Access the x.
const double & pex() const
Access the endpoint x.
const int & ID() const
Access the x.
void unlink()
disconnect from Geant4ParticleObj instance
const double & vsx() const
Access the startpoint x.
const int & status() const
Access the x.
A Collection is identified by an ID.
std::vector< int >::const_iterator daughters_begin() const
unsigned int id() const
unsigned int parents_size() const
const double & pez() const
Access the endpoint pz.