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
82 /// Set the Hit count associated with this radiator by IRT engine
83 void setNhits(const std::uint16_t nhits);
84 /// Get mutable reference to Hit count associated with this radiator by IRT engine
85 std::uint16_t& getNhits();
86
87 /// Set the Reconstructed Cherenkov angle
88 void setAngle(const float angle);
89 /// Get mutable reference to Reconstructed Cherenkov angle
90 float& getAngle();
91
92
93
94
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from IrtRadiatorInfoObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj>{nullptr}; }
101
102 constexpr bool operator==(const MutableIrtRadiatorInfo& other) const { return m_obj == other.m_obj; }
103 bool operator==(const IrtRadiatorInfo& other) const;
104
105 constexpr bool operator!=(const MutableIrtRadiatorInfo& other) const { return !(*this == other); }
106 bool operator!=(const IrtRadiatorInfo& other) const { return !(*this == other); }
107
108 // less comparison operator, so that objects can be e.g. stored in sets.
110
111 podio::ObjectID id() const { return getObjectID(); }
112
113 const podio::ObjectID getObjectID() const;
114
115 friend std::hash<MutableIrtRadiatorInfo>;
116
118 using std::swap;
119 swap(a.m_obj, b.m_obj); // swap out the internal pointers
120 }
121
122private:
123 /// constructor from existing IrtRadiatorInfoObj
124 explicit MutableIrtRadiatorInfo(podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> obj);
125
126 podio::utils::MaybeSharedPtr<IrtRadiatorInfoObj> m_obj{new IrtRadiatorInfoObj{}, podio::utils::MarkOwned};
127};
128
129#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
130void to_json(nlohmann::json& j, const MutableIrtRadiatorInfo& value);
131#endif
132
133
134} // namespace edm4eic
135
136
137
138template<>
139struct std::hash<edm4eic::MutableIrtRadiatorInfo> {
140 std::size_t operator()(const edm4eic::MutableIrtRadiatorInfo& obj) const {
141 return std::hash<edm4eic::IrtRadiatorInfoObj*>{}(obj.m_obj.get());
142 }
143};
144
145
146#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:117
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
void setNpe(const std::uint16_t npe)
Set the Detected photoelectron count.
Definition MutableIrtRadiatorInfo.cc:44
MutableIrtRadiatorInfo(const MutableIrtRadiatorInfo &other)=default
copy constructor
bool operator<(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:109
constexpr bool operator!=(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:105
constexpr bool operator==(const MutableIrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:102
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:111
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:100
bool operator!=(const IrtRadiatorInfo &other) const
Definition MutableIrtRadiatorInfo.h:106
Definition ArrowMapper.cc:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableIrtRadiatorInfo &obj) const
Definition MutableIrtRadiatorInfo.h:140