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/ClusterConst.h"
7 #include "eicd/ClusterObj.h"
8 
9 #include "eicd/CovXYZ.h"
10 #include "eicd/Index.h"
11 #include "eicd/VectorXYZ.h"
12 #include "podio/ObjectID.h"
13 #include <ostream>
14 
15 
16 
17 namespace eic {
18 
19 
20 /** @class Cluster
21  * EIC cluster
22  * @author: W. Armstrong, S. Joosten, C.Peng
23  */
24 class Cluster {
25 
26  friend class ClusterCollection;
28  friend class ConstCluster;
29 
30 public:
31 
32  /// default constructor
33  Cluster();
34  Cluster(eic::Index ID, float energy, float energyError, float time, std::uint32_t nhits, eic::VectorXYZ position, eic::CovXYZ positionError, float radius, float skewness);
35 
36  /// constructor from existing ClusterObj
37  Cluster(ClusterObj* obj);
38 
39  /// copy constructor
40  Cluster(const Cluster& other);
41 
42  /// copy-assignment operator
43  Cluster& operator=(const Cluster& other);
44 
45  /// support cloning (deep-copy)
46  Cluster clone() const;
47 
48  /// destructor
49  ~Cluster();
50 
51  /// conversion to const object
52  operator ConstCluster() const;
53 
54 public:
55 
56  /// Access the unique ID for this cluster
57  const eic::Index& ID() const;
58 
59  /// Access the Reconstructed energy of the cluster [GeV].
60  const float& energy() const;
61 
62  /// Access the Error on the cluster energy [GeV]
63  const float& energyError() const;
64 
65  /// Access the [ns]
66  const float& time() const;
67 
68  /// Access the Number of hits in the cluster.
69  const std::uint32_t& nhits() const;
70 
71  /// Access the Global position of the cluster [mm].
72  const eic::VectorXYZ& position() const;
73 
74  /// Access the Covariance matrix of the position (6 Parameters).
75  const eic::CovXYZ& positionError() const;
76 
77  /// Access the shower radius [mm]
78  const float& radius() const;
79 
80  /// Access the shower skewness [unitless]
81  const float& skewness() const;
82 
83 
84 
85  /// Set the unique ID for this cluster
86  void ID(eic::Index value);
87  /// Get reference to unique ID for this cluster
88  eic::Index& ID();
89 
90  /// Set the Reconstructed energy of the cluster [GeV].
91  void energy(float value);
92 
93  /// Set the Error on the cluster energy [GeV]
94  void energyError(float value);
95 
96  /// Set the [ns]
97  void time(float value);
98 
99  /// Set the Number of hits in the cluster.
100  void nhits(std::uint32_t value);
101 
102  /// Set the Global position of the cluster [mm].
103  void position(eic::VectorXYZ value);
104  /// Get reference to Global position of the cluster [mm].
106 
107  /// Set the Covariance matrix of the position (6 Parameters).
108  void positionError(eic::CovXYZ value);
109  /// Get reference to Covariance matrix of the position (6 Parameters).
111 
112  /// Set the shower radius [mm]
113  void radius(float value);
114 
115  /// Set the shower skewness [unitless]
116  void skewness(float value);
117 
118 
119 
120 
121 
122 
123  /// check whether the object is actually available
124  bool isAvailable() const;
125  /// disconnect from ClusterObj instance
126  void unlink() { m_obj = nullptr; }
127 
128  bool operator==(const Cluster& other) const { return m_obj == other.m_obj; }
129  bool operator==(const ConstCluster& other) const;
130 
131  // less comparison operator, so that objects can be e.g. stored in sets.
132  bool operator<(const Cluster& other) const { return m_obj < other.m_obj; }
133 
134  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
135 
136  const podio::ObjectID getObjectID() const;
137 
138 private:
139  ClusterObj* m_obj;
140 };
141 
142 std::ostream& operator<<(std::ostream& o, const ConstCluster& value);
143 
144 } // namespace eic
145 
146 
147 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::Index
Definition: Index.h:11
CovXYZ.h
eic::Cluster::clone
Cluster clone() const
support cloning (deep-copy)
Definition: Cluster.cc:47
eic::Cluster::skewness
const float & skewness() const
Access the shower skewness [unitless].
Definition: Cluster.cc:64
eic::Cluster::unlink
void unlink()
disconnect from ClusterObj instance
Definition: Cluster.h:126
eic::ClusterCollection
Definition: ClusterCollection.h:76
eic::Cluster::operator=
Cluster & operator=(const Cluster &other)
copy-assignment operator
Definition: Cluster.cc:37
eic::Cluster::nhits
const std::uint32_t & nhits() const
Access the Number of hits in the cluster.
Definition: Cluster.cc:60
eic::Cluster::id
unsigned int id() const
Definition: Cluster.h:134
eic::Cluster
Definition: Cluster.h:24
eic::ClusterObj
Definition: ClusterObj.h:18
eic
Definition: BasicParticle.cc:13
eic::Cluster::~Cluster
~Cluster()
destructor
Definition: Cluster.cc:51
eic::Cluster::operator<
bool operator<(const Cluster &other) const
Definition: Cluster.h:132
eic::ClusterCollectionIterator
Definition: ClusterCollection.h:29
VectorXYZ.h
eic::Cluster::energyError
const float & energyError() const
Access the Error on the cluster energy [GeV].
Definition: Cluster.cc:58
eic::Cluster::position
const eic::VectorXYZ & position() const
Access the Global position of the cluster [mm].
Definition: Cluster.cc:61
eic::Cluster::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: Cluster.cc:86
eic::Cluster::energy
const float & energy() const
Access the Reconstructed energy of the cluster [GeV].
Definition: Cluster.cc:57
eic::Cluster::ID
const eic::Index & ID() const
Access the unique ID for this cluster.
Definition: Cluster.cc:56
eic::Cluster::Cluster
Cluster()
default constructor
Definition: Cluster.cc:16
eic::Cluster::ConstCluster
friend class ConstCluster
Definition: Cluster.h:28
eic::Cluster::operator==
bool operator==(const Cluster &other) const
Definition: Cluster.h:128
eic::ConstCluster
Definition: ClusterConst.h:22
ClusterConst.h
eic::Cluster::positionError
const eic::CovXYZ & positionError() const
Access the Covariance matrix of the position (6 Parameters).
Definition: Cluster.cc:62
eic::CovXYZ
Definition: CovXYZ.h:11
Index.h
eic::Cluster::time
const float & time() const
Access the [ns].
Definition: Cluster.cc:59
eic::Cluster::getObjectID
const podio::ObjectID getObjectID() const
Definition: Cluster.cc:93
eic::Cluster::radius
const float & radius() const
Access the shower radius [mm].
Definition: Cluster.cc:63
eic::VectorXYZ
Definition: VectorXYZ.h:13
ClusterObj.h