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 {
21class ReconstructedParticle;
22class MutableReconstructedParticle;
23}
24
25
26namespace edm4eic {
27
28
29/** @class MutableInclusiveKinematics
30 * Kinematic variables for DIS events
31 * @author: S. Joosten, W. Deconinck
32 */
34
37 friend class InclusiveKinematics;
38
39public:
42
43 /// default constructor
45
46 /// Constructor initializing all members
47 MutableInclusiveKinematics(float x, float Q2, float W, float y, float nu);
48
49 /// copy constructor
51
52 /// copy-assignment operator
54
55 /// create a mutable deep-copy of the object with identical relations
56 /// if cloneRelations=false, the relations are not cloned and will be empty
57 MutableInclusiveKinematics clone(bool cloneRelations=true) const;
58
59 /// destructor
61
62
63public:
64
65 /// Access the Bjorken x (Q2/2P.q)
66 float getX() const;
67
68 /// Access the Four-momentum transfer squared [GeV^2]
69 float getQ2() const;
70
71 /// Access the Invariant mass of final state [GeV]
72 float getW() const;
73
74 /// Access the Inelasticity (P.q/P.k)
75 float getY() const;
76
77 /// Access the Energy transfer P.q/M [GeV]
78 float getNu() const;
79
80
81 /// Access the Associated scattered electron (if identified)
83
84 /// Set the Bjorken x (Q2/2P.q)
85 void setX(float value);
86 /// Get mutable reference to Bjorken x (Q2/2P.q)
87 float& getX();
88 /// Get reference to Bjorken x (Q2/2P.q)
89 [[deprecated("use getX instead")]]
90 float& x();
91
92 /// Set the Four-momentum transfer squared [GeV^2]
93 void setQ2(float value);
94 /// Get mutable reference to Four-momentum transfer squared [GeV^2]
95 float& getQ2();
96 /// Get reference to Four-momentum transfer squared [GeV^2]
97 [[deprecated("use getQ2 instead")]]
98 float& Q2();
99
100 /// Set the Invariant mass of final state [GeV]
101 void setW(float value);
102 /// Get mutable reference to Invariant mass of final state [GeV]
103 float& getW();
104 /// Get reference to Invariant mass of final state [GeV]
105 [[deprecated("use getW instead")]]
106 float& W();
107
108 /// Set the Inelasticity (P.q/P.k)
109 void setY(float value);
110 /// Get mutable reference to Inelasticity (P.q/P.k)
111 float& getY();
112 /// Get reference to Inelasticity (P.q/P.k)
113 [[deprecated("use getY instead")]]
114 float& y();
115
116 /// Set the Energy transfer P.q/M [GeV]
117 void setNu(float value);
118 /// Get mutable reference to Energy transfer P.q/M [GeV]
119 float& getNu();
120 /// Get reference to Energy transfer P.q/M [GeV]
121 [[deprecated("use getNu instead")]]
122 float& nu();
123
124
125 /// Set the Associated scattered electron (if identified)
126 void setScat(const edm4eic::ReconstructedParticle& value);
127
128
129
130
131 /// check whether the object is actually available
132 bool isAvailable() const;
133 /// disconnect from InclusiveKinematicsObj instance
134 void unlink() { m_obj = podio::utils::MaybeSharedPtr<InclusiveKinematicsObj>{nullptr}; }
135
136 bool operator==(const MutableInclusiveKinematics& other) const { return m_obj == other.m_obj; }
137 bool operator==(const InclusiveKinematics& other) const;
138
139 bool operator!=(const MutableInclusiveKinematics& other) const { return !(*this == other); }
140 bool operator!=(const InclusiveKinematics& other) const { return !(*this == other); }
141
142 // less comparison operator, so that objects can be e.g. stored in sets.
143 bool operator<(const MutableInclusiveKinematics& other) const { return m_obj < other.m_obj; }
144
145 podio::ObjectID id() const { return getObjectID(); }
146
147 const podio::ObjectID getObjectID() const;
148
150 using std::swap;
151 swap(a.m_obj, b.m_obj); // swap out the internal pointers
152 }
153
154private:
155 /// constructor from existing InclusiveKinematicsObj
156 explicit MutableInclusiveKinematics(podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> obj);
157
158 podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> m_obj{nullptr};
159};
160
161#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
162void to_json(nlohmann::json& j, const MutableInclusiveKinematics& value);
163#endif
164
165
166} // namespace edm4eic
167
168
169#endif
Definition InclusiveKinematicsCollection.h:92
Definition InclusiveKinematics.h:35
Definition InclusiveKinematicsCollection.h:63
Definition MutableInclusiveKinematics.h:33
MutableInclusiveKinematics()
default constructor
Definition MutableInclusiveKinematics.cc:19
float getNu() const
Access the Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:50
void setW(float value)
Set the Invariant mass of final state [GeV].
Definition MutableInclusiveKinematics.cc:66
MutableInclusiveKinematics & operator=(MutableInclusiveKinematics other)
copy-assignment operator
Definition MutableInclusiveKinematics.cc:31
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
void setNu(float value)
Set the Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:72
float & Q2()
Get reference to Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:65
MutableInclusiveKinematics(const MutableInclusiveKinematics &other)=default
copy constructor
void setX(float value)
Set the Bjorken x (Q2/2P.q)
Definition MutableInclusiveKinematics.cc:60
bool operator!=(const InclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:140
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:134
podio::ObjectID id() const
Definition MutableInclusiveKinematics.h:145
friend class InclusiveKinematicsCollection
Definition MutableInclusiveKinematics.h:35
MutableInclusiveKinematics clone(bool cloneRelations=true) const
Definition MutableInclusiveKinematics.cc:36
bool isAvailable() const
check whether the object is actually available
Definition MutableInclusiveKinematics.cc:87
bool operator==(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:136
bool operator<(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:143
~MutableInclusiveKinematics()=default
destructor
void setY(float value)
Set the Inelasticity (P.q/P.k)
Definition MutableInclusiveKinematics.cc:69
const podio::ObjectID getObjectID() const
Definition MutableInclusiveKinematics.cc:91
float getQ2() const
Access the Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:47
friend class InclusiveKinematics
Definition MutableInclusiveKinematics.h:37
friend void swap(MutableInclusiveKinematics &a, MutableInclusiveKinematics &b)
Definition MutableInclusiveKinematics.h:149
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:139
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
void setQ2(float value)
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 ReconstructedParticle.h:47
Definition CalorimeterHit.cc:17