EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableReconstructedParticle.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableReconstructedParticle_H
4#define EDM4EIC_MutableReconstructedParticle_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include "edm4eic/Cluster.h"
11#include "edm4eic/Cov4f.h"
12#include "edm4eic/Track.h"
13#include "edm4hep/ParticleID.h"
14#include "edm4hep/Vector3f.h"
15#include "podio/RelationRange.h"
16#include <cstdint>
17#include <vector>
18
19#include "podio/utilities/MaybeSharedPtr.h"
20
21#include <cstdint>
22
23#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
24#include "nlohmann/json_fwd.hpp"
25#endif
26
27// forward declarations
28namespace edm4eic {
29class Vertex;
30class MutableVertex;
31}
32namespace edm4hep {
33class ParticleID;
34class MutableParticleID;
35}
36
37
38namespace edm4eic {
39
40
41/** @class MutableReconstructedParticle
42 * EIC Reconstructed Particle
43 * @author: W. Armstrong, S. Joosten, F. Gaede
44 */
46
50
51public:
54
55 /// default constructor
57
58 /// Constructor initializing all members
59 MutableReconstructedParticle(std::int32_t type, float energy, edm4hep::Vector3f momentum, edm4hep::Vector3f referencePoint, float charge, float mass, float goodnessOfPID, edm4eic::Cov4f covMatrix, std::int32_t PDG);
60
61 /// copy constructor
63
64 /// copy-assignment operator
66
67 /// create a mutable deep-copy of the object with identical relations
68 /// if cloneRelations=false, the relations are not cloned and will be empty
69 MutableReconstructedParticle clone(bool cloneRelations=true) const;
70
71 /// destructor
73
74
75public:
76
77 /// Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
78 std::int32_t getType() const;
79
80 /// Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
81 float getEnergy() const;
82
83 /// Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
84 const edm4hep::Vector3f& getMomentum() const;
85
86 /// Access the [mm] reference, i.e. where the particle has been measured
87 const edm4hep::Vector3f& getReferencePoint() const;
88
89 /// Access the charge of the reconstructed particle.
90 float getCharge() const;
91
92 /// Access the [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
93 float getMass() const;
94
95 /// Access the overall goodness of the PID on a scale of [0;1]
96 float getGoodnessOfPID() const;
97
98 /// Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
99 const edm4eic::Cov4f& getCovMatrix() const;
100
101 /// Access the PDG code for this particle
102 std::int32_t getPDG() const;
103
104
105 /// Access the Start vertex associated to this particle
106 const edm4eic::Vertex getStartVertex() const;
107 /// Access the particle ID used for the kinematics of this particle
108 const edm4hep::ParticleID getParticleIDUsed() const;
109
110 /// Set the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
111 void setType(std::int32_t value);
112 /// Get mutable reference to type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
113 std::int32_t& getType();
114 /// Get reference to type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
115 [[deprecated("use getType instead")]]
116 std::int32_t& type();
117
118 /// Set the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
119 void setEnergy(float value);
120 /// Get mutable reference to [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
121 float& getEnergy();
122 /// Get reference to [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
123 [[deprecated("use getEnergy instead")]]
124 float& energy();
125
126 /// Set the [GeV] particle momentum. Four momentum state is not kept consistent internally.
127 void setMomentum(edm4hep::Vector3f value);
128 /// Get mutable reference to [GeV] particle momentum. Four momentum state is not kept consistent internally.
129 edm4hep::Vector3f& getMomentum();
130 /// Get reference to [GeV] particle momentum. Four momentum state is not kept consistent internally.
131 [[deprecated("use getMomentum instead")]]
132 edm4hep::Vector3f& momentum();
133
134 /// Set the [mm] reference, i.e. where the particle has been measured
135 void setReferencePoint(edm4hep::Vector3f value);
136 /// Get mutable reference to [mm] reference, i.e. where the particle has been measured
137 edm4hep::Vector3f& getReferencePoint();
138 /// Get reference to [mm] reference, i.e. where the particle has been measured
139 [[deprecated("use getReferencePoint instead")]]
140 edm4hep::Vector3f& referencePoint();
141
142 /// Set the charge of the reconstructed particle.
143 void setCharge(float value);
144 /// Get mutable reference to charge of the reconstructed particle.
145 float& getCharge();
146 /// Get reference to charge of the reconstructed particle.
147 [[deprecated("use getCharge instead")]]
148 float& charge();
149
150 /// Set the [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
151 void setMass(float value);
152 /// Get mutable reference to [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
153 float& getMass();
154 /// Get reference to [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
155 [[deprecated("use getMass instead")]]
156 float& mass();
157
158 /// Set the overall goodness of the PID on a scale of [0;1]
159 void setGoodnessOfPID(float value);
160 /// Get mutable reference to overall goodness of the PID on a scale of [0;1]
161 float& getGoodnessOfPID();
162 /// Get reference to overall goodness of the PID on a scale of [0;1]
163 [[deprecated("use getGoodnessOfPID instead")]]
164 float& goodnessOfPID();
165
166 /// Set the covariance matrix of the reconstructed particle 4vector (10 parameters).
167 void setCovMatrix(edm4eic::Cov4f value);
168 /// Get mutable reference to covariance matrix of the reconstructed particle 4vector (10 parameters).
170 /// Get reference to covariance matrix of the reconstructed particle 4vector (10 parameters).
171 [[deprecated("use getCovMatrix instead")]]
173
174 /// Set the PDG code for this particle
175 void setPDG(std::int32_t value);
176 /// Get mutable reference to PDG code for this particle
177 std::int32_t& getPDG();
178 /// Get reference to PDG code for this particle
179 [[deprecated("use getPDG instead")]]
180 std::int32_t& PDG();
181
182
183 /// Set the Start vertex associated to this particle
184 void setStartVertex(const edm4eic::Vertex& value);
185 /// Set the particle ID used for the kinematics of this particle
186 void setParticleIDUsed(const edm4hep::ParticleID& value);
187
188 void addToClusters(const edm4eic::Cluster&);
189 std::size_t clusters_size() const;
190 edm4eic::Cluster getClusters(std::size_t) const;
191 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
192 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
193 podio::RelationRange<edm4eic::Cluster> getClusters() const;
194 void addToTracks(const edm4eic::Track&);
195 std::size_t tracks_size() const;
196 edm4eic::Track getTracks(std::size_t) const;
197 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
198 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
199 podio::RelationRange<edm4eic::Track> getTracks() const;
201 std::size_t particles_size() const;
203 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_begin() const;
204 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_end() const;
205 podio::RelationRange<edm4eic::ReconstructedParticle> getParticles() const;
206 void addToParticleIDs(const edm4hep::ParticleID&);
207 std::size_t particleIDs_size() const;
208 edm4hep::ParticleID getParticleIDs(std::size_t) const;
209 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
210 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
211 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
212
213 bool isCompound() const {return particles_size() > 0;}
214
215
216
217 /// check whether the object is actually available
218 bool isAvailable() const;
219 /// disconnect from ReconstructedParticleObj instance
220 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ReconstructedParticleObj>{nullptr}; }
221
222 bool operator==(const MutableReconstructedParticle& other) const { return m_obj == other.m_obj; }
223 bool operator==(const ReconstructedParticle& other) const;
224
225 bool operator!=(const MutableReconstructedParticle& other) const { return !(*this == other); }
226 bool operator!=(const ReconstructedParticle& other) const { return !(*this == other); }
227
228 // less comparison operator, so that objects can be e.g. stored in sets.
229 bool operator<(const MutableReconstructedParticle& other) const { return m_obj < other.m_obj; }
230
231 podio::ObjectID id() const { return getObjectID(); }
232
233 const podio::ObjectID getObjectID() const;
234
236 using std::swap;
237 swap(a.m_obj, b.m_obj); // swap out the internal pointers
238 }
239
240private:
241 /// constructor from existing ReconstructedParticleObj
242 explicit MutableReconstructedParticle(podio::utils::MaybeSharedPtr<ReconstructedParticleObj> obj);
243
244 podio::utils::MaybeSharedPtr<ReconstructedParticleObj> m_obj{nullptr};
245};
246
247#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
248void to_json(nlohmann::json& j, const MutableReconstructedParticle& value);
249#endif
250
251
252} // namespace edm4eic
253
254
255#endif
Definition Cluster.h:38
Definition Cov4f.h:18
Definition MutableReconstructedParticle.h:45
void setMass(float value)
Set the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:103
void setPDG(std::int32_t value)
Set the PDG code for this particle.
Definition MutableReconstructedParticle.cc:112
std::size_t clusters_size() const
Definition MutableReconstructedParticle.cc:144
MutableReconstructedParticle & operator=(MutableReconstructedParticle other)
copy-assignment operator
Definition MutableReconstructedParticle.cc:36
const edm4eic::Vertex getStartVertex() const
Access the Start vertex associated to this particle.
Definition MutableReconstructedParticle.cc:73
void addToParticleIDs(const edm4hep::ParticleID &)
Definition MutableReconstructedParticle.cc:235
void unlink()
disconnect from ReconstructedParticleObj instance
Definition MutableReconstructedParticle.h:220
bool isCompound() const
Definition MutableReconstructedParticle.h:213
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition MutableReconstructedParticle.cc:168
void addToTracks(const edm4eic::Track &)
Definition MutableReconstructedParticle.cc:163
MutableReconstructedParticle clone(bool cloneRelations=true) const
Definition MutableReconstructedParticle.cc:41
podio::ObjectID id() const
Definition MutableReconstructedParticle.h:231
friend class ReconstructedParticleCollection
Definition MutableReconstructedParticle.h:47
std::size_t particleIDs_size() const
Definition MutableReconstructedParticle.cc:252
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition MutableReconstructedParticle.cc:132
const edm4hep::Vector3f & getMomentum() const
Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:65
edm4eic::Cov4f & covMatrix()
Get reference to covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:111
void setGoodnessOfPID(float value)
Set the overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:106
float getEnergy() const
Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent int...
Definition MutableReconstructedParticle.cc:64
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_begin() const
Definition MutableReconstructedParticle.cc:204
float & goodnessOfPID()
Get reference to overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:108
bool operator<(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:229
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition MutableReconstructedParticle.cc:246
std::int32_t getPDG() const
Access the PDG code for this particle.
Definition MutableReconstructedParticle.cc:71
float & mass()
Get reference to [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:105
const edm4hep::Vector3f & getReferencePoint() const
Access the [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:66
float & charge()
Get reference to charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:102
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition MutableReconstructedParticle.cc:174
const podio::ObjectID getObjectID() const
Definition MutableReconstructedParticle.cc:280
float getGoodnessOfPID() const
Access the overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:69
bool operator==(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:222
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition MutableReconstructedParticle.cc:138
void setCharge(float value)
Set the charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:100
const edm4eic::Cov4f & getCovMatrix() const
Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:70
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition MutableReconstructedParticle.cc:155
MutableReconstructedParticle()
default constructor
Definition MutableReconstructedParticle.cc:20
void setParticleIDUsed(const edm4hep::ParticleID &value)
Set the particle ID used for the kinematics of this particle.
Definition MutableReconstructedParticle.cc:121
std::int32_t & PDG()
Get reference to PDG code for this particle.
Definition MutableReconstructedParticle.cc:114
bool operator!=(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:225
std::int32_t & type()
Get reference to type of reconstructed particle. Check/set collection parameters ReconstructedParticl...
Definition MutableReconstructedParticle.cc:90
~MutableReconstructedParticle()=default
destructor
void setCovMatrix(edm4eic::Cov4f value)
Set the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:109
bool isAvailable() const
check whether the object is actually available
Definition MutableReconstructedParticle.cc:276
std::size_t tracks_size() const
Definition MutableReconstructedParticle.cc:180
podio::RelationRange< edm4eic::ReconstructedParticle > getParticles() const
Definition MutableReconstructedParticle.cc:227
edm4hep::Vector3f & referencePoint()
Get reference to [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:99
std::int32_t getType() const
Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeN...
Definition MutableReconstructedParticle.cc:63
void setReferencePoint(edm4hep::Vector3f value)
Set the [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:97
float getMass() const
Access the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:68
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition MutableReconstructedParticle.cc:240
void setMomentum(edm4hep::Vector3f value)
Set the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:94
float & energy()
Get reference to [GeV] energy of the reconstructed particle. Four momentum state is not kept consiste...
Definition MutableReconstructedParticle.cc:93
const edm4hep::ParticleID getParticleIDUsed() const
Access the particle ID used for the kinematics of this particle.
Definition MutableReconstructedParticle.cc:80
MutableReconstructedParticle(const MutableReconstructedParticle &other)=default
copy constructor
void setType(std::int32_t value)
Set the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeName...
Definition MutableReconstructedParticle.cc:88
void setEnergy(float value)
Set the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent intern...
Definition MutableReconstructedParticle.cc:91
std::size_t particles_size() const
Definition MutableReconstructedParticle.cc:216
friend class ReconstructedParticle
Definition MutableReconstructedParticle.h:49
edm4hep::Vector3f & momentum()
Get reference to [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:96
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_end() const
Definition MutableReconstructedParticle.cc:210
friend void swap(MutableReconstructedParticle &a, MutableReconstructedParticle &b)
Definition MutableReconstructedParticle.h:235
float getCharge() const
Access the charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:67
bool operator!=(const ReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:226
void addToParticles(const edm4eic::ReconstructedParticle &)
Definition MutableReconstructedParticle.cc:199
podio::RelationRange< edm4eic::Track > getTracks() const
Definition MutableReconstructedParticle.cc:191
void setStartVertex(const edm4eic::Vertex &value)
Set the Start vertex associated to this particle.
Definition MutableReconstructedParticle.cc:116
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition MutableReconstructedParticle.cc:263
void addToClusters(const edm4eic::Cluster &)
Definition MutableReconstructedParticle.cc:127
Definition ReconstructedParticleCollection.h:92
Definition ReconstructedParticle.h:47
Definition ReconstructedParticleCollection.h:63
Definition Track.h:41
Definition Vertex.h:36
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:21