EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableCalorimeterHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableCalorimeterHit_H
4#define EDM4EIC_MutableCalorimeterHit_H
5
7// Make the immutable class available from its mutable version but not vice versa
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 edm4hep {
23class RawCalorimeterHit;
24class MutableRawCalorimeterHit;
25}
26
27
28namespace edm4eic {
29
30
31/** @class MutableCalorimeterHit
32 * Calorimeter hit
33 * @author: W. Armstrong, S. Joosten
34 */
36
39 friend class CalorimeterHit;
40
41public:
44
45 /// default constructor
47
48 /// Constructor initializing all members
49 MutableCalorimeterHit(std::uint64_t cellID, float energy, float energyError, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, std::int32_t layer, edm4hep::Vector3f local);
50
51 /// copy constructor
53
54 /// copy-assignment operator
56
57 /// create a mutable deep-copy of the object with identical relations
58 /// if cloneRelations=false, the relations are not cloned and will be empty
59 MutableCalorimeterHit clone(bool cloneRelations=true) const;
60
61 /// destructor
63
64
65public:
66
67 /// Access the The detector specific (geometrical) cell id.
68 std::uint64_t getCellID() const;
69
70 /// Access the The energy for this hit in [GeV].
71 float getEnergy() const;
72
73 /// Access the Error on energy [GeV].
74 float getEnergyError() const;
75
76 /// Access the The time of the hit in [ns].
77 float getTime() const;
78
79 /// Access the Error on the time
80 float getTimeError() const;
81
82 /// Access the The global position of the hit in world coordinates [mm].
83 const edm4hep::Vector3f& getPosition() const;
84
85 /// Access the The dimension information of the cell [mm].
86 const edm4hep::Vector3f& getDimension() const;
87
88 /// Access the Sector that this hit occurred in
89 std::int32_t getSector() const;
90
91 /// Access the Layer that the hit occurred in
92 std::int32_t getLayer() const;
93
94 /// Access the The local coordinates of the hit in the detector segment [mm].
95 const edm4hep::Vector3f& getLocal() const;
96
97
98 /// Access the Related raw calorimeter hit
99 const edm4hep::RawCalorimeterHit getRawHit() const;
100
101 /// Set the The detector specific (geometrical) cell id.
102 void setCellID(std::uint64_t value);
103 /// Get mutable reference to The detector specific (geometrical) cell id.
104 std::uint64_t& getCellID();
105 /// Get reference to The detector specific (geometrical) cell id.
106 [[deprecated("use getCellID instead")]]
107 std::uint64_t& cellID();
108
109 /// Set the The energy for this hit in [GeV].
110 void setEnergy(float value);
111 /// Get mutable reference to The energy for this hit in [GeV].
112 float& getEnergy();
113 /// Get reference to The energy for this hit in [GeV].
114 [[deprecated("use getEnergy instead")]]
115 float& energy();
116
117 /// Set the Error on energy [GeV].
118 void setEnergyError(float value);
119 /// Get mutable reference to Error on energy [GeV].
120 float& getEnergyError();
121 /// Get reference to Error on energy [GeV].
122 [[deprecated("use getEnergyError instead")]]
123 float& energyError();
124
125 /// Set the The time of the hit in [ns].
126 void setTime(float value);
127 /// Get mutable reference to The time of the hit in [ns].
128 float& getTime();
129 /// Get reference to The time of the hit in [ns].
130 [[deprecated("use getTime instead")]]
131 float& time();
132
133 /// Set the Error on the time
134 void setTimeError(float value);
135 /// Get mutable reference to Error on the time
136 float& getTimeError();
137 /// Get reference to Error on the time
138 [[deprecated("use getTimeError instead")]]
139 float& timeError();
140
141 /// Set the The global position of the hit in world coordinates [mm].
142 void setPosition(edm4hep::Vector3f value);
143 /// Get mutable reference to The global position of the hit in world coordinates [mm].
144 edm4hep::Vector3f& getPosition();
145 /// Get reference to The global position of the hit in world coordinates [mm].
146 [[deprecated("use getPosition instead")]]
147 edm4hep::Vector3f& position();
148
149 /// Set the The dimension information of the cell [mm].
150 void setDimension(edm4hep::Vector3f value);
151 /// Get mutable reference to The dimension information of the cell [mm].
152 edm4hep::Vector3f& getDimension();
153 /// Get reference to The dimension information of the cell [mm].
154 [[deprecated("use getDimension instead")]]
155 edm4hep::Vector3f& dimension();
156
157 /// Set the Sector that this hit occurred in
158 void setSector(std::int32_t value);
159 /// Get mutable reference to Sector that this hit occurred in
160 std::int32_t& getSector();
161 /// Get reference to Sector that this hit occurred in
162 [[deprecated("use getSector instead")]]
163 std::int32_t& sector();
164
165 /// Set the Layer that the hit occurred in
166 void setLayer(std::int32_t value);
167 /// Get mutable reference to Layer that the hit occurred in
168 std::int32_t& getLayer();
169 /// Get reference to Layer that the hit occurred in
170 [[deprecated("use getLayer instead")]]
171 std::int32_t& layer();
172
173 /// Set the The local coordinates of the hit in the detector segment [mm].
174 void setLocal(edm4hep::Vector3f value);
175 /// Get mutable reference to The local coordinates of the hit in the detector segment [mm].
176 edm4hep::Vector3f& getLocal();
177 /// Get reference to The local coordinates of the hit in the detector segment [mm].
178 [[deprecated("use getLocal instead")]]
179 edm4hep::Vector3f& local();
180
181
182 /// Set the Related raw calorimeter hit
183 void setRawHit(const edm4hep::RawCalorimeterHit& value);
184
185
186
187
188 /// check whether the object is actually available
189 bool isAvailable() const;
190 /// disconnect from CalorimeterHitObj instance
191 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{nullptr}; }
192
193 bool operator==(const MutableCalorimeterHit& other) const { return m_obj == other.m_obj; }
194 bool operator==(const CalorimeterHit& other) const;
195
196 bool operator!=(const MutableCalorimeterHit& other) const { return !(*this == other); }
197 bool operator!=(const CalorimeterHit& other) const { return !(*this == other); }
198
199 // less comparison operator, so that objects can be e.g. stored in sets.
200 bool operator<(const MutableCalorimeterHit& other) const { return m_obj < other.m_obj; }
201
202 podio::ObjectID id() const { return getObjectID(); }
203
204 const podio::ObjectID getObjectID() const;
205
207 using std::swap;
208 swap(a.m_obj, b.m_obj); // swap out the internal pointers
209 }
210
211private:
212 /// constructor from existing CalorimeterHitObj
213 explicit MutableCalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
214
215 podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{nullptr};
216};
217
218#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
219void to_json(nlohmann::json& j, const MutableCalorimeterHit& value);
220#endif
221
222
223} // namespace edm4eic
224
225
226#endif
Definition CalorimeterHitCollection.h:92
Definition CalorimeterHit.h:37
Definition CalorimeterHitCollection.h:63
Definition MutableCalorimeterHit.h:35
std::int32_t getLayer() const
Access the Layer that the hit occurred in.
Definition MutableCalorimeterHit.cc:59
MutableCalorimeterHit(const MutableCalorimeterHit &other)=default
copy constructor
float & time()
Get reference to The time of the hit in [ns].
Definition MutableCalorimeterHit.cc:81
std::int32_t & layer()
Get reference to Layer that the hit occurred in.
Definition MutableCalorimeterHit.cc:96
void unlink()
disconnect from CalorimeterHitObj instance
Definition MutableCalorimeterHit.h:191
MutableCalorimeterHit clone(bool cloneRelations=true) const
Definition MutableCalorimeterHit.cc:41
bool operator==(const MutableCalorimeterHit &other) const
Definition MutableCalorimeterHit.h:193
edm4hep::Vector3f & position()
Get reference to The global position of the hit in world coordinates [mm].
Definition MutableCalorimeterHit.cc:87
bool operator!=(const CalorimeterHit &other) const
Definition MutableCalorimeterHit.h:197
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition MutableCalorimeterHit.cc:70
void setEnergyError(float value)
Set the Error on energy [GeV].
Definition MutableCalorimeterHit.cc:76
MutableCalorimeterHit & operator=(MutableCalorimeterHit other)
copy-assignment operator
Definition MutableCalorimeterHit.cc:36
float & energy()
Get reference to The energy for this hit in [GeV].
Definition MutableCalorimeterHit.cc:75
std::int32_t & sector()
Get reference to Sector that this hit occurred in.
Definition MutableCalorimeterHit.cc:93
void setPosition(edm4hep::Vector3f value)
Set the The global position of the hit in world coordinates [mm].
Definition MutableCalorimeterHit.cc:85
void setSector(std::int32_t value)
Set the Sector that this hit occurred in.
Definition MutableCalorimeterHit.cc:91
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition MutableCalorimeterHit.cc:51
bool operator<(const MutableCalorimeterHit &other) const
Definition MutableCalorimeterHit.h:200
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the cell [mm].
Definition MutableCalorimeterHit.cc:57
const edm4hep::Vector3f & getPosition() const
Access the The global position of the hit in world coordinates [mm].
Definition MutableCalorimeterHit.cc:56
edm4hep::Vector3f & dimension()
Get reference to The dimension information of the cell [mm].
Definition MutableCalorimeterHit.cc:90
float getEnergy() const
Access the The energy for this hit in [GeV].
Definition MutableCalorimeterHit.cc:52
float getTimeError() const
Access the Error on the time.
Definition MutableCalorimeterHit.cc:55
MutableCalorimeterHit()
default constructor
Definition MutableCalorimeterHit.cc:19
void setLayer(std::int32_t value)
Set the Layer that the hit occurred in.
Definition MutableCalorimeterHit.cc:94
~MutableCalorimeterHit()=default
destructor
void setTime(float value)
Set the The time of the hit in [ns].
Definition MutableCalorimeterHit.cc:79
std::int32_t getSector() const
Access the Sector that this hit occurred in.
Definition MutableCalorimeterHit.cc:58
friend void swap(MutableCalorimeterHit &a, MutableCalorimeterHit &b)
Definition MutableCalorimeterHit.h:206
const podio::ObjectID getObjectID() const
Definition MutableCalorimeterHit.cc:116
void setLocal(edm4hep::Vector3f value)
Set the The local coordinates of the hit in the detector segment [mm].
Definition MutableCalorimeterHit.cc:97
void setEnergy(float value)
Set the The energy for this hit in [GeV].
Definition MutableCalorimeterHit.cc:73
edm4hep::Vector3f & local()
Get reference to The local coordinates of the hit in the detector segment [mm].
Definition MutableCalorimeterHit.cc:99
float & timeError()
Get reference to Error on the time.
Definition MutableCalorimeterHit.cc:84
float & energyError()
Get reference to Error on energy [GeV].
Definition MutableCalorimeterHit.cc:78
float getTime() const
Access the The time of the hit in [ns].
Definition MutableCalorimeterHit.cc:54
void setTimeError(float value)
Set the Error on the time.
Definition MutableCalorimeterHit.cc:82
std::uint64_t & cellID()
Get reference to The detector specific (geometrical) cell id.
Definition MutableCalorimeterHit.cc:72
friend class CalorimeterHitCollection
Definition MutableCalorimeterHit.h:37
bool operator!=(const MutableCalorimeterHit &other) const
Definition MutableCalorimeterHit.h:196
bool isAvailable() const
check whether the object is actually available
Definition MutableCalorimeterHit.cc:112
float getEnergyError() const
Access the Error on energy [GeV].
Definition MutableCalorimeterHit.cc:53
void setDimension(edm4hep::Vector3f value)
Set the The dimension information of the cell [mm].
Definition MutableCalorimeterHit.cc:88
podio::ObjectID id() const
Definition MutableCalorimeterHit.h:202
friend class CalorimeterHit
Definition MutableCalorimeterHit.h:39
const edm4hep::RawCalorimeterHit getRawHit() const
Access the Related raw calorimeter hit.
Definition MutableCalorimeterHit.cc:62
void setRawHit(const edm4hep::RawCalorimeterHit &value)
Set the Related raw calorimeter hit.
Definition MutableCalorimeterHit.cc:101
const edm4hep::Vector3f & getLocal() const
Access the The local coordinates of the hit in the detector segment [mm].
Definition MutableCalorimeterHit.cc:60
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:21