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