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#include "podio/detail/OrderKey.h"
14
15#include <ostream>
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 podio::detail {
31// Internal function used in less comparison operators of the datatypes and interface types
32OrderKey getOrderKey(const edm4eic::TrackerHit& obj);
33};
34
35namespace edm4eic {
36
37class MutableTrackerHit;
38class TrackerHitCollection;
39class TrackerHitCollectionData;
40
41/** @class TrackerHit
42 * Tracker hit (reconstructed from Raw)
43 * @author: W. Armstrong, S. Joosten
44 */
46
47 friend class MutableTrackerHit;
51 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackerHit & obj);
52
53public:
56
57 /// default constructor
58 TrackerHit();
59
60 /// Constructor initializing all members
61 TrackerHit(std::uint64_t cellID, edm4hep::Vector3f position, edm4eic::CovDiag3f positionError, float time, float timeError, float edep, float edepError);
62
63 /// copy constructor
64 TrackerHit(const TrackerHit& other) = default;
65
66 /// copy-assignment operator
68
69 /// create a mutable deep-copy of the object with identical relations
70 /// if cloneRelations=false, the relations are not cloned and will be empty
71 MutableTrackerHit clone(bool cloneRelations=true) const;
72
73 /// destructor
74 ~TrackerHit() = default;
75
76 /// converting constructor from mutable object
77 TrackerHit(const MutableTrackerHit& other);
78
79 static TrackerHit makeEmpty();
80
81public:
82
83 static constexpr auto typeName = "edm4eic::TrackerHit";
84
85 /// Access the The detector specific (geometrical) cell id.
86 std::uint64_t getCellID() const;
87
88 /// Access the Hit (cell) position [mm]
89 const edm4hep::Vector3f& getPosition() const;
90
91 /// Access the Covariance Matrix
93
94 /// Access the Hit time [ns]
95 float getTime() const;
96
97 /// Access the Error on the time
98 float getTimeError() const;
99
100 /// Access the Energy deposit in this hit [GeV]
101 float getEdep() const;
102
103 /// Access the Error on the energy deposit [GeV]
104 float getEdepError() const;
105
106
107 /// Access the Related raw tracker hit
108 const edm4eic::RawTrackerHit getRawHit() const;
109
110
111
112 /// check whether the object is actually available
113 bool isAvailable() const;
114 /// disconnect from TrackerHitObj instance
115 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitObj>{nullptr}; }
116
117 bool operator==(const TrackerHit& other) const { return m_obj == other.m_obj; }
118 bool operator==(const MutableTrackerHit& other) const;
119
120 bool operator!=(const TrackerHit& other) const { return !(*this == other); }
121 bool operator!=(const MutableTrackerHit& other) const { return !(*this == other); }
122
123 // less comparison operator, so that objects can be e.g. stored in sets.
124 bool operator<(const TrackerHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
125
126 podio::ObjectID id() const { return getObjectID(); }
127
128 const podio::ObjectID getObjectID() const;
129
130 friend void swap(TrackerHit& a, TrackerHit& b) {
131 using std::swap;
132 swap(a.m_obj, b.m_obj); // swap out the internal pointers
133 }
134
135private:
136 /// constructor from existing TrackerHitObj
137 explicit TrackerHit(podio::utils::MaybeSharedPtr<TrackerHitObj> obj);
139
140 podio::utils::MaybeSharedPtr<TrackerHitObj> m_obj{nullptr};
141};
142
143std::ostream& operator<<(std::ostream& o, const TrackerHit& value);
144
145#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
146void to_json(nlohmann::json& j, const TrackerHit& value);
147#endif
148
149
150} // namespace edm4eic
151
152
153#endif
Definition CovDiag3f.h:18
Definition MutableTrackerHit.h:37
Definition RawTrackerHit.h:41
Definition TrackerHitCollectionData.h:31
Definition TrackerHitCollection.h:91
Definition TrackerHitCollection.h:36
Definition TrackerHit.h:45
friend class TrackerHitCollection
Definition TrackerHit.h:48
bool operator!=(const TrackerHit &other) const
Definition TrackerHit.h:120
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:130
bool operator!=(const MutableTrackerHit &other) const
Definition TrackerHit.h:121
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:117
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:115
TrackerHit(const TrackerHit &other)=default
copy constructor
static constexpr auto typeName
Definition TrackerHit.h:83
friend class MutableTrackerHit
Definition TrackerHit.h:47
bool operator<(const TrackerHit &other) const
Definition TrackerHit.h:124
TrackerHit & operator=(TrackerHit other)
copy-assignment operator
Definition TrackerHit.cc:35
podio::ObjectID id() const
Definition TrackerHit.h:126
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
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150