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 <cstdint>
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
61 /// if cloneRelations=false, the relations are not cloned and will be empty
62 MutableCalorimeterHit clone(bool cloneRelations=true) const;
63
64 /// destructor
65 ~CalorimeterHit() = default;
66
67 /// converting constructor from mutable object
69
71
72public:
73
74 /// Access the The detector specific (geometrical) cell id.
75 std::uint64_t getCellID() const;
76
77 /// Access the The energy for this hit in [GeV].
78 float getEnergy() const;
79
80 /// Access the Error on energy [GeV].
81 float getEnergyError() const;
82
83 /// Access the The time of the hit in [ns].
84 float getTime() const;
85
86 /// Access the Error on the time
87 float getTimeError() const;
88
89 /// Access the The global position of the hit in world coordinates [mm].
90 const edm4hep::Vector3f& getPosition() const;
91
92 /// Access the The dimension information of the cell [mm].
93 const edm4hep::Vector3f& getDimension() const;
94
95 /// Access the Sector that this hit occurred in
96 std::int32_t getSector() const;
97
98 /// Access the Layer that the hit occurred in
99 std::int32_t getLayer() const;
100
101 /// Access the The local coordinates of the hit in the detector segment [mm].
102 const edm4hep::Vector3f& getLocal() const;
103
104
105 /// Access the Related raw calorimeter hit
106 const edm4hep::RawCalorimeterHit getRawHit() const;
107
108
109
110 /// check whether the object is actually available
111 bool isAvailable() const;
112 /// disconnect from CalorimeterHitObj instance
113 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{nullptr}; }
114
115 bool operator==(const CalorimeterHit& other) const { return m_obj == other.m_obj; }
116 bool operator==(const MutableCalorimeterHit& other) const;
117
118 bool operator!=(const CalorimeterHit& other) const { return !(*this == other); }
119 bool operator!=(const MutableCalorimeterHit& other) const { return !(*this == other); }
120
121 // less comparison operator, so that objects can be e.g. stored in sets.
122 bool operator<(const CalorimeterHit& other) const { return m_obj < other.m_obj; }
123
124 podio::ObjectID id() const { return getObjectID(); }
125
126 const podio::ObjectID getObjectID() const;
127
128 friend void swap(CalorimeterHit& a, CalorimeterHit& b) {
129 using std::swap;
130 swap(a.m_obj, b.m_obj); // swap out the internal pointers
131 }
132
133private:
134 /// constructor from existing CalorimeterHitObj
135 explicit CalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
137
138 podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{nullptr};
139};
140
141std::ostream& operator<<(std::ostream& o, const CalorimeterHit& value);
142
143#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
144void to_json(nlohmann::json& j, const CalorimeterHit& value);
145#endif
146
147
148} // namespace edm4eic
149
150
151#endif
Definition CalorimeterHitCollectionData.h:31
Definition CalorimeterHitCollection.h:92
Definition CalorimeterHitCollection.h:37
Definition CalorimeterHit.h:37
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:128
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:115
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:118
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:122
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
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:113
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:21
~CalorimeterHit()=default
destructor
podio::ObjectID id() const
Definition CalorimeterHit.h:124
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:119
const edm4hep::RawCalorimeterHit getRawHit() const
Access the Related raw calorimeter hit.
Definition CalorimeterHit.cc:76
Definition CalorimeterHitObj.h:21
Definition MutableCalorimeterHit.h:35
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:21