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 {
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(const float npe, const edm4hep::Vector3f& position, const edm4hep::Vector3f& positionError, const float theta, const float thetaError, const float radius, const float radiusError);
48
49 /// copy constructor
50 MutableRingImage(const MutableRingImage& other) = default;
51
52 /// copy-assignment operator
53 MutableRingImage& operator=(MutableRingImage other) &; // Rebind this to other's internal object
54 MutableRingImage& operator=(MutableRingImage other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
55
56 /// create a mutable deep-copy of the object with identical relations
57 /// if cloneRelations=false, the relations are not cloned and will be empty
58 MutableRingImage clone(bool cloneRelations=true) const;
59
60 /// destructor
61 ~MutableRingImage() = default;
62
63
64public:
65
66 /// Access the Number of photo-electrons [#]
67 float getNpe() const;
68
69 /// Access the Global position of the cluster [mm]
70 const edm4hep::Vector3f& getPosition() const;
71
72 /// Access the Error on the position
73 const edm4hep::Vector3f& getPositionError() const;
74
75 /// Access the Opening angle of the ring [rad, 0->pi]
76 float getTheta() const;
77
78 /// Access the Error on the opening angle
79 float getThetaError() const;
80
81 /// Access the Radius of the best fit ring [mm]
82 float getRadius() const;
83
84 /// Access the Estimated error from the fit [mm]
85 float getRadiusError() const;
86
87
88
89 /// Set the Number of photo-electrons [#]
90 void setNpe(const float npe);
91 /// Get mutable reference to Number of photo-electrons [#]
92 float& getNpe();
93 /// Get reference to Number of photo-electrons [#]
94 [[deprecated("use getNpe instead")]]
95 float& npe();
96
97 /// Set the Global position of the cluster [mm]
98 void setPosition(const edm4hep::Vector3f& position);
99 /// Get mutable reference to Global position of the cluster [mm]
100 edm4hep::Vector3f& getPosition();
101 /// Get reference to Global position of the cluster [mm]
102 [[deprecated("use getPosition instead")]]
103 edm4hep::Vector3f& position();
104
105 /// Set the Error on the position
106 void setPositionError(const edm4hep::Vector3f& positionError);
107 /// Get mutable reference to Error on the position
108 edm4hep::Vector3f& getPositionError();
109 /// Get reference to Error on the position
110 [[deprecated("use getPositionError instead")]]
111 edm4hep::Vector3f& positionError();
112
113 /// Set the Opening angle of the ring [rad, 0->pi]
114 void setTheta(const float theta);
115 /// Get mutable reference to Opening angle of the ring [rad, 0->pi]
116 float& getTheta();
117 /// Get reference to Opening angle of the ring [rad, 0->pi]
118 [[deprecated("use getTheta instead")]]
119 float& theta();
120
121 /// Set the Error on the opening angle
122 void setThetaError(const float thetaError);
123 /// Get mutable reference to Error on the opening angle
124 float& getThetaError();
125 /// Get reference to Error on the opening angle
126 [[deprecated("use getThetaError instead")]]
127 float& thetaError();
128
129 /// Set the Radius of the best fit ring [mm]
130 void setRadius(const float radius);
131 /// Get mutable reference to Radius of the best fit ring [mm]
132 float& getRadius();
133 /// Get reference to Radius of the best fit ring [mm]
134 [[deprecated("use getRadius instead")]]
135 float& radius();
136
137 /// Set the Estimated error from the fit [mm]
138 void setRadiusError(const float radiusError);
139 /// Get mutable reference to Estimated error from the fit [mm]
140 float& getRadiusError();
141 /// Get reference to Estimated error from the fit [mm]
142 [[deprecated("use getRadiusError instead")]]
143 float& radiusError();
144
145
146
147
148
149
150 /// check whether the object is actually available
151 bool isAvailable() const;
152 /// disconnect from RingImageObj instance
153 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
154
155 bool operator==(const MutableRingImage& other) const { return m_obj == other.m_obj; }
156 bool operator==(const RingImage& other) const;
157
158 bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
159 bool operator!=(const RingImage& other) const { return !(*this == other); }
160
161 // less comparison operator, so that objects can be e.g. stored in sets.
162 bool operator<(const MutableRingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
163
164 podio::ObjectID id() const { return getObjectID(); }
165
166 const podio::ObjectID getObjectID() const;
167
168 friend std::hash<MutableRingImage>;
169
171 using std::swap;
172 swap(a.m_obj, b.m_obj); // swap out the internal pointers
173 }
174
175private:
176 /// constructor from existing RingImageObj
177 explicit MutableRingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
178
179 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{nullptr};
180};
181
182#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
183void to_json(nlohmann::json& j, const MutableRingImage& value);
184#endif
185
186
187} // namespace edm4eic
188
189
190
191template<>
192struct std::hash<edm4eic::MutableRingImage> {
193 std::size_t operator()(const edm4eic::MutableRingImage& obj) const {
194 return std::hash<edm4eic::RingImageObj*>{}(obj.m_obj.get());
195 }
196};
197
198
199#endif
Definition MutableRingImage.h:33
float & radius()
Get reference to Radius of the best fit ring [mm].
Definition MutableRingImage.cc:73
float & theta()
Get reference to Opening angle of the ring [rad, 0->pi].
Definition MutableRingImage.cc:67
float getThetaError() const
Access the Error on the opening angle.
Definition MutableRingImage.cc:51
void setTheta(const float theta)
Set the Opening angle of the ring [rad, 0->pi].
Definition MutableRingImage.cc:65
void setNpe(const float npe)
Set the Number of photo-electrons [#].
Definition MutableRingImage.cc:56
void setThetaError(const float thetaError)
Set the Error on the opening angle.
Definition MutableRingImage.cc:68
MutableRingImage()
default constructor
Definition MutableRingImage.cc:18
MutableRingImage & operator=(MutableRingImage other) &&=delete
bool isAvailable() const
check whether the object is actually available
Definition MutableRingImage.cc:84
MutableRingImage(const MutableRingImage &other)=default
copy constructor
void unlink()
disconnect from RingImageObj instance
Definition MutableRingImage.h:153
friend class RingImage
Definition MutableRingImage.h:37
const edm4hep::Vector3f & getPositionError() const
Access the Error on the position.
Definition MutableRingImage.cc:49
podio::ObjectID id() const
Definition MutableRingImage.h:164
friend class RingImageMutableCollectionIterator
Definition MutableRingImage.h:36
MutableRingImage & operator=(MutableRingImage other) &
copy-assignment operator
Definition MutableRingImage.cc:32
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
friend void swap(MutableRingImage &a, MutableRingImage &b)
Definition MutableRingImage.h:170
float getNpe() const
Access the Number of photo-electrons [#].
Definition MutableRingImage.cc:47
RingImage object_type
Definition MutableRingImage.h:40
void setPosition(const edm4hep::Vector3f &position)
Set the Global position of the cluster [mm].
Definition MutableRingImage.cc:59
bool operator==(const MutableRingImage &other) const
Definition MutableRingImage.h:155
MutableRingImage clone(bool cloneRelations=true) const
Definition MutableRingImage.cc:37
void setPositionError(const edm4hep::Vector3f &positionError)
Set the Error on the position.
Definition MutableRingImage.cc:62
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:158
bool operator<(const MutableRingImage &other) const
Definition MutableRingImage.h:162
RingImageCollection collection_type
Definition MutableRingImage.h:41
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:159
void setRadiusError(const float radiusError)
Set the Estimated error from the fit [mm].
Definition MutableRingImage.cc:74
const podio::ObjectID getObjectID() const
Definition MutableRingImage.cc:88
void setRadius(const float radius)
Set the Radius of the best fit ring [mm].
Definition MutableRingImage.cc:71
Definition RingImageCollection.h:137
Definition RingImage.h:41
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableRingImage &obj) const
Definition MutableRingImage.h:193