EICd
EIC data model
MutableCalorimeterHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableCalorimeterHit_H
4#define EICD_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#include "podio/ObjectID.h"
13#include <ostream>
14
15#ifdef PODIO_JSON_OUTPUT
16#include "nlohmann/json.hpp"
17#endif
18
19
20
21namespace eicd {
22
23
24/** @class MutableCalorimeterHit
25 * Calorimeter hit
26 * @author: W. Armstrong, S. Joosten
27 */
29
32 friend class CalorimeterHit;
33
34public:
35
36 /// default constructor
38 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);
39
40 /// constructor from existing CalorimeterHitObj
42
43 /// copy constructor
45
46 /// copy-assignment operator
48
49 /// create a mutable deep-copy of the object with identical relations
51
52 /// destructor
54
55 /// conversion to const object
56 operator CalorimeterHit() const;
57
58public:
59
60 /// Access the The detector specific (geometrical) cell id.
61 const std::uint64_t& getCellID() const;
62
63 /// Access the The energy for this hit in [GeV].
64 const float& getEnergy() const;
65
66 /// Access the Error on energy [GeV].
67 const float& getEnergyError() const;
68
69 /// Access the The time of the hit in [ns].
70 const float& getTime() const;
71
72 /// Access the Error on the time
73 const float& getTimeError() const;
74
75 /// Access the The global position of the hit in world coordinates [mm].
76 const edm4hep::Vector3f& getPosition() const;
77
78 /// Access the The dimension information of the cell [mm].
79 const edm4hep::Vector3f& getDimension() const;
80
81 /// Access the Sector that this hit occured in
82 const std::int32_t& getSector() const;
83
84 /// Access the Layer that the hit occured in
85 const std::int32_t& getLayer() const;
86
87 /// Access the The local coordinates of the hit in the detector segment [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
95 /// Set the The energy for this hit in [GeV].
96 void setEnergy(float value);
97
98 /// Set the Error on energy [GeV].
99 void setEnergyError(float value);
100
101 /// Set the The time of the hit in [ns].
102 void setTime(float value);
103
104 /// Set the Error on the time
105 void setTimeError(float value);
106
107 /// Set the The global position of the hit in world coordinates [mm].
108 void setPosition(edm4hep::Vector3f value);
109 /// Get reference to The global position of the hit in world coordinates [mm].
110 edm4hep::Vector3f& position();
111
112 /// Set the The dimension information of the cell [mm].
113 void setDimension(edm4hep::Vector3f value);
114 /// Get reference to The dimension information of the cell [mm].
115 edm4hep::Vector3f& dimension();
116
117 /// Set the Sector that this hit occured in
118 void setSector(std::int32_t value);
119
120 /// Set the Layer that the hit occured in
121 void setLayer(std::int32_t value);
122
123 /// Set the The local coordinates of the hit in the detector segment [mm].
124 void setLocal(edm4hep::Vector3f value);
125 /// Get reference to The local coordinates of the hit in the detector segment [mm].
126 edm4hep::Vector3f& local();
127
128
129
130
131
132
133 /// check whether the object is actually available
134 bool isAvailable() const;
135 /// disconnect from CalorimeterHitObj instance
136 void unlink() { m_obj = nullptr; }
137
138 bool operator==(const MutableCalorimeterHit& other) const { return m_obj == other.m_obj; }
139 bool operator==(const CalorimeterHit& other) const;
140
141 // less comparison operator, so that objects can be e.g. stored in sets.
142 bool operator<(const MutableCalorimeterHit& other) const { return m_obj < other.m_obj; }
143
144 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
145
146 const podio::ObjectID getObjectID() const;
147
149 using std::swap;
150 swap(a.m_obj, b.m_obj); // swap out the internal pointers
151 }
152
153private:
154 CalorimeterHitObj* m_obj;
155};
156
157#ifdef PODIO_JSON_OUTPUT
158void to_json(nlohmann::json& j, const MutableCalorimeterHit& value);
159#endif
160
161
162} // namespace eicd
163
164
165#endif
Definition: CalorimeterHitCollection.h:82
Definition: CalorimeterHit.h:27
Definition: CalorimeterHitCollection.h:57
Definition: CalorimeterHitObj.h:17
Definition: MutableCalorimeterHit.h:28
void setLocal(edm4hep::Vector3f value)
Set the The local coordinates of the hit in the detector segment [mm].
Definition: MutableCalorimeterHit.cc:83
const float & getEnergyError() const
Access the Error on energy [GeV].
Definition: MutableCalorimeterHit.cc:62
edm4hep::Vector3f & local()
Get reference to The local coordinates of the hit in the detector segment [mm].
Definition: MutableCalorimeterHit.cc:84
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition: MutableCalorimeterHit.cc:72
const float & getTimeError() const
Access the Error on the time.
Definition: MutableCalorimeterHit.cc:64
void setEnergyError(float value)
Set the Error on energy [GeV].
Definition: MutableCalorimeterHit.cc:74
void setTimeError(float value)
Set the Error on the time.
Definition: MutableCalorimeterHit.cc:76
const float & getEnergy() const
Access the The energy for this hit in [GeV].
Definition: MutableCalorimeterHit.cc:61
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the cell [mm].
Definition: MutableCalorimeterHit.cc:66
void unlink()
disconnect from CalorimeterHitObj instance
Definition: MutableCalorimeterHit.h:136
void setEnergy(float value)
Set the The energy for this hit in [GeV].
Definition: MutableCalorimeterHit.cc:73
bool operator<(const MutableCalorimeterHit &other) const
Definition: MutableCalorimeterHit.h:142
void setPosition(edm4hep::Vector3f value)
Set the The global position of the hit in world coordinates [mm].
Definition: MutableCalorimeterHit.cc:77
MutableCalorimeterHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableCalorimeterHit.cc:49
void setDimension(edm4hep::Vector3f value)
Set the The dimension information of the cell [mm].
Definition: MutableCalorimeterHit.cc:79
bool operator==(const MutableCalorimeterHit &other) const
Definition: MutableCalorimeterHit.h:138
friend void swap(MutableCalorimeterHit &a, MutableCalorimeterHit &b)
Definition: MutableCalorimeterHit.h:148
void setSector(std::int32_t value)
Set the Sector that this hit occured in.
Definition: MutableCalorimeterHit.cc:81
const edm4hep::Vector3f & getPosition() const
Access the The global position of the hit in world coordinates [mm].
Definition: MutableCalorimeterHit.cc:65
~MutableCalorimeterHit()
destructor
Definition: MutableCalorimeterHit.cc:53
bool isAvailable() const
check whether the object is actually available
Definition: MutableCalorimeterHit.cc:92
MutableCalorimeterHit & operator=(MutableCalorimeterHit other)
copy-assignment operator
Definition: MutableCalorimeterHit.cc:38
MutableCalorimeterHit()
default constructor
Definition: MutableCalorimeterHit.cc:16
edm4hep::Vector3f & position()
Get reference to The global position of the hit in world coordinates [mm].
Definition: MutableCalorimeterHit.cc:78
const std::int32_t & getSector() const
Access the Sector that this hit occured in.
Definition: MutableCalorimeterHit.cc:67
edm4hep::Vector3f & dimension()
Get reference to The dimension information of the cell [mm].
Definition: MutableCalorimeterHit.cc:80
const podio::ObjectID getObjectID() const
Definition: MutableCalorimeterHit.cc:99
friend class CalorimeterHit
Definition: MutableCalorimeterHit.h:32
void setTime(float value)
Set the The time of the hit in [ns].
Definition: MutableCalorimeterHit.cc:75
const std::int32_t & getLayer() const
Access the Layer that the hit occured in.
Definition: MutableCalorimeterHit.cc:68
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: MutableCalorimeterHit.cc:60
const float & getTime() const
Access the The time of the hit in [ns].
Definition: MutableCalorimeterHit.cc:63
unsigned int id() const
Definition: MutableCalorimeterHit.h:144
const edm4hep::Vector3f & getLocal() const
Access the The local coordinates of the hit in the detector segment [mm].
Definition: MutableCalorimeterHit.cc:69
void setLayer(std::int32_t value)
Set the Layer that the hit occured in.
Definition: MutableCalorimeterHit.cc:82
Definition: CalorimeterHit.cc:13