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
51
52 /// copy-assignment operator
53 MutableIrtRadiatorInfo& operator=(MutableIrtRadiatorInfo other) &; // Rebind this to other's internal object
54 MutableIrtRadiatorInfo& operator=(MutableIrtRadiatorInfo other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
55
56 /// create a mutable deep-copy of the object with identical relations
57 /// if cloneRelations=false, the relations are not cloned and will be empty
58 MutableIrtRadiatorInfo clone(bool cloneRelations=true) const;
59
60 /// destructor
62
63
64public:
65
66 /// Access the Detected photoelectron count
67 std::uint16_t getNpe() const;
68
69 /// Access the Hit count associated with this radiator by IRT engine
70 std::uint16_t getNhits() const;
71
72 /// Access the Reconstructed Cherenkov angle
73 float getAngle() const;
74
75
76
77 /// Set the Detected photoelectron count
78 void setNpe(const std::uint16_t npe);
79 /// Get mutable reference to Detected photoelectron count
80 std::uint16_t& getNpe();
81 /// Get reference to Detected photoelectron count
82 [[deprecated("use getNpe instead")]]
83 std::uint16_t& npe();
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 /// Get reference to Hit count associated with this radiator by IRT engine
90 [[deprecated("use getNhits instead")]]
91 std::uint16_t& nhits();
92
93 /// Set the Reconstructed Cherenkov angle
94 void setAngle(const float angle);
95 /// Get mutable reference to Reconstructed Cherenkov angle
96 float& getAngle();
97 /// Get reference to Reconstructed Cherenkov angle
98 [[deprecated("use getAngle instead")]]
99 float& angle();
100
101
102
103
104
105
106 /// check whether the object is actually available
107 bool isAvailable() const;
108 /// disconnect from IrtRadiatorInfoObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj>{nullptr}; }
110
111 bool operator==(const MutableIrtRadiatorInfo& other) const { return m_obj == other.m_obj; }
112 bool operator==(const IrtRadiatorInfo& other) const;
113
114 bool operator!=(const MutableIrtRadiatorInfo& other) const { return !(*this == other); }
115 bool operator!=(const IrtRadiatorInfo& other) const { return !(*this == other); }
116
117 // less comparison operator, so that objects can be e.g. stored in sets.
119
120 podio::ObjectID id() const { return getObjectID(); }
121
122 const podio::ObjectID getObjectID() const;
123
124 friend std::hash<MutableIrtRadiatorInfo>;
125
127 using std::swap;
128 swap(a.m_obj, b.m_obj); // swap out the internal pointers
129 }
130
131private:
132 /// constructor from existing IrtRadiatorInfoObj
133 explicit MutableIrtRadiatorInfo(podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> obj);
134
135 podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> m_obj{new IrtRadiatorInfoObj{}, podio::utils::MarkOwned};
136};
137
138#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
139void to_json(nlohmann::json& j, const MutableIrtRadiatorInfo& value);
140#endif
141
142
143} // namespace edm4eic
144
145
146
147template<>
148struct std::hash<edm4eic::MutableIrtRadiatorInfo> {
149 std::size_t operator()(const edm4eic::MutableIrtRadiatorInfo& obj) const {
150 return std::hash<edm4eic::IrtRadiatorInfoObj*>{}(obj.m_obj.get());
151 }
152};
153
154
155#endif
Definition IrtRadiatorInfoCollection.h:138
Definition IrtRadiatorInfo.h:41
Definition IrtRadiatorInfoObj.h:17
Definition MutableIrtRadiatorInfo.h:33
friend void swap(MutableIrtRadiatorInfo &a, MutableIrtRadiatorInfo &b)
Definition MutableIrtRadiatorInfo.h:126
std::uint16_t getNpe() const
Access the Detected photoelectron count.
Definition MutableIrtRadiatorInfo.cc:39
std::uint16_t & npe()
Get reference to Detected photoelectron count.
Definition MutableIrtRadiatorInfo.cc:46
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:64
void setNhits(const std::uint16_t nhits)
Set the Hit count associated with this radiator by IRT engine.
Definition MutableIrtRadiatorInfo.cc:47
void setNpe(const std::uint16_t npe)
Set the Detected photoelectron count.
Definition MutableIrtRadiatorInfo.cc:44
MutableIrtRadiatorInfo(const MutableIrtRadiatorInfo &other)=default
copy constructor
std::uint16_t & nhits()
Get reference to Hit count associated with this radiator by IRT engine.
Definition MutableIrtRadiatorInfo.cc:49
bool operator<(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:118
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 operator!=(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:114
bool isAvailable() const
check whether the object is actually available
Definition MutableIrtRadiatorInfo.cc:60
podio::ObjectID id() const
Definition MutableIrtRadiatorInfo.h:120
float & angle()
Get reference to Reconstructed Cherenkov angle.
Definition MutableIrtRadiatorInfo.cc:52
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:50
bool operator==(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:111
MutableIrtRadiatorInfo clone(bool cloneRelations=true) const
Definition MutableIrtRadiatorInfo.cc:29
void unlink()
disconnect from IrtRadiatorInfoObj instance
Definition MutableIrtRadiatorInfo.h:109
bool operator!=(const IrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:115
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableIrtRadiatorInfo &obj) const
Definition MutableIrtRadiatorInfo.h:149