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