TrackerHit.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef DD4POD_TrackerHit_H
4 #define DD4POD_TrackerHit_H
5 
7 #include "dd4pod/TrackerHitObj.h"
8 
9 #include "dd4pod/FourVector.h"
11 #include "podio/ObjectID.h"
12 #include <ostream>
13 
14 
15 
16 namespace dd4pod {
17 
18 
19 class TrackerHitCollection;
20 class TrackerHitCollectionIterator;
21 class ConstTrackerHit;
22 
27 class TrackerHit {
28 
29  friend TrackerHitCollection;
31  friend ConstTrackerHit;
32 
33 public:
34 
36  TrackerHit();
38 
41 
43  TrackerHit(const TrackerHit& other);
44 
46  TrackerHit& operator=(const TrackerHit& other);
47 
49  TrackerHit clone() const;
50 
52  ~TrackerHit();
53 
55  operator ConstTrackerHit() const;
56 
57 public:
58 
60  const long long& cellID() const;
61 
63  const long& flag() const;
64 
66  const long& g4ID() const;
67 
69  const dd4pod::FourVector& position() const;
70 
72  const dd4pod::FourVector& momentum() const;
73 
75  const double& length() const;
76 
78  const dd4pod::MonteCarloContrib& truth() const;
79 
81  const double& energyDeposit() const;
82 
83 
84 
86  void cellID(long long value);
87 
89  void flag(long value);
90 
92  void g4ID(long value);
93 
98 
103 
105  void length(double value);
106 
111 
113  void energyDeposit(double value);
114 
115 
116 
117 
118 
119 
121  bool isAvailable() const;
123  void unlink() { m_obj = nullptr; }
124 
125  bool operator==(const TrackerHit& other) const { return m_obj == other.m_obj; }
126  bool operator==(const ConstTrackerHit& other) const;
127 
128  // less comparison operator, so that objects can be e.g. stored in sets.
129  bool operator<(const TrackerHit& other) const { return m_obj < other.m_obj; }
130 
131  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
132 
133  const podio::ObjectID getObjectID() const;
134 
135 private:
136  TrackerHitObj* m_obj;
137 };
138 
139 std::ostream& operator<<(std::ostream& o, const ConstTrackerHit& value);
140 
141 } // namespace dd4pod
142 
143 
144 #endif
parameter value(const doc_string &label, Targets &&... tgts)
makes required, blocking, repeatable value parameter; matches any non-empty string
Definition: clipp.h:2094
const long & g4ID() const
Access the Original Geant4 track identifier of the creating track (debugging)
Definition: TrackerHit.cc:57
const dd4pod::FourVector & momentum() const
Access the momentum.
Definition: TrackerHit.cc:59
bool operator==(const TrackerHit &other) const
Definition: TrackerHit.h:125
A Collection is identified by an ID.
~TrackerHit()
destructor
Definition: TrackerHit.cc:50
bool operator<(const TrackerHit &other) const
Definition: TrackerHit.h:129
TrackerHit clone() const
support cloning (deep-copy)
Definition: TrackerHit.cc:46
const double & length() const
Access the length.
Definition: TrackerHit.cc:60
const long long & cellID() const
Access the cellID.
Definition: TrackerHit.cc:55
bool isAvailable() const
check whether the object is actually available
Definition: TrackerHit.cc:83
TrackerHit & operator=(const TrackerHit &other)
copy-assignment operator
Definition: TrackerHit.cc:36
const double & energyDeposit() const
Access the energyDeposit.
Definition: TrackerHit.cc:62
const dd4pod::MonteCarloContrib & truth() const
Access the truth.
Definition: TrackerHit.cc:61
const podio::ObjectID getObjectID() const
Definition: TrackerHit.cc:90
std::ostream & operator<<(std::ostream &o, const ConstCalorimeterHit &value)
const long & flag() const
Access the User flag to classify hits.
Definition: TrackerHit.cc:56
unsigned int id() const
Definition: TrackerHit.h:131
const dd4pod::FourVector & position() const
Access the position.
Definition: TrackerHit.cc:58
void unlink()
disconnect from TrackerHitObj instance
Definition: TrackerHit.h:123
TrackerHit()
default constructor
Definition: TrackerHit.cc:16