EDM4eic
EIC data model
Loading...
Searching...
No Matches
IrtRadiatorInfo.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_IrtRadiatorInfo_H
4#define EDM4EIC_IrtRadiatorInfo_H
5
7
8#include <cstdint>
9
10#include "podio/utilities/MaybeSharedPtr.h"
11#include "podio/detail/OrderKey.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// forward declarations
21namespace edm4eic {
23}
24
25
26namespace podio::detail {
27// Internal function used in less comparison operators of the datatypes and interface types
28OrderKey getOrderKey(const edm4eic::IrtRadiatorInfo& obj);
29};
30
31namespace edm4eic {
32
36
37/** @class IrtRadiatorInfo
38 * IRT 2.1 output (radiator level)
39 * @author: A. Kiselev
40 */
42
47 friend podio::detail::OrderKey podio::detail::getOrderKey(const IrtRadiatorInfo & obj);
48
49public:
52
53 /// default constructor
54 IrtRadiatorInfo() = default;
55
56 /// Constructor initializing all members
57 IrtRadiatorInfo(const std::uint16_t npe, const std::uint16_t nhits, const float angle);
58
59 /// copy constructor
60 IrtRadiatorInfo(const IrtRadiatorInfo& other) = default;
61
62 /// copy-assignment operator
63 IrtRadiatorInfo& operator=(IrtRadiatorInfo other) &; // Rebind this to other's internal object
64 IrtRadiatorInfo& operator=(IrtRadiatorInfo other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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 MutableIrtRadiatorInfo clone(bool cloneRelations=true) const;
69
70 /// destructor
71 ~IrtRadiatorInfo() = default;
72
73 /// converting constructor from mutable object
75
77
78public:
79
80 static constexpr std::string_view typeName = "edm4eic::IrtRadiatorInfo";
81
82 /// Access the Detected photoelectron count
83 std::uint16_t getNpe() const;
84
85 /// Access the Hit count associated with this radiator by IRT engine
86 std::uint16_t getNhits() const;
87
88 /// Access the Reconstructed Cherenkov angle
89 float getAngle() const;
90
91
92
93
94
95 /// check whether the object is actually available
96 bool isAvailable() const;
97 /// disconnect from IrtRadiatorInfoObj instance
98 void unlink() { m_obj = podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj>{nullptr}; }
99
100 bool operator==(const IrtRadiatorInfo& other) const { return m_obj == other.m_obj; }
101 bool operator==(const MutableIrtRadiatorInfo& other) const;
102
103 bool operator!=(const IrtRadiatorInfo& other) const { return !(*this == other); }
104 bool operator!=(const MutableIrtRadiatorInfo& other) const { return !(*this == other); }
105
106 // less comparison operator, so that objects can be e.g. stored in sets.
107 bool operator<(const IrtRadiatorInfo& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
108
109 podio::ObjectID id() const { return getObjectID(); }
110
111 const podio::ObjectID getObjectID() const;
112
113 friend std::hash<IrtRadiatorInfo>;
114
116 using std::swap;
117 swap(a.m_obj, b.m_obj); // swap out the internal pointers
118 }
119
120private:
121 /// constructor from existing IrtRadiatorInfoObj
122 explicit IrtRadiatorInfo(podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> obj);
124
125 podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> m_obj{new IrtRadiatorInfoObj{}, podio::utils::MarkOwned};
126};
127
128std::ostream& operator<<(std::ostream& o, const IrtRadiatorInfo& value);
129
130#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
131void to_json(nlohmann::json& j, const IrtRadiatorInfo& value);
132#endif
133
134
135} // namespace edm4eic
136
137
138
139template<>
140struct std::hash<edm4eic::IrtRadiatorInfo> {
141 std::size_t operator()(const edm4eic::IrtRadiatorInfo& obj) const {
142 return std::hash<edm4eic::IrtRadiatorInfoObj*>{}(obj.m_obj.get());
143 }
144};
145
146
147// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
148// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
149// and https://github.com/AIDASoft/podio/issues/770
150#if defined(__clang__)
151 #pragma clang diagnostic push
152 #pragma clang diagnostic ignored "-Wunknown-warning-option"
153 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
154 #pragma clang diagnostic ignored "-Wdeprecated"
155constexpr std::string_view edm4eic::IrtRadiatorInfo::typeName;
156 #pragma clang diagnostic pop
157#elif defined(__GNUC__)
158 #pragma GCC diagnostic push
159 #pragma GCC diagnostic ignored "-Wdeprecated"
160constexpr std::string_view edm4eic::IrtRadiatorInfo::typeName;
161 #pragma GCC diagnostic pop
162#endif
163
164
165#endif
Definition IrtRadiatorInfoCollectionData.h:31
Definition IrtRadiatorInfoCollection.h:138
Definition IrtRadiatorInfo.h:41
bool operator<(const IrtRadiatorInfo &other) const
Definition IrtRadiatorInfo.h:107
friend class IrtRadiatorInfoCollectionIterator
Definition IrtRadiatorInfo.h:46
IrtRadiatorInfo & operator=(IrtRadiatorInfo other) &
copy-assignment operator
Definition IrtRadiatorInfo.cc:26
bool operator!=(const MutableIrtRadiatorInfo &other) const
Definition IrtRadiatorInfo.h:104
float getAngle() const
Access the Reconstructed Cherenkov angle.
Definition IrtRadiatorInfo.cc:52
const podio::ObjectID getObjectID() const
Definition IrtRadiatorInfo.cc:63
bool operator==(const IrtRadiatorInfo &other) const
Definition IrtRadiatorInfo.h:100
std::uint16_t getNpe() const
Access the Detected photoelectron count.
Definition IrtRadiatorInfo.cc:50
IrtRadiatorInfo()=default
default constructor
static IrtRadiatorInfo makeEmpty()
Definition IrtRadiatorInfo.cc:46
IrtRadiatorInfo & operator=(IrtRadiatorInfo other) &&=delete
IrtRadiatorInfoCollection collection_type
Definition IrtRadiatorInfo.h:51
~IrtRadiatorInfo()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition IrtRadiatorInfo.cc:59
friend void swap(IrtRadiatorInfo &a, IrtRadiatorInfo &b)
Definition IrtRadiatorInfo.h:115
MutableIrtRadiatorInfo clone(bool cloneRelations=true) const
Definition IrtRadiatorInfo.cc:31
friend class IrtRadiatorInfoCollection
Definition IrtRadiatorInfo.h:44
MutableIrtRadiatorInfo mutable_type
Definition IrtRadiatorInfo.h:50
void unlink()
disconnect from IrtRadiatorInfoObj instance
Definition IrtRadiatorInfo.h:98
std::uint16_t getNhits() const
Access the Hit count associated with this radiator by IRT engine.
Definition IrtRadiatorInfo.cc:51
IrtRadiatorInfo(const IrtRadiatorInfo &other)=default
copy constructor
bool operator!=(const IrtRadiatorInfo &other) const
Definition IrtRadiatorInfo.h:103
podio::ObjectID id() const
Definition IrtRadiatorInfo.h:109
static constexpr std::string_view typeName
Definition IrtRadiatorInfo.h:80
friend class MutableIrtRadiatorInfo
Definition IrtRadiatorInfo.h:43
Definition IrtRadiatorInfoObj.h:17
Definition MutableIrtRadiatorInfo.h:33
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::IrtRadiatorInfo &obj) const
Definition IrtRadiatorInfo.h:141