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#include "podio/detail/OrderKey.h"
13
14#include <ostream>
15#include <cstdint>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21// forward declarations
22namespace edm4eic {
23class PMTHitCollection;
24}
25
26
27namespace podio::detail {
28// Internal function used in less comparison operators of the datatypes and interface types
29OrderKey getOrderKey(const edm4eic::PMTHit& obj);
30};
31
32namespace edm4eic {
33
34class MutablePMTHit;
35class PMTHitCollection;
36class PMTHitCollectionData;
37
38/** @class PMTHit
39 * EIC PMT hit
40 * @author: S. Joosten, C. Peng
41 */
42class PMTHit {
43
44 friend class MutablePMTHit;
45 friend class PMTHitCollection;
48 friend podio::detail::OrderKey podio::detail::getOrderKey(const PMTHit & obj);
49
50public:
53
54 /// default constructor
55 PMTHit();
56
57 /// Constructor initializing all members
58 PMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
59
60 /// copy constructor
61 PMTHit(const PMTHit& other) = default;
62
63 /// copy-assignment operator
64 PMTHit& operator=(PMTHit other);
65
66 /// create a mutable deep-copy of the object with identical relations
67 /// if cloneRelations=false, the relations are not cloned and will be empty
68 MutablePMTHit clone(bool cloneRelations=true) const;
69
70 /// destructor
71 ~PMTHit() = default;
72
73 /// converting constructor from mutable object
74 PMTHit(const MutablePMTHit& other);
75
76 static PMTHit makeEmpty();
77
78public:
79
80 static constexpr auto typeName = "edm4eic::PMTHit";
81
82 /// Access the The detector specific (geometrical) cell id.
83 std::uint64_t getCellID() const;
84
85 /// Access the Estimated number of photo-electrons [#]
86 float getNpe() const;
87
88 /// Access the Time [ns]
89 float getTime() const;
90
91 /// Access the Error on the time [ns]
92 float getTimeError() const;
93
94 /// Access the PMT hit position [mm]
95 const edm4hep::Vector3f& getPosition() const;
96
97 /// Access the The dimension information of the pixel [mm].
98 const edm4hep::Vector3f& getDimension() const;
99
100 /// Access the The sector this hit occurred in
101 std::int32_t getSector() const;
102
103 /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
104 const edm4hep::Vector3f& getLocal() const;
105
106
107
108
109
110 /// check whether the object is actually available
111 bool isAvailable() const;
112 /// disconnect from PMTHitObj instance
113 void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
114
115 bool operator==(const PMTHit& other) const { return m_obj == other.m_obj; }
116 bool operator==(const MutablePMTHit& other) const;
117
118 bool operator!=(const PMTHit& other) const { return !(*this == other); }
119 bool operator!=(const MutablePMTHit& other) const { return !(*this == other); }
120
121 // less comparison operator, so that objects can be e.g. stored in sets.
122 bool operator<(const PMTHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
123
124 podio::ObjectID id() const { return getObjectID(); }
125
126 const podio::ObjectID getObjectID() const;
127
128 friend void swap(PMTHit& a, PMTHit& 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 PMTHitObj
135 explicit PMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
136 PMTHit(PMTHitObj* obj);
137
138 podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
139};
140
141std::ostream& operator<<(std::ostream& o, const PMTHit& value);
142
143#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
144void to_json(nlohmann::json& j, const PMTHit& value);
145#endif
146
147
148} // namespace edm4eic
149
150
151#endif
Definition MutablePMTHit.h:34
Definition PMTHitCollectionData.h:30
Definition PMTHitCollection.h:91
Definition PMTHitCollection.h:36
Definition PMTHit.h:42
void unlink()
disconnect from PMTHitObj instance
Definition PMTHit.h:113
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
static constexpr auto typeName
Definition PMTHit.h:80
bool operator<(const PMTHit &other) const
Definition PMTHit.h:122
friend class PMTHitCollection
Definition PMTHit.h:45
friend class MutablePMTHit
Definition PMTHit.h:44
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:118
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:128
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:119
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:124
bool isAvailable() const
check whether the object is actually available
Definition PMTHit.cc:73
bool operator==(const PMTHit &other) const
Definition PMTHit.h:115
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
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150