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
91 /// Set the Four-momentum transfer squared [GeV^2]
92 void setQ2(const float Q2);
93 /// Get mutable reference to Four-momentum transfer squared [GeV^2]
94 float& getQ2();
95
96 /// Set the Invariant mass of final state [GeV]
97 void setW(const float W);
98 /// Get mutable reference to Invariant mass of final state [GeV]
99 float& getW();
100
101 /// Set the Inelasticity (P.q/P.k)
102 void setY(const float y);
103 /// Get mutable reference to Inelasticity (P.q/P.k)
104 float& getY();
105
106 /// Set the Energy transfer P.q/M [GeV]
107 void setNu(const float nu);
108 /// Get mutable reference to Energy transfer P.q/M [GeV]
109 float& getNu();
110
111
112 /// Set the Associated scattered electron (if identified)
113 void setScat(const edm4eic::ReconstructedParticle& value);
114
115
116
117
118 /// check whether the object is actually available
119 bool isAvailable() const;
120 /// disconnect from InclusiveKinematicsObj instance
121 void unlink() { m_obj = podio::utils::MaybeSharedPtr<InclusiveKinematicsObj>{nullptr}; }
122
123 constexpr bool operator==(const MutableInclusiveKinematics& other) const { return m_obj == other.m_obj; }
124 bool operator==(const InclusiveKinematics& other) const;
125
126 constexpr bool operator!=(const MutableInclusiveKinematics& other) const { return !(*this == other); }
127 bool operator!=(const InclusiveKinematics& other) const { return !(*this == other); }
128
129 // less comparison operator, so that objects can be e.g. stored in sets.
131
132 podio::ObjectID id() const { return getObjectID(); }
133
134 const podio::ObjectID getObjectID() const;
135
136 friend std::hash<MutableInclusiveKinematics>;
137
139 using std::swap;
140 swap(a.m_obj, b.m_obj); // swap out the internal pointers
141 }
142
143private:
144 /// constructor from existing InclusiveKinematicsObj
145 explicit MutableInclusiveKinematics(podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> obj);
146
147 podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> m_obj{new InclusiveKinematicsObj{}, podio::utils::MarkOwned};
148};
149
150#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
151void to_json(nlohmann::json& j, const MutableInclusiveKinematics& value);
152#endif
153
154
155} // namespace edm4eic
156
157
158
159template<>
160struct std::hash<edm4eic::MutableInclusiveKinematics> {
161 std::size_t operator()(const edm4eic::MutableInclusiveKinematics& obj) const {
162 return std::hash<edm4eic::InclusiveKinematicsObj*>{}(obj.m_obj.get());
163 }
164};
165
166
167#endif
Definition InclusiveKinematicsCollection.h:139
Definition InclusiveKinematics.h:42
Definition InclusiveKinematicsObj.h:21
Definition MutableInclusiveKinematics.h:34
void setW(const float W)
Set the Invariant mass of final state [GeV].
Definition MutableInclusiveKinematics.cc:60
float getNu() const
Access the Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:46
void setNu(const float nu)
Set the Energy transfer P.q/M [GeV].
Definition MutableInclusiveKinematics.cc:64
friend class InclusiveKinematicsMutableCollectionIterator
Definition MutableInclusiveKinematics.h:37
InclusiveKinematics object_type
Definition MutableInclusiveKinematics.h:41
float getX() const
Access the Bjorken x (Q2/2P.q).
Definition MutableInclusiveKinematics.cc:42
MutableInclusiveKinematics(const MutableInclusiveKinematics &other)=default
copy constructor
MutableInclusiveKinematics & operator=(MutableInclusiveKinematics other) &
copy-assignment operator
Definition MutableInclusiveKinematics.cc:27
bool operator!=(const InclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:127
float getY() const
Access the Inelasticity (P.q/P.k).
Definition MutableInclusiveKinematics.cc:45
void unlink()
disconnect from InclusiveKinematicsObj instance
Definition MutableInclusiveKinematics.h:121
void setY(const float y)
Set the Inelasticity (P.q/P.k).
Definition MutableInclusiveKinematics.cc:62
podio::ObjectID id() const
Definition MutableInclusiveKinematics.h:132
MutableInclusiveKinematics()=default
default constructor
friend class InclusiveKinematicsCollection
Definition MutableInclusiveKinematics.h:36
MutableInclusiveKinematics clone(bool cloneRelations=true) const
Definition MutableInclusiveKinematics.cc:32
bool isAvailable() const
check whether the object is actually available
Definition MutableInclusiveKinematics.cc:77
InclusiveKinematicsCollection collection_type
Definition MutableInclusiveKinematics.h:42
bool operator<(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:130
constexpr bool operator==(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:123
~MutableInclusiveKinematics()=default
destructor
constexpr bool operator!=(const MutableInclusiveKinematics &other) const
Definition MutableInclusiveKinematics.h:126
void setX(const float x)
Set the Bjorken x (Q2/2P.q).
Definition MutableInclusiveKinematics.cc:56
const podio::ObjectID getObjectID() const
Definition MutableInclusiveKinematics.cc:81
float getQ2() const
Access the Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:43
friend class InclusiveKinematics
Definition MutableInclusiveKinematics.h:38
friend void swap(MutableInclusiveKinematics &a, MutableInclusiveKinematics &b)
Definition MutableInclusiveKinematics.h:138
float getW() const
Access the Invariant mass of final state [GeV].
Definition MutableInclusiveKinematics.cc:44
const edm4eic::ReconstructedParticle getScat() const
Access the Associated scattered electron (if identified).
Definition MutableInclusiveKinematics.cc:48
MutableInclusiveKinematics & operator=(MutableInclusiveKinematics other) &&=delete
void setQ2(const float Q2)
Set the Four-momentum transfer squared [GeV^2].
Definition MutableInclusiveKinematics.cc:58
void setScat(const edm4eic::ReconstructedParticle &value)
Set the Associated scattered electron (if identified).
Definition MutableInclusiveKinematics.cc:67
Definition MutableReconstructedParticle.h:46
Definition ReconstructedParticle.h:54
Definition ArrowMapper.cc:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableInclusiveKinematics &obj) const
Definition MutableInclusiveKinematics.h:161