EDM4eic
EIC data model
Loading...
Searching...
No Matches
RingImage.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_RingImage_H
4#define EDM4EIC_RingImage_H
5
7
8#include "edm4hep/Vector3f.h"
9
10#include "podio/utilities/MaybeSharedPtr.h"
11#include "podio/detail/OrderKey.h"
12
13#include <ostream>
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 podio::detail {
27// Internal function used in less comparison operators of the datatypes and interface types
28OrderKey getOrderKey(const edm4eic::RingImage& obj);
29};
30
31namespace edm4eic {
32
36
37/** @class RingImage
38 * EIC Ring Image Cluster
39 * @author: S. Joosten, C. Peng
40 */
41class RingImage {
42
43 friend class MutableRingImage;
44 friend class RingImageCollection;
47 friend podio::detail::OrderKey podio::detail::getOrderKey(const RingImage & obj);
48
49public:
52
53 /// default constructor
54 RingImage();
55
56 /// Constructor initializing all members
57 RingImage(const float npe, const edm4hep::Vector3f& position, const edm4hep::Vector3f& positionError, const float theta, const float thetaError, const float radius, const float radiusError);
58
59 /// copy constructor
60 RingImage(const RingImage& other) = default;
61
62 /// copy-assignment operator
63 RingImage& operator=(RingImage other) &; // Rebind this to other's internal object
64 RingImage& operator=(RingImage other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
65
66 /// create a mutable deep-copy of the object with identical relations
67 /// if cloneRelations=false, the relations are not cloned and will be empty
68 MutableRingImage clone(bool cloneRelations=true) const;
69
70 /// destructor
71 ~RingImage() = default;
72
73 /// converting constructor from mutable object
74 RingImage(const MutableRingImage& other);
75
76 static RingImage makeEmpty();
77
78public:
79
80 static constexpr std::string_view typeName = "edm4eic::RingImage";
81
82 /// Access the Number of photo-electrons [#]
83 float getNpe() const;
84
85 /// Access the Global position of the cluster [mm]
86 const edm4hep::Vector3f& getPosition() const;
87
88 /// Access the Error on the position
89 const edm4hep::Vector3f& getPositionError() const;
90
91 /// Access the Opening angle of the ring [rad, 0->pi]
92 float getTheta() const;
93
94 /// Access the Error on the opening angle
95 float getThetaError() const;
96
97 /// Access the Radius of the best fit ring [mm]
98 float getRadius() const;
99
100 /// Access the Estimated error from the fit [mm]
101 float getRadiusError() const;
102
103
104
105
106
107 /// check whether the object is actually available
108 bool isAvailable() const;
109 /// disconnect from RingImageObj instance
110 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
111
112 bool operator==(const RingImage& other) const { return m_obj == other.m_obj; }
113 bool operator==(const MutableRingImage& other) const;
114
115 bool operator!=(const RingImage& other) const { return !(*this == other); }
116 bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
117
118 // less comparison operator, so that objects can be e.g. stored in sets.
119 bool operator<(const RingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
120
121 podio::ObjectID id() const { return getObjectID(); }
122
123 const podio::ObjectID getObjectID() const;
124
125 friend std::hash<RingImage>;
126
127 friend void swap(RingImage& a, RingImage& b) {
128 using std::swap;
129 swap(a.m_obj, b.m_obj); // swap out the internal pointers
130 }
131
132private:
133 /// constructor from existing RingImageObj
134 explicit RingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
136
137 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{nullptr};
138};
139
140std::ostream& operator<<(std::ostream& o, const RingImage& value);
141
142#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
143void to_json(nlohmann::json& j, const RingImage& value);
144#endif
145
146
147} // namespace edm4eic
148
149
150
151template<>
152struct std::hash<edm4eic::RingImage> {
153 std::size_t operator()(const edm4eic::RingImage& obj) const {
154 return std::hash<edm4eic::RingImageObj*>{}(obj.m_obj.get());
155 }
156};
157
158
159// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
160// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
161// and https://github.com/AIDASoft/podio/issues/770
162#if defined(__clang__)
163#pragma clang diagnostic push
164#pragma clang diagnostic ignored "-Wunknown-warning-option"
165#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
166#pragma clang diagnostic ignored "-Wdeprecated"
167constexpr std::string_view edm4eic::RingImage::typeName;
168#pragma clang diagnostic pop
169#elif defined(__GNUC__)
170#pragma GCC diagnostic push
171#pragma GCC diagnostic ignored "-Wdeprecated"
172constexpr std::string_view edm4eic::RingImage::typeName;
173#pragma GCC diagnostic pop
174#endif
175
176#endif
Definition MutableRingImage.h:33
Definition RingImageCollectionData.h:30
Definition RingImageCollection.h:137
Definition RingImage.h:41
MutableRingImage clone(bool cloneRelations=true) const
Definition RingImage.cc:39
bool operator==(const RingImage &other) const
Definition RingImage.h:112
bool operator!=(const MutableRingImage &other) const
Definition RingImage.h:116
friend class MutableRingImage
Definition RingImage.h:43
bool operator<(const RingImage &other) const
Definition RingImage.h:119
RingImage & operator=(RingImage other) &
copy-assignment operator
Definition RingImage.cc:34
~RingImage()=default
destructor
void unlink()
disconnect from RingImageObj instance
Definition RingImage.h:110
RingImage & operator=(RingImage other) &&=delete
MutableRingImage mutable_type
Definition RingImage.h:50
float getRadiusError() const
Access the Estimated error from the fit [mm].
Definition RingImage.cc:64
bool operator!=(const RingImage &other) const
Definition RingImage.h:115
friend void swap(RingImage &a, RingImage &b)
Definition RingImage.h:127
static constexpr std::string_view typeName
Definition RingImage.h:80
friend class RingImageCollection
Definition RingImage.h:44
float getRadius() const
Access the Radius of the best fit ring [mm].
Definition RingImage.cc:63
RingImage(const RingImage &other)=default
copy constructor
RingImageCollection collection_type
Definition RingImage.h:51
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition RingImage.cc:59
float getTheta() const
Access the Opening angle of the ring [rad, 0->pi].
Definition RingImage.cc:61
bool isAvailable() const
check whether the object is actually available
Definition RingImage.cc:71
float getNpe() const
Access the Number of photo-electrons [#].
Definition RingImage.cc:58
static RingImage makeEmpty()
Definition RingImage.cc:54
friend class RingImageCollectionIterator
Definition RingImage.h:46
const edm4hep::Vector3f & getPositionError() const
Access the Error on the position.
Definition RingImage.cc:60
float getThetaError() const
Access the Error on the opening angle.
Definition RingImage.cc:62
podio::ObjectID id() const
Definition RingImage.h:121
const podio::ObjectID getObjectID() const
Definition RingImage.cc:75
RingImage()
default constructor
Definition RingImage.cc:20
Definition RingImageObj.h:17
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::RingImage &obj) const
Definition RingImage.h:153