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