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