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