EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrackerHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrackerHit_H
4#define EDM4EIC_MutableTrackerHit_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include "edm4eic/CovDiag3f.h"
11#include "edm4hep/Vector3f.h"
12#include <cstdint>
13
14#include "podio/utilities/MaybeSharedPtr.h"
15
16#include <cstdint>
17
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
20#endif
21
22// forward declarations
23namespace edm4eic {
24class TrackerHitCollection;
25class RawTrackerHit;
26class MutableRawTrackerHit;
27}
28
29
30namespace edm4eic {
31
32
33/** @class MutableTrackerHit
34 * Tracker hit (reconstructed from Raw)
35 * @author: W. Armstrong, S. Joosten
36 */
38
41 friend class TrackerHit;
42
43public:
46
47 /// default constructor
49
50 /// Constructor initializing all members
51 MutableTrackerHit(std::uint64_t cellID, edm4hep::Vector3f position, edm4eic::CovDiag3f positionError, float time, float timeError, float edep, float edepError);
52
53 /// copy constructor
54 MutableTrackerHit(const MutableTrackerHit& other) = default;
55
56 /// copy-assignment operator
58
59 /// create a mutable deep-copy of the object with identical relations
60 /// if cloneRelations=false, the relations are not cloned and will be empty
61 MutableTrackerHit clone(bool cloneRelations=true) const;
62
63 /// destructor
64 ~MutableTrackerHit() = default;
65
66
67public:
68
69 /// Access the The detector specific (geometrical) cell id.
70 std::uint64_t getCellID() const;
71
72 /// Access the Hit (cell) position [mm]
73 const edm4hep::Vector3f& getPosition() const;
74
75 /// Access the Covariance Matrix
77
78 /// Access the Hit time [ns]
79 float getTime() const;
80
81 /// Access the Error on the time
82 float getTimeError() const;
83
84 /// Access the Energy deposit in this hit [GeV]
85 float getEdep() const;
86
87 /// Access the Error on the energy deposit [GeV]
88 float getEdepError() const;
89
90
91 /// Access the Related raw tracker hit
93
94 /// Set the The detector specific (geometrical) cell id.
95 void setCellID(std::uint64_t value);
96 /// Get mutable reference to The detector specific (geometrical) cell id.
97 std::uint64_t& getCellID();
98 /// Get reference to The detector specific (geometrical) cell id.
99 [[deprecated("use getCellID instead")]]
100 std::uint64_t& cellID();
101
102 /// Set the Hit (cell) position [mm]
103 void setPosition(edm4hep::Vector3f value);
104 /// Get mutable reference to Hit (cell) position [mm]
105 edm4hep::Vector3f& getPosition();
106 /// Get reference to Hit (cell) position [mm]
107 [[deprecated("use getPosition instead")]]
108 edm4hep::Vector3f& position();
109
110 /// Set the Covariance Matrix
112 /// Get mutable reference to Covariance Matrix
114 /// Get reference to Covariance Matrix
115 [[deprecated("use getPositionError instead")]]
117
118 /// Set the Hit time [ns]
119 void setTime(float value);
120 /// Get mutable reference to Hit time [ns]
121 float& getTime();
122 /// Get reference to Hit time [ns]
123 [[deprecated("use getTime instead")]]
124 float& time();
125
126 /// Set the Error on the time
127 void setTimeError(float value);
128 /// Get mutable reference to Error on the time
129 float& getTimeError();
130 /// Get reference to Error on the time
131 [[deprecated("use getTimeError instead")]]
132 float& timeError();
133
134 /// Set the Energy deposit in this hit [GeV]
135 void setEdep(float value);
136 /// Get mutable reference to Energy deposit in this hit [GeV]
137 float& getEdep();
138 /// Get reference to Energy deposit in this hit [GeV]
139 [[deprecated("use getEdep instead")]]
140 float& edep();
141
142 /// Set the Error on the energy deposit [GeV]
143 void setEdepError(float value);
144 /// Get mutable reference to Error on the energy deposit [GeV]
145 float& getEdepError();
146 /// Get reference to Error on the energy deposit [GeV]
147 [[deprecated("use getEdepError instead")]]
148 float& edepError();
149
150
151 /// Set the Related raw tracker hit
152 void setRawHit(const edm4eic::RawTrackerHit& value);
153
154
155
156
157 /// check whether the object is actually available
158 bool isAvailable() const;
159 /// disconnect from TrackerHitObj instance
160 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitObj>{nullptr}; }
161
162 bool operator==(const MutableTrackerHit& other) const { return m_obj == other.m_obj; }
163 bool operator==(const TrackerHit& other) const;
164
165 bool operator!=(const MutableTrackerHit& other) const { return !(*this == other); }
166 bool operator!=(const TrackerHit& other) const { return !(*this == other); }
167
168 // less comparison operator, so that objects can be e.g. stored in sets.
169 bool operator<(const MutableTrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
170
171 podio::ObjectID id() const { return getObjectID(); }
172
173 const podio::ObjectID getObjectID() const;
174
176 using std::swap;
177 swap(a.m_obj, b.m_obj); // swap out the internal pointers
178 }
179
180private:
181 /// constructor from existing TrackerHitObj
182 explicit MutableTrackerHit(podio::utils::MaybeSharedPtr<TrackerHitObj> obj);
183
184 podio::utils::MaybeSharedPtr<TrackerHitObj> m_obj{nullptr};
185};
186
187#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
188void to_json(nlohmann::json& j, const MutableTrackerHit& value);
189#endif
190
191
192} // namespace edm4eic
193
194
195#endif
Definition CovDiag3f.h:18
Definition MutableTrackerHit.h:37
friend class TrackerHitCollection
Definition MutableTrackerHit.h:39
~MutableTrackerHit()=default
destructor
void setRawHit(const edm4eic::RawTrackerHit &value)
Set the Related raw tracker hit.
Definition MutableTrackerHit.cc:86
friend class TrackerHit
Definition MutableTrackerHit.h:41
std::uint64_t & cellID()
Get reference to The detector specific (geometrical) cell id.
Definition MutableTrackerHit.cc:66
void setTime(float value)
Set the Hit time [ns].
Definition MutableTrackerHit.cc:73
const podio::ObjectID getObjectID() const
Definition MutableTrackerHit.cc:100
MutableTrackerHit & operator=(MutableTrackerHit other)
copy-assignment operator
Definition MutableTrackerHit.cc:33
float & time()
Get reference to Hit time [ns].
Definition MutableTrackerHit.cc:75
float getEdep() const
Access the Energy deposit in this hit [GeV].
Definition MutableTrackerHit.cc:53
edm4eic::CovDiag3f & positionError()
Get reference to Covariance Matrix.
Definition MutableTrackerHit.cc:72
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackerHit.cc:96
float getTimeError() const
Access the Error on the time.
Definition MutableTrackerHit.cc:52
void setPositionError(edm4eic::CovDiag3f value)
Set the Covariance Matrix.
Definition MutableTrackerHit.cc:70
void unlink()
disconnect from TrackerHitObj instance
Definition MutableTrackerHit.h:160
bool operator!=(const TrackerHit &other) const
Definition MutableTrackerHit.h:166
float getTime() const
Access the Hit time [ns].
Definition MutableTrackerHit.cc:51
bool operator<(const MutableTrackerHit &other) const
Definition MutableTrackerHit.h:169
const edm4eic::RawTrackerHit getRawHit() const
Access the Related raw tracker hit.
Definition MutableTrackerHit.cc:56
float & edepError()
Get reference to Error on the energy deposit [GeV].
Definition MutableTrackerHit.cc:84
MutableTrackerHit clone(bool cloneRelations=true) const
Definition MutableTrackerHit.cc:38
float & edep()
Get reference to Energy deposit in this hit [GeV].
Definition MutableTrackerHit.cc:81
float & timeError()
Get reference to Error on the time.
Definition MutableTrackerHit.cc:78
void setTimeError(float value)
Set the Error on the time.
Definition MutableTrackerHit.cc:76
void setEdepError(float value)
Set the Error on the energy deposit [GeV].
Definition MutableTrackerHit.cc:82
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition MutableTrackerHit.cc:64
const edm4eic::CovDiag3f & getPositionError() const
Access the Covariance Matrix.
Definition MutableTrackerHit.cc:50
bool operator!=(const MutableTrackerHit &other) const
Definition MutableTrackerHit.h:165
void setPosition(edm4hep::Vector3f value)
Set the Hit (cell) position [mm].
Definition MutableTrackerHit.cc:67
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition MutableTrackerHit.cc:48
const edm4hep::Vector3f & getPosition() const
Access the Hit (cell) position [mm].
Definition MutableTrackerHit.cc:49
void setEdep(float value)
Set the Energy deposit in this hit [GeV].
Definition MutableTrackerHit.cc:79
friend void swap(MutableTrackerHit &a, MutableTrackerHit &b)
Definition MutableTrackerHit.h:175
edm4hep::Vector3f & position()
Get reference to Hit (cell) position [mm].
Definition MutableTrackerHit.cc:69
bool operator==(const MutableTrackerHit &other) const
Definition MutableTrackerHit.h:162
MutableTrackerHit(const MutableTrackerHit &other)=default
copy constructor
MutableTrackerHit()
default constructor
Definition MutableTrackerHit.cc:19
float getEdepError() const
Access the Error on the energy deposit [GeV].
Definition MutableTrackerHit.cc:54
podio::ObjectID id() const
Definition MutableTrackerHit.h:171
Definition RawTrackerHit.h:41
Definition TrackerHitCollection.h:91
Definition TrackerHit.h:45
Definition TrackerHitCollection.h:62
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150