EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableIrtRadiatorInfo.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableIrtRadiatorInfo_H
4#define EDM4EIC_MutableIrtRadiatorInfo_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include <cstdint>
11
12#include "podio/utilities/MaybeSharedPtr.h"
13
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 edm4eic {
27
28
29/** @class MutableIrtRadiatorInfo
30 * IRT 2.1 output (radiator level)
31 * @author: A. Kiselev
32 */
34
37 friend class IrtRadiatorInfo;
38
39public:
42
43 /// default constructor
45
46 /// Constructor initializing all members
47 MutableIrtRadiatorInfo(const std::uint16_t npe, const std::uint16_t nhits, const float angle);
48
49 /// copy constructor
50 MutableIrtRadiatorInfo(const MutableIrtRadiatorInfo& other) noexcept = default;
51
52 /// move constructor
54
55 /// copy-assignment operator
56 MutableIrtRadiatorInfo& operator=(MutableIrtRadiatorInfo other) &; // Rebind this to other's internal object
57 MutableIrtRadiatorInfo& operator=(MutableIrtRadiatorInfo other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
58
59 /// create a mutable deep-copy of the object with identical relations
60 /// if cloneRelations=false, the relations are not cloned and will be empty
61 MutableIrtRadiatorInfo clone(bool cloneRelations=true) const;
62
63 /// destructor
65
66
67public:
68
69 /// Access the Detected photoelectron count
70 std::uint16_t getNpe() const;
71
72 /// Access the Hit count associated with this radiator by IRT engine
73 std::uint16_t getNhits() const;
74
75 /// Access the Reconstructed Cherenkov angle
76 float getAngle() const;
77
78
79
80 /// Set the Detected photoelectron count
81 void setNpe(const std::uint16_t npe);
82 /// Get mutable reference to Detected photoelectron count
83 std::uint16_t& getNpe();
84
85 /// Set the Hit count associated with this radiator by IRT engine
86 void setNhits(const std::uint16_t nhits);
87 /// Get mutable reference to Hit count associated with this radiator by IRT engine
88 std::uint16_t& getNhits();
89
90 /// Set the Reconstructed Cherenkov angle
91 void setAngle(const float angle);
92 /// Get mutable reference to Reconstructed Cherenkov angle
93 float& getAngle();
94
95
96
97
98
99
100 /// check whether the object is actually available
101 bool isAvailable() const;
102 /// disconnect from IrtRadiatorInfoObj instance
103 void unlink() { m_obj = podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj>{nullptr}; }
104
105 constexpr bool operator==(const MutableIrtRadiatorInfo& other) const { return m_obj == other.m_obj; }
106 bool operator==(const IrtRadiatorInfo& other) const;
107
108 constexpr bool operator!=(const MutableIrtRadiatorInfo& other) const { return !(*this == other); }
109 bool operator!=(const IrtRadiatorInfo& other) const { return !(*this == other); }
110
111 // less comparison operator, so that objects can be e.g. stored in sets.
113
114 podio::ObjectID id() const { return getObjectID(); }
115
116 const podio::ObjectID getObjectID() const;
117
118 friend std::hash<MutableIrtRadiatorInfo>;
119
121 using std::swap;
122 swap(a.m_obj, b.m_obj); // swap out the internal pointers
123 }
124
125private:
126 /// constructor from existing IrtRadiatorInfoObj
127 explicit MutableIrtRadiatorInfo(podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> obj);
128
129 podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> m_obj{new IrtRadiatorInfoObj{}, podio::utils::MarkOwned};
130};
131
132#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
133void to_json(nlohmann::json& j, const MutableIrtRadiatorInfo& value);
134#endif
135
136
137} // namespace edm4eic
138
139
140
141template<>
142struct std::hash<edm4eic::MutableIrtRadiatorInfo> {
143 std::size_t operator()(const edm4eic::MutableIrtRadiatorInfo& obj) const {
144 return std::hash<edm4eic::IrtRadiatorInfoObj*>{}(obj.m_obj.get());
145 }
146};
147
148
149#endif
Definition IrtRadiatorInfoCollection.h:139
Definition IrtRadiatorInfo.h:41
Definition IrtRadiatorInfoObj.h:17
Definition MutableIrtRadiatorInfo.h:33
friend void swap(MutableIrtRadiatorInfo &a, MutableIrtRadiatorInfo &b)
Definition MutableIrtRadiatorInfo.h:120
std::uint16_t getNpe() const
Access the Detected photoelectron count.
Definition MutableIrtRadiatorInfo.cc:39
MutableIrtRadiatorInfo & operator=(MutableIrtRadiatorInfo other) &
copy-assignment operator
Definition MutableIrtRadiatorInfo.cc:24
MutableIrtRadiatorInfo & operator=(MutableIrtRadiatorInfo other) &&=delete
friend class IrtRadiatorInfo
Definition MutableIrtRadiatorInfo.h:37
IrtRadiatorInfo object_type
Definition MutableIrtRadiatorInfo.h:40
~MutableIrtRadiatorInfo()=default
destructor
const podio::ObjectID getObjectID() const
Definition MutableIrtRadiatorInfo.cc:61
void setNhits(const std::uint16_t nhits)
Set the Hit count associated with this radiator by IRT engine.
Definition MutableIrtRadiatorInfo.cc:46
MutableIrtRadiatorInfo(const MutableIrtRadiatorInfo &other) noexcept=default
copy constructor
void setNpe(const std::uint16_t npe)
Set the Detected photoelectron count.
Definition MutableIrtRadiatorInfo.cc:44
bool operator<(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:112
constexpr bool operator!=(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:108
constexpr bool operator==(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:105
float getAngle() const
Access the Reconstructed Cherenkov angle.
Definition MutableIrtRadiatorInfo.cc:41
friend class IrtRadiatorInfoCollection
Definition MutableIrtRadiatorInfo.h:35
std::uint16_t getNhits() const
Access the Hit count associated with this radiator by IRT engine.
Definition MutableIrtRadiatorInfo.cc:40
bool isAvailable() const
check whether the object is actually available
Definition MutableIrtRadiatorInfo.cc:57
podio::ObjectID id() const
Definition MutableIrtRadiatorInfo.h:114
MutableIrtRadiatorInfo(MutableIrtRadiatorInfo &&other) noexcept=default
move constructor
friend class IrtRadiatorInfoMutableCollectionIterator
Definition MutableIrtRadiatorInfo.h:36
IrtRadiatorInfoCollection collection_type
Definition MutableIrtRadiatorInfo.h:41
MutableIrtRadiatorInfo()=default
default constructor
void setAngle(const float angle)
Set the Reconstructed Cherenkov angle.
Definition MutableIrtRadiatorInfo.cc:48
MutableIrtRadiatorInfo clone(bool cloneRelations=true) const
Definition MutableIrtRadiatorInfo.cc:29
void unlink()
disconnect from IrtRadiatorInfoObj instance
Definition MutableIrtRadiatorInfo.h:103
bool operator!=(const IrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:109
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableIrtRadiatorInfo &obj) const
Definition MutableIrtRadiatorInfo.h:143