EDM4eic
EIC data model
All Classes Namespaces Files Functions Variables Typedefs Friends Pages
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 InclusiveKinematicsCollection;
22class ReconstructedParticle;
23class MutableReconstructedParticle;
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(float x, float Q2, float W, float y, float nu);
49
50 /// copy constructor
52
53 /// copy-assignment operator
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 MutableInclusiveKinematics clone(bool cloneRelations=true) const;
59
60 /// destructor
62
63
64public:
65
66 /// Access the Bjorken x (Q2/2P.q)
67 float getX() const;
68
69 /// Access the Four-momentum transfer squared [GeV^2]
70 float getQ2() const;
71
72 /// Access the Invariant mass of final state [GeV]
73 float getW() const;
74
75 /// Access the Inelasticity (P.q/P.k)
76 float getY() const;
77
78 /// Access the Energy transfer P.q/M [GeV]
79 float getNu() const;
80
81
82 /// Access the Associated scattered electron (if identified)
84
85 /// Set the Bjorken x (Q2/2P.q)
86 void setX(float value);
87 /// Get mutable reference to Bjorken x (Q2/2P.q)
88 float& getX();
89 /// Get reference to Bjorken x (Q2/2P.q)
90 [[deprecated("use getX instead")]]
91 float& x();
92
93 /// Set the Four-momentum transfer squared [GeV^2]
94 void setQ2(float value);
95 /// Get mutable reference to Four-momentum transfer squared [GeV^2]
96 float& getQ2();
97 /// Get reference to Four-momentum transfer squared [GeV^2]
98 [[deprecated("use getQ2 instead")]]
99 float& Q2();
100
101 /// Set the Invariant mass of final state [GeV]
102 void setW(float value);
103 /// Get mutable reference to Invariant mass of final state [GeV]
104 float& getW();
105 /// Get reference to Invariant mass of final state [GeV]
106 [[deprecated("use getW instead")]]
107 float& W();
108
109 /// Set the Inelasticity (P.q/P.k)
110 void setY(float value);
111 /// Get mutable reference to Inelasticity (P.q/P.k)
112 float& getY();
113 /// Get reference to Inelasticity (P.q/P.k)
114 [[deprecated("use getY instead")]]
115 float& y();
116
117 /// Set the Energy transfer P.q/M [GeV]
118 void setNu(float value);
119 /// Get mutable reference to Energy transfer P.q/M [GeV]
120 float& getNu();
121 /// Get reference to Energy transfer P.q/M [GeV]
122 [[deprecated("use getNu instead")]]
123 float& nu();
124
125
126 /// Set the Associated scattered electron (if identified)
127 void setScat(const edm4eic::ReconstructedParticle& value);
128
129
130
131
132 /// check whether the object is actually available
133 bool isAvailable() const;
134 /// disconnect from InclusiveKinematicsObj instance
135 void unlink() { m_obj = podio::utils::MaybeSharedPtr<InclusiveKinematicsObj>{nullptr}; }
136
137 bool operator==(const MutableInclusiveKinematics& other) const { return m_obj == other.m_obj; }
138 bool operator==(const InclusiveKinematics& other) const;
139
140 bool operator!=(const MutableInclusiveKinematics& other) const { return !(*this == other); }
141 bool operator!=(const InclusiveKinematics& other) const { return !(*this == other); }
142
143 // less comparison operator, so that objects can be e.g. stored in sets.
145
146 podio::ObjectID id() const { return getObjectID(); }
147
148 const podio::ObjectID getObjectID() const;
149
151 using std::swap;
152 swap(a.m_obj, b.m_obj); // swap out the internal pointers
153 }
154
155private:
156 /// constructor from existing InclusiveKinematicsObj
157 explicit MutableInclusiveKinematics(podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> obj);
158
159 podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> m_obj{nullptr};
160};
161
162#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
163void to_json(nlohmann::json& j, const MutableInclusiveKinematics& value);
164#endif
165
166
167} // namespace edm4eic
168
169
170#endif
Definition InclusiveKinematicsCollection.h:91
Definition InclusiveKinematics.h:42
Definition InclusiveKinematicsCollection.h:62
Definition MutableInclusiveKinematics.h:34
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:141
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:135
podio::ObjectID id() const
Definition MutableInclusiveKinematics.h:146
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:137
bool operator<(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:144
~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: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:150
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:140
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:54
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150