EDM4eic
EIC data model
Loading...
Searching...
No Matches
Cluster.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Cluster_H
4#define EDM4EIC_Cluster_H
5
7
9#include "edm4eic/Cov2f.h"
10#include "edm4eic/Cov3f.h"
11#include "edm4hep/ParticleID.h"
12#include "edm4hep/Vector3f.h"
13#include "podio/RelationRange.h"
14#include <cstdint>
15#include <vector>
16
17#include "podio/utilities/MaybeSharedPtr.h"
18
19#include <ostream>
20#include <cstddef>
21
22#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
23#include "nlohmann/json_fwd.hpp"
24#endif
25
26
27
28namespace edm4eic {
29
30class MutableCluster;
31class ClusterCollection;
32class ClusterCollectionData;
33
34/** @class Cluster
35 * EIC hit cluster, reworked to more closely resemble EDM4hep
36 * @author: W. Armstrong, S. Joosten, C.Peng
37 */
38class Cluster {
39
40 friend class MutableCluster;
41 friend class ClusterCollection;
44
45public:
48
49 /// default constructor
50 Cluster();
51
52 /// Constructor initializing all members
53 Cluster(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);
54
55 /// copy constructor
56 Cluster(const Cluster& other) = default;
57
58 /// copy-assignment operator
60
61 /// create a mutable deep-copy of the object with identical relations
62 MutableCluster clone() const;
63
64 /// destructor
65 ~Cluster() = default;
66
67
68 static Cluster makeEmpty();
69
70public:
71
72 /// Access the Flag-word that defines the type of the cluster
73 std::int32_t getType() const;
74
75 /// Access the Reconstructed energy of the cluster [GeV].
76 float getEnergy() const;
77
78 /// Access the Error on the cluster energy [GeV]
79 float getEnergyError() const;
80
81 /// Access the [ns]
82 float getTime() const;
83
84 /// Access the Error on the cluster time
85 float getTimeError() const;
86
87 /// Access the Number of hits in the cluster.
88 std::uint32_t getNhits() const;
89
90 /// Access the Global position of the cluster [mm].
91 const edm4hep::Vector3f& getPosition() const;
92
93 /// Access the Covariance matrix of the position (6 Parameters).
94 const edm4eic::Cov3f& getPositionError() const;
95
96 /// Access the Intrinsic cluster propagation direction polar angle [rad]
97 float getIntrinsicTheta() const;
98
99 /// Access the Intrinsic cluster propagation direction azimuthal angle [rad]
100 float getIntrinsicPhi() const;
101
102 /// Access the Error on the intrinsic cluster propagation direction
104
105
106
107 std::size_t clusters_size() const;
108 edm4eic::Cluster getClusters(std::size_t) const;
109 std::vector<edm4eic::Cluster>::const_iterator clusters_begin() const;
110 std::vector<edm4eic::Cluster>::const_iterator clusters_end() const;
111 podio::RelationRange<edm4eic::Cluster> getClusters() const;
112 std::size_t hits_size() const;
113 edm4eic::CalorimeterHit getHits(std::size_t) const;
114 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_begin() const;
115 std::vector<edm4eic::CalorimeterHit>::const_iterator hits_end() const;
116 podio::RelationRange<edm4eic::CalorimeterHit> getHits() const;
117 std::size_t particleIDs_size() const;
118 edm4hep::ParticleID getParticleIDs(std::size_t) const;
119 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
120 std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
121 podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
122 std::size_t shapeParameters_size() const;
123 float getShapeParameters(std::size_t) const;
124 std::vector<float>::const_iterator shapeParameters_begin() const;
125 std::vector<float>::const_iterator shapeParameters_end() const;
126 podio::RelationRange<float> getShapeParameters() const;
127 std::size_t hitContributions_size() const;
128 float getHitContributions(std::size_t) const;
129 std::vector<float>::const_iterator hitContributions_begin() const;
130 std::vector<float>::const_iterator hitContributions_end() const;
131 podio::RelationRange<float> getHitContributions() const;
132 std::size_t subdetectorEnergies_size() const;
133 float getSubdetectorEnergies(std::size_t) const;
134 std::vector<float>::const_iterator subdetectorEnergies_begin() const;
135 std::vector<float>::const_iterator subdetectorEnergies_end() const;
136 podio::RelationRange<float> getSubdetectorEnergies() const;
137
138
139 /// check whether the object is actually available
140 bool isAvailable() const;
141 /// disconnect from ClusterObj instance
142 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ClusterObj>{nullptr}; }
143
144 bool operator==(const Cluster& other) const { return m_obj == other.m_obj; }
145 bool operator==(const MutableCluster& other) const;
146
147 // less comparison operator, so that objects can be e.g. stored in sets.
148 bool operator<(const Cluster& other) const { return m_obj < other.m_obj; }
149
150 podio::ObjectID id() const { return getObjectID(); }
151
152 const podio::ObjectID getObjectID() const;
153
154 friend void swap(Cluster& a, Cluster& b) {
155 using std::swap;
156 swap(a.m_obj, b.m_obj); // swap out the internal pointers
157 }
158
159private:
160 /// constructor from existing ClusterObj
161 explicit Cluster(podio::utils::MaybeSharedPtr<ClusterObj> obj);
162 Cluster(ClusterObj* obj);
163
164 podio::utils::MaybeSharedPtr<ClusterObj> m_obj{nullptr};
165};
166
167std::ostream& operator<<(std::ostream& o, const Cluster& value);
168
169#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
170void to_json(nlohmann::json& j, const Cluster& value);
171#endif
172
173
174} // namespace edm4eic
175
176
177#endif
Definition CalorimeterHit.h:37
Definition ClusterCollectionData.h:32
Definition ClusterCollection.h:95
Definition ClusterCollection.h:40
Definition Cluster.h:38
std::size_t particleIDs_size() const
Definition Cluster.cc:146
podio::RelationRange< float > getSubdetectorEnergies() const
Definition Cluster.cc:253
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition Cluster.cc:134
bool operator<(const Cluster &other) const
Definition Cluster.h:148
std::vector< float >::const_iterator hitContributions_end() const
Definition Cluster.cc:204
bool operator==(const Cluster &other) const
Definition Cluster.h:144
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition Cluster.cc:70
podio::RelationRange< float > getShapeParameters() const
Definition Cluster.cc:189
void unlink()
disconnect from ClusterObj instance
Definition Cluster.h:142
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition Cluster.cc:62
std::vector< float >::const_iterator shapeParameters_end() const
Definition Cluster.cc:172
Cluster & operator=(Cluster other)
copy-assignment operator
Definition Cluster.cc:39
Cluster(const Cluster &other)=default
copy constructor
std::vector< float >::const_iterator subdetectorEnergies_begin() const
Definition Cluster.cc:230
float getEnergyError() const
Access the Error on the cluster energy [GeV].
Definition Cluster.cc:58
std::uint32_t getNhits() const
Access the Number of hits in the cluster.
Definition Cluster.cc:61
std::vector< float >::const_iterator hitContributions_begin() const
Definition Cluster.cc:198
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition Cluster.cc:157
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_begin() const
Definition Cluster.cc:102
friend class ClusterCollection
Definition Cluster.h:41
bool isAvailable() const
check whether the object is actually available
Definition Cluster.cc:265
float getTime() const
Access the [ns].
Definition Cluster.cc:59
podio::RelationRange< float > getHitContributions() const
Definition Cluster.cc:221
std::size_t hits_size() const
Definition Cluster.cc:114
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition Cluster.cc:93
const edm4eic::Cov2f & getIntrinsicDirectionError() const
Access the Error on the intrinsic cluster propagation direction.
Definition Cluster.cc:66
Cluster()
default constructor
Definition Cluster.cc:21
std::size_t subdetectorEnergies_size() const
Definition Cluster.cc:242
podio::RelationRange< edm4eic::CalorimeterHit > getHits() const
Definition Cluster.cc:125
std::size_t hitContributions_size() const
Definition Cluster.cc:210
float getIntrinsicPhi() const
Access the Intrinsic cluster propagation direction azimuthal angle [rad].
Definition Cluster.cc:65
friend class MutableCluster
Definition Cluster.h:40
std::size_t clusters_size() const
Definition Cluster.cc:82
const edm4eic::Cov3f & getPositionError() const
Access the Covariance matrix of the position (6 Parameters).
Definition Cluster.cc:63
std::vector< float >::const_iterator shapeParameters_begin() const
Definition Cluster.cc:166
static Cluster makeEmpty()
Definition Cluster.cc:52
float getIntrinsicTheta() const
Access the Intrinsic cluster propagation direction polar angle [rad].
Definition Cluster.cc:64
float getTimeError() const
Access the Error on the cluster time.
Definition Cluster.cc:60
std::vector< edm4eic::CalorimeterHit >::const_iterator hits_end() const
Definition Cluster.cc:108
MutableCluster clone() const
create a mutable deep-copy of the object with identical relations
Definition Cluster.cc:44
podio::ObjectID id() const
Definition Cluster.h:150
~Cluster()=default
destructor
std::int32_t getType() const
Access the Flag-word that defines the type of the cluster.
Definition Cluster.cc:56
std::size_t shapeParameters_size() const
Definition Cluster.cc:178
float getEnergy() const
Access the Reconstructed energy of the cluster [GeV].
Definition Cluster.cc:57
const podio::ObjectID getObjectID() const
Definition Cluster.cc:272
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition Cluster.cc:76
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition Cluster.cc:140
friend void swap(Cluster &a, Cluster &b)
Definition Cluster.h:154
std::vector< float >::const_iterator subdetectorEnergies_end() const
Definition Cluster.cc:236
Definition ClusterObj.h:20
Definition Cov2f.h:18
Definition Cov3f.h:18
Definition MutableCluster.h:37
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97