EDM4eic
EIC data model
Loading...
Searching...
No Matches
TrackerHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_TrackerHit_H
4#define EDM4EIC_TrackerHit_H
5
7
8#include "edm4eic/CovDiag3f.h"
9#include "edm4hep/Vector3f.h"
10#include <cstdint>
11
12#include "podio/utilities/MaybeSharedPtr.h"
13
14#include <ostream>
15#include <cstdint>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21// forward declarations
22namespace edm4eic {
23class RawTrackerHit;
24class MutableRawTrackerHit;
25}
26
27
28namespace edm4eic {
29
30class MutableTrackerHit;
31class TrackerHitCollection;
32class TrackerHitCollectionData;
33
34/** @class TrackerHit
35 * Tracker hit (reconstructed from Raw)
36 * @author: W. Armstrong, S. Joosten
37 */
39
40 friend class MutableTrackerHit;
44
45public:
48
49 /// default constructor
50 TrackerHit();
51
52 /// Constructor initializing all members
53 TrackerHit(std::uint64_t cellID, edm4hep::Vector3f position, edm4eic::CovDiag3f positionError, float time, float timeError, float edep, float edepError);
54
55 /// copy constructor
56 TrackerHit(const TrackerHit& other) = default;
57
58 /// copy-assignment operator
60
61 /// create a mutable deep-copy of the object with identical relations
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableTrackerHit clone(bool cloneRelations=true) const;
64
65 /// destructor
66 ~TrackerHit() = default;
67
68 /// converting constructor from mutable object
69 TrackerHit(const MutableTrackerHit& other);
70
71 static TrackerHit makeEmpty();
72
73public:
74
75 /// Access the The detector specific (geometrical) cell id.
76 std::uint64_t getCellID() const;
77
78 /// Access the Hit (cell) position [mm]
79 const edm4hep::Vector3f& getPosition() const;
80
81 /// Access the Covariance Matrix
83
84 /// Access the Hit time [ns]
85 float getTime() const;
86
87 /// Access the Error on the time
88 float getTimeError() const;
89
90 /// Access the Energy deposit in this hit [GeV]
91 float getEdep() const;
92
93 /// Access the Error on the energy deposit [GeV]
94 float getEdepError() const;
95
96
97 /// Access the Related raw tracker hit
99
100
101
102 /// check whether the object is actually available
103 bool isAvailable() const;
104 /// disconnect from TrackerHitObj instance
105 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitObj>{nullptr}; }
106
107 bool operator==(const TrackerHit& other) const { return m_obj == other.m_obj; }
108 bool operator==(const MutableTrackerHit& other) const;
109
110 bool operator!=(const TrackerHit& other) const { return !(*this == other); }
111 bool operator!=(const MutableTrackerHit& other) const { return !(*this == other); }
112
113 // less comparison operator, so that objects can be e.g. stored in sets.
114 bool operator<(const TrackerHit& other) const { return m_obj < other.m_obj; }
115
116 podio::ObjectID id() const { return getObjectID(); }
117
118 const podio::ObjectID getObjectID() const;
119
120 friend void swap(TrackerHit& a, TrackerHit& b) {
121 using std::swap;
122 swap(a.m_obj, b.m_obj); // swap out the internal pointers
123 }
124
125private:
126 /// constructor from existing TrackerHitObj
127 explicit TrackerHit(podio::utils::MaybeSharedPtr<TrackerHitObj> obj);
129
130 podio::utils::MaybeSharedPtr<TrackerHitObj> m_obj{nullptr};
131};
132
133std::ostream& operator<<(std::ostream& o, const TrackerHit& value);
134
135#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
136void to_json(nlohmann::json& j, const TrackerHit& value);
137#endif
138
139
140} // namespace edm4eic
141
142
143#endif
Definition CovDiag3f.h:18
Definition MutableTrackerHit.h:36
Definition RawTrackerHit.h:31
Definition TrackerHitCollectionData.h:31
Definition TrackerHitCollection.h:92
Definition TrackerHitCollection.h:37
Definition TrackerHit.h:38
friend class TrackerHitCollection
Definition TrackerHit.h:41
bool operator!=(const TrackerHit &other) const
Definition TrackerHit.h:110
float getEdep() const
Access the Energy deposit in this hit [GeV].
Definition TrackerHit.cc:67
const edm4eic::CovDiag3f & getPositionError() const
Access the Covariance Matrix.
Definition TrackerHit.cc:64
~TrackerHit()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition TrackerHit.cc:82
const edm4eic::RawTrackerHit getRawHit() const
Access the Related raw tracker hit.
Definition TrackerHit.cc:70
friend void swap(TrackerHit &a, TrackerHit &b)
Definition TrackerHit.h:120
bool operator!=(const MutableTrackerHit &other) const
Definition TrackerHit.h:111
MutableTrackerHit clone(bool cloneRelations=true) const
Definition TrackerHit.cc:40
float getTimeError() const
Access the Error on the time.
Definition TrackerHit.cc:66
static TrackerHit makeEmpty()
Definition TrackerHit.cc:58
float getEdepError() const
Access the Error on the energy deposit [GeV].
Definition TrackerHit.cc:68
const podio::ObjectID getObjectID() const
Definition TrackerHit.cc:86
bool operator==(const TrackerHit &other) const
Definition TrackerHit.h:107
float getTime() const
Access the Hit time [ns].
Definition TrackerHit.cc:65
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition TrackerHit.cc:62
TrackerHit()
default constructor
Definition TrackerHit.cc:21
void unlink()
disconnect from TrackerHitObj instance
Definition TrackerHit.h:105
TrackerHit(const TrackerHit &other)=default
copy constructor
friend class MutableTrackerHit
Definition TrackerHit.h:40
bool operator<(const TrackerHit &other) const
Definition TrackerHit.h:114
TrackerHit & operator=(TrackerHit other)
copy-assignment operator
Definition TrackerHit.cc:35
podio::ObjectID id() const
Definition TrackerHit.h:116
const edm4hep::Vector3f & getPosition() const
Access the Hit (cell) position [mm].
Definition TrackerHit.cc:63
Definition TrackerHitObj.h:21
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103