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 
6 #include "eicd/TrackerHitConst.h"
7 #include "eicd/TrackerHitObj.h"
8 
9 #include "eicd/CovDiagXYZT.h"
10 #include "eicd/Index.h"
11 #include "eicd/VectorXYZT.h"
12 #include "podio/ObjectID.h"
13 #include <ostream>
14 
15 
16 
17 namespace eic {
18 
19 
20 /** @class TrackerHit
21  * Tracker hit (reconstructed from Raw)
22  * @author: W. Armstrong, S. Joosten
23  */
24 class TrackerHit {
25 
26  friend class TrackerHitCollection;
28  friend class ConstTrackerHit;
29 
30 public:
31 
32  /// default constructor
33  TrackerHit();
35 
36  /// constructor from existing TrackerHitObj
38 
39  /// copy constructor
40  TrackerHit(const TrackerHit& other);
41 
42  /// copy-assignment operator
43  TrackerHit& operator=(const TrackerHit& other);
44 
45  /// support cloning (deep-copy)
46  TrackerHit clone() const;
47 
48  /// destructor
49  ~TrackerHit();
50 
51  /// conversion to const object
52  operator ConstTrackerHit() const;
53 
54 public:
55 
56  /// Access the unique ID for this hit
57  const eic::Index& ID() const;
58 
59  /// Access the The detector specific (geometrical) cell id.
60  const std::int64_t& cellID() const;
61 
62  /// Access the Hit (cell) position and time [mm, ns]
63  const eic::VectorXYZT& position() const;
64 
65  /// Access the Covariance Matrix
66  const eic::CovDiagXYZT& covMatrix() const;
67 
68  /// Access the Energy deposit in this hit [GeV]
69  const float& edep() const;
70 
71  /// Access the Error on the energy deposit [GeV]
72  const float& edepError() const;
73 
74 
75 
76  /// Set the unique ID for this hit
77  void ID(eic::Index value);
78  /// Get reference to unique ID for this hit
79  eic::Index& ID();
80 
81  /// Set the The detector specific (geometrical) cell id.
82  void cellID(std::int64_t value);
83 
84  /// Set the Hit (cell) position and time [mm, ns]
85  void position(eic::VectorXYZT value);
86  /// Get reference to Hit (cell) position and time [mm, ns]
88 
89  /// Set the Covariance Matrix
90  void covMatrix(eic::CovDiagXYZT value);
91  /// Get reference to Covariance Matrix
93 
94  /// Set the Energy deposit in this hit [GeV]
95  void edep(float value);
96 
97  /// Set the Error on the energy deposit [GeV]
98  void edepError(float value);
99 
100 
101 
102 
103 
104  double time() const {return position().t;}
105 
106 
107  /// check whether the object is actually available
108  bool isAvailable() const;
109  /// disconnect from TrackerHitObj instance
110  void unlink() { m_obj = nullptr; }
111 
112  bool operator==(const TrackerHit& other) const { return m_obj == other.m_obj; }
113  bool operator==(const ConstTrackerHit& other) const;
114 
115  // less comparison operator, so that objects can be e.g. stored in sets.
116  bool operator<(const TrackerHit& other) const { return m_obj < other.m_obj; }
117 
118  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
119 
120  const podio::ObjectID getObjectID() const;
121 
122 private:
123  TrackerHitObj* m_obj;
124 };
125 
126 std::ostream& operator<<(std::ostream& o, const ConstTrackerHit& value);
127 
128 } // namespace eic
129 
130 
131 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::Index
Definition: Index.h:11
eic::TrackerHit::edep
const float & edep() const
Access the Energy deposit in this hit [GeV].
Definition: TrackerHit.cc:57
eic::VectorXYZT::t
double t
[ns] or [GeV]
Definition: VectorXYZT.h:18
eic::CovDiagXYZT
Definition: CovDiagXYZT.h:11
eic::TrackerHitCollectionIterator
Definition: TrackerHitCollection.h:29
eic::TrackerHit::operator=
TrackerHit & operator=(const TrackerHit &other)
copy-assignment operator
Definition: TrackerHit.cc:34
CovDiagXYZT.h
eic::TrackerHit::cellID
const std::int64_t & cellID() const
Access the The detector specific (geometrical) cell id.
Definition: TrackerHit.cc:54
eic
Definition: BasicParticle.cc:13
eic::TrackerHit::unlink
void unlink()
disconnect from TrackerHitObj instance
Definition: TrackerHit.h:110
eic::VectorXYZT
Definition: VectorXYZT.h:13
eic::TrackerHitCollection
Definition: TrackerHitCollection.h:76
eic::TrackerHit::TrackerHit
TrackerHit()
default constructor
Definition: TrackerHit.cc:16
eic::TrackerHit::covMatrix
const eic::CovDiagXYZT & covMatrix() const
Access the Covariance Matrix.
Definition: TrackerHit.cc:56
eic::TrackerHit::~TrackerHit
~TrackerHit()
destructor
Definition: TrackerHit.cc:48
eic::TrackerHitObj
Definition: TrackerHitObj.h:18
eic::TrackerHit::ConstTrackerHit
friend class ConstTrackerHit
Definition: TrackerHit.h:28
TrackerHitConst.h
eic::TrackerHit::operator==
bool operator==(const TrackerHit &other) const
Definition: TrackerHit.h:112
eic::TrackerHit::id
unsigned int id() const
Definition: TrackerHit.h:118
eic::TrackerHit::operator<
bool operator<(const TrackerHit &other) const
Definition: TrackerHit.h:116
eic::ConstTrackerHit
Definition: TrackerHitConst.h:22
TrackerHitObj.h
eic::TrackerHit::getObjectID
const podio::ObjectID getObjectID() const
Definition: TrackerHit.cc:84
VectorXYZT.h
eic::TrackerHit
Definition: TrackerHit.h:24
eic::TrackerHit::clone
TrackerHit clone() const
support cloning (deep-copy)
Definition: TrackerHit.cc:44
eic::TrackerHit::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: TrackerHit.cc:77
eic::TrackerHit::position
const eic::VectorXYZT & position() const
Access the Hit (cell) position and time [mm, ns].
Definition: TrackerHit.cc:55
Index.h
eic::TrackerHit::time
double time() const
Definition: TrackerHit.h:104
eic::TrackerHit::edepError
const float & edepError() const
Access the Error on the energy deposit [GeV].
Definition: TrackerHit.cc:58
eic::TrackerHit::ID
const eic::Index & ID() const
Access the unique ID for this hit.
Definition: TrackerHit.cc:53