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 <ostream>
16#include <cstddef>
17
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
20#endif
21
22// forward declarations
23namespace edm4hep {
24class RawCalorimeterHit;
25class MutableRawCalorimeterHit;
26}
27
28
29namespace edm4eic {
30
31
32/** @class MutableCalorimeterHit
33 * Calorimeter hit
34 * @author: W. Armstrong, S. Joosten
35 */
37
40 friend class CalorimeterHit;
41
42public:
45
46 /// default constructor
48
49 /// Constructor initializing all members
50 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);
51
52 /// copy constructor
54
55 /// copy-assignment operator
57
58 /// create a mutable deep-copy of the object with identical relations
60
61 /// destructor
63
64
65 /// conversion to const object
66 operator CalorimeterHit() const;
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
107 /// Set the The energy for this hit in [GeV].
108 void setEnergy(float value);
109
110 /// Set the Error on energy [GeV].
111 void setEnergyError(float value);
112
113 /// Set the The time of the hit in [ns].
114 void setTime(float value);
115
116 /// Set the Error on the time
117 void setTimeError(float value);
118
119 /// Set the The global position of the hit in world coordinates [mm].
120 void setPosition(edm4hep::Vector3f value);
121 /// Get reference to The global position of the hit in world coordinates [mm].
122 edm4hep::Vector3f& position();
123
124 /// Set the The dimension information of the cell [mm].
125 void setDimension(edm4hep::Vector3f value);
126 /// Get reference to The dimension information of the cell [mm].
127 edm4hep::Vector3f& dimension();
128
129 /// Set the Sector that this hit occurred in
130 void setSector(std::int32_t value);
131
132 /// Set the Layer that the hit occurred in
133 void setLayer(std::int32_t value);
134
135 /// Set the The local coordinates of the hit in the detector segment [mm].
136 void setLocal(edm4hep::Vector3f value);
137 /// Get reference to The local coordinates of the hit in the detector segment [mm].
138 edm4hep::Vector3f& local();
139
140
141 /// Set the Related raw calorimeter hit
142 void setRawHit(edm4hep::RawCalorimeterHit value);
143
144
145
146
147 /// check whether the object is actually available
148 bool isAvailable() const;
149 /// disconnect from CalorimeterHitObj instance
150 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{nullptr}; }
151
152 bool operator==(const MutableCalorimeterHit& other) const { return m_obj == other.m_obj; }
153 bool operator==(const CalorimeterHit& other) const;
154
155 // less comparison operator, so that objects can be e.g. stored in sets.
156 bool operator<(const MutableCalorimeterHit& other) const { return m_obj < other.m_obj; }
157
158 podio::ObjectID id() const { return getObjectID(); }
159
160 const podio::ObjectID getObjectID() const;
161
163 using std::swap;
164 swap(a.m_obj, b.m_obj); // swap out the internal pointers
165 }
166
167private:
168 /// constructor from existing CalorimeterHitObj
169 explicit MutableCalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
170
171 podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{nullptr};
172};
173
174#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
175void to_json(nlohmann::json& j, const MutableCalorimeterHit& value);
176#endif
177
178
179} // namespace edm4eic
180
181
182#endif
Definition CalorimeterHitCollection.h:95
Definition CalorimeterHit.h:37
Definition CalorimeterHitCollection.h:66
Definition MutableCalorimeterHit.h:36
std::int32_t getLayer() const
Access the Layer that the hit occurred in.
Definition MutableCalorimeterHit.cc:59
MutableCalorimeterHit(const MutableCalorimeterHit &other)=default
copy constructor
void unlink()
disconnect from CalorimeterHitObj instance
Definition MutableCalorimeterHit.h:150
MutableCalorimeterHit clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableCalorimeterHit.cc:44
bool operator==(const MutableCalorimeterHit &other) const
Definition MutableCalorimeterHit.h:152
edm4hep::Vector3f & position()
Get reference to The global position of the hit in world coordinates [mm].
Definition MutableCalorimeterHit.cc:76
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:72
MutableCalorimeterHit & operator=(MutableCalorimeterHit other)
copy-assignment operator
Definition MutableCalorimeterHit.cc:39
void setPosition(edm4hep::Vector3f value)
Set the The global position of the hit in world coordinates [mm].
Definition MutableCalorimeterHit.cc:75
void setSector(std::int32_t value)
Set the Sector that this hit occurred in.
Definition MutableCalorimeterHit.cc:79
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:156
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:78
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:22
void setLayer(std::int32_t value)
Set the Layer that the hit occurred in.
Definition MutableCalorimeterHit.cc:80
~MutableCalorimeterHit()=default
destructor
void setTime(float value)
Set the The time of the hit in [ns].
Definition MutableCalorimeterHit.cc:73
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:162
const podio::ObjectID getObjectID() const
Definition MutableCalorimeterHit.cc:104
void setLocal(edm4hep::Vector3f value)
Set the The local coordinates of the hit in the detector segment [mm].
Definition MutableCalorimeterHit.cc:81
void setRawHit(edm4hep::RawCalorimeterHit value)
Set the Related raw calorimeter hit.
Definition MutableCalorimeterHit.cc:84
void setEnergy(float value)
Set the The energy for this hit in [GeV].
Definition MutableCalorimeterHit.cc:71
edm4hep::Vector3f & local()
Get reference to The local coordinates of the hit in the detector segment [mm].
Definition MutableCalorimeterHit.cc:82
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:74
friend class CalorimeterHitCollection
Definition MutableCalorimeterHit.h:38
bool isAvailable() const
check whether the object is actually available
Definition MutableCalorimeterHit.cc:97
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:77
podio::ObjectID id() const
Definition MutableCalorimeterHit.h:158
friend class CalorimeterHit
Definition MutableCalorimeterHit.h:40
const edm4hep::RawCalorimeterHit getRawHit() const
Access the Related raw calorimeter hit.
Definition MutableCalorimeterHit.cc:62
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:18
Definition CalorimeterHit.h:21