EICd
EIC data model
ClusterLayer.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef EICD_ClusterLayer_H
4 #define EICD_ClusterLayer_H
5 
7 #include "eicd/ClusterLayerObj.h"
8 
9 #include "eicd/Index.h"
10 #include "eicd/VectorXYZ.h"
11 #include "podio/ObjectID.h"
12 #include <ostream>
13 
14 
15 
16 namespace eic {
17 
18 
19 /** @class ClusterLayer
20  * 2D Cluster in a single layer for a multi-layer detector
21  * @author: S. Joosten, C. Peng
22  */
23 class ClusterLayer {
24 
25  friend class ClusterLayerCollection;
27  friend class ConstClusterLayer;
28 
29 public:
30 
31  /// default constructor
32  ClusterLayer();
33  ClusterLayer(eic::Index ID, eic::Index clusterID, std::int32_t layer, std::uint32_t nhits, float energy, float energyError, float radius, float skewness, eic::VectorXYZ position);
34 
35  /// constructor from existing ClusterLayerObj
37 
38  /// copy constructor
39  ClusterLayer(const ClusterLayer& other);
40 
41  /// copy-assignment operator
42  ClusterLayer& operator=(const ClusterLayer& other);
43 
44  /// support cloning (deep-copy)
45  ClusterLayer clone() const;
46 
47  /// destructor
48  ~ClusterLayer();
49 
50  /// conversion to const object
51  operator ConstClusterLayer() const;
52 
53 public:
54 
55  /// Access the unique layer ID
56  const eic::Index& ID() const;
57 
58  /// Access the associated full 3D cluster, -1 if none
59  const eic::Index& clusterID() const;
60 
61  /// Access the layer number for this cluster layer
62  const std::int32_t& layer() const;
63 
64  /// Access the Number of hits
65  const std::uint32_t& nhits() const;
66 
67  /// Access the Energy in this cluster layer [GeV]
68  const float& energy() const;
69 
70  /// Access the Error on energy [GeV]
71  const float& energyError() const;
72 
73  /// Access the Shower radius [mm]
74  const float& radius() const;
75 
76  /// Access the Skewness of hits distribution
77  const float& skewness() const;
78 
79  /// Access the Global center position. [mm]
80  const eic::VectorXYZ& position() const;
81 
82 
83 
84  /// Set the unique layer ID
85  void ID(eic::Index value);
86  /// Get reference to unique layer ID
87  eic::Index& ID();
88 
89  /// Set the associated full 3D cluster, -1 if none
90  void clusterID(eic::Index value);
91  /// Get reference to associated full 3D cluster, -1 if none
93 
94  /// Set the layer number for this cluster layer
95  void layer(std::int32_t value);
96 
97  /// Set the Number of hits
98  void nhits(std::uint32_t value);
99 
100  /// Set the Energy in this cluster layer [GeV]
101  void energy(float value);
102 
103  /// Set the Error on energy [GeV]
104  void energyError(float value);
105 
106  /// Set the Shower radius [mm]
107  void radius(float value);
108 
109  /// Set the Skewness of hits distribution
110  void skewness(float value);
111 
112  /// Set the Global center position. [mm]
113  void position(eic::VectorXYZ value);
114  /// Get reference to Global center position. [mm]
116 
117 
118 
119 
120 
121 
122  /// check whether the object is actually available
123  bool isAvailable() const;
124  /// disconnect from ClusterLayerObj instance
125  void unlink() { m_obj = nullptr; }
126 
127  bool operator==(const ClusterLayer& other) const { return m_obj == other.m_obj; }
128  bool operator==(const ConstClusterLayer& other) const;
129 
130  // less comparison operator, so that objects can be e.g. stored in sets.
131  bool operator<(const ClusterLayer& other) const { return m_obj < other.m_obj; }
132 
133  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
134 
135  const podio::ObjectID getObjectID() const;
136 
137 private:
138  ClusterLayerObj* m_obj;
139 };
140 
141 std::ostream& operator<<(std::ostream& o, const ConstClusterLayer& value);
142 
143 } // namespace eic
144 
145 
146 #endif
ClusterLayerObj.h
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::Index
Definition: Index.h:11
eic::ClusterLayer::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: ClusterLayer.cc:86
eic::ClusterLayer::id
unsigned int id() const
Definition: ClusterLayer.h:133
eic::ClusterLayer::getObjectID
const podio::ObjectID getObjectID() const
Definition: ClusterLayer.cc:93
eic::ClusterLayer::radius
const float & radius() const
Access the Shower radius [mm].
Definition: ClusterLayer.cc:62
eic::ClusterLayerObj
Definition: ClusterLayerObj.h:18
eic::ClusterLayer::operator==
bool operator==(const ClusterLayer &other) const
Definition: ClusterLayer.h:127
eic::ClusterLayer::operator<
bool operator<(const ClusterLayer &other) const
Definition: ClusterLayer.h:131
eic
Definition: BasicParticle.cc:13
eic::ClusterLayerCollection
Definition: ClusterLayerCollection.h:76
eic::ClusterLayer::clone
ClusterLayer clone() const
support cloning (deep-copy)
Definition: ClusterLayer.cc:47
ClusterLayerConst.h
eic::ClusterLayer::~ClusterLayer
~ClusterLayer()
destructor
Definition: ClusterLayer.cc:51
eic::ClusterLayer::nhits
const std::uint32_t & nhits() const
Access the Number of hits.
Definition: ClusterLayer.cc:59
eic::ClusterLayer::energyError
const float & energyError() const
Access the Error on energy [GeV].
Definition: ClusterLayer.cc:61
VectorXYZ.h
eic::ClusterLayer::position
const eic::VectorXYZ & position() const
Access the Global center position. [mm].
Definition: ClusterLayer.cc:64
eic::ClusterLayer::operator=
ClusterLayer & operator=(const ClusterLayer &other)
copy-assignment operator
Definition: ClusterLayer.cc:37
eic::ClusterLayer::unlink
void unlink()
disconnect from ClusterLayerObj instance
Definition: ClusterLayer.h:125
eic::ClusterLayer::ClusterLayer
ClusterLayer()
default constructor
Definition: ClusterLayer.cc:16
eic::ClusterLayerCollectionIterator
Definition: ClusterLayerCollection.h:29
eic::ClusterLayer::energy
const float & energy() const
Access the Energy in this cluster layer [GeV].
Definition: ClusterLayer.cc:60
eic::ClusterLayer::ID
const eic::Index & ID() const
Access the unique layer ID.
Definition: ClusterLayer.cc:56
eic::ClusterLayer
Definition: ClusterLayer.h:23
eic::ClusterLayer::skewness
const float & skewness() const
Access the Skewness of hits distribution.
Definition: ClusterLayer.cc:63
Index.h
eic::ClusterLayer::clusterID
const eic::Index & clusterID() const
Access the associated full 3D cluster, -1 if none.
Definition: ClusterLayer.cc:57
eic::ClusterLayer::layer
const std::int32_t & layer() const
Access the layer number for this cluster layer.
Definition: ClusterLayer.cc:58
eic::ConstClusterLayer
Definition: ClusterLayerConst.h:21
eic::VectorXYZ
Definition: VectorXYZ.h:13
eic::ClusterLayer::ConstClusterLayer
friend class ConstClusterLayer
Definition: ClusterLayer.h:27