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 <ostream>
17#include <cstddef>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23// forward declarations
24namespace edm4eic {
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
61
62 /// destructor
63 ~MutableTrackerHit() = default;
64
65
66 /// conversion to const object
67 operator TrackerHit() const;
68
69public:
70
71 /// Access the The detector specific (geometrical) cell id.
72 std::uint64_t getCellID() const;
73
74 /// Access the Hit (cell) position [mm]
75 const edm4hep::Vector3f& getPosition() const;
76
77 /// Access the Covariance Matrix
79
80 /// Access the Hit time [ns]
81 float getTime() const;
82
83 /// Access the Error on the time
84 float getTimeError() const;
85
86 /// Access the Energy deposit in this hit [GeV]
87 float getEdep() const;
88
89 /// Access the Error on the energy deposit [GeV]
90 float getEdepError() const;
91
92
93 /// Access the Related raw tracker hit
95
96 /// Set the The detector specific (geometrical) cell id.
97 void setCellID(std::uint64_t value);
98
99 /// Set the Hit (cell) position [mm]
100 void setPosition(edm4hep::Vector3f value);
101 /// Get reference to Hit (cell) position [mm]
102 edm4hep::Vector3f& position();
103
104 /// Set the Covariance Matrix
106 /// Get reference to Covariance Matrix
108
109 /// Set the Hit time [ns]
110 void setTime(float value);
111
112 /// Set the Error on the time
113 void setTimeError(float value);
114
115 /// Set the Energy deposit in this hit [GeV]
116 void setEdep(float value);
117
118 /// Set the Error on the energy deposit [GeV]
119 void setEdepError(float value);
120
121
122 /// Set the Related raw tracker hit
124
125
126
127
128 /// check whether the object is actually available
129 bool isAvailable() const;
130 /// disconnect from TrackerHitObj instance
131 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitObj>{nullptr}; }
132
133 bool operator==(const MutableTrackerHit& other) const { return m_obj == other.m_obj; }
134 bool operator==(const TrackerHit& other) const;
135
136 // less comparison operator, so that objects can be e.g. stored in sets.
137 bool operator<(const MutableTrackerHit& other) const { return m_obj < other.m_obj; }
138
139 podio::ObjectID id() const { return getObjectID(); }
140
141 const podio::ObjectID getObjectID() const;
142
144 using std::swap;
145 swap(a.m_obj, b.m_obj); // swap out the internal pointers
146 }
147
148private:
149 /// constructor from existing TrackerHitObj
150 explicit MutableTrackerHit(podio::utils::MaybeSharedPtr<TrackerHitObj> obj);
151
152 podio::utils::MaybeSharedPtr<TrackerHitObj> m_obj{nullptr};
153};
154
155#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
156void to_json(nlohmann::json& j, const MutableTrackerHit& value);
157#endif
158
159
160} // namespace edm4eic
161
162
163#endif
Definition CovDiag3f.h:18
Definition MutableTrackerHit.h:37
friend class TrackerHitCollection
Definition MutableTrackerHit.h:39
~MutableTrackerHit()=default
destructor
friend class TrackerHit
Definition MutableTrackerHit.h:41
void setTime(float value)
Set the Hit time [ns].
Definition MutableTrackerHit.cc:69
const podio::ObjectID getObjectID() const
Definition MutableTrackerHit.cc:94
MutableTrackerHit & operator=(MutableTrackerHit other)
copy-assignment operator
Definition MutableTrackerHit.cc:36
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:68
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackerHit.cc:87
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:67
void unlink()
disconnect from TrackerHitObj instance
Definition MutableTrackerHit.h:131
float getTime() const
Access the Hit time [ns].
Definition MutableTrackerHit.cc:51
bool operator<(const MutableTrackerHit &other) const
Definition MutableTrackerHit.h:137
const edm4eic::RawTrackerHit getRawHit() const
Access the Related raw tracker hit.
Definition MutableTrackerHit.cc:56
void setTimeError(float value)
Set the Error on the time.
Definition MutableTrackerHit.cc:70
void setEdepError(float value)
Set the Error on the energy deposit [GeV].
Definition MutableTrackerHit.cc:72
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
void setPosition(edm4hep::Vector3f value)
Set the Hit (cell) position [mm].
Definition MutableTrackerHit.cc:65
void setRawHit(edm4eic::RawTrackerHit value)
Set the Related raw tracker hit.
Definition MutableTrackerHit.cc:74
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:71
friend void swap(MutableTrackerHit &a, MutableTrackerHit &b)
Definition MutableTrackerHit.h:143
edm4hep::Vector3f & position()
Get reference to Hit (cell) position [mm].
Definition MutableTrackerHit.cc:66
bool operator==(const MutableTrackerHit &other) const
Definition MutableTrackerHit.h:133
MutableTrackerHit(const MutableTrackerHit &other)=default
copy constructor
MutableTrackerHit()
default constructor
Definition MutableTrackerHit.cc:22
float getEdepError() const
Access the Error on the energy deposit [GeV].
Definition MutableTrackerHit.cc:54
MutableTrackerHit clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableTrackerHit.cc:41
podio::ObjectID id() const
Definition MutableTrackerHit.h:139
Definition RawTrackerHit.h:31
Definition TrackerHitCollection.h:95
Definition TrackerHit.h:38
Definition TrackerHitCollection.h:66
Definition CalorimeterHit.cc:18