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