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#include "podio/detail/OrderKey.h"
13
14#include <ostream>
15#include <cstdint>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21// forward declarations
22namespace edm4eic {
23class CalorimeterHitCollection;
24}
25namespace edm4hep {
26class RawCalorimeterHit;
27class MutableRawCalorimeterHit;
28}
29
30
31namespace podio::detail {
32// Internal function used in less comparison operators of the datatypes and interface types
33OrderKey getOrderKey(const edm4eic::CalorimeterHit& obj);
34};
35
36namespace edm4eic {
37
38class MutableCalorimeterHit;
39class CalorimeterHitCollection;
40class CalorimeterHitCollectionData;
41
42/** @class CalorimeterHit
43 * Calorimeter hit
44 * @author: W. Armstrong, S. Joosten
45 */
47
52 friend podio::detail::OrderKey podio::detail::getOrderKey(const CalorimeterHit & obj);
53
54public:
57
58 /// default constructor
60
61 /// Constructor initializing all members
62 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);
63
64 /// copy constructor
65 CalorimeterHit(const CalorimeterHit& other) = default;
66
67 /// copy-assignment operator
69
70 /// create a mutable deep-copy of the object with identical relations
71 /// if cloneRelations=false, the relations are not cloned and will be empty
72 MutableCalorimeterHit clone(bool cloneRelations=true) const;
73
74 /// destructor
75 ~CalorimeterHit() = default;
76
77 /// converting constructor from mutable object
79
81
82public:
83
84 static constexpr auto typeName = "edm4eic::CalorimeterHit";
85
86 /// Access the The detector specific (geometrical) cell id.
87 std::uint64_t getCellID() const;
88
89 /// Access the The energy for this hit in [GeV].
90 float getEnergy() const;
91
92 /// Access the Error on energy [GeV].
93 float getEnergyError() const;
94
95 /// Access the The time of the hit in [ns].
96 float getTime() const;
97
98 /// Access the Error on the time
99 float getTimeError() const;
100
101 /// Access the The global position of the hit in world coordinates [mm].
102 const edm4hep::Vector3f& getPosition() const;
103
104 /// Access the The dimension information of the cell [mm].
105 const edm4hep::Vector3f& getDimension() const;
106
107 /// Access the Sector that this hit occurred in
108 std::int32_t getSector() const;
109
110 /// Access the Layer that the hit occurred in
111 std::int32_t getLayer() const;
112
113 /// Access the The local coordinates of the hit in the detector segment [mm].
114 const edm4hep::Vector3f& getLocal() const;
115
116
117 /// Access the Related raw calorimeter hit
118 const edm4hep::RawCalorimeterHit getRawHit() const;
119
120
121
122 /// check whether the object is actually available
123 bool isAvailable() const;
124 /// disconnect from CalorimeterHitObj instance
125 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{nullptr}; }
126
127 bool operator==(const CalorimeterHit& other) const { return m_obj == other.m_obj; }
128 bool operator==(const MutableCalorimeterHit& other) const;
129
130 bool operator!=(const CalorimeterHit& other) const { return !(*this == other); }
131 bool operator!=(const MutableCalorimeterHit& other) const { return !(*this == other); }
132
133 // less comparison operator, so that objects can be e.g. stored in sets.
134 bool operator<(const CalorimeterHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
135
136 podio::ObjectID id() const { return getObjectID(); }
137
138 const podio::ObjectID getObjectID() const;
139
140 friend void swap(CalorimeterHit& a, CalorimeterHit& b) {
141 using std::swap;
142 swap(a.m_obj, b.m_obj); // swap out the internal pointers
143 }
144
145private:
146 /// constructor from existing CalorimeterHitObj
147 explicit CalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
149
150 podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{nullptr};
151};
152
153std::ostream& operator<<(std::ostream& o, const CalorimeterHit& value);
154
155#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
156void to_json(nlohmann::json& j, const CalorimeterHit& value);
157#endif
158
159
160} // namespace edm4eic
161
162
163#endif
Definition CalorimeterHitCollectionData.h:31
Definition CalorimeterHitCollection.h:91
Definition CalorimeterHitCollection.h:36
Definition CalorimeterHit.h:46
float getTime() const
Access the The time of the hit in [ns].
Definition CalorimeterHit.cc:68
friend void swap(CalorimeterHit &a, CalorimeterHit &b)
Definition CalorimeterHit.h:140
const podio::ObjectID getObjectID() const
Definition CalorimeterHit.cc:92
const edm4hep::Vector3f & getPosition() const
Access the The global position of the hit in world coordinates [mm].
Definition CalorimeterHit.cc:70
bool isAvailable() const
check whether the object is actually available
Definition CalorimeterHit.cc:88
float getTimeError() const
Access the Error on the time.
Definition CalorimeterHit.cc:69
bool operator==(const CalorimeterHit &other) const
Definition CalorimeterHit.h:127
float getEnergy() const
Access the The energy for this hit in [GeV].
Definition CalorimeterHit.cc:66
CalorimeterHit & operator=(CalorimeterHit other)
copy-assignment operator
Definition CalorimeterHit.cc:38
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the cell [mm].
Definition CalorimeterHit.cc:71
bool operator!=(const CalorimeterHit &other) const
Definition CalorimeterHit.h:130
float getEnergyError() const
Access the Error on energy [GeV].
Definition CalorimeterHit.cc:67
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition CalorimeterHit.cc:65
bool operator<(const CalorimeterHit &other) const
Definition CalorimeterHit.h:134
std::int32_t getSector() const
Access the Sector that this hit occurred in.
Definition CalorimeterHit.cc:72
MutableCalorimeterHit clone(bool cloneRelations=true) const
Definition CalorimeterHit.cc:43
static constexpr auto typeName
Definition CalorimeterHit.h:84
const edm4hep::Vector3f & getLocal() const
Access the The local coordinates of the hit in the detector segment [mm].
Definition CalorimeterHit.cc:74
static CalorimeterHit makeEmpty()
Definition CalorimeterHit.cc:61
void unlink()
disconnect from CalorimeterHitObj instance
Definition CalorimeterHit.h:125
CalorimeterHit(const CalorimeterHit &other)=default
copy constructor
friend class CalorimeterHitCollection
Definition CalorimeterHit.h:49
friend class MutableCalorimeterHit
Definition CalorimeterHit.h:48
CalorimeterHit()
default constructor
Definition CalorimeterHit.cc:21
~CalorimeterHit()=default
destructor
podio::ObjectID id() const
Definition CalorimeterHit.h:136
std::int32_t getLayer() const
Access the Layer that the hit occurred in.
Definition CalorimeterHit.cc:73
bool operator!=(const MutableCalorimeterHit &other) const
Definition CalorimeterHit.h:131
const edm4hep::RawCalorimeterHit getRawHit() const
Access the Related raw calorimeter hit.
Definition CalorimeterHit.cc:76
Definition CalorimeterHitObj.h:21
Definition MutableCalorimeterHit.h:38
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:25
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150