EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutablePMTHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutablePMTHit_H
4#define EDM4EIC_MutablePMTHit_H
5
6#include "edm4eic/PMTHitObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/PMTHit.h"
9
10#include "edm4hep/Vector3f.h"
11#include <cstdint>
12
13#include "podio/utilities/MaybeSharedPtr.h"
14
15#include <ostream>
16#include <cstddef>
17
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
20#endif
21
22
23
24namespace edm4eic {
25
26
27/** @class MutablePMTHit
28 * EIC PMT hit
29 * @author: S. Joosten, C. Peng
30 */
32
33 friend class PMTHitCollection;
35 friend class PMTHit;
36
37public:
40
41 /// default constructor
43
44 /// Constructor initializing all members
45 MutablePMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
46
47 /// copy constructor
48 MutablePMTHit(const MutablePMTHit& other) = default;
49
50 /// copy-assignment operator
52
53 /// create a mutable deep-copy of the object with identical relations
54 MutablePMTHit clone() const;
55
56 /// destructor
57 ~MutablePMTHit() = default;
58
59
60 /// conversion to const object
61 operator PMTHit() const;
62
63public:
64
65 /// Access the The detector specific (geometrical) cell id.
66 std::uint64_t getCellID() const;
67
68 /// Access the Estimated number of photo-electrons [#]
69 float getNpe() const;
70
71 /// Access the Time [ns]
72 float getTime() const;
73
74 /// Access the Error on the time [ns]
75 float getTimeError() const;
76
77 /// Access the PMT hit position [mm]
78 const edm4hep::Vector3f& getPosition() const;
79
80 /// Access the The dimension information of the pixel [mm].
81 const edm4hep::Vector3f& getDimension() const;
82
83 /// Access the The sector this hit occurred in
84 std::int32_t getSector() const;
85
86 /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
87 const edm4hep::Vector3f& getLocal() const;
88
89
90
91 /// Set the The detector specific (geometrical) cell id.
92 void setCellID(std::uint64_t value);
93
94 /// Set the Estimated number of photo-electrons [#]
95 void setNpe(float value);
96
97 /// Set the Time [ns]
98 void setTime(float value);
99
100 /// Set the Error on the time [ns]
101 void setTimeError(float value);
102
103 /// Set the PMT hit position [mm]
104 void setPosition(edm4hep::Vector3f value);
105 /// Get reference to PMT hit position [mm]
106 edm4hep::Vector3f& position();
107
108 /// Set the The dimension information of the pixel [mm].
109 void setDimension(edm4hep::Vector3f value);
110 /// Get reference to The dimension information of the pixel [mm].
111 edm4hep::Vector3f& dimension();
112
113 /// Set the The sector this hit occurred in
114 void setSector(std::int32_t value);
115
116 /// Set the The local position of the hit in detector coordinates (relative to the sector) [mm]
117 void setLocal(edm4hep::Vector3f value);
118 /// Get reference to The local position of the hit in detector coordinates (relative to the sector) [mm]
119 edm4hep::Vector3f& local();
120
121
122
123
124
125
126 /// check whether the object is actually available
127 bool isAvailable() const;
128 /// disconnect from PMTHitObj instance
129 void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
130
131 bool operator==(const MutablePMTHit& other) const { return m_obj == other.m_obj; }
132 bool operator==(const PMTHit& other) const;
133
134 // less comparison operator, so that objects can be e.g. stored in sets.
135 bool operator<(const MutablePMTHit& other) const { return m_obj < other.m_obj; }
136
137 podio::ObjectID id() const { return getObjectID(); }
138
139 const podio::ObjectID getObjectID() const;
140
141 friend void swap(MutablePMTHit& a, MutablePMTHit& b) {
142 using std::swap;
143 swap(a.m_obj, b.m_obj); // swap out the internal pointers
144 }
145
146private:
147 /// constructor from existing PMTHitObj
148 explicit MutablePMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
149
150 podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
151};
152
153#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
154void to_json(nlohmann::json& j, const MutablePMTHit& value);
155#endif
156
157
158} // namespace edm4eic
159
160
161#endif
Definition MutablePMTHit.h:31
bool isAvailable() const
check whether the object is actually available
Definition MutablePMTHit.cc:76
void setLocal(edm4hep::Vector3f value)
Set the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition MutablePMTHit.cc:67
void setDimension(edm4hep::Vector3f value)
Set the The dimension information of the pixel [mm].
Definition MutablePMTHit.cc:64
const edm4hep::Vector3f & getPosition() const
Access the PMT hit position [mm].
Definition MutablePMTHit.cc:52
MutablePMTHit & operator=(MutablePMTHit other)
copy-assignment operator
Definition MutablePMTHit.cc:36
friend class PMTHitCollection
Definition MutablePMTHit.h:33
void setNpe(float value)
Set the Estimated number of photo-electrons [#].
Definition MutablePMTHit.cc:59
void setTime(float value)
Set the Time [ns].
Definition MutablePMTHit.cc:60
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the pixel [mm].
Definition MutablePMTHit.cc:53
std::int32_t getSector() const
Access the The sector this hit occurred in.
Definition MutablePMTHit.cc:54
~MutablePMTHit()=default
destructor
void setCellID(std::uint64_t value)
Set the The detector specific (geometrical) cell id.
Definition MutablePMTHit.cc:58
MutablePMTHit()
default constructor
Definition MutablePMTHit.cc:21
float getNpe() const
Access the Estimated number of photo-electrons [#].
Definition MutablePMTHit.cc:49
bool operator==(const MutablePMTHit &other) const
Definition MutablePMTHit.h:131
void setTimeError(float value)
Set the Error on the time [ns].
Definition MutablePMTHit.cc:61
edm4hep::Vector3f & local()
Get reference to The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition MutablePMTHit.cc:68
MutablePMTHit clone() const
create a mutable deep-copy of the object with identical relations
Definition MutablePMTHit.cc:41
float getTimeError() const
Access the Error on the time [ns].
Definition MutablePMTHit.cc:51
friend class PMTHit
Definition MutablePMTHit.h:35
void setPosition(edm4hep::Vector3f value)
Set the PMT hit position [mm].
Definition MutablePMTHit.cc:62
podio::ObjectID id() const
Definition MutablePMTHit.h:137
const edm4hep::Vector3f & getLocal() const
Access the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition MutablePMTHit.cc:55
float getTime() const
Access the Time [ns].
Definition MutablePMTHit.cc:50
edm4hep::Vector3f & position()
Get reference to PMT hit position [mm].
Definition MutablePMTHit.cc:63
bool operator<(const MutablePMTHit &other) const
Definition MutablePMTHit.h:135
const podio::ObjectID getObjectID() const
Definition MutablePMTHit.cc:83
edm4hep::Vector3f & dimension()
Get reference to The dimension information of the pixel [mm].
Definition MutablePMTHit.cc:65
void setSector(std::int32_t value)
Set the The sector this hit occurred in.
Definition MutablePMTHit.cc:66
friend void swap(MutablePMTHit &a, MutablePMTHit &b)
Definition MutablePMTHit.h:141
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition MutablePMTHit.cc:48
MutablePMTHit(const MutablePMTHit &other)=default
copy constructor
void unlink()
disconnect from PMTHitObj instance
Definition MutablePMTHit.h:129
Definition PMTHitCollection.h:95
Definition PMTHit.h:32
Definition PMTHitCollection.h:66
Definition CalorimeterHit.cc:18