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 {
22class RingImageCollection;
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
33class MutableRingImage;
34class RingImageCollection;
35class RingImageCollectionData;
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(float npe, edm4hep::Vector3f position, edm4hep::Vector3f positionError, float theta, float thetaError, float radius, float radiusError);
58
59 /// copy constructor
60 RingImage(const RingImage& other) = default;
61
62 /// copy-assignment operator
64
65 /// create a mutable deep-copy of the object with identical relations
66 /// if cloneRelations=false, the relations are not cloned and will be empty
67 MutableRingImage clone(bool cloneRelations=true) const;
68
69 /// destructor
70 ~RingImage() = default;
71
72 /// converting constructor from mutable object
73 RingImage(const MutableRingImage& other);
74
75 static RingImage makeEmpty();
76
77public:
78
79 static constexpr auto typeName = "edm4eic::RingImage";
80
81 /// Access the Number of photo-electrons [#]
82 float getNpe() const;
83
84 /// Access the Global position of the cluster [mm]
85 const edm4hep::Vector3f& getPosition() const;
86
87 /// Access the Error on the position
88 const edm4hep::Vector3f& getPositionError() const;
89
90 /// Access the Opening angle of the ring [rad, 0->pi]
91 float getTheta() const;
92
93 /// Access the Error on the opening angle
94 float getThetaError() const;
95
96 /// Access the Radius of the best fit ring [mm]
97 float getRadius() const;
98
99 /// Access the Estimated error from the fit [mm]
100 float getRadiusError() const;
101
102
103
104
105
106 /// check whether the object is actually available
107 bool isAvailable() const;
108 /// disconnect from RingImageObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
110
111 bool operator==(const RingImage& other) const { return m_obj == other.m_obj; }
112 bool operator==(const MutableRingImage& other) const;
113
114 bool operator!=(const RingImage& other) const { return !(*this == other); }
115 bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
116
117 // less comparison operator, so that objects can be e.g. stored in sets.
118 bool operator<(const RingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
119
120 podio::ObjectID id() const { return getObjectID(); }
121
122 const podio::ObjectID getObjectID() const;
123
124 friend void swap(RingImage& a, RingImage& b) {
125 using std::swap;
126 swap(a.m_obj, b.m_obj); // swap out the internal pointers
127 }
128
129private:
130 /// constructor from existing RingImageObj
131 explicit RingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
133
134 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{nullptr};
135};
136
137std::ostream& operator<<(std::ostream& o, const RingImage& value);
138
139#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
140void to_json(nlohmann::json& j, const RingImage& value);
141#endif
142
143
144} // namespace edm4eic
145
146
147#endif
Definition MutableRingImage.h:33
Definition RingImageCollectionData.h:30
Definition RingImageCollection.h:91
Definition RingImageCollection.h:36
Definition RingImage.h:41
RingImage & operator=(RingImage other)
copy-assignment operator
Definition RingImage.cc:34
MutableRingImage clone(bool cloneRelations=true) const
Definition RingImage.cc:39
bool operator==(const RingImage &other) const
Definition RingImage.h:111
bool operator!=(const MutableRingImage &other) const
Definition RingImage.h:115
friend class MutableRingImage
Definition RingImage.h:43
bool operator<(const RingImage &other) const
Definition RingImage.h:118
~RingImage()=default
destructor
void unlink()
disconnect from RingImageObj instance
Definition RingImage.h:109
static constexpr auto typeName
Definition RingImage.h:79
float getRadiusError() const
Access the Estimated error from the fit [mm].
Definition RingImage.cc:64
bool operator!=(const RingImage &other) const
Definition RingImage.h:114
friend void swap(RingImage &a, RingImage &b)
Definition RingImage.h:124
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
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
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:120
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