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