EDM4eic
EIC data model
Loading...
Searching...
No Matches
PMTHit.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_PMTHit_H
4#define EDM4EIC_PMTHit_H
5
6#include "edm4eic/PMTHitObj.h"
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
21
22namespace edm4eic {
23
24class MutablePMTHit;
25class PMTHitCollection;
26class PMTHitCollectionData;
27
28/** @class PMTHit
29 * EIC PMT hit
30 * @author: S. Joosten, C. Peng
31 */
32class PMTHit {
33
34 friend class MutablePMTHit;
35 friend class PMTHitCollection;
38
39public:
42
43 /// default constructor
44 PMTHit();
45
46 /// Constructor initializing all members
47 PMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
48
49 /// copy constructor
50 PMTHit(const PMTHit& other) = default;
51
52 /// copy-assignment operator
53 PMTHit& operator=(PMTHit other);
54
55 /// create a mutable deep-copy of the object with identical relations
56 MutablePMTHit clone() const;
57
58 /// destructor
59 ~PMTHit() = default;
60
61
62 static PMTHit makeEmpty();
63
64public:
65
66 /// Access the The detector specific (geometrical) cell id.
67 std::uint64_t getCellID() const;
68
69 /// Access the Estimated number of photo-electrons [#]
70 float getNpe() const;
71
72 /// Access the Time [ns]
73 float getTime() const;
74
75 /// Access the Error on the time [ns]
76 float getTimeError() const;
77
78 /// Access the PMT hit position [mm]
79 const edm4hep::Vector3f& getPosition() const;
80
81 /// Access the The dimension information of the pixel [mm].
82 const edm4hep::Vector3f& getDimension() const;
83
84 /// Access the The sector this hit occurred in
85 std::int32_t getSector() const;
86
87 /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
88 const edm4hep::Vector3f& getLocal() const;
89
90
91
92
93
94 /// check whether the object is actually available
95 bool isAvailable() const;
96 /// disconnect from PMTHitObj instance
97 void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
98
99 bool operator==(const PMTHit& other) const { return m_obj == other.m_obj; }
100 bool operator==(const MutablePMTHit& other) const;
101
102 // less comparison operator, so that objects can be e.g. stored in sets.
103 bool operator<(const PMTHit& other) const { return m_obj < other.m_obj; }
104
105 podio::ObjectID id() const { return getObjectID(); }
106
107 const podio::ObjectID getObjectID() const;
108
109 friend void swap(PMTHit& a, PMTHit& b) {
110 using std::swap;
111 swap(a.m_obj, b.m_obj); // swap out the internal pointers
112 }
113
114private:
115 /// constructor from existing PMTHitObj
116 explicit PMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
117 PMTHit(PMTHitObj* obj);
118
119 podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
120};
121
122std::ostream& operator<<(std::ostream& o, const PMTHit& value);
123
124#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
125void to_json(nlohmann::json& j, const PMTHit& value);
126#endif
127
128
129} // namespace edm4eic
130
131
132#endif
Definition MutablePMTHit.h:31
Definition PMTHitCollectionData.h:30
Definition PMTHitCollection.h:95
Definition PMTHitCollection.h:40
Definition PMTHit.h:32
void unlink()
disconnect from PMTHitObj instance
Definition PMTHit.h:97
MutablePMTHit clone() const
create a mutable deep-copy of the object with identical relations
Definition PMTHit.cc:41
float getNpe() const
Access the Estimated number of photo-electrons [#].
Definition PMTHit.cc:54
PMTHit()
default constructor
Definition PMTHit.cc:21
bool operator<(const PMTHit &other) const
Definition PMTHit.h:103
friend class PMTHitCollection
Definition PMTHit.h:35
friend class MutablePMTHit
Definition PMTHit.h:34
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the pixel [mm].
Definition PMTHit.cc:58
PMTHit & operator=(PMTHit other)
copy-assignment operator
Definition PMTHit.cc:36
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition PMTHit.cc:53
friend void swap(PMTHit &a, PMTHit &b)
Definition PMTHit.h:109
const edm4hep::Vector3f & getLocal() const
Access the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition PMTHit.cc:60
~PMTHit()=default
destructor
float getTime() const
Access the Time [ns].
Definition PMTHit.cc:55
const podio::ObjectID getObjectID() const
Definition PMTHit.cc:74
const edm4hep::Vector3f & getPosition() const
Access the PMT hit position [mm].
Definition PMTHit.cc:57
float getTimeError() const
Access the Error on the time [ns].
Definition PMTHit.cc:56
PMTHit(const PMTHit &other)=default
copy constructor
static PMTHit makeEmpty()
Definition PMTHit.cc:49
podio::ObjectID id() const
Definition PMTHit.h:105
bool isAvailable() const
check whether the object is actually available
Definition PMTHit.cc:67
bool operator==(const PMTHit &other) const
Definition PMTHit.h:99
std::int32_t getSector() const
Access the The sector this hit occurred in.
Definition PMTHit.cc:59
Definition PMTHitObj.h:17
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97