Geant4ParticleConst.cc
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 // datamodel specific includes
9 
10 
11 #include <ostream>
12 
13 namespace dd4pod {
14 
15 
17  m_obj->acquire();
18 }
19 
20 ConstGeant4Particle::ConstGeant4Particle(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) : m_obj(new Geant4ParticleObj()) {
21  m_obj->acquire();
22  m_obj->data.ID = ID;
23  m_obj->data.g4Parent = g4Parent;
24  m_obj->data.reason = reason;
25  m_obj->data.mask = mask;
26  m_obj->data.steps = steps;
27  m_obj->data.secondaries = secondaries;
28  m_obj->data.pdgID = pdgID;
29  m_obj->data.status = status;
30  m_obj->data.colorFlow = colorFlow;
31  m_obj->data.genStatus = genStatus;
32  m_obj->data.charge = charge;
33  m_obj->data.spare = spare;
34  m_obj->data.spin = spin;
35  m_obj->data.vsx = vsx;
36  m_obj->data.vsy = vsy;
37  m_obj->data.vsz = vsz;
38  m_obj->data.vex = vex;
39  m_obj->data.vey = vey;
40  m_obj->data.vez = vez;
41  m_obj->data.psx = psx;
42  m_obj->data.psy = psy;
43  m_obj->data.psz = psz;
44  m_obj->data.pex = pex;
45  m_obj->data.pey = pey;
46  m_obj->data.pez = pez;
47  m_obj->data.mass = mass;
48  m_obj->data.time = time;
49  m_obj->data.properTime = properTime;
50 }
51 
53  m_obj->acquire();
54 }
55 
57  if (m_obj) m_obj->release();
58  m_obj = other.m_obj;
59  return *this;
60 }
61 
63  if (m_obj) m_obj->acquire();
64 }
65 
67  return {new Geant4ParticleObj(*m_obj)};
68 }
69 
71  if (m_obj) m_obj->release();
72 }
73 const int& ConstGeant4Particle::ID() const { return m_obj->data.ID; }
74 const int& ConstGeant4Particle::g4Parent() const { return m_obj->data.g4Parent; }
75 const int& ConstGeant4Particle::reason() const { return m_obj->data.reason; }
76 const int& ConstGeant4Particle::mask() const { return m_obj->data.mask; }
77 const int& ConstGeant4Particle::steps() const { return m_obj->data.steps; }
78 const int& ConstGeant4Particle::secondaries() const { return m_obj->data.secondaries; }
79 const int& ConstGeant4Particle::pdgID() const { return m_obj->data.pdgID; }
80 const int& ConstGeant4Particle::status() const { return m_obj->data.status; }
81 const std::array<int, 2>& ConstGeant4Particle::colorFlow() const { return m_obj->data.colorFlow; }
82 const int& ConstGeant4Particle::colorFlow(size_t i) const { return m_obj->data.colorFlow.at(i); }
83 const int& ConstGeant4Particle::genStatus() const { return m_obj->data.genStatus; }
84 const int& ConstGeant4Particle::charge() const { return m_obj->data.charge; }
85 const std::array<int, 1>& ConstGeant4Particle::spare() const { return m_obj->data.spare; }
86 const int& ConstGeant4Particle::spare(size_t i) const { return m_obj->data.spare.at(i); }
87 const std::array<float, 3>& ConstGeant4Particle::spin() const { return m_obj->data.spin; }
88 const float& ConstGeant4Particle::spin(size_t i) const { return m_obj->data.spin.at(i); }
89 const double& ConstGeant4Particle::vsx() const { return m_obj->data.vsx; }
90 const double& ConstGeant4Particle::vsy() const { return m_obj->data.vsy; }
91 const double& ConstGeant4Particle::vsz() const { return m_obj->data.vsz; }
92 const double& ConstGeant4Particle::vex() const { return m_obj->data.vex; }
93 const double& ConstGeant4Particle::vey() const { return m_obj->data.vey; }
94 const double& ConstGeant4Particle::vez() const { return m_obj->data.vez; }
95 const double& ConstGeant4Particle::psx() const { return m_obj->data.psx; }
96 const double& ConstGeant4Particle::psy() const { return m_obj->data.psy; }
97 const double& ConstGeant4Particle::psz() const { return m_obj->data.psz; }
98 const double& ConstGeant4Particle::pex() const { return m_obj->data.pex; }
99 const double& ConstGeant4Particle::pey() const { return m_obj->data.pey; }
100 const double& ConstGeant4Particle::pez() const { return m_obj->data.pez; }
101 const double& ConstGeant4Particle::mass() const { return m_obj->data.mass; }
102 const double& ConstGeant4Particle::time() const { return m_obj->data.time; }
103 const double& ConstGeant4Particle::properTime() const { return m_obj->data.properTime; }
104 
105 
106 
107 std::vector<int>::const_iterator ConstGeant4Particle::parents_begin() const {
108  auto ret_value = m_obj->m_parents->begin();
109  std::advance(ret_value, m_obj->data.parents_begin);
110  return ret_value;
111 }
112 
113 std::vector<int>::const_iterator ConstGeant4Particle::parents_end() const {
114  auto ret_value = m_obj->m_parents->begin();
115  std::advance(ret_value, m_obj->data.parents_end);
116  return ret_value;
117 }
118 
119 unsigned int ConstGeant4Particle::parents_size() const {
120  return m_obj->data.parents_end - m_obj->data.parents_begin;
121 }
122 
123 int ConstGeant4Particle::parents(unsigned int index) const {
124  if (parents_size() > index) {
125  return m_obj->m_parents->at(m_obj->data.parents_begin + index);
126  }
127  throw std::out_of_range("index out of bounds for existing references");
128 }
129 
130 podio::RelationRange<int> ConstGeant4Particle::parents() const {
131  auto begin = m_obj->m_parents->begin();
132  std::advance(begin, m_obj->data.parents_begin);
133  auto end = m_obj->m_parents->begin();
134  std::advance(end, m_obj->data.parents_end);
135  return {begin, end};
136 }
137 
138 
139 std::vector<int>::const_iterator ConstGeant4Particle::daughters_begin() const {
140  auto ret_value = m_obj->m_daughters->begin();
141  std::advance(ret_value, m_obj->data.daughters_begin);
142  return ret_value;
143 }
144 
145 std::vector<int>::const_iterator ConstGeant4Particle::daughters_end() const {
146  auto ret_value = m_obj->m_daughters->begin();
147  std::advance(ret_value, m_obj->data.daughters_end);
148  return ret_value;
149 }
150 
152  return m_obj->data.daughters_end - m_obj->data.daughters_begin;
153 }
154 
155 int ConstGeant4Particle::daughters(unsigned int index) const {
156  if (daughters_size() > index) {
157  return m_obj->m_daughters->at(m_obj->data.daughters_begin + index);
158  }
159  throw std::out_of_range("index out of bounds for existing references");
160 }
161 
162 podio::RelationRange<int> ConstGeant4Particle::daughters() const {
163  auto begin = m_obj->m_daughters->begin();
164  std::advance(begin, m_obj->data.daughters_begin);
165  auto end = m_obj->m_daughters->begin();
166  std::advance(end, m_obj->data.daughters_end);
167  return {begin, end};
168 }
169 
170 
171 
172 
173 
175  if (m_obj) {
176  return true;
177  }
178  return false;
179 }
180 
181 const podio::ObjectID ConstGeant4Particle::getObjectID() const {
182  if (m_obj) {
183  return m_obj->id;
184  }
185  return podio::ObjectID{podio::ObjectID::invalid, podio::ObjectID::invalid};
186 }
187 
189  return m_obj == other.m_obj;
190 }
191 
192 } // namespace dd4pod
193 
const int & secondaries() const
Access the x.
const double & properTime() const
Access the x.
const double & pez() const
Access the endpoint pz.
std::vector< int >::const_iterator parents_begin() const
const double & vsz() const
Access the startpoint x.
const int & steps() const
Access the x.
bool isAvailable() const
check whether the object is actually available
const int & pdgID() const
Access the x.
const std::array< float, 3 > & spin() const
Access the x.
unsigned int daughters_size() const
ConstGeant4Particle & operator=(const ConstGeant4Particle &other)
copy-assignment operator
const int & reason() const
Access the x.
const double & vey() const
Access the endpoint x.
const double & psz() const
Access the startpoint pz.
const double & psy() const
Access the startpoint py.
const double & vex() const
Access the endpoint x.
const podio::ObjectID getObjectID() const
std::array< int, 2 > colorFlow
x
const double & time() const
Access the x.
bool operator==(const ConstGeant4Particle &other) const
std::vector< int >::const_iterator daughters_end() const
const double & vsx() const
Access the startpoint x.
const int & charge() const
Access the x.
const int & g4Parent() const
Access the x.
std::vector< int >::const_iterator parents_end() const
const double & vez() const
Access the endpoint x.
const double & psx() const
Access the startpoint x.
ConstGeant4Particle()
default constructor
const double & pey() const
Access the endpoint x.
std::vector< int >::const_iterator daughters_begin() const
std::vector< int > * m_parents
const double & vsy() const
Access the startpoint x.
const int & status() const
Access the x.
const std::array< int, 1 > & spare() const
Access the x.
const double & mass() const
Access the x.
podio::RelationRange< int > parents() const
const int & ID() const
Access the x.
podio::RelationRange< int > daughters() const
unsigned int parents_size() const
const int & genStatus() const
Access the x.
ConstGeant4Particle clone() const
support cloning (deep-copy)
std::array< int, 1 > spare
x
std::array< float, 3 > spin
x
std::vector< int > * m_daughters
const std::array< int, 2 > & colorFlow() const
Access the x.
const double & pex() const
Access the endpoint x.
const int & mask() const
Access the x.