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) = 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
94 /// Set the Global position of the cluster [mm]
95 void setPosition(const edm4hep::Vector3f& position);
96 /// Get mutable reference to Global position of the cluster [mm]
97 edm4hep::Vector3f& getPosition();
98
99 /// Set the Error on the position
100 void setPositionError(const edm4hep::Vector3f& positionError);
101 /// Get mutable reference to Error on the position
102 edm4hep::Vector3f& getPositionError();
103
104 /// Set the Opening angle of the ring [rad, 0->pi]
105 void setTheta(const float theta);
106 /// Get mutable reference to Opening angle of the ring [rad, 0->pi]
107 float& getTheta();
108
109 /// Set the Error on the opening angle
110 void setThetaError(const float thetaError);
111 /// Get mutable reference to Error on the opening angle
112 float& getThetaError();
113
114 /// Set the Radius of the best fit ring [mm]
115 void setRadius(const float radius);
116 /// Get mutable reference to Radius of the best fit ring [mm]
117 float& getRadius();
118
119 /// Set the Estimated error from the fit [mm]
120 void setRadiusError(const float radiusError);
121 /// Get mutable reference to Estimated error from the fit [mm]
122 float& getRadiusError();
123
124
125
126
127
128
129 /// check whether the object is actually available
130 bool isAvailable() const;
131 /// disconnect from RingImageObj instance
132 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
133
134 constexpr bool operator==(const MutableRingImage& other) const { return m_obj == other.m_obj; }
135 bool operator==(const RingImage& other) const;
136
137 constexpr bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
138 bool operator!=(const RingImage& other) const { return !(*this == other); }
139
140 // less comparison operator, so that objects can be e.g. stored in sets.
141 bool operator<(const MutableRingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
142
143 podio::ObjectID id() const { return getObjectID(); }
144
145 const podio::ObjectID getObjectID() const;
146
147 friend std::hash<MutableRingImage>;
148
150 using std::swap;
151 swap(a.m_obj, b.m_obj); // swap out the internal pointers
152 }
153
154private:
155 /// constructor from existing RingImageObj
156 explicit MutableRingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
157
158 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{new RingImageObj{}, podio::utils::MarkOwned};
159};
160
161#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
162void to_json(nlohmann::json& j, const MutableRingImage& value);
163#endif
164
165
166} // namespace edm4eic
167
168
169
170template<>
171struct std::hash<edm4eic::MutableRingImage> {
172 std::size_t operator()(const edm4eic::MutableRingImage& obj) const {
173 return std::hash<edm4eic::RingImageObj*>{}(obj.m_obj.get());
174 }
175};
176
177
178#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:134
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
MutableRingImage(const MutableRingImage &other)=default
copy constructor
void unlink()
disconnect from RingImageObj instance
Definition MutableRingImage.h:132
friend class RingImage
Definition MutableRingImage.h:37
const edm4hep::Vector3f & getPositionError() const
Access the Error on the position.
Definition MutableRingImage.cc:45
podio::ObjectID id() const
Definition MutableRingImage.h:143
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:137
friend void swap(MutableRingImage &a, MutableRingImage &b)
Definition MutableRingImage.h:149
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
bool operator<(const MutableRingImage &other) const
Definition MutableRingImage.h:141
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:138
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:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableRingImage &obj) const
Definition MutableRingImage.h:172