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