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 <cstdint>
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 /// if cloneRelations=false, the relations are not cloned and will be empty
57 MutablePMTHit clone(bool cloneRelations=true) const;
58
59 /// destructor
60 ~PMTHit() = default;
61
62 /// converting constructor from mutable object
63 PMTHit(const MutablePMTHit& other);
64
65 static PMTHit makeEmpty();
66
67public:
68
69 /// Access the The detector specific (geometrical) cell id.
70 std::uint64_t getCellID() const;
71
72 /// Access the Estimated number of photo-electrons [#]
73 float getNpe() const;
74
75 /// Access the Time [ns]
76 float getTime() const;
77
78 /// Access the Error on the time [ns]
79 float getTimeError() const;
80
81 /// Access the PMT hit position [mm]
82 const edm4hep::Vector3f& getPosition() const;
83
84 /// Access the The dimension information of the pixel [mm].
85 const edm4hep::Vector3f& getDimension() const;
86
87 /// Access the The sector this hit occurred in
88 std::int32_t getSector() const;
89
90 /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
91 const edm4hep::Vector3f& getLocal() const;
92
93
94
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from PMTHitObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
101
102 bool operator==(const PMTHit& other) const { return m_obj == other.m_obj; }
103 bool operator==(const MutablePMTHit& other) const;
104
105 bool operator!=(const PMTHit& other) const { return !(*this == other); }
106 bool operator!=(const MutablePMTHit& other) const { return !(*this == other); }
107
108 // less comparison operator, so that objects can be e.g. stored in sets.
109 bool operator<(const PMTHit& other) const { return m_obj < other.m_obj; }
110
111 podio::ObjectID id() const { return getObjectID(); }
112
113 const podio::ObjectID getObjectID() const;
114
115 friend void swap(PMTHit& a, PMTHit& b) {
116 using std::swap;
117 swap(a.m_obj, b.m_obj); // swap out the internal pointers
118 }
119
120private:
121 /// constructor from existing PMTHitObj
122 explicit PMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
123 PMTHit(PMTHitObj* obj);
124
125 podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
126};
127
128std::ostream& operator<<(std::ostream& o, const PMTHit& value);
129
130#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
131void to_json(nlohmann::json& j, const PMTHit& value);
132#endif
133
134
135} // namespace edm4eic
136
137
138#endif
Definition MutablePMTHit.h:30
Definition PMTHitCollectionData.h:30
Definition PMTHitCollection.h:92
Definition PMTHitCollection.h:37
Definition PMTHit.h:32
void unlink()
disconnect from PMTHitObj instance
Definition PMTHit.h:100
float getNpe() const
Access the Estimated number of photo-electrons [#].
Definition PMTHit.cc:60
MutablePMTHit clone(bool cloneRelations=true) const
Definition PMTHit.cc:40
PMTHit()
default constructor
Definition PMTHit.cc:20
bool operator<(const PMTHit &other) const
Definition PMTHit.h:109
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:64
bool operator!=(const PMTHit &other) const
Definition PMTHit.h:105
PMTHit & operator=(PMTHit other)
copy-assignment operator
Definition PMTHit.cc:35
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition PMTHit.cc:59
friend void swap(PMTHit &a, PMTHit &b)
Definition PMTHit.h:115
const edm4hep::Vector3f & getLocal() const
Access the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition PMTHit.cc:66
~PMTHit()=default
destructor
float getTime() const
Access the Time [ns].
Definition PMTHit.cc:61
const podio::ObjectID getObjectID() const
Definition PMTHit.cc:77
bool operator!=(const MutablePMTHit &other) const
Definition PMTHit.h:106
const edm4hep::Vector3f & getPosition() const
Access the PMT hit position [mm].
Definition PMTHit.cc:63
float getTimeError() const
Access the Error on the time [ns].
Definition PMTHit.cc:62
PMTHit(const PMTHit &other)=default
copy constructor
static PMTHit makeEmpty()
Definition PMTHit.cc:55
podio::ObjectID id() const
Definition PMTHit.h:111
bool isAvailable() const
check whether the object is actually available
Definition PMTHit.cc:73
bool operator==(const PMTHit &other) const
Definition PMTHit.h:102
std::int32_t getSector() const
Access the The sector this hit occurred in.
Definition PMTHit.cc:65
Definition PMTHitObj.h:17
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103