EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableCluster.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableCluster_H
4#define EDM4EIC_MutableCluster_H
5
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/Cluster.h"
9
11#include "edm4eic/Cov2f.h"
12#include "edm4eic/Cov3f.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
28
29namespace edm4eic {
30
31
32/** @class MutableCluster
33 * EIC hit cluster, reworked to more closely resemble EDM4hep
34 * @author: W. Armstrong, S. Joosten, C.Peng
35 */
37
38 friend class ClusterCollection;
40 friend class Cluster;
41
42public:
45
46 /// default constructor
48
49 /// Constructor initializing all members
50 MutableCluster(std::int32_t type, float energy, float energyError, float time, float timeError, std::uint32_t nhits, edm4hep::Vector3f position, edm4eic::Cov3f positionError, float intrinsicTheta, float intrinsicPhi, edm4eic::Cov2f intrinsicDirectionError);
51
52 /// copy constructor
53 MutableCluster(const MutableCluster& other) = default;
54
55 /// copy-assignment operator
57
58 /// create a mutable deep-copy of the object with identical relations
59 /// if cloneRelations=false, the relations are not cloned and will be empty
60 MutableCluster clone(bool cloneRelations=true) const;
61
62 /// destructor
63 ~MutableCluster() = default;
64
65
66public:
67
68 /// Access the Flag-word that defines the type of the cluster
69 std::int32_t getType() const;
70
71 /// Access the Reconstructed energy of the cluster [GeV].
72 float getEnergy() const;
73
74 /// Access the Error on the cluster energy [GeV]
75 float getEnergyError() const;
76
77 /// Access the [ns]
78 float getTime() const;
79
80 /// Access the Error on the cluster time
81 float getTimeError() const;
82
83 /// Access the Number of hits in the cluster.
84 std::uint32_t getNhits() const;
85
86 /// Access the Global position of the cluster [mm].
87 const edm4hep::Vector3f& getPosition() const;
88
89 /// Access the Covariance matrix of the position (6 Parameters).
90 const edm4eic::Cov3f& getPositionError() const;
91
92 /// Access the Intrinsic cluster propagation direction polar angle [rad]
93 float getIntrinsicTheta() const;
94
95 /// Access the Intrinsic cluster propagation direction azimuthal angle [rad]
96 float getIntrinsicPhi() const;
97
98 /// Access the Error on the intrinsic cluster propagation direction
100
101
102
103 /// Set the Flag-word that defines the type of the cluster
104 void setType(std::int32_t value);
105 /// Get mutable reference to Flag-word that defines the type of the cluster
106 std::int32_t& getType();
107 /// Get reference to Flag-word that defines the type of the cluster
108 [[deprecated("use getType instead")]]
109 std::int32_t& type();
110
111 /// Set the Reconstructed energy of the cluster [GeV].
112 void setEnergy(float value);
113 /// Get mutable reference to Reconstructed energy of the cluster [GeV].
114 float& getEnergy();
115 /// Get reference to Reconstructed energy of the cluster [GeV].
116 [[deprecated("use getEnergy instead")]]
117 float& energy();
118
119 /// Set the Error on the cluster energy [GeV]
120 void setEnergyError(float value);
121 /// Get mutable reference to Error on the cluster energy [GeV]
122 float& getEnergyError();
123 /// Get reference to Error on the cluster energy [GeV]
124 [[deprecated("use getEnergyError instead")]]
125 float& energyError();
126
127 /// Set the [ns]
128 void setTime(float value);
129 /// Get mutable reference to [ns]
130 float& getTime();
131 /// Get reference to [ns]
132 [[deprecated("use getTime instead")]]
133 float& time();
134
135 /// Set the Error on the cluster time
136 void setTimeError(float value);
137 /// Get mutable reference to Error on the cluster time
138 float& getTimeError();
139 /// Get reference to Error on the cluster time
140 [[deprecated("use getTimeError instead")]]
141 float& timeError();
142
143 /// Set the Number of hits in the cluster.
144 void setNhits(std::uint32_t value);
145 /// Get mutable reference to Number of hits in the cluster.
146 std::uint32_t& getNhits();
147 /// Get reference to Number of hits in the cluster.
148 [[deprecated("use getNhits instead")]]
149 std::uint32_t& nhits();
150
151 /// Set the Global position of the cluster [mm].
152 void setPosition(edm4hep::Vector3f value);
153 /// Get mutable reference to Global position of the cluster [mm].
154 edm4hep::Vector3f& getPosition();
155 /// Get reference to Global position of the cluster [mm].
156 [[deprecated("use getPosition instead")]]
157 edm4hep::Vector3f& position();
158
159 /// Set the Covariance matrix of the position (6 Parameters).
161 /// Get mutable reference to Covariance matrix of the position (6 Parameters).
163 /// Get reference to Covariance matrix of the position (6 Parameters).
164 [[deprecated("use getPositionError instead")]]
166
167 /// Set the Intrinsic cluster propagation direction polar angle [rad]
168 void setIntrinsicTheta(float value);
169 /// Get mutable reference to Intrinsic cluster propagation direction polar angle [rad]
170 float& getIntrinsicTheta();
171 /// Get reference to Intrinsic cluster propagation direction polar angle [rad]
172 [[deprecated("use getIntrinsicTheta instead")]]
173 float& intrinsicTheta();
174
175 /// Set the Intrinsic cluster propagation direction azimuthal angle [rad]
176 void setIntrinsicPhi(float value);
177 /// Get mutable reference to Intrinsic cluster propagation direction azimuthal angle [rad]
178 float& getIntrinsicPhi();
179 /// Get reference to Intrinsic cluster propagation direction azimuthal angle [rad]
180 [[deprecated("use getIntrinsicPhi instead")]]
181 float& intrinsicPhi();
182
183 /// Set the Error on the intrinsic cluster propagation direction
185 /// Get mutable reference to Error on the intrinsic cluster propagation direction
187 /// Get reference to Error on the intrinsic cluster propagation direction
188 [[deprecated("use getIntrinsicDirectionError instead")]]
190
191
192
193 void addToClusters(const edm4eic::Cluster&);
194 std::size_t clusters_size() const;
195 edm4eic::Cluster getClusters(std::size_t) const;
196 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
197 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
198 podio::RelationRange<edm4eic::Cluster> getClusters() const;
200 std::size_t hits_size() const;
201 edm4eic::CalorimeterHit getHits(std::size_t) const;
202 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_begin() const;
203 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_end() const;
204 podio::RelationRange<edm4eic::CalorimeterHit> getHits() const;
205 void addToParticleIDs(const edm4hep::ParticleID&);
206 std::size_t particleIDs_size() const;
207 edm4hep::ParticleID getParticleIDs(std::size_t) const;
208 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
209 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
210 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
211 void addToShapeParameters(const float&);
212 std::size_t shapeParameters_size() const;
213 float getShapeParameters(std::size_t) const;
214 std::vector<float>::const_iterator shapeParameters_begin() const;
215 std::vector<float>::const_iterator shapeParameters_end() const;
216 podio::RelationRange<float> getShapeParameters() const;
217 void addToHitContributions(const float&);
218 std::size_t hitContributions_size() const;
219 float getHitContributions(std::size_t) const;
220 std::vector<float>::const_iterator hitContributions_begin() const;
221 std::vector<float>::const_iterator hitContributions_end() const;
222 podio::RelationRange<float> getHitContributions() const;
223 void addToSubdetectorEnergies(const float&);
224 std::size_t subdetectorEnergies_size() const;
225 float getSubdetectorEnergies(std::size_t) const;
226 std::vector<float>::const_iterator subdetectorEnergies_begin() const;
227 std::vector<float>::const_iterator subdetectorEnergies_end() const;
228 podio::RelationRange<float> getSubdetectorEnergies() const;
229
230
231
232 /// check whether the object is actually available
233 bool isAvailable() const;
234 /// disconnect from ClusterObj instance
235 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ClusterObj>{nullptr}; }
236
237 bool operator==(const MutableCluster& other) const { return m_obj == other.m_obj; }
238 bool operator==(const Cluster& other) const;
239
240 bool operator!=(const MutableCluster& other) const { return !(*this == other); }
241 bool operator!=(const Cluster& other) const { return !(*this == other); }
242
243 // less comparison operator, so that objects can be e.g. stored in sets.
244 bool operator<(const MutableCluster& other) const { return m_obj < other.m_obj; }
245
246 podio::ObjectID id() const { return getObjectID(); }
247
248 const podio::ObjectID getObjectID() const;
249
250 friend void swap(MutableCluster& a, MutableCluster& b) {
251 using std::swap;
252 swap(a.m_obj, b.m_obj); // swap out the internal pointers
253 }
254
255private:
256 /// constructor from existing ClusterObj
257 explicit MutableCluster(podio::utils::MaybeSharedPtr<ClusterObj> obj);
258
259 podio::utils::MaybeSharedPtr<ClusterObj> m_obj{nullptr};
260};
261
262#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
263void to_json(nlohmann::json& j, const MutableCluster& value);
264#endif
265
266
267} // namespace edm4eic
268
269
270#endif
Definition CalorimeterHit.h:37
Definition ClusterCollection.h:92
Definition Cluster.h:38
Definition ClusterCollection.h:63
Definition Cov2f.h:18
Definition Cov3f.h:18
Definition MutableCluster.h:36
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition MutableCluster.cc:75
podio::RelationRange< float > getSubdetectorEnergies() const
Definition MutableCluster.cc:325
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition MutableCluster.cc:194
void setEnergy(float value)
Set the Reconstructed energy of the cluster [GeV].
Definition MutableCluster.cc:85
friend class Cluster
Definition MutableCluster.h:40
float getTime() const
Access the [ns].
Definition MutableCluster.cc:72
void addToShapeParameters(const float &)
Definition MutableCluster.cc:225
podio::RelationRange< edm4eic::CalorimeterHit > getHits() const
Definition MutableCluster.cc:181
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_end() const
Definition MutableCluster.cc:164
podio::ObjectID id() const
Definition MutableCluster.h:246
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_begin() const
Definition MutableCluster.cc:158
void addToParticleIDs(const edm4hep::ParticleID &)
Definition MutableCluster.cc:189
void setPositionError(edm4eic::Cov3f value)
Set the Covariance matrix of the position (6 Parameters).
Definition MutableCluster.cc:103
float getTimeError() const
Access the Error on the cluster time.
Definition MutableCluster.cc:73
void unlink()
disconnect from ClusterObj instance
Definition MutableCluster.h:235
float getEnergyError() const
Access the Error on the cluster energy [GeV].
Definition MutableCluster.cc:71
bool operator!=(const Cluster &other) const
Definition MutableCluster.h:241
void setPosition(edm4hep::Vector3f value)
Set the Global position of the cluster [mm].
Definition MutableCluster.cc:100
const edm4eic::Cov2f & getIntrinsicDirectionError() const
Access the Error on the intrinsic cluster propagation direction.
Definition MutableCluster.cc:79
bool isAvailable() const
check whether the object is actually available
Definition MutableCluster.cc:338
MutableCluster(const MutableCluster &other)=default
copy constructor
bool operator<(const MutableCluster &other) const
Definition MutableCluster.h:244
std::size_t particleIDs_size() const
Definition MutableCluster.cc:206
edm4eic::Cov2f & intrinsicDirectionError()
Get reference to Error on the intrinsic cluster propagation direction.
Definition MutableCluster.cc:114
std::size_t hits_size() const
Definition MutableCluster.cc:170
MutableCluster & operator=(MutableCluster other)
copy-assignment operator
Definition MutableCluster.cc:36
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition MutableCluster.cc:200
bool operator!=(const MutableCluster &other) const
Definition MutableCluster.h:240
float & intrinsicTheta()
Get reference to Intrinsic cluster propagation direction polar angle [rad].
Definition MutableCluster.cc:108
float getIntrinsicTheta() const
Access the Intrinsic cluster propagation direction polar angle [rad].
Definition MutableCluster.cc:77
void addToHits(const edm4eic::CalorimeterHit &)
Definition MutableCluster.cc:153
std::int32_t & type()
Get reference to Flag-word that defines the type of the cluster.
Definition MutableCluster.cc:84
friend void swap(MutableCluster &a, MutableCluster &b)
Definition MutableCluster.h:250
void setIntrinsicDirectionError(edm4eic::Cov2f value)
Set the Error on the intrinsic cluster propagation direction.
Definition MutableCluster.cc:112
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition MutableCluster.cc:217
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition MutableCluster.cc:128
void setIntrinsicTheta(float value)
Set the Intrinsic cluster propagation direction polar angle [rad].
Definition MutableCluster.cc:106
friend class ClusterCollection
Definition MutableCluster.h:38
void setNhits(std::uint32_t value)
Set the Number of hits in the cluster.
Definition MutableCluster.cc:97
edm4eic::Cov3f & positionError()
Get reference to Covariance matrix of the position (6 Parameters).
Definition MutableCluster.cc:105
float & energyError()
Get reference to Error on the cluster energy [GeV].
Definition MutableCluster.cc:90
void setEnergyError(float value)
Set the Error on the cluster energy [GeV].
Definition MutableCluster.cc:88
std::int32_t getType() const
Access the Flag-word that defines the type of the cluster.
Definition MutableCluster.cc:69
float & intrinsicPhi()
Get reference to Intrinsic cluster propagation direction azimuthal angle [rad].
Definition MutableCluster.cc:111
void addToSubdetectorEnergies(const float &)
Definition MutableCluster.cc:297
std::vector< float >::const_iterator hitContributions_begin() const
Definition MutableCluster.cc:266
std::vector< float >::const_iterator subdetectorEnergies_begin() const
Definition MutableCluster.cc:302
std::uint32_t getNhits() const
Access the Number of hits in the cluster.
Definition MutableCluster.cc:74
edm4hep::Vector3f & position()
Get reference to Global position of the cluster [mm].
Definition MutableCluster.cc:102
std::size_t clusters_size() const
Definition MutableCluster.cc:134
void addToHitContributions(const float &)
Definition MutableCluster.cc:261
std::size_t hitContributions_size() const
Definition MutableCluster.cc:278
bool operator==(const MutableCluster &other) const
Definition MutableCluster.h:237
~MutableCluster()=default
destructor
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition MutableCluster.cc:122
float getEnergy() const
Access the Reconstructed energy of the cluster [GeV].
Definition MutableCluster.cc:70
std::size_t shapeParameters_size() const
Definition MutableCluster.cc:242
MutableCluster()
default constructor
Definition MutableCluster.cc:18
const edm4eic::Cov3f & getPositionError() const
Access the Covariance matrix of the position (6 Parameters).
Definition MutableCluster.cc:76
MutableCluster clone(bool cloneRelations=true) const
Definition MutableCluster.cc:41
void setTimeError(float value)
Set the Error on the cluster time.
Definition MutableCluster.cc:94
float & energy()
Get reference to Reconstructed energy of the cluster [GeV].
Definition MutableCluster.cc:87
std::vector< float >::const_iterator shapeParameters_end() const
Definition MutableCluster.cc:236
const podio::ObjectID getObjectID() const
Definition MutableCluster.cc:342
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition MutableCluster.cc:145
podio::RelationRange< float > getHitContributions() const
Definition MutableCluster.cc:289
void addToClusters(const edm4eic::Cluster &)
Definition MutableCluster.cc:117
float getIntrinsicPhi() const
Access the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition MutableCluster.cc:78
std::vector< float >::const_iterator subdetectorEnergies_end() const
Definition MutableCluster.cc:308
void setType(std::int32_t value)
Set the Flag-word that defines the type of the cluster.
Definition MutableCluster.cc:82
void setIntrinsicPhi(float value)
Set the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition MutableCluster.cc:109
std::uint32_t & nhits()
Get reference to Number of hits in the cluster.
Definition MutableCluster.cc:99
std::vector< float >::const_iterator hitContributions_end() const
Definition MutableCluster.cc:272
float & time()
Get reference to [ns].
Definition MutableCluster.cc:93
float & timeError()
Get reference to Error on the cluster time.
Definition MutableCluster.cc:96
void setTime(float value)
Set the [ns].
Definition MutableCluster.cc:91
std::vector< float >::const_iterator shapeParameters_begin() const
Definition MutableCluster.cc:230
podio::RelationRange< float > getShapeParameters() const
Definition MutableCluster.cc:253
std::size_t subdetectorEnergies_size() const
Definition MutableCluster.cc:314
Definition CalorimeterHit.cc:17