EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableRingImage.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableRingImage_H
4#define EDM4EIC_MutableRingImage_H
5
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/RingImage.h"
9
10#include "edm4hep/Vector3f.h"
11
12#include "podio/utilities/MaybeSharedPtr.h"
13
14#include <cstdint>
15
16#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
17#include "nlohmann/json_fwd.hpp"
18#endif
19
20// forward declarations
21namespace edm4eic {
22class RingImageCollection;
23}
24
25
26namespace edm4eic {
27
28
29/** @class MutableRingImage
30 * EIC Ring Image Cluster
31 * @author: S. Joosten, C. Peng
32 */
34
35 friend class RingImageCollection;
37 friend class RingImage;
38
39public:
42
43 /// default constructor
45
46 /// Constructor initializing all members
47 MutableRingImage(float npe, edm4hep::Vector3f position, edm4hep::Vector3f positionError, float theta, float thetaError, float radius, float radiusError);
48
49 /// copy constructor
50 MutableRingImage(const MutableRingImage& other) = default;
51
52 /// copy-assignment operator
54
55 /// create a mutable deep-copy of the object with identical relations
56 /// if cloneRelations=false, the relations are not cloned and will be empty
57 MutableRingImage clone(bool cloneRelations=true) const;
58
59 /// destructor
60 ~MutableRingImage() = default;
61
62
63public:
64
65 /// Access the Number of photo-electrons [#]
66 float getNpe() const;
67
68 /// Access the Global position of the cluster [mm]
69 const edm4hep::Vector3f& getPosition() const;
70
71 /// Access the Error on the position
72 const edm4hep::Vector3f& getPositionError() const;
73
74 /// Access the Opening angle of the ring [rad, 0->pi]
75 float getTheta() const;
76
77 /// Access the Error on the opening angle
78 float getThetaError() const;
79
80 /// Access the Radius of the best fit ring [mm]
81 float getRadius() const;
82
83 /// Access the Estimated error from the fit [mm]
84 float getRadiusError() const;
85
86
87
88 /// Set the Number of photo-electrons [#]
89 void setNpe(float value);
90 /// Get mutable reference to Number of photo-electrons [#]
91 float& getNpe();
92 /// Get reference to Number of photo-electrons [#]
93 [[deprecated("use getNpe instead")]]
94 float& npe();
95
96 /// Set the Global position of the cluster [mm]
97 void setPosition(edm4hep::Vector3f value);
98 /// Get mutable reference to Global position of the cluster [mm]
99 edm4hep::Vector3f& getPosition();
100 /// Get reference to Global position of the cluster [mm]
101 [[deprecated("use getPosition instead")]]
102 edm4hep::Vector3f& position();
103
104 /// Set the Error on the position
105 void setPositionError(edm4hep::Vector3f value);
106 /// Get mutable reference to Error on the position
107 edm4hep::Vector3f& getPositionError();
108 /// Get reference to Error on the position
109 [[deprecated("use getPositionError instead")]]
110 edm4hep::Vector3f& positionError();
111
112 /// Set the Opening angle of the ring [rad, 0->pi]
113 void setTheta(float value);
114 /// Get mutable reference to Opening angle of the ring [rad, 0->pi]
115 float& getTheta();
116 /// Get reference to Opening angle of the ring [rad, 0->pi]
117 [[deprecated("use getTheta instead")]]
118 float& theta();
119
120 /// Set the Error on the opening angle
121 void setThetaError(float value);
122 /// Get mutable reference to Error on the opening angle
123 float& getThetaError();
124 /// Get reference to Error on the opening angle
125 [[deprecated("use getThetaError instead")]]
126 float& thetaError();
127
128 /// Set the Radius of the best fit ring [mm]
129 void setRadius(float value);
130 /// Get mutable reference to Radius of the best fit ring [mm]
131 float& getRadius();
132 /// Get reference to Radius of the best fit ring [mm]
133 [[deprecated("use getRadius instead")]]
134 float& radius();
135
136 /// Set the Estimated error from the fit [mm]
137 void setRadiusError(float value);
138 /// Get mutable reference to Estimated error from the fit [mm]
139 float& getRadiusError();
140 /// Get reference to Estimated error from the fit [mm]
141 [[deprecated("use getRadiusError instead")]]
142 float& radiusError();
143
144
145
146
147
148
149 /// check whether the object is actually available
150 bool isAvailable() const;
151 /// disconnect from RingImageObj instance
152 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
153
154 bool operator==(const MutableRingImage& other) const { return m_obj == other.m_obj; }
155 bool operator==(const RingImage& other) const;
156
157 bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
158 bool operator!=(const RingImage& other) const { return !(*this == other); }
159
160 // less comparison operator, so that objects can be e.g. stored in sets.
161 bool operator<(const MutableRingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
162
163 podio::ObjectID id() const { return getObjectID(); }
164
165 const podio::ObjectID getObjectID() const;
166
168 using std::swap;
169 swap(a.m_obj, b.m_obj); // swap out the internal pointers
170 }
171
172private:
173 /// constructor from existing RingImageObj
174 explicit MutableRingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
175
176 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{nullptr};
177};
178
179#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
180void to_json(nlohmann::json& j, const MutableRingImage& value);
181#endif
182
183
184} // namespace edm4eic
185
186
187#endif
Definition MutableRingImage.h:33
float & radius()
Get reference to Radius of the best fit ring [mm].
Definition MutableRingImage.cc:73
MutableRingImage & operator=(MutableRingImage other)
copy-assignment operator
Definition MutableRingImage.cc:32
float & theta()
Get reference to Opening angle of the ring [rad, 0->pi].
Definition MutableRingImage.cc:67
void setPosition(edm4hep::Vector3f value)
Set the Global position of the cluster [mm].
Definition MutableRingImage.cc:59
float getThetaError() const
Access the Error on the opening angle.
Definition MutableRingImage.cc:51
MutableRingImage()
default constructor
Definition MutableRingImage.cc:18
bool isAvailable() const
check whether the object is actually available
Definition MutableRingImage.cc:84
MutableRingImage(const MutableRingImage &other)=default
copy constructor
void setNpe(float value)
Set the Number of photo-electrons [#].
Definition MutableRingImage.cc:56
void unlink()
disconnect from RingImageObj instance
Definition MutableRingImage.h:152
void setRadius(float value)
Set the Radius of the best fit ring [mm].
Definition MutableRingImage.cc:71
friend class RingImage
Definition MutableRingImage.h:37
const edm4hep::Vector3f & getPositionError() const
Access the Error on the position.
Definition MutableRingImage.cc:49
void setThetaError(float value)
Set the Error on the opening angle.
Definition MutableRingImage.cc:68
podio::ObjectID id() const
Definition MutableRingImage.h:163
float & npe()
Get reference to Number of photo-electrons [#].
Definition MutableRingImage.cc:58
float & radiusError()
Get reference to Estimated error from the fit [mm].
Definition MutableRingImage.cc:76
void setTheta(float value)
Set the Opening angle of the ring [rad, 0->pi].
Definition MutableRingImage.cc:65
friend void swap(MutableRingImage &a, MutableRingImage &b)
Definition MutableRingImage.h:167
float getNpe() const
Access the Number of photo-electrons [#].
Definition MutableRingImage.cc:47
bool operator==(const MutableRingImage &other) const
Definition MutableRingImage.h:154
MutableRingImage clone(bool cloneRelations=true) const
Definition MutableRingImage.cc:37
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition MutableRingImage.cc:48
float getTheta() const
Access the Opening angle of the ring [rad, 0->pi].
Definition MutableRingImage.cc:50
float getRadiusError() const
Access the Estimated error from the fit [mm].
Definition MutableRingImage.cc:53
friend class RingImageCollection
Definition MutableRingImage.h:35
edm4hep::Vector3f & positionError()
Get reference to Error on the position.
Definition MutableRingImage.cc:64
~MutableRingImage()=default
destructor
edm4hep::Vector3f & position()
Get reference to Global position of the cluster [mm].
Definition MutableRingImage.cc:61
bool operator!=(const MutableRingImage &other) const
Definition MutableRingImage.h:157
bool operator<(const MutableRingImage &other) const
Definition MutableRingImage.h:161
float getRadius() const
Access the Radius of the best fit ring [mm].
Definition MutableRingImage.cc:52
float & thetaError()
Get reference to Error on the opening angle.
Definition MutableRingImage.cc:70
bool operator!=(const RingImage &other) const
Definition MutableRingImage.h:158
const podio::ObjectID getObjectID() const
Definition MutableRingImage.cc:88
void setPositionError(edm4hep::Vector3f value)
Set the Error on the position.
Definition MutableRingImage.cc:62
void setRadiusError(float value)
Set the Estimated error from the fit [mm].
Definition MutableRingImage.cc:74
Definition RingImageCollection.h:91
Definition RingImage.h:41
Definition RingImageCollection.h:62
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150