EDM4eic
EIC data model
Loading...
Searching...
No Matches
CalorimeterHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_CalorimeterHit_H
4#define EDM4EIC_CalorimeterHit_H
5
7
8#include "edm4hep/Vector3f.h"
9#include <cstdint>
10
11#include "podio/utilities/MaybeSharedPtr.h"
12
13#include <ostream>
14#include <cstddef>
15
16#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
17#include "nlohmann/json_fwd.hpp"
18#endif
19
20// forward declarations
21namespace edm4hep {
22class RawCalorimeterHit;
23class MutableRawCalorimeterHit;
24}
25
26
27namespace edm4eic {
28
29class MutableCalorimeterHit;
30class CalorimeterHitCollection;
31class CalorimeterHitCollectionData;
32
33/** @class CalorimeterHit
34 * Calorimeter hit
35 * @author: W. Armstrong, S. Joosten
36 */
38
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 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);
53
54 /// copy constructor
55 CalorimeterHit(const CalorimeterHit& other) = default;
56
57 /// copy-assignment operator
59
60 /// create a mutable deep-copy of the object with identical relations
62
63 /// destructor
64 ~CalorimeterHit() = default;
65
66
68
69public:
70
71 /// Access the The detector specific (geometrical) cell id.
72 std::uint64_t getCellID() const;
73
74 /// Access the The energy for this hit in [GeV].
75 float getEnergy() const;
76
77 /// Access the Error on energy [GeV].
78 float getEnergyError() const;
79
80 /// Access the The time of the hit in [ns].
81 float getTime() const;
82
83 /// Access the Error on the time
84 float getTimeError() const;
85
86 /// Access the The global position of the hit in world coordinates [mm].
87 const edm4hep::Vector3f& getPosition() const;
88
89 /// Access the The dimension information of the cell [mm].
90 const edm4hep::Vector3f& getDimension() const;
91
92 /// Access the Sector that this hit occurred in
93 std::int32_t getSector() const;
94
95 /// Access the Layer that the hit occurred in
96 std::int32_t getLayer() const;
97
98 /// Access the The local coordinates of the hit in the detector segment [mm].
99 const edm4hep::Vector3f& getLocal() const;
100
101
102 /// Access the Related raw calorimeter hit
103 const edm4hep::RawCalorimeterHit getRawHit() const;
104
105
106
107 /// check whether the object is actually available
108 bool isAvailable() const;
109 /// disconnect from CalorimeterHitObj instance
110 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{nullptr}; }
111
112 bool operator==(const CalorimeterHit& other) const { return m_obj == other.m_obj; }
113 bool operator==(const MutableCalorimeterHit& other) const;
114
115 // less comparison operator, so that objects can be e.g. stored in sets.
116 bool operator<(const CalorimeterHit& other) const { return m_obj < other.m_obj; }
117
118 podio::ObjectID id() const { return getObjectID(); }
119
120 const podio::ObjectID getObjectID() const;
121
122 friend void swap(CalorimeterHit& a, CalorimeterHit& b) {
123 using std::swap;
124 swap(a.m_obj, b.m_obj); // swap out the internal pointers
125 }
126
127private:
128 /// constructor from existing CalorimeterHitObj
129 explicit CalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
131
132 podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{nullptr};
133};
134
135std::ostream& operator<<(std::ostream& o, const CalorimeterHit& value);
136
137#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
138void to_json(nlohmann::json& j, const CalorimeterHit& value);
139#endif
140
141
142} // namespace edm4eic
143
144
145#endif
Definition CalorimeterHitCollectionData.h:31
Definition CalorimeterHitCollection.h:95
Definition CalorimeterHitCollection.h:40
Definition CalorimeterHit.h:37
float getTime() const
Access the The time of the hit in [ns].
Definition CalorimeterHit.cc:59
friend void swap(CalorimeterHit &a, CalorimeterHit &b)
Definition CalorimeterHit.h:122
const podio::ObjectID getObjectID() const
Definition CalorimeterHit.cc:86
const edm4hep::Vector3f & getPosition() const
Access the The global position of the hit in world coordinates [mm].
Definition CalorimeterHit.cc:61
bool isAvailable() const
check whether the object is actually available
Definition CalorimeterHit.cc:79
float getTimeError() const
Access the Error on the time.
Definition CalorimeterHit.cc:60
bool operator==(const CalorimeterHit &other) const
Definition CalorimeterHit.h:112
float getEnergy() const
Access the The energy for this hit in [GeV].
Definition CalorimeterHit.cc:57
CalorimeterHit & operator=(CalorimeterHit other)
copy-assignment operator
Definition CalorimeterHit.cc:39
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the cell [mm].
Definition CalorimeterHit.cc:62
float getEnergyError() const
Access the Error on energy [GeV].
Definition CalorimeterHit.cc:58
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition CalorimeterHit.cc:56
bool operator<(const CalorimeterHit &other) const
Definition CalorimeterHit.h:116
std::int32_t getSector() const
Access the Sector that this hit occurred in.
Definition CalorimeterHit.cc:63
MutableCalorimeterHit clone() const
create a mutable deep-copy of the object with identical relations
Definition CalorimeterHit.cc:44
const edm4hep::Vector3f & getLocal() const
Access the The local coordinates of the hit in the detector segment [mm].
Definition CalorimeterHit.cc:65
static CalorimeterHit makeEmpty()
Definition CalorimeterHit.cc:52
void unlink()
disconnect from CalorimeterHitObj instance
Definition CalorimeterHit.h:110
CalorimeterHit(const CalorimeterHit &other)=default
copy constructor
friend class CalorimeterHitCollection
Definition CalorimeterHit.h:40
friend class MutableCalorimeterHit
Definition CalorimeterHit.h:39
CalorimeterHit()
default constructor
Definition CalorimeterHit.cc:22
~CalorimeterHit()=default
destructor
podio::ObjectID id() const
Definition CalorimeterHit.h:118
std::int32_t getLayer() const
Access the Layer that the hit occurred in.
Definition CalorimeterHit.cc:64
const edm4hep::RawCalorimeterHit getRawHit() const
Access the Related raw calorimeter hit.
Definition CalorimeterHit.cc:67
Definition CalorimeterHitObj.h:21
Definition MutableCalorimeterHit.h:36
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
Definition CalorimeterHit.h:21