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
7
8#include "edm4hep/Vector3f.h"
9#include <cstdint>
10#include "podio/ObjectID.h"
11#include <ostream>
12
13#ifdef PODIO_JSON_OUTPUT
14#include "nlohmann/json.hpp"
15#endif
16
17
18
19namespace eicd {
20
21class MutableCalorimeterHit;
22
23/** @class CalorimeterHit
24 * Calorimeter hit
25 * @author: W. Armstrong, S. Joosten
26 */
28
32
33public:
34 /// default constructor
36 CalorimeterHit(std::uint64_t cellID, float energy, float energyError, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, std::int32_t layer, edm4hep::Vector3f local);
37
38 /// constructor from existing CalorimeterHitObj
40
41 /// copy constructor
42 CalorimeterHit(const CalorimeterHit& other);
43
44 /// copy-assignment operator
46
47 /// create a mutable deep-copy of the object with identical relations
49
50 /// destructor
52
53
54public:
55
56 /// Access the The detector specific (geometrical) cell id.
57 const std::uint64_t& getCellID() const;
58
59 /// Access the The energy for this hit in [GeV].
60 const float& getEnergy() const;
61
62 /// Access the Error on energy [GeV].
63 const float& getEnergyError() const;
64
65 /// Access the The time of the hit in [ns].
66 const float& getTime() const;
67
68 /// Access the Error on the time
69 const float& getTimeError() const;
70
71 /// Access the The global position of the hit in world coordinates [mm].
72 const edm4hep::Vector3f& getPosition() const;
73
74 /// Access the The dimension information of the cell [mm].
75 const edm4hep::Vector3f& getDimension() const;
76
77 /// Access the Sector that this hit occured in
78 const std::int32_t& getSector() const;
79
80 /// Access the Layer that the hit occured in
81 const std::int32_t& getLayer() const;
82
83 /// Access the The local coordinates of the hit in the detector segment [mm].
84 const edm4hep::Vector3f& getLocal() const;
85
86
87
88
89
90 /// check whether the object is actually available
91 bool isAvailable() const;
92 /// disconnect from CalorimeterHitObj instance
93 void unlink() { m_obj = nullptr; }
94
95 bool operator==(const CalorimeterHit& other) const { return m_obj == other.m_obj; }
96 bool operator==(const MutableCalorimeterHit& other) const;
97
98 // less comparison operator, so that objects can be e.g. stored in sets.
99 bool operator<(const CalorimeterHit& other) const { return m_obj < other.m_obj; }
100
101 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
102
103 const podio::ObjectID getObjectID() const;
104
105 friend void swap(CalorimeterHit& a, CalorimeterHit& b) {
106 using std::swap;
107 swap(a.m_obj, b.m_obj); // swap out the internal pointers
108 }
109
110private:
111 CalorimeterHitObj* m_obj;
112};
113
114std::ostream& operator<<(std::ostream& o, const CalorimeterHit& value);
115
116#ifdef PODIO_JSON_OUTPUT
117void to_json(nlohmann::json& j, const CalorimeterHit& value);
118#endif
119
120
121} // namespace eicd
122
123
124#endif
Definition: CalorimeterHitCollection.h:82
Definition: CalorimeterHitCollection.h:35
Definition: CalorimeterHit.h:27
friend void swap(CalorimeterHit &a, CalorimeterHit &b)
Definition: CalorimeterHit.h:105
const edm4hep::Vector3f & getLocal() const
Access the The local coordinates of the hit in the detector segment [mm].
Definition: CalorimeterHit.cc:68
unsigned int id() const
Definition: CalorimeterHit.h:101
const std::uint64_t & getCellID() const
Access the The detector specific (geometrical) cell id.
Definition: CalorimeterHit.cc:59
const float & getEnergyError() const
Access the Error on energy [GeV].
Definition: CalorimeterHit.cc:61
MutableCalorimeterHit clone() const
create a mutable deep-copy of the object with identical relations
Definition: CalorimeterHit.cc:49
bool operator==(const CalorimeterHit &other) const
Definition: CalorimeterHit.h:95
const float & getTimeError() const
Access the Error on the time.
Definition: CalorimeterHit.cc:63
const edm4hep::Vector3f & getPosition() const
Access the The global position of the hit in world coordinates [mm].
Definition: CalorimeterHit.cc:64
bool operator<(const CalorimeterHit &other) const
Definition: CalorimeterHit.h:99
void unlink()
disconnect from CalorimeterHitObj instance
Definition: CalorimeterHit.h:93
const std::int32_t & getSector() const
Access the Sector that this hit occured in.
Definition: CalorimeterHit.cc:66
const podio::ObjectID getObjectID() const
Definition: CalorimeterHit.cc:82
const float & getTime() const
Access the The time of the hit in [ns].
Definition: CalorimeterHit.cc:62
CalorimeterHit()
default constructor
Definition: CalorimeterHit.cc:16
const std::int32_t & getLayer() const
Access the Layer that the hit occured in.
Definition: CalorimeterHit.cc:67
bool isAvailable() const
check whether the object is actually available
Definition: CalorimeterHit.cc:75
~CalorimeterHit()
destructor
Definition: CalorimeterHit.cc:53
const float & getEnergy() const
Access the The energy for this hit in [GeV].
Definition: CalorimeterHit.cc:60
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the cell [mm].
Definition: CalorimeterHit.cc:65
CalorimeterHit & operator=(CalorimeterHit other)
copy-assignment operator
Definition: CalorimeterHit.cc:38
Definition: CalorimeterHitObj.h:17
Definition: MutableCalorimeterHit.h:28
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93