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