EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableInclusiveKinematics.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableInclusiveKinematics_H
4#define EDM4EIC_MutableInclusiveKinematics_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10
11#include "podio/utilities/MaybeSharedPtr.h"
12
13#include <cstdint>
14
15#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
16#include "nlohmann/json_fwd.hpp"
17#endif
18
19// forward declarations
20namespace edm4eic {
24}
25
26
27namespace edm4eic {
28
29
30/** @class MutableInclusiveKinematics
31 * Kinematic variables for DIS events
32 * @author: S. Joosten, W. Deconinck
33 */
35
38 friend class InclusiveKinematics;
39
40public:
43
44 /// default constructor
46
47 /// Constructor initializing all members
48 MutableInclusiveKinematics(const float x, const float Q2, const float W, const float y, const float nu);
49
50 /// copy constructor
52
53 /// copy-assignment operator
54 MutableInclusiveKinematics& operator=(MutableInclusiveKinematics other) &; // Rebind this to other's internal object
55 MutableInclusiveKinematics& operator=(MutableInclusiveKinematics other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
56
57 /// create a mutable deep-copy of the object with identical relations
58 /// if cloneRelations=false, the relations are not cloned and will be empty
59 MutableInclusiveKinematics clone(bool cloneRelations=true) const;
60
61 /// destructor
63
64
65public:
66
67 /// Access the Bjorken x (Q2/2P.q)
68 float getX() const;
69
70 /// Access the Four-momentum transfer squared [GeV^2]
71 float getQ2() const;
72
73 /// Access the Invariant mass of final state [GeV]
74 float getW() const;
75
76 /// Access the Inelasticity (P.q/P.k)
77 float getY() const;
78
79 /// Access the Energy transfer P.q/M [GeV]
80 float getNu() const;
81
82
83 /// Access the Associated scattered electron (if identified)
85
86 /// Set the Bjorken x (Q2/2P.q)
87 void setX(const float x);
88 /// Get mutable reference to Bjorken x (Q2/2P.q)
89 float& getX();
90 /// Get reference to Bjorken x (Q2/2P.q)
91 [[deprecated("use getX instead")]]
92 float& x();
93
94 /// Set the Four-momentum transfer squared [GeV^2]
95 void setQ2(const float Q2);
96 /// Get mutable reference to Four-momentum transfer squared [GeV^2]
97 float& getQ2();
98 /// Get reference to Four-momentum transfer squared [GeV^2]
99 [[deprecated("use getQ2 instead")]]
100 float& Q2();
101
102 /// Set the Invariant mass of final state [GeV]
103 void setW(const float W);
104 /// Get mutable reference to Invariant mass of final state [GeV]
105 float& getW();
106 /// Get reference to Invariant mass of final state [GeV]
107 [[deprecated("use getW instead")]]
108 float& W();
109
110 /// Set the Inelasticity (P.q/P.k)
111 void setY(const float y);
112 /// Get mutable reference to Inelasticity (P.q/P.k)
113 float& getY();
114 /// Get reference to Inelasticity (P.q/P.k)
115 [[deprecated("use getY instead")]]
116 float& y();
117
118 /// Set the Energy transfer P.q/M [GeV]
119 void setNu(const float nu);
120 /// Get mutable reference to Energy transfer P.q/M [GeV]
121 float& getNu();
122 /// Get reference to Energy transfer P.q/M [GeV]
123 [[deprecated("use getNu instead")]]
124 float& nu();
125
126
127 /// Set the Associated scattered electron (if identified)
128 void setScat(const edm4eic::ReconstructedParticle& value);
129
130
131
132
133 /// check whether the object is actually available
134 bool isAvailable() const;
135 /// disconnect from InclusiveKinematicsObj instance
136 void unlink() { m_obj = podio::utils::MaybeSharedPtr<InclusiveKinematicsObj>{nullptr}; }
137
138 bool operator==(const MutableInclusiveKinematics& other) const { return m_obj == other.m_obj; }
139 bool operator==(const InclusiveKinematics& other) const;
140
141 bool operator!=(const MutableInclusiveKinematics& other) const { return !(*this == other); }
142 bool operator!=(const InclusiveKinematics& other) const { return !(*this == other); }
143
144 // less comparison operator, so that objects can be e.g. stored in sets.
146
147 podio::ObjectID id() const { return getObjectID(); }
148
149 const podio::ObjectID getObjectID() const;
150
151 friend std::hash<MutableInclusiveKinematics>;
152
154 using std::swap;
155 swap(a.m_obj, b.m_obj); // swap out the internal pointers
156 }
157
158private:
159 /// constructor from existing InclusiveKinematicsObj
160 explicit MutableInclusiveKinematics(podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> obj);
161
162 podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> m_obj{nullptr};
163};
164
165#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
166void to_json(nlohmann::json& j, const MutableInclusiveKinematics& value);
167#endif
168
169
170} // namespace edm4eic
171
172
173
174template<>
175struct std::hash<edm4eic::MutableInclusiveKinematics> {
176 std::size_t operator()(const edm4eic::MutableInclusiveKinematics& obj) const {
177 return std::hash<edm4eic::InclusiveKinematicsObj*>{}(obj.m_obj.get());
178 }
179};
180
181
182#endif
Definition InclusiveKinematicsCollection.h:137
Definition InclusiveKinematics.h:42
Definition MutableInclusiveKinematics.h:34
MutableInclusiveKinematics()
default constructor
Definition MutableInclusiveKinematics.cc:19
void setW(const float W)
Set the Invariant mass of final state [GeV].
Definition MutableInclusiveKinematics.cc:66
float getNu() const
Access the Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:50
void setNu(const float nu)
Set the Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:72
friend class InclusiveKinematicsMutableCollectionIterator
Definition MutableInclusiveKinematics.h:37
InclusiveKinematics object_type
Definition MutableInclusiveKinematics.h:41
float & x()
Get reference to Bjorken x (Q2/2P.q)
Definition MutableInclusiveKinematics.cc:62
float getX() const
Access the Bjorken x (Q2/2P.q)
Definition MutableInclusiveKinematics.cc:46
float & Q2()
Get reference to Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:65
MutableInclusiveKinematics(const MutableInclusiveKinematics &other)=default
copy constructor
MutableInclusiveKinematics & operator=(MutableInclusiveKinematics other) &
copy-assignment operator
Definition MutableInclusiveKinematics.cc:31
bool operator!=(const InclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:142
float & y()
Get reference to Inelasticity (P.q/P.k)
Definition MutableInclusiveKinematics.cc:71
float getY() const
Access the Inelasticity (P.q/P.k)
Definition MutableInclusiveKinematics.cc:49
void unlink()
disconnect from InclusiveKinematicsObj instance
Definition MutableInclusiveKinematics.h:136
void setY(const float y)
Set the Inelasticity (P.q/P.k)
Definition MutableInclusiveKinematics.cc:69
podio::ObjectID id() const
Definition MutableInclusiveKinematics.h:147
friend class InclusiveKinematicsCollection
Definition MutableInclusiveKinematics.h:36
MutableInclusiveKinematics clone(bool cloneRelations=true) const
Definition MutableInclusiveKinematics.cc:36
bool isAvailable() const
check whether the object is actually available
Definition MutableInclusiveKinematics.cc:86
bool operator==(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:138
InclusiveKinematicsCollection collection_type
Definition MutableInclusiveKinematics.h:42
bool operator<(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:145
~MutableInclusiveKinematics()=default
destructor
void setX(const float x)
Set the Bjorken x (Q2/2P.q)
Definition MutableInclusiveKinematics.cc:60
const podio::ObjectID getObjectID() const
Definition MutableInclusiveKinematics.cc:90
float getQ2() const
Access the Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:47
friend class InclusiveKinematics
Definition MutableInclusiveKinematics.h:38
friend void swap(MutableInclusiveKinematics &a, MutableInclusiveKinematics &b)
Definition MutableInclusiveKinematics.h:153
float getW() const
Access the Invariant mass of final state [GeV].
Definition MutableInclusiveKinematics.cc:48
float & W()
Get reference to Invariant mass of final state [GeV].
Definition MutableInclusiveKinematics.cc:68
bool operator!=(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:141
const edm4eic::ReconstructedParticle getScat() const
Access the Associated scattered electron (if identified)
Definition MutableInclusiveKinematics.cc:52
float & nu()
Get reference to Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:74
MutableInclusiveKinematics & operator=(MutableInclusiveKinematics other) &&=delete
void setQ2(const float Q2)
Set the Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:63
void setScat(const edm4eic::ReconstructedParticle &value)
Set the Associated scattered electron (if identified)
Definition MutableInclusiveKinematics.cc:76
Definition MutableReconstructedParticle.h:46
Definition ReconstructedParticle.h:54
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableInclusiveKinematics &obj) const
Definition MutableInclusiveKinematics.h:176