EICd
EIC data model
MutableTrackerHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableTrackerHit_H
4#define EICD_MutableTrackerHit_H
5
7// Make the immutable class available from its mutable version but not vice versa
8#include "eicd/TrackerHit.h"
9
10#include "eicd/CovDiag3f.h"
11#include "edm4hep/Vector3f.h"
12#include <cstdint>
13#include "podio/ObjectID.h"
14#include <ostream>
15
16#ifdef PODIO_JSON_OUTPUT
17#include "nlohmann/json.hpp"
18#endif
19
20
21
22namespace eicd {
23
24
25/** @class MutableTrackerHit
26 * Tracker hit (reconstructed from Raw)
27 * @author: W. Armstrong, S. Joosten
28 */
30
33 friend class TrackerHit;
34
35public:
36
37 /// default constructor
39 MutableTrackerHit(std::uint64_t cellID, edm4hep::Vector3f position, eicd::CovDiag3f positionError, float time, float timeError, float edep, float edepError);
40
41 /// constructor from existing TrackerHitObj
43
44 /// copy constructor
46
47 /// copy-assignment operator
49
50 /// create a mutable deep-copy of the object with identical relations
52
53 /// destructor
55
56 /// conversion to const object
57 operator TrackerHit() const;
58
59public:
60
61 /// Access the The detector specific (geometrical) cell id.
62 const std::uint64_t& getCellID() const;
63
64 /// Access the Hit (cell) position and time [mm, ns]
65 const edm4hep::Vector3f& getPosition() const;
66
67 /// Access the Covariance Matrix
68 const eicd::CovDiag3f& getPositionError() const;
69
70 /// Access the Hit time
71 const float& getTime() const;
72
73 /// Access the Error on the time
74 const float& getTimeError() const;
75
76 /// Access the Energy deposit in this hit [GeV]
77 const float& getEdep() const;
78
79 /// Access the Error on the energy deposit [GeV]
80 const float& getEdepError() const;
81
82
83
84 /// Set the The detector specific (geometrical) cell id.
85 void setCellID(std::uint64_t value);
86
87 /// Set the Hit (cell) position and time [mm, ns]
88 void setPosition(edm4hep::Vector3f value);
89 /// Get reference to Hit (cell) position and time [mm, ns]
90 edm4hep::Vector3f& position();
91
92 /// Set the Covariance Matrix
94 /// Get reference to Covariance Matrix
96
97 /// Set the Hit time
98 void setTime(float value);
99
100 /// Set the Error on the time
101 void setTimeError(float value);
102
103 /// Set the Energy deposit in this hit [GeV]
104 void setEdep(float value);
105
106 /// Set the Error on the energy deposit [GeV]
107 void setEdepError(float value);
108
109
110
111
112
113
114 /// check whether the object is actually available
115 bool isAvailable() const;
116 /// disconnect from TrackerHitObj instance
117 void unlink() { m_obj = nullptr; }
118
119 bool operator==(const MutableTrackerHit& other) const { return m_obj == other.m_obj; }
120 bool operator==(const TrackerHit& other) const;
121
122 // less comparison operator, so that objects can be e.g. stored in sets.
123 bool operator<(const MutableTrackerHit& other) const { return m_obj < other.m_obj; }
124
125 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
126
127 const podio::ObjectID getObjectID() const;
128
130 using std::swap;
131 swap(a.m_obj, b.m_obj); // swap out the internal pointers
132 }
133
134private:
135 TrackerHitObj* m_obj;
136};
137
138#ifdef PODIO_JSON_OUTPUT
139void to_json(nlohmann::json& j, const MutableTrackerHit& value);
140#endif
141
142
143} // namespace eicd
144
145
146#endif
Definition: CovDiag3f.h:15
Definition: MutableTrackerHit.h:29
unsigned int id() const
Definition: MutableTrackerHit.h:125
eicd::CovDiag3f & positionError()
Get reference to Covariance Matrix.
Definition: MutableTrackerHit.cc:70
friend class TrackerHit
Definition: MutableTrackerHit.h:33
const float & getTimeError() const
Access the Error on the time.
Definition: MutableTrackerHit.cc:61
~MutableTrackerHit()
destructor
Definition: MutableTrackerHit.cc:50
void setPosition(edm4hep::Vector3f value)
Set the Hit (cell) position and time [mm, ns].
Definition: MutableTrackerHit.cc:67
bool isAvailable() const
check whether the object is actually available
Definition: MutableTrackerHit.cc:82
void setTimeError(float value)
Set the Error on the time.
Definition: MutableTrackerHit.cc:72
void setTime(float value)
Set the Hit time.
Definition: MutableTrackerHit.cc:71
void setPositionError(eicd::CovDiag3f value)
Set the Covariance Matrix.
Definition: MutableTrackerHit.cc:69
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: MutableTrackerHit.cc:57
MutableTrackerHit & operator=(MutableTrackerHit other)
copy-assignment operator
Definition: MutableTrackerHit.cc:35
MutableTrackerHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableTrackerHit.cc:46
edm4hep::Vector3f & position()
Get reference to Hit (cell) position and time [mm, ns].
Definition: MutableTrackerHit.cc:68
const float & getEdepError() const
Access the Error on the energy deposit [GeV].
Definition: MutableTrackerHit.cc:63
const edm4hep::Vector3f & getPosition() const
Access the Hit (cell) position and time [mm, ns].
Definition: MutableTrackerHit.cc:58
const float & getTime() const
Access the Hit time.
Definition: MutableTrackerHit.cc:60
MutableTrackerHit()
default constructor
Definition: MutableTrackerHit.cc:16
const podio::ObjectID getObjectID() const
Definition: MutableTrackerHit.cc:89
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition: MutableTrackerHit.cc:66
void setEdep(float value)
Set the Energy deposit in this hit [GeV].
Definition: MutableTrackerHit.cc:73
const eicd::CovDiag3f & getPositionError() const
Access the Covariance Matrix.
Definition: MutableTrackerHit.cc:59
friend void swap(MutableTrackerHit &a, MutableTrackerHit &b)
Definition: MutableTrackerHit.h:129
const float & getEdep() const
Access the Energy deposit in this hit [GeV].
Definition: MutableTrackerHit.cc:62
bool operator==(const MutableTrackerHit &other) const
Definition: MutableTrackerHit.h:119
bool operator<(const MutableTrackerHit &other) const
Definition: MutableTrackerHit.h:123
void unlink()
disconnect from TrackerHitObj instance
Definition: MutableTrackerHit.h:117
void setEdepError(float value)
Set the Error on the energy deposit [GeV].
Definition: MutableTrackerHit.cc:74
Definition: TrackerHitCollection.h:82
Definition: TrackerHit.h:28
Definition: TrackerHitCollection.h:57
Definition: TrackerHitObj.h:17
Definition: CalorimeterHit.cc:13