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