EICd
EIC data model
RingImage.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_RingImage_H
4#define EICD_RingImage_H
5
6#include "eicd/RingImageObj.h"
7
8#include "edm4hep/Vector3f.h"
9#include "podio/ObjectID.h"
10#include <ostream>
11
12#ifdef PODIO_JSON_OUTPUT
13#include "nlohmann/json.hpp"
14#endif
15
16
17
18namespace eicd {
19
20class MutableRingImage;
21
22/** @class RingImage
23 * EIC Ring Image Cluster
24 * @author: S. Joosten, C. Peng
25 */
26class RingImage {
27
28 friend class MutableRingImage;
29 friend class RingImageCollection;
31
32public:
33 /// default constructor
34 RingImage();
35 RingImage(float npe, edm4hep::Vector3f position, edm4hep::Vector3f positionError, float theta, float thetaError, float radius, float radiusError);
36
37 /// constructor from existing RingImageObj
39
40 /// copy constructor
41 RingImage(const RingImage& other);
42
43 /// copy-assignment operator
45
46 /// create a mutable deep-copy of the object with identical relations
47 MutableRingImage clone() const;
48
49 /// destructor
50 ~RingImage();
51
52
53public:
54
55 /// Access the Number of photo-electrons [#]
56 const float& getNpe() const;
57
58 /// Access the Global position of the cluster [mm]
59 const edm4hep::Vector3f& getPosition() const;
60
61 /// Access the Error on the position
62 const edm4hep::Vector3f& getPositionError() const;
63
64 /// Access the Opening angle of the ring [rad, 0->pi]
65 const float& getTheta() const;
66
67 /// Access the Error on the opening angle
68 const float& getThetaError() const;
69
70 /// Access the Radius of the best fit ring [mm]
71 const float& getRadius() const;
72
73 /// Access the Estimated error from the fit [mm]
74 const float& getRadiusError() const;
75
76
77
78
79
80 /// check whether the object is actually available
81 bool isAvailable() const;
82 /// disconnect from RingImageObj instance
83 void unlink() { m_obj = nullptr; }
84
85 bool operator==(const RingImage& other) const { return m_obj == other.m_obj; }
86 bool operator==(const MutableRingImage& other) const;
87
88 // less comparison operator, so that objects can be e.g. stored in sets.
89 bool operator<(const RingImage& other) const { return m_obj < other.m_obj; }
90
91 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
92
93 const podio::ObjectID getObjectID() const;
94
95 friend void swap(RingImage& a, RingImage& b) {
96 using std::swap;
97 swap(a.m_obj, b.m_obj); // swap out the internal pointers
98 }
99
100private:
101 RingImageObj* m_obj;
102};
103
104std::ostream& operator<<(std::ostream& o, const RingImage& value);
105
106#ifdef PODIO_JSON_OUTPUT
107void to_json(nlohmann::json& j, const RingImage& value);
108#endif
109
110
111} // namespace eicd
112
113
114#endif
Definition: MutableRingImage.h:27
Definition: RingImageCollection.h:82
Definition: RingImageCollection.h:35
Definition: RingImage.h:26
const float & getThetaError() const
Access the Error on the opening angle.
Definition: RingImage.cc:60
bool operator<(const RingImage &other) const
Definition: RingImage.h:89
bool operator==(const RingImage &other) const
Definition: RingImage.h:85
unsigned int id() const
Definition: RingImage.h:91
const podio::ObjectID getObjectID() const
Definition: RingImage.cc:76
const edm4hep::Vector3f & getPosition() const
Access the Global position of the cluster [mm].
Definition: RingImage.cc:57
~RingImage()
destructor
Definition: RingImage.cc:50
friend void swap(RingImage &a, RingImage &b)
Definition: RingImage.h:95
RingImage & operator=(RingImage other)
copy-assignment operator
Definition: RingImage.cc:35
void unlink()
disconnect from RingImageObj instance
Definition: RingImage.h:83
const float & getRadius() const
Access the Radius of the best fit ring [mm].
Definition: RingImage.cc:61
const float & getNpe() const
Access the Number of photo-electrons [#].
Definition: RingImage.cc:56
bool isAvailable() const
check whether the object is actually available
Definition: RingImage.cc:69
const edm4hep::Vector3f & getPositionError() const
Access the Error on the position.
Definition: RingImage.cc:58
MutableRingImage clone() const
create a mutable deep-copy of the object with identical relations
Definition: RingImage.cc:46
RingImage()
default constructor
Definition: RingImage.cc:16
const float & getTheta() const
Access the Opening angle of the ring [rad, 0->pi].
Definition: RingImage.cc:59
const float & getRadiusError() const
Access the Estimated error from the fit [mm].
Definition: RingImage.cc:62
Definition: RingImageObj.h:17
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93