EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutablePMTHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutablePMTHit_H
4#define EDM4EIC_MutablePMTHit_H
5
6#include "edm4eic/PMTHitObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/PMTHit.h"
9
10#include "edm4hep/Vector3f.h"
11#include <cstdint>
12
13#include "podio/utilities/MaybeSharedPtr.h"
14
15#include <cstdint>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21
22
23namespace edm4eic {
24
25
26/** @class MutablePMTHit
27 * EIC PMT hit
28 * @author: S. Joosten, C. Peng
29 */
31
32 friend class PMTHitCollection;
34 friend class PMTHit;
35
36public:
39
40 /// default constructor
42
43 /// Constructor initializing all members
44 MutablePMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
45
46 /// copy constructor
47 MutablePMTHit(const MutablePMTHit& other) = default;
48
49 /// copy-assignment operator
51
52 /// create a mutable deep-copy of the object with identical relations
53 /// if cloneRelations=false, the relations are not cloned and will be empty
54 MutablePMTHit clone(bool cloneRelations=true) const;
55
56 /// destructor
57 ~MutablePMTHit() = default;
58
59
60public:
61
62 /// Access the The detector specific (geometrical) cell id.
63 std::uint64_t getCellID() const;
64
65 /// Access the Estimated number of photo-electrons [#]
66 float getNpe() const;
67
68 /// Access the Time [ns]
69 float getTime() const;
70
71 /// Access the Error on the time [ns]
72 float getTimeError() const;
73
74 /// Access the PMT hit position [mm]
75 const edm4hep::Vector3f& getPosition() const;
76
77 /// Access the The dimension information of the pixel [mm].
78 const edm4hep::Vector3f& getDimension() const;
79
80 /// Access the The sector this hit occurred in
81 std::int32_t getSector() const;
82
83 /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
84 const edm4hep::Vector3f& getLocal() const;
85
86
87
88 /// Set the The detector specific (geometrical) cell id.
89 void setCellID(std::uint64_t value);
90 /// Get mutable reference to The detector specific (geometrical) cell id.
91 std::uint64_t& getCellID();
92 /// Get reference to The detector specific (geometrical) cell id.
93 [[deprecated("use getCellID instead")]]
94 std::uint64_t& cellID();
95
96 /// Set the Estimated number of photo-electrons [#]
97 void setNpe(float value);
98 /// Get mutable reference to Estimated number of photo-electrons [#]
99 float& getNpe();
100 /// Get reference to Estimated number of photo-electrons [#]
101 [[deprecated("use getNpe instead")]]
102 float& npe();
103
104 /// Set the Time [ns]
105 void setTime(float value);
106 /// Get mutable reference to Time [ns]
107 float& getTime();
108 /// Get reference to Time [ns]
109 [[deprecated("use getTime instead")]]
110 float& time();
111
112 /// Set the Error on the time [ns]
113 void setTimeError(float value);
114 /// Get mutable reference to Error on the time [ns]
115 float& getTimeError();
116 /// Get reference to Error on the time [ns]
117 [[deprecated("use getTimeError instead")]]
118 float& timeError();
119
120 /// Set the PMT hit position [mm]
121 void setPosition(edm4hep::Vector3f value);
122 /// Get mutable reference to PMT hit position [mm]
123 edm4hep::Vector3f& getPosition();
124 /// Get reference to PMT hit position [mm]
125 [[deprecated("use getPosition instead")]]
126 edm4hep::Vector3f& position();
127
128 /// Set the The dimension information of the pixel [mm].
129 void setDimension(edm4hep::Vector3f value);
130 /// Get mutable reference to The dimension information of the pixel [mm].
131 edm4hep::Vector3f& getDimension();
132 /// Get reference to The dimension information of the pixel [mm].
133 [[deprecated("use getDimension instead")]]
134 edm4hep::Vector3f& dimension();
135
136 /// Set the The sector this hit occurred in
137 void setSector(std::int32_t value);
138 /// Get mutable reference to The sector this hit occurred in
139 std::int32_t& getSector();
140 /// Get reference to The sector this hit occurred in
141 [[deprecated("use getSector instead")]]
142 std::int32_t& sector();
143
144 /// Set the The local position of the hit in detector coordinates (relative to the sector) [mm]
145 void setLocal(edm4hep::Vector3f value);
146 /// Get mutable reference to The local position of the hit in detector coordinates (relative to the sector) [mm]
147 edm4hep::Vector3f& getLocal();
148 /// Get reference to The local position of the hit in detector coordinates (relative to the sector) [mm]
149 [[deprecated("use getLocal instead")]]
150 edm4hep::Vector3f& local();
151
152
153
154
155
156
157 /// check whether the object is actually available
158 bool isAvailable() const;
159 /// disconnect from PMTHitObj instance
160 void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
161
162 bool operator==(const MutablePMTHit& other) const { return m_obj == other.m_obj; }
163 bool operator==(const PMTHit& other) const;
164
165 bool operator!=(const MutablePMTHit& other) const { return !(*this == other); }
166 bool operator!=(const PMTHit& other) const { return !(*this == other); }
167
168 // less comparison operator, so that objects can be e.g. stored in sets.
169 bool operator<(const MutablePMTHit& other) const { return m_obj < other.m_obj; }
170
171 podio::ObjectID id() const { return getObjectID(); }
172
173 const podio::ObjectID getObjectID() const;
174
175 friend void swap(MutablePMTHit& a, MutablePMTHit& b) {
176 using std::swap;
177 swap(a.m_obj, b.m_obj); // swap out the internal pointers
178 }
179
180private:
181 /// constructor from existing PMTHitObj
182 explicit MutablePMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
183
184 podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
185};
186
187#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
188void to_json(nlohmann::json& j, const MutablePMTHit& value);
189#endif
190
191
192} // namespace edm4eic
193
194
195#endif
Definition MutablePMTHit.h:30
bool isAvailable() const
check whether the object is actually available
Definition MutablePMTHit.cc:89
MutablePMTHit clone(bool cloneRelations=true) const
Definition MutablePMTHit.cc:38
void setLocal(edm4hep::Vector3f value)
Set the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition MutablePMTHit.cc:79
bool operator!=(const PMTHit &other) const
Definition MutablePMTHit.h:166
void setDimension(edm4hep::Vector3f value)
Set the The dimension information of the pixel [mm].
Definition MutablePMTHit.cc:73
const edm4hep::Vector3f & getPosition() const
Access the PMT hit position [mm].
Definition MutablePMTHit.cc:52
bool operator!=(const MutablePMTHit &other) const
Definition MutablePMTHit.h:165
MutablePMTHit & operator=(MutablePMTHit other)
copy-assignment operator
Definition MutablePMTHit.cc:33
friend class PMTHitCollection
Definition MutablePMTHit.h:32
void setNpe(float value)
Set the Estimated number of photo-electrons [#].
Definition MutablePMTHit.cc:61
void setTime(float value)
Set the Time [ns].
Definition MutablePMTHit.cc:64
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the pixel [mm].
Definition MutablePMTHit.cc:53
std::int32_t getSector() const
Access the The sector this hit occurred in.
Definition MutablePMTHit.cc:54
float & npe()
Get reference to Estimated number of photo-electrons [#].
Definition MutablePMTHit.cc:63
~MutablePMTHit()=default
destructor
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition MutablePMTHit.cc:58
MutablePMTHit()
default constructor
Definition MutablePMTHit.cc:18
float getNpe() const
Access the Estimated number of photo-electrons [#].
Definition MutablePMTHit.cc:49
bool operator==(const MutablePMTHit &other) const
Definition MutablePMTHit.h:162
void setTimeError(float value)
Set the Error on the time [ns].
Definition MutablePMTHit.cc:67
std::int32_t & sector()
Get reference to The sector this hit occurred in.
Definition MutablePMTHit.cc:78
edm4hep::Vector3f & local()
Get reference to The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition MutablePMTHit.cc:81
float getTimeError() const
Access the Error on the time [ns].
Definition MutablePMTHit.cc:51
friend class PMTHit
Definition MutablePMTHit.h:34
void setPosition(edm4hep::Vector3f value)
Set the PMT hit position [mm].
Definition MutablePMTHit.cc:70
float & time()
Get reference to Time [ns].
Definition MutablePMTHit.cc:66
podio::ObjectID id() const
Definition MutablePMTHit.h:171
const edm4hep::Vector3f & getLocal() const
Access the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition MutablePMTHit.cc:55
float getTime() const
Access the Time [ns].
Definition MutablePMTHit.cc:50
edm4hep::Vector3f & position()
Get reference to PMT hit position [mm].
Definition MutablePMTHit.cc:72
bool operator<(const MutablePMTHit &other) const
Definition MutablePMTHit.h:169
const podio::ObjectID getObjectID() const
Definition MutablePMTHit.cc:93
edm4hep::Vector3f & dimension()
Get reference to The dimension information of the pixel [mm].
Definition MutablePMTHit.cc:75
std::uint64_t & cellID()
Get reference to The detector specific (geometrical) cell id.
Definition MutablePMTHit.cc:60
void setSector(std::int32_t value)
Set the The sector this hit occurred in.
Definition MutablePMTHit.cc:76
friend void swap(MutablePMTHit &a, MutablePMTHit &b)
Definition MutablePMTHit.h:175
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition MutablePMTHit.cc:48
MutablePMTHit(const MutablePMTHit &other)=default
copy constructor
float & timeError()
Get reference to Error on the time [ns].
Definition MutablePMTHit.cc:69
void unlink()
disconnect from PMTHitObj instance
Definition MutablePMTHit.h:160
Definition PMTHitCollection.h:92
Definition PMTHit.h:32
Definition PMTHitCollection.h:63
Definition CalorimeterHit.cc:17