EICd
EIC data model
MutableCluster.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableCluster_H
4#define EICD_MutableCluster_H
5
6#include "eicd/ClusterObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "eicd/Cluster.h"
9
10#include "eicd/CalorimeterHit.h"
11#include "eicd/Cov2f.h"
12#include "eicd/Cov3f.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
26
27namespace eicd {
28
29
30/** @class MutableCluster
31 * EIC hit cluster, reworked to more closely resemble EDM4hep
32 * @author: W. Armstrong, S. Joosten, C.Peng
33 */
35
36 friend class ClusterCollection;
38 friend class Cluster;
39
40public:
41
42 /// default constructor
44 MutableCluster(std::int32_t type, float energy, float energyError, float time, float timeError, std::uint32_t nhits, edm4hep::Vector3f position, eicd::Cov3f positionError, float intrinsicTheta, float intrinsicPhi, eicd::Cov2f intrinsicDirectionError);
45
46 /// constructor from existing ClusterObj
48
49 /// copy constructor
50 MutableCluster(const MutableCluster& other);
51
52 /// copy-assignment operator
54
55 /// create a mutable deep-copy of the object with identical relations
56 MutableCluster clone() const;
57
58 /// destructor
60
61 /// conversion to const object
62 operator Cluster() const;
63
64public:
65
66 /// Access the Flagword that defines the type of the cluster
67 const std::int32_t& getType() const;
68
69 /// Access the Reconstructed energy of the cluster [GeV].
70 const float& getEnergy() const;
71
72 /// Access the Error on the cluster energy [GeV]
73 const float& getEnergyError() const;
74
75 /// Access the [ns]
76 const float& getTime() const;
77
78 /// Access the Error on the cluster time
79 const float& getTimeError() const;
80
81 /// Access the Number of hits in the cluster.
82 const std::uint32_t& getNhits() const;
83
84 /// Access the Global position of the cluster [mm].
85 const edm4hep::Vector3f& getPosition() const;
86
87 /// Access the Covariance matrix of the position (6 Parameters).
88 const eicd::Cov3f& getPositionError() const;
89
90 /// Access the Intrinsic cluster propagation direction polar angle [rad]
91 const float& getIntrinsicTheta() const;
92
93 /// Access the Intrinsic cluster propagation direction azimuthal angle [rad]
94 const float& getIntrinsicPhi() const;
95
96 /// Access the Error on the intrinsic cluster propagation direction
98
99
100
101 /// Set the Flagword that defines the type of the cluster
102 void setType(std::int32_t value);
103
104 /// Set the Reconstructed energy of the cluster [GeV].
105 void setEnergy(float value);
106
107 /// Set the Error on the cluster energy [GeV]
108 void setEnergyError(float value);
109
110 /// Set the [ns]
111 void setTime(float value);
112
113 /// Set the Error on the cluster time
114 void setTimeError(float value);
115
116 /// Set the Number of hits in the cluster.
117 void setNhits(std::uint32_t value);
118
119 /// Set the Global position of the cluster [mm].
120 void setPosition(edm4hep::Vector3f value);
121 /// Get reference to Global position of the cluster [mm].
122 edm4hep::Vector3f& position();
123
124 /// Set the Covariance matrix of the position (6 Parameters).
125 void setPositionError(eicd::Cov3f value);
126 /// Get reference to Covariance matrix of the position (6 Parameters).
128
129 /// Set the Intrinsic cluster propagation direction polar angle [rad]
130 void setIntrinsicTheta(float value);
131
132 /// Set the Intrinsic cluster propagation direction azimuthal angle [rad]
133 void setIntrinsicPhi(float value);
134
135 /// Set the Error on the intrinsic cluster propagation direction
137 /// Get reference to Error on the intrinsic cluster propagation direction
139
140
141
143 unsigned int clusters_size() const;
144 eicd::Cluster getClusters(unsigned int) const;
145 std::vector<eicd::Cluster>::const_iterator clusters_begin() const;
146 std::vector<eicd::Cluster>::const_iterator clusters_end() const;
147 podio::RelationRange<eicd::Cluster> getClusters() const;
149 unsigned int hits_size() const;
150 eicd::CalorimeterHit getHits(unsigned int) const;
151 std::vector<eicd::CalorimeterHit>::const_iterator hits_begin() const;
152 std::vector<eicd::CalorimeterHit>::const_iterator hits_end() const;
153 podio::RelationRange<eicd::CalorimeterHit> getHits() const;
154 void addToParticleIDs(edm4hep::ParticleID);
155 unsigned int particleIDs_size() const;
156 edm4hep::ParticleID getParticleIDs(unsigned int) const;
157 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
158 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
159 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
160 void addToShapeParameters(float);
161 unsigned int shapeParameters_size() const;
162 float getShapeParameters(unsigned int) const;
163 std::vector<float>::const_iterator shapeParameters_begin() const;
164 std::vector<float>::const_iterator shapeParameters_end() const;
165 podio::RelationRange<float> getShapeParameters() const;
166 void addToHitContributions(float);
167 unsigned int hitContributions_size() const;
168 float getHitContributions(unsigned int) const;
169 std::vector<float>::const_iterator hitContributions_begin() const;
170 std::vector<float>::const_iterator hitContributions_end() const;
171 podio::RelationRange<float> getHitContributions() const;
172 void addToSubdetectorEnergies(float);
173 unsigned int subdetectorEnergies_size() const;
174 float getSubdetectorEnergies(unsigned int) const;
175 std::vector<float>::const_iterator subdetectorEnergies_begin() const;
176 std::vector<float>::const_iterator subdetectorEnergies_end() const;
177 podio::RelationRange<float> getSubdetectorEnergies() const;
178
179
180
181 /// check whether the object is actually available
182 bool isAvailable() const;
183 /// disconnect from ClusterObj instance
184 void unlink() { m_obj = nullptr; }
185
186 bool operator==(const MutableCluster& other) const { return m_obj == other.m_obj; }
187 bool operator==(const Cluster& other) const;
188
189 // less comparison operator, so that objects can be e.g. stored in sets.
190 bool operator<(const MutableCluster& other) const { return m_obj < other.m_obj; }
191
192 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
193
194 const podio::ObjectID getObjectID() const;
195
196 friend void swap(MutableCluster& a, MutableCluster& b) {
197 using std::swap;
198 swap(a.m_obj, b.m_obj); // swap out the internal pointers
199 }
200
201private:
202 ClusterObj* m_obj;
203};
204
205#ifdef PODIO_JSON_OUTPUT
206void to_json(nlohmann::json& j, const MutableCluster& value);
207#endif
208
209
210} // namespace eicd
211
212
213#endif
Definition: CalorimeterHit.h:27
Definition: ClusterCollection.h:82
Definition: Cluster.h:33
Definition: ClusterCollection.h:57
Definition: ClusterObj.h:20
Definition: Cov2f.h:15
Definition: Cov3f.h:15
Definition: MutableCluster.h:34
friend class Cluster
Definition: MutableCluster.h:38
MutableCluster & operator=(MutableCluster other)
copy-assignment operator
Definition: MutableCluster.cc:39
podio::RelationRange< eicd::CalorimeterHit > getHits() const
Definition: MutableCluster.cc:154
MutableCluster()
default constructor
Definition: MutableCluster.cc:16
void addToClusters(eicd::Cluster)
Definition: MutableCluster.cc:90
void setIntrinsicTheta(float value)
Set the Intrinsic cluster propagation direction polar angle [rad].
Definition: MutableCluster.cc:84
std::vector< float >::const_iterator shapeParameters_begin() const
Definition: MutableCluster.cc:203
void addToHitContributions(float)
Definition: MutableCluster.cc:234
void setType(std::int32_t value)
Set the Flagword that defines the type of the cluster.
Definition: MutableCluster.cc:74
void setEnergy(float value)
Set the Reconstructed energy of the cluster [GeV].
Definition: MutableCluster.cc:75
std::vector< float >::const_iterator hitContributions_end() const
Definition: MutableCluster.cc:245
const podio::ObjectID getObjectID() const
Definition: MutableCluster.cc:318
const float & getTimeError() const
Access the Error on the cluster time.
Definition: MutableCluster.cc:65
unsigned int particleIDs_size() const
Definition: MutableCluster.cc:179
unsigned int hitContributions_size() const
Definition: MutableCluster.cc:251
std::vector< eicd::Cluster >::const_iterator clusters_begin() const
Definition: MutableCluster.cc:95
void setIntrinsicDirectionError(eicd::Cov2f value)
Set the Error on the intrinsic cluster propagation direction.
Definition: MutableCluster.cc:86
const float & getEnergyError() const
Access the Error on the cluster energy [GeV].
Definition: MutableCluster.cc:63
void addToShapeParameters(float)
Definition: MutableCluster.cc:198
void addToParticleIDs(edm4hep::ParticleID)
Definition: MutableCluster.cc:162
podio::RelationRange< float > getHitContributions() const
Definition: MutableCluster.cc:262
std::vector< eicd::Cluster >::const_iterator clusters_end() const
Definition: MutableCluster.cc:101
const eicd::Cov3f & getPositionError() const
Access the Covariance matrix of the position (6 Parameters).
Definition: MutableCluster.cc:68
eicd::Cov2f & intrinsicDirectionError()
Get reference to Error on the intrinsic cluster propagation direction.
Definition: MutableCluster.cc:87
friend void swap(MutableCluster &a, MutableCluster &b)
Definition: MutableCluster.h:196
std::vector< float >::const_iterator shapeParameters_end() const
Definition: MutableCluster.cc:209
unsigned int hits_size() const
Definition: MutableCluster.cc:143
MutableCluster clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableCluster.cc:50
const float & getIntrinsicTheta() const
Access the Intrinsic cluster propagation direction polar angle [rad].
Definition: MutableCluster.cc:69
podio::RelationRange< eicd::Cluster > getClusters() const
Definition: MutableCluster.cc:118
~MutableCluster()
destructor
Definition: MutableCluster.cc:54
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition: MutableCluster.cc:67
std::vector< float >::const_iterator hitContributions_begin() const
Definition: MutableCluster.cc:239
std::vector< eicd::CalorimeterHit >::const_iterator hits_begin() const
Definition: MutableCluster.cc:131
bool isAvailable() const
check whether the object is actually available
Definition: MutableCluster.cc:311
unsigned int clusters_size() const
Definition: MutableCluster.cc:107
podio::RelationRange< float > getShapeParameters() const
Definition: MutableCluster.cc:226
unsigned int shapeParameters_size() const
Definition: MutableCluster.cc:215
void setNhits(std::uint32_t value)
Set the Number of hits in the cluster.
Definition: MutableCluster.cc:79
const std::int32_t & getType() const
Access the Flagword that defines the type of the cluster.
Definition: MutableCluster.cc:61
void setEnergyError(float value)
Set the Error on the cluster energy [GeV].
Definition: MutableCluster.cc:76
std::vector< eicd::CalorimeterHit >::const_iterator hits_end() const
Definition: MutableCluster.cc:137
std::vector< float >::const_iterator subdetectorEnergies_end() const
Definition: MutableCluster.cc:281
const eicd::Cov2f & getIntrinsicDirectionError() const
Access the Error on the intrinsic cluster propagation direction.
Definition: MutableCluster.cc:71
void addToHits(eicd::CalorimeterHit)
Definition: MutableCluster.cc:126
bool operator<(const MutableCluster &other) const
Definition: MutableCluster.h:190
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition: MutableCluster.cc:173
void setTime(float value)
Set the [ns].
Definition: MutableCluster.cc:77
bool operator==(const MutableCluster &other) const
Definition: MutableCluster.h:186
eicd::Cov3f & positionError()
Get reference to Covariance matrix of the position (6 Parameters).
Definition: MutableCluster.cc:83
podio::RelationRange< float > getSubdetectorEnergies() const
Definition: MutableCluster.cc:298
const float & getEnergy() const
Access the Reconstructed energy of the cluster [GeV].
Definition: MutableCluster.cc:62
void addToSubdetectorEnergies(float)
Definition: MutableCluster.cc:270
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition: MutableCluster.cc:167
unsigned int subdetectorEnergies_size() const
Definition: MutableCluster.cc:287
void setTimeError(float value)
Set the Error on the cluster time.
Definition: MutableCluster.cc:78
void setPositionError(eicd::Cov3f value)
Set the Covariance matrix of the position (6 Parameters).
Definition: MutableCluster.cc:82
const float & getIntrinsicPhi() const
Access the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition: MutableCluster.cc:70
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition: MutableCluster.cc:190
const float & getTime() const
Access the [ns].
Definition: MutableCluster.cc:64
void setIntrinsicPhi(float value)
Set the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition: MutableCluster.cc:85
void unlink()
disconnect from ClusterObj instance
Definition: MutableCluster.h:184
void setPosition(edm4hep::Vector3f value)
Set the Global position of the cluster [mm].
Definition: MutableCluster.cc:80
edm4hep::Vector3f & position()
Get reference to Global position of the cluster [mm].
Definition: MutableCluster.cc:81
std::vector< float >::const_iterator subdetectorEnergies_begin() const
Definition: MutableCluster.cc:275
const std::uint32_t & getNhits() const
Access the Number of hits in the cluster.
Definition: MutableCluster.cc:66
unsigned int id() const
Definition: MutableCluster.h:192
Definition: CalorimeterHit.cc:13