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 <ostream>
22#include <cstddef>
23
24#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
25#include "nlohmann/json_fwd.hpp"
26#endif
27
28
29
30namespace edm4eic {
31
32
33/** @class MutableCluster
34 * EIC hit cluster, reworked to more closely resemble EDM4hep
35 * @author: W. Armstrong, S. Joosten, C.Peng
36 */
38
39 friend class ClusterCollection;
41 friend class Cluster;
42
43public:
46
47 /// default constructor
49
50 /// Constructor initializing all members
51 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);
52
53 /// copy constructor
54 MutableCluster(const MutableCluster& other) = default;
55
56 /// copy-assignment operator
58
59 /// create a mutable deep-copy of the object with identical relations
60 MutableCluster clone() const;
61
62 /// destructor
63 ~MutableCluster() = default;
64
65
66 /// conversion to const object
67 operator Cluster() const;
68
69public:
70
71 /// Access the Flag-word that defines the type of the cluster
72 std::int32_t getType() const;
73
74 /// Access the Reconstructed energy of the cluster [GeV].
75 float getEnergy() const;
76
77 /// Access the Error on the cluster energy [GeV]
78 float getEnergyError() const;
79
80 /// Access the [ns]
81 float getTime() const;
82
83 /// Access the Error on the cluster time
84 float getTimeError() const;
85
86 /// Access the Number of hits in the cluster.
87 std::uint32_t getNhits() const;
88
89 /// Access the Global position of the cluster [mm].
90 const edm4hep::Vector3f& getPosition() const;
91
92 /// Access the Covariance matrix of the position (6 Parameters).
93 const edm4eic::Cov3f& getPositionError() const;
94
95 /// Access the Intrinsic cluster propagation direction polar angle [rad]
96 float getIntrinsicTheta() const;
97
98 /// Access the Intrinsic cluster propagation direction azimuthal angle [rad]
99 float getIntrinsicPhi() const;
100
101 /// Access the Error on the intrinsic cluster propagation direction
103
104
105
106 /// Set the Flag-word that defines the type of the cluster
107 void setType(std::int32_t value);
108
109 /// Set the Reconstructed energy of the cluster [GeV].
110 void setEnergy(float value);
111
112 /// Set the Error on the cluster energy [GeV]
113 void setEnergyError(float value);
114
115 /// Set the [ns]
116 void setTime(float value);
117
118 /// Set the Error on the cluster time
119 void setTimeError(float value);
120
121 /// Set the Number of hits in the cluster.
122 void setNhits(std::uint32_t value);
123
124 /// Set the Global position of the cluster [mm].
125 void setPosition(edm4hep::Vector3f value);
126 /// Get reference to Global position of the cluster [mm].
127 edm4hep::Vector3f& position();
128
129 /// Set the Covariance matrix of the position (6 Parameters).
131 /// Get reference to Covariance matrix of the position (6 Parameters).
133
134 /// Set the Intrinsic cluster propagation direction polar angle [rad]
135 void setIntrinsicTheta(float value);
136
137 /// Set the Intrinsic cluster propagation direction azimuthal angle [rad]
138 void setIntrinsicPhi(float value);
139
140 /// Set the Error on the intrinsic cluster propagation direction
142 /// Get reference to Error on the intrinsic cluster propagation direction
144
145
146
148 std::size_t clusters_size() const;
149 edm4eic::Cluster getClusters(std::size_t) const;
150 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
151 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
152 podio::RelationRange<edm4eic::Cluster> getClusters() const;
154 std::size_t hits_size() const;
155 edm4eic::CalorimeterHit getHits(std::size_t) const;
156 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_begin() const;
157 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_end() const;
158 podio::RelationRange<edm4eic::CalorimeterHit> getHits() const;
159 void addToParticleIDs(edm4hep::ParticleID);
160 std::size_t particleIDs_size() const;
161 edm4hep::ParticleID getParticleIDs(std::size_t) const;
162 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
163 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
164 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
165 void addToShapeParameters(float);
166 std::size_t shapeParameters_size() const;
167 float getShapeParameters(std::size_t) const;
168 std::vector<float>::const_iterator shapeParameters_begin() const;
169 std::vector<float>::const_iterator shapeParameters_end() const;
170 podio::RelationRange<float> getShapeParameters() const;
171 void addToHitContributions(float);
172 std::size_t hitContributions_size() const;
173 float getHitContributions(std::size_t) const;
174 std::vector<float>::const_iterator hitContributions_begin() const;
175 std::vector<float>::const_iterator hitContributions_end() const;
176 podio::RelationRange<float> getHitContributions() const;
177 void addToSubdetectorEnergies(float);
178 std::size_t subdetectorEnergies_size() const;
179 float getSubdetectorEnergies(std::size_t) const;
180 std::vector<float>::const_iterator subdetectorEnergies_begin() const;
181 std::vector<float>::const_iterator subdetectorEnergies_end() const;
182 podio::RelationRange<float> getSubdetectorEnergies() const;
183
184
185
186 /// check whether the object is actually available
187 bool isAvailable() const;
188 /// disconnect from ClusterObj instance
189 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ClusterObj>{nullptr}; }
190
191 bool operator==(const MutableCluster& other) const { return m_obj == other.m_obj; }
192 bool operator==(const Cluster& other) const;
193
194 // less comparison operator, so that objects can be e.g. stored in sets.
195 bool operator<(const MutableCluster& other) const { return m_obj < other.m_obj; }
196
197 podio::ObjectID id() const { return getObjectID(); }
198
199 const podio::ObjectID getObjectID() const;
200
201 friend void swap(MutableCluster& a, MutableCluster& b) {
202 using std::swap;
203 swap(a.m_obj, b.m_obj); // swap out the internal pointers
204 }
205
206private:
207 /// constructor from existing ClusterObj
208 explicit MutableCluster(podio::utils::MaybeSharedPtr<ClusterObj> obj);
209
210 podio::utils::MaybeSharedPtr<ClusterObj> m_obj{nullptr};
211};
212
213#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
214void to_json(nlohmann::json& j, const MutableCluster& value);
215#endif
216
217
218} // namespace edm4eic
219
220
221#endif
Definition CalorimeterHit.h:37
Definition ClusterCollection.h:95
Definition Cluster.h:38
Definition ClusterCollection.h:66
Definition Cov2f.h:18
Definition Cov3f.h:18
Definition MutableCluster.h:37
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition MutableCluster.cc:57
podio::RelationRange< float > getSubdetectorEnergies() const
Definition MutableCluster.cc:288
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition MutableCluster.cc:157
void setEnergy(float value)
Set the Reconstructed energy of the cluster [GeV].
Definition MutableCluster.cc:65
friend class Cluster
Definition MutableCluster.h:41
float getTime() const
Access the [ns].
Definition MutableCluster.cc:54
void addToParticleIDs(edm4hep::ParticleID)
Definition MutableCluster.cc:152
podio::RelationRange< edm4eic::CalorimeterHit > getHits() const
Definition MutableCluster.cc:144
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_end() const
Definition MutableCluster.cc:127
void addToClusters(edm4eic::Cluster)
Definition MutableCluster.cc:80
podio::ObjectID id() const
Definition MutableCluster.h:197
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_begin() const
Definition MutableCluster.cc:121
void addToShapeParameters(float)
Definition MutableCluster.cc:188
void setPositionError(edm4eic::Cov3f value)
Set the Covariance matrix of the position (6 Parameters).
Definition MutableCluster.cc:72
float getTimeError() const
Access the Error on the cluster time.
Definition MutableCluster.cc:55
void unlink()
disconnect from ClusterObj instance
Definition MutableCluster.h:189
void addToHits(edm4eic::CalorimeterHit)
Definition MutableCluster.cc:116
float getEnergyError() const
Access the Error on the cluster energy [GeV].
Definition MutableCluster.cc:53
void setPosition(edm4hep::Vector3f value)
Set the Global position of the cluster [mm].
Definition MutableCluster.cc:70
const edm4eic::Cov2f & getIntrinsicDirectionError() const
Access the Error on the intrinsic cluster propagation direction.
Definition MutableCluster.cc:61
bool isAvailable() const
check whether the object is actually available
Definition MutableCluster.cc:301
MutableCluster(const MutableCluster &other)=default
copy constructor
bool operator<(const MutableCluster &other) const
Definition MutableCluster.h:195
std::size_t particleIDs_size() const
Definition MutableCluster.cc:169
MutableCluster clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableCluster.cc:44
void addToHitContributions(float)
Definition MutableCluster.cc:224
edm4eic::Cov2f & intrinsicDirectionError()
Get reference to Error on the intrinsic cluster propagation direction.
Definition MutableCluster.cc:77
std::size_t hits_size() const
Definition MutableCluster.cc:133
MutableCluster & operator=(MutableCluster other)
copy-assignment operator
Definition MutableCluster.cc:39
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition MutableCluster.cc:163
float getIntrinsicTheta() const
Access the Intrinsic cluster propagation direction polar angle [rad].
Definition MutableCluster.cc:59
friend void swap(MutableCluster &a, MutableCluster &b)
Definition MutableCluster.h:201
void setIntrinsicDirectionError(edm4eic::Cov2f value)
Set the Error on the intrinsic cluster propagation direction.
Definition MutableCluster.cc:76
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition MutableCluster.cc:180
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition MutableCluster.cc:91
void setIntrinsicTheta(float value)
Set the Intrinsic cluster propagation direction polar angle [rad].
Definition MutableCluster.cc:74
friend class ClusterCollection
Definition MutableCluster.h:39
void setNhits(std::uint32_t value)
Set the Number of hits in the cluster.
Definition MutableCluster.cc:69
edm4eic::Cov3f & positionError()
Get reference to Covariance matrix of the position (6 Parameters).
Definition MutableCluster.cc:73
void setEnergyError(float value)
Set the Error on the cluster energy [GeV].
Definition MutableCluster.cc:66
std::int32_t getType() const
Access the Flag-word that defines the type of the cluster.
Definition MutableCluster.cc:51
std::vector< float >::const_iterator hitContributions_begin() const
Definition MutableCluster.cc:229
std::vector< float >::const_iterator subdetectorEnergies_begin() const
Definition MutableCluster.cc:265
std::uint32_t getNhits() const
Access the Number of hits in the cluster.
Definition MutableCluster.cc:56
edm4hep::Vector3f & position()
Get reference to Global position of the cluster [mm].
Definition MutableCluster.cc:71
std::size_t clusters_size() const
Definition MutableCluster.cc:97
std::size_t hitContributions_size() const
Definition MutableCluster.cc:241
bool operator==(const MutableCluster &other) const
Definition MutableCluster.h:191
~MutableCluster()=default
destructor
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition MutableCluster.cc:85
float getEnergy() const
Access the Reconstructed energy of the cluster [GeV].
Definition MutableCluster.cc:52
std::size_t shapeParameters_size() const
Definition MutableCluster.cc:205
MutableCluster()
default constructor
Definition MutableCluster.cc:21
const edm4eic::Cov3f & getPositionError() const
Access the Covariance matrix of the position (6 Parameters).
Definition MutableCluster.cc:58
void setTimeError(float value)
Set the Error on the cluster time.
Definition MutableCluster.cc:68
std::vector< float >::const_iterator shapeParameters_end() const
Definition MutableCluster.cc:199
const podio::ObjectID getObjectID() const
Definition MutableCluster.cc:308
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition MutableCluster.cc:108
podio::RelationRange< float > getHitContributions() const
Definition MutableCluster.cc:252
float getIntrinsicPhi() const
Access the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition MutableCluster.cc:60
std::vector< float >::const_iterator subdetectorEnergies_end() const
Definition MutableCluster.cc:271
void setType(std::int32_t value)
Set the Flag-word that defines the type of the cluster.
Definition MutableCluster.cc:64
void setIntrinsicPhi(float value)
Set the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition MutableCluster.cc:75
std::vector< float >::const_iterator hitContributions_end() const
Definition MutableCluster.cc:235
void addToSubdetectorEnergies(float)
Definition MutableCluster.cc:260
void setTime(float value)
Set the [ns].
Definition MutableCluster.cc:67
std::vector< float >::const_iterator shapeParameters_begin() const
Definition MutableCluster.cc:193
podio::RelationRange< float > getShapeParameters() const
Definition MutableCluster.cc:216
std::size_t subdetectorEnergies_size() const
Definition MutableCluster.cc:277
Definition CalorimeterHit.cc:18