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