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 <ostream>
22#include <cstddef>
23
24#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
25#include "nlohmann/json_fwd.hpp"
26#endif
27
28// forward declarations
29namespace edm4eic {
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
70
71 /// destructor
73
74
75 /// conversion to const object
76 operator ReconstructedParticle() const;
77
78public:
79
80 /// Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
81 std::int32_t getType() const;
82
83 /// Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
84 float getEnergy() const;
85
86 /// Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
87 const edm4hep::Vector3f& getMomentum() const;
88
89 /// Access the [mm] reference, i.e. where the particle has been measured
90 const edm4hep::Vector3f& getReferencePoint() const;
91
92 /// Access the charge of the reconstructed particle.
93 float getCharge() const;
94
95 /// Access the [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
96 float getMass() const;
97
98 /// Access the overall goodness of the PID on a scale of [0;1]
99 float getGoodnessOfPID() const;
100
101 /// Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
102 const edm4eic::Cov4f& getCovMatrix() const;
103
104 /// Access the PDG code for this particle
105 std::int32_t getPDG() const;
106
107
108 /// Access the Start vertex associated to this particle
109 const edm4eic::Vertex getStartVertex() const;
110 /// Access the particle ID used for the kinematics of this particle
111 const edm4hep::ParticleID getParticleIDUsed() const;
112
113 /// Set the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeNames and ReconstructedParticleTypeValues.
114 void setType(std::int32_t value);
115
116 /// Set the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent internally.
117 void setEnergy(float value);
118
119 /// Set the [GeV] particle momentum. Four momentum state is not kept consistent internally.
120 void setMomentum(edm4hep::Vector3f value);
121 /// Get reference to [GeV] particle momentum. Four momentum state is not kept consistent internally.
122 edm4hep::Vector3f& momentum();
123
124 /// Set the [mm] reference, i.e. where the particle has been measured
125 void setReferencePoint(edm4hep::Vector3f value);
126 /// Get reference to [mm] reference, i.e. where the particle has been measured
127 edm4hep::Vector3f& referencePoint();
128
129 /// Set the charge of the reconstructed particle.
130 void setCharge(float value);
131
132 /// Set the [GeV] mass of the reconstructed particle, set independently from four vector. Four momentum state is not kept consistent internally.
133 void setMass(float value);
134
135 /// Set the overall goodness of the PID on a scale of [0;1]
136 void setGoodnessOfPID(float value);
137
138 /// Set the covariance matrix of the reconstructed particle 4vector (10 parameters).
139 void setCovMatrix(edm4eic::Cov4f value);
140 /// Get reference to covariance matrix of the reconstructed particle 4vector (10 parameters).
142
143 /// Set the PDG code for this particle
144 void setPDG(std::int32_t value);
145
146
147 /// Set the Start vertex associated to this particle
149 /// Set the particle ID used for the kinematics of this particle
150 void setParticleIDUsed(edm4hep::ParticleID value);
151
153 std::size_t clusters_size() const;
154 edm4eic::Cluster getClusters(std::size_t) const;
155 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
156 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
157 podio::RelationRange<edm4eic::Cluster> getClusters() const;
159 std::size_t tracks_size() const;
160 edm4eic::Track getTracks(std::size_t) const;
161 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
162 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
163 podio::RelationRange<edm4eic::Track> getTracks() const;
165 std::size_t particles_size() const;
167 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_begin() const;
168 std::vector<edm4eic::ReconstructedParticle>::const_iterator particles_end() const;
169 podio::RelationRange<edm4eic::ReconstructedParticle> getParticles() const;
170 void addToParticleIDs(edm4hep::ParticleID);
171 std::size_t particleIDs_size() const;
172 edm4hep::ParticleID getParticleIDs(std::size_t) const;
173 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
174 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
175 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
176
177 bool isCompound() const {return particles_size() > 0;}
178
179
180
181 /// check whether the object is actually available
182 bool isAvailable() const;
183 /// disconnect from ReconstructedParticleObj instance
184 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ReconstructedParticleObj>{nullptr}; }
185
186 bool operator==(const MutableReconstructedParticle& other) const { return m_obj == other.m_obj; }
187 bool operator==(const ReconstructedParticle& other) const;
188
189 // less comparison operator, so that objects can be e.g. stored in sets.
190 bool operator<(const MutableReconstructedParticle& other) const { return m_obj < other.m_obj; }
191
192 podio::ObjectID id() const { return getObjectID(); }
193
194 const podio::ObjectID getObjectID() const;
195
197 using std::swap;
198 swap(a.m_obj, b.m_obj); // swap out the internal pointers
199 }
200
201private:
202 /// constructor from existing ReconstructedParticleObj
203 explicit MutableReconstructedParticle(podio::utils::MaybeSharedPtr<ReconstructedParticleObj> obj);
204
205 podio::utils::MaybeSharedPtr<ReconstructedParticleObj> m_obj{nullptr};
206};
207
208#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
209void to_json(nlohmann::json& j, const MutableReconstructedParticle& value);
210#endif
211
212
213} // namespace edm4eic
214
215
216#endif
Definition Cluster.h:38
Definition Cov4f.h:18
Definition MutableReconstructedParticle.h:46
void setParticleIDUsed(edm4hep::ParticleID value)
Set the particle ID used for the kinematics of this particle.
Definition MutableReconstructedParticle.cc:96
void setMass(float value)
Set the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:83
void setPDG(std::int32_t value)
Set the PDG code for this particle.
Definition MutableReconstructedParticle.cc:87
std::size_t clusters_size() const
Definition MutableReconstructedParticle.cc:121
MutableReconstructedParticle & operator=(MutableReconstructedParticle other)
copy-assignment operator
Definition MutableReconstructedParticle.cc:39
const edm4eic::Vertex getStartVertex() const
Access the Start vertex associated to this particle.
Definition MutableReconstructedParticle.cc:61
void unlink()
disconnect from ReconstructedParticleObj instance
Definition MutableReconstructedParticle.h:184
bool isCompound() const
Definition MutableReconstructedParticle.h:177
MutableReconstructedParticle clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableReconstructedParticle.cc:44
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition MutableReconstructedParticle.cc:145
podio::ObjectID id() const
Definition MutableReconstructedParticle.h:192
friend class ReconstructedParticleCollection
Definition MutableReconstructedParticle.h:48
std::size_t particleIDs_size() const
Definition MutableReconstructedParticle.cc:229
void addToParticleIDs(edm4hep::ParticleID)
Definition MutableReconstructedParticle.cc:212
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition MutableReconstructedParticle.cc:109
const edm4hep::Vector3f & getMomentum() const
Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:53
edm4eic::Cov4f & covMatrix()
Get reference to covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:86
void setGoodnessOfPID(float value)
Set the overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:84
float getEnergy() const
Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent int...
Definition MutableReconstructedParticle.cc:52
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_begin() const
Definition MutableReconstructedParticle.cc:181
void addToTracks(edm4eic::Track)
Definition MutableReconstructedParticle.cc:140
bool operator<(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:190
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition MutableReconstructedParticle.cc:223
std::int32_t getPDG() const
Access the PDG code for this particle.
Definition MutableReconstructedParticle.cc:59
const edm4hep::Vector3f & getReferencePoint() const
Access the [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:54
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition MutableReconstructedParticle.cc:151
const podio::ObjectID getObjectID() const
Definition MutableReconstructedParticle.cc:260
float getGoodnessOfPID() const
Access the overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:57
bool operator==(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:186
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition MutableReconstructedParticle.cc:115
void setCharge(float value)
Set the charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:82
const edm4eic::Cov4f & getCovMatrix() const
Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:58
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition MutableReconstructedParticle.cc:132
MutableReconstructedParticle()
default constructor
Definition MutableReconstructedParticle.cc:23
~MutableReconstructedParticle()=default
destructor
void setCovMatrix(edm4eic::Cov4f value)
Set the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:85
bool isAvailable() const
check whether the object is actually available
Definition MutableReconstructedParticle.cc:253
std::size_t tracks_size() const
Definition MutableReconstructedParticle.cc:157
podio::RelationRange< edm4eic::ReconstructedParticle > getParticles() const
Definition MutableReconstructedParticle.cc:204
edm4hep::Vector3f & referencePoint()
Get reference to [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:81
std::int32_t getType() const
Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeN...
Definition MutableReconstructedParticle.cc:51
void setReferencePoint(edm4hep::Vector3f value)
Set the [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:80
float getMass() const
Access the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:56
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition MutableReconstructedParticle.cc:217
void setMomentum(edm4hep::Vector3f value)
Set the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:78
const edm4hep::ParticleID getParticleIDUsed() const
Access the particle ID used for the kinematics of this particle.
Definition MutableReconstructedParticle.cc:68
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:76
void setEnergy(float value)
Set the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent intern...
Definition MutableReconstructedParticle.cc:77
std::size_t particles_size() const
Definition MutableReconstructedParticle.cc:193
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:79
void addToParticles(edm4eic::ReconstructedParticle)
Definition MutableReconstructedParticle.cc:176
void setStartVertex(edm4eic::Vertex value)
Set the Start vertex associated to this particle.
Definition MutableReconstructedParticle.cc:89
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_end() const
Definition MutableReconstructedParticle.cc:187
friend void swap(MutableReconstructedParticle &a, MutableReconstructedParticle &b)
Definition MutableReconstructedParticle.h:196
float getCharge() const
Access the charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:55
podio::RelationRange< edm4eic::Track > getTracks() const
Definition MutableReconstructedParticle.cc:168
void addToClusters(edm4eic::Cluster)
Definition MutableReconstructedParticle.cc:104
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition MutableReconstructedParticle.cc:240
Definition ReconstructedParticleCollection.h:95
Definition ReconstructedParticle.h:47
Definition ReconstructedParticleCollection.h:66
Definition Track.h:41
Definition Vertex.h:36
Definition CalorimeterHit.cc:18
Definition CalorimeterHit.h:21