EICd
EIC data model
PMTHit.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef EICD_PMTHit_H
4 #define EICD_PMTHit_H
5 
6 #include "eicd/PMTHitConst.h"
7 #include "eicd/PMTHitObj.h"
8 
9 #include "eicd/Index.h"
10 #include "eicd/VectorXYZ.h"
11 #include "podio/ObjectID.h"
12 #include <ostream>
13 
14 
15 
16 namespace eic {
17 
18 
19 /** @class PMTHit
20  * EIC PMT hit
21  * @author: S. Joosten, C. Peng
22  */
23 class PMTHit {
24 
25  friend class PMTHitCollection;
27  friend class ConstPMTHit;
28 
29 public:
30 
31  /// default constructor
32  PMTHit();
34 
35  /// constructor from existing PMTHitObj
36  PMTHit(PMTHitObj* obj);
37 
38  /// copy constructor
39  PMTHit(const PMTHit& other);
40 
41  /// copy-assignment operator
42  PMTHit& operator=(const PMTHit& other);
43 
44  /// support cloning (deep-copy)
45  PMTHit clone() const;
46 
47  /// destructor
48  ~PMTHit();
49 
50  /// conversion to const object
51  operator ConstPMTHit() const;
52 
53 public:
54 
55  /// Access the Unique hit ID
56  const eic::Index& ID() const;
57 
58  /// Access the The detector specific (geometrical) cell id.
59  const std::int64_t& cellID() const;
60 
61  /// Access the estimated number of photo-electrons [#]
62  const float& npe() const;
63 
64  /// Access the Time [ns]
65  const float& time() const;
66 
67  /// Access the Error on the time [ns]
68  const float& timeError() const;
69 
70  /// Access the PMT hit position [mm]
71  const eic::VectorXYZ& position() const;
72 
73  /// Access the The local position of the hit in detector coordinates [mm]
74  const eic::VectorXYZ& local() const;
75 
76  /// Access the The dimension information of the pixel [mm].
77  const eic::VectorXYZ& dimension() const;
78 
79 
80 
81  /// Set the Unique hit ID
82  void ID(eic::Index value);
83  /// Get reference to Unique hit ID
84  eic::Index& ID();
85 
86  /// Set the The detector specific (geometrical) cell id.
87  void cellID(std::int64_t value);
88 
89  /// Set the estimated number of photo-electrons [#]
90  void npe(float value);
91 
92  /// Set the Time [ns]
93  void time(float value);
94 
95  /// Set the Error on the time [ns]
96  void timeError(float value);
97 
98  /// Set the PMT hit position [mm]
99  void position(eic::VectorXYZ value);
100  /// Get reference to PMT hit position [mm]
102 
103  /// Set the The local position of the hit in detector coordinates [mm]
104  void local(eic::VectorXYZ value);
105  /// Get reference to The local position of the hit in detector coordinates [mm]
107 
108  /// Set the The dimension information of the pixel [mm].
109  void dimension(eic::VectorXYZ value);
110  /// Get reference to The dimension information of the pixel [mm].
112 
113 
114 
115 
116 
117 
118  /// check whether the object is actually available
119  bool isAvailable() const;
120  /// disconnect from PMTHitObj instance
121  void unlink() { m_obj = nullptr; }
122 
123  bool operator==(const PMTHit& other) const { return m_obj == other.m_obj; }
124  bool operator==(const ConstPMTHit& other) const;
125 
126  // less comparison operator, so that objects can be e.g. stored in sets.
127  bool operator<(const PMTHit& other) const { return m_obj < other.m_obj; }
128 
129  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
130 
131  const podio::ObjectID getObjectID() const;
132 
133 private:
134  PMTHitObj* m_obj;
135 };
136 
137 std::ostream& operator<<(std::ostream& o, const ConstPMTHit& value);
138 
139 } // namespace eic
140 
141 
142 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::Index
Definition: Index.h:11
eic::PMTHit::dimension
const eic::VectorXYZ & dimension() const
Access the The dimension information of the pixel [mm].
Definition: PMTHit.cc:62
eic::PMTHit::unlink
void unlink()
disconnect from PMTHitObj instance
Definition: PMTHit.h:121
eic::PMTHit::operator=
PMTHit & operator=(const PMTHit &other)
copy-assignment operator
Definition: PMTHit.cc:36
eic::PMTHit::ConstPMTHit
friend class ConstPMTHit
Definition: PMTHit.h:27
eic::PMTHitObj
Definition: PMTHitObj.h:18
eic::PMTHit::cellID
const std::int64_t & cellID() const
Access the The detector specific (geometrical) cell id.
Definition: PMTHit.cc:56
eic::PMTHit::npe
const float & npe() const
Access the estimated number of photo-electrons [#].
Definition: PMTHit.cc:57
eic::PMTHit::operator<
bool operator<(const PMTHit &other) const
Definition: PMTHit.h:127
eic::PMTHit::ID
const eic::Index & ID() const
Access the Unique hit ID.
Definition: PMTHit.cc:55
eic::PMTHit::getObjectID
const podio::ObjectID getObjectID() const
Definition: PMTHit.cc:91
eic::PMTHit::position
const eic::VectorXYZ & position() const
Access the PMT hit position [mm].
Definition: PMTHit.cc:60
eic
Definition: BasicParticle.cc:13
eic::PMTHit::local
const eic::VectorXYZ & local() const
Access the The local position of the hit in detector coordinates [mm].
Definition: PMTHit.cc:61
eic::PMTHit
Definition: PMTHit.h:23
eic::PMTHit::id
unsigned int id() const
Definition: PMTHit.h:129
eic::PMTHit::operator==
bool operator==(const PMTHit &other) const
Definition: PMTHit.h:123
eic::PMTHitCollection
Definition: PMTHitCollection.h:76
PMTHitObj.h
VectorXYZ.h
eic::PMTHit::~PMTHit
~PMTHit()
destructor
Definition: PMTHit.cc:50
eic::PMTHit::PMTHit
PMTHit()
default constructor
Definition: PMTHit.cc:16
eic::PMTHit::timeError
const float & timeError() const
Access the Error on the time [ns].
Definition: PMTHit.cc:59
eic::PMTHit::clone
PMTHit clone() const
support cloning (deep-copy)
Definition: PMTHit.cc:46
eic::PMTHit::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: PMTHit.cc:84
eic::ConstPMTHit
Definition: PMTHitConst.h:21
Index.h
eic::PMTHit::time
const float & time() const
Access the Time [ns].
Definition: PMTHit.cc:58
eic::PMTHitCollectionIterator
Definition: PMTHitCollection.h:29
eic::VectorXYZ
Definition: VectorXYZ.h:13
PMTHitConst.h