EICd
EIC data model
CalorimeterHit.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef EICD_CalorimeterHit_H
4 #define EICD_CalorimeterHit_H
5 
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 CalorimeterHit
20  * Calorimeter hit
21  * @author: W. Armstrong, S. Joosten
22  */
24 
27  friend class ConstCalorimeterHit;
28 
29 public:
30 
31  /// default constructor
33  CalorimeterHit(eic::Index ID, std::int64_t cellID, std::int32_t layer, std::int32_t sector, float energy, float energyError, float time, eic::VectorXYZ position, eic::VectorXYZ local, eic::VectorXYZ dimension);
34 
35  /// constructor from existing CalorimeterHitObj
37 
38  /// copy constructor
39  CalorimeterHit(const CalorimeterHit& other);
40 
41  /// copy-assignment operator
43 
44  /// support cloning (deep-copy)
45  CalorimeterHit clone() const;
46 
47  /// destructor
49 
50  /// conversion to const object
51  operator ConstCalorimeterHit() const;
52 
53 public:
54 
55  /// Access the unique ID for this hit
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 layer for this hit
62  const std::int32_t& layer() const;
63 
64  /// Access the sector for this hit
65  const std::int32_t& sector() const;
66 
67  /// Access the The energy for this hit in [GeV].
68  const float& energy() const;
69 
70  /// Access the Error on energy [GeV].
71  const float& energyError() const;
72 
73  /// Access the The time of the hit in [ns].
74  const float& time() const;
75 
76  /// Access the The global position of the hit in world coordinates [mm].
77  const eic::VectorXYZ& position() const;
78 
79  /// Access the The local position of the hit in detector coordinates [mm].
80  const eic::VectorXYZ& local() const;
81 
82  /// Access the The dimension information of the cell [mm].
83  const eic::VectorXYZ& dimension() const;
84 
85 
86 
87  /// Set the unique ID for this hit
88  void ID(eic::Index value);
89  /// Get reference to unique ID for this hit
90  eic::Index& ID();
91 
92  /// Set the The detector specific (geometrical) cell id.
93  void cellID(std::int64_t value);
94 
95  /// Set the layer for this hit
96  void layer(std::int32_t value);
97 
98  /// Set the sector for this hit
99  void sector(std::int32_t value);
100 
101  /// Set the The energy for this hit in [GeV].
102  void energy(float value);
103 
104  /// Set the Error on energy [GeV].
105  void energyError(float value);
106 
107  /// Set the The time of the hit in [ns].
108  void time(float value);
109 
110  /// Set the The global position of the hit in world coordinates [mm].
111  void position(eic::VectorXYZ value);
112  /// Get reference to The global position of the hit in world coordinates [mm].
114 
115  /// Set the The local position of the hit in detector coordinates [mm].
116  void local(eic::VectorXYZ value);
117  /// Get reference to The local position of the hit in detector coordinates [mm].
119 
120  /// Set the The dimension information of the cell [mm].
121  void dimension(eic::VectorXYZ value);
122  /// Get reference to The dimension information of the cell [mm].
124 
125 
126 
127 
128 
129 
130  /// check whether the object is actually available
131  bool isAvailable() const;
132  /// disconnect from CalorimeterHitObj instance
133  void unlink() { m_obj = nullptr; }
134 
135  bool operator==(const CalorimeterHit& other) const { return m_obj == other.m_obj; }
136  bool operator==(const ConstCalorimeterHit& other) const;
137 
138  // less comparison operator, so that objects can be e.g. stored in sets.
139  bool operator<(const CalorimeterHit& other) const { return m_obj < other.m_obj; }
140 
141  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
142 
143  const podio::ObjectID getObjectID() const;
144 
145 private:
146  CalorimeterHitObj* m_obj;
147 };
148 
149 std::ostream& operator<<(std::ostream& o, const ConstCalorimeterHit& value);
150 
151 } // namespace eic
152 
153 
154 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
eic::Index
Definition: Index.h:11
eic::CalorimeterHit::dimension
const eic::VectorXYZ & dimension() const
Access the The dimension information of the cell [mm].
Definition: CalorimeterHit.cc:66
CalorimeterHitConst.h
eic::CalorimeterHit::operator=
CalorimeterHit & operator=(const CalorimeterHit &other)
copy-assignment operator
Definition: CalorimeterHit.cc:38
CalorimeterHitObj.h
eic
Definition: BasicParticle.cc:13
eic::CalorimeterHit::getObjectID
const podio::ObjectID getObjectID() const
Definition: CalorimeterHit.cc:97
eic::CalorimeterHitObj
Definition: CalorimeterHitObj.h:18
eic::CalorimeterHitCollectionIterator
Definition: CalorimeterHitCollection.h:29
eic::CalorimeterHit::ConstCalorimeterHit
friend class ConstCalorimeterHit
Definition: CalorimeterHit.h:27
eic::CalorimeterHit::position
const eic::VectorXYZ & position() const
Access the The global position of the hit in world coordinates [mm].
Definition: CalorimeterHit.cc:64
VectorXYZ.h
eic::CalorimeterHit::~CalorimeterHit
~CalorimeterHit()
destructor
Definition: CalorimeterHit.cc:52
eic::CalorimeterHit::clone
CalorimeterHit clone() const
support cloning (deep-copy)
Definition: CalorimeterHit.cc:48
eic::CalorimeterHit::sector
const std::int32_t & sector() const
Access the sector for this hit.
Definition: CalorimeterHit.cc:60
eic::CalorimeterHit::local
const eic::VectorXYZ & local() const
Access the The local position of the hit in detector coordinates [mm].
Definition: CalorimeterHit.cc:65
eic::ConstCalorimeterHit
Definition: CalorimeterHitConst.h:21
eic::CalorimeterHit::energy
const float & energy() const
Access the The energy for this hit in [GeV].
Definition: CalorimeterHit.cc:61
eic::CalorimeterHit::ID
const eic::Index & ID() const
Access the unique ID for this hit.
Definition: CalorimeterHit.cc:57
eic::CalorimeterHit::cellID
const std::int64_t & cellID() const
Access the The detector specific (geometrical) cell id.
Definition: CalorimeterHit.cc:58
eic::CalorimeterHit::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: CalorimeterHit.cc:90
eic::CalorimeterHit
Definition: CalorimeterHit.h:23
eic::CalorimeterHit::layer
const std::int32_t & layer() const
Access the layer for this hit.
Definition: CalorimeterHit.cc:59
eic::CalorimeterHit::operator==
bool operator==(const CalorimeterHit &other) const
Definition: CalorimeterHit.h:135
Index.h
eic::CalorimeterHit::operator<
bool operator<(const CalorimeterHit &other) const
Definition: CalorimeterHit.h:139
eic::CalorimeterHit::time
const float & time() const
Access the The time of the hit in [ns].
Definition: CalorimeterHit.cc:63
eic::CalorimeterHit::id
unsigned int id() const
Definition: CalorimeterHit.h:141
eic::CalorimeterHit::unlink
void unlink()
disconnect from CalorimeterHitObj instance
Definition: CalorimeterHit.h:133
eic::CalorimeterHitCollection
Definition: CalorimeterHitCollection.h:76
eic::CalorimeterHit::CalorimeterHit
CalorimeterHit()
default constructor
Definition: CalorimeterHit.cc:16
eic::VectorXYZ
Definition: VectorXYZ.h:13
eic::CalorimeterHit::energyError
const float & energyError() const
Access the Error on energy [GeV].
Definition: CalorimeterHit.cc:62