EDM4eic
EIC data model
Loading...
Searching...
No Matches
InclusiveKinematics.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_InclusiveKinematics_H
4#define EDM4EIC_InclusiveKinematics_H
5
7
8
9#include "podio/utilities/MaybeSharedPtr.h"
10#include "podio/detail/OrderKey.h"
11
12#include <ostream>
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 podio::detail {
28// Internal function used in less comparison operators of the datatypes and interface types
29OrderKey getOrderKey(const edm4eic::InclusiveKinematics& obj);
30};
31
32namespace edm4eic {
33
34class MutableInclusiveKinematics;
35class InclusiveKinematicsCollection;
36class InclusiveKinematicsCollectionData;
37
38/** @class InclusiveKinematics
39 * Kinematic variables for DIS events
40 * @author: S. Joosten, W. Deconinck
41 */
43
48 friend podio::detail::OrderKey podio::detail::getOrderKey(const InclusiveKinematics & obj);
49
50public:
53
54 /// default constructor
56
57 /// Constructor initializing all members
58 InclusiveKinematics(float x, float Q2, float W, float y, float nu);
59
60 /// copy constructor
62
63 /// copy-assignment operator
65
66 /// create a mutable deep-copy of the object with identical relations
67 /// if cloneRelations=false, the relations are not cloned and will be empty
68 MutableInclusiveKinematics clone(bool cloneRelations=true) const;
69
70 /// destructor
72
73 /// converting constructor from mutable object
75
77
78public:
79
80 static constexpr auto typeName = "edm4eic::InclusiveKinematics";
81
82 /// Access the Bjorken x (Q2/2P.q)
83 float getX() const;
84
85 /// Access the Four-momentum transfer squared [GeV^2]
86 float getQ2() const;
87
88 /// Access the Invariant mass of final state [GeV]
89 float getW() const;
90
91 /// Access the Inelasticity (P.q/P.k)
92 float getY() const;
93
94 /// Access the Energy transfer P.q/M [GeV]
95 float getNu() const;
96
97
98 /// Access the Associated scattered electron (if identified)
100
101
102
103 /// check whether the object is actually available
104 bool isAvailable() const;
105 /// disconnect from InclusiveKinematicsObj instance
106 void unlink() { m_obj = podio::utils::MaybeSharedPtr<InclusiveKinematicsObj>{nullptr}; }
107
108 bool operator==(const InclusiveKinematics& other) const { return m_obj == other.m_obj; }
109 bool operator==(const MutableInclusiveKinematics& other) const;
110
111 bool operator!=(const InclusiveKinematics& other) const { return !(*this == other); }
112 bool operator!=(const MutableInclusiveKinematics& other) const { return !(*this == other); }
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
115 bool operator<(const InclusiveKinematics& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
116
117 podio::ObjectID id() const { return getObjectID(); }
118
119 const podio::ObjectID getObjectID() const;
120
122 using std::swap;
123 swap(a.m_obj, b.m_obj); // swap out the internal pointers
124 }
125
126private:
127 /// constructor from existing InclusiveKinematicsObj
128 explicit InclusiveKinematics(podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> obj);
130
131 podio::utils::MaybeSharedPtr<InclusiveKinematicsObj> m_obj{nullptr};
132};
133
134std::ostream& operator<<(std::ostream& o, const InclusiveKinematics& value);
135
136#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
137void to_json(nlohmann::json& j, const InclusiveKinematics& value);
138#endif
139
140
141} // namespace edm4eic
142
143
144#endif
Definition InclusiveKinematicsCollectionData.h:31
Definition InclusiveKinematicsCollection.h:91
Definition InclusiveKinematicsCollection.h:36
Definition InclusiveKinematics.h:42
InclusiveKinematics & operator=(InclusiveKinematics other)
copy-assignment operator
Definition InclusiveKinematics.cc:33
friend void swap(InclusiveKinematics &a, InclusiveKinematics &b)
Definition InclusiveKinematics.h:121
InclusiveKinematics(const InclusiveKinematics &other)=default
copy constructor
bool operator!=(const MutableInclusiveKinematics &other) const
Definition InclusiveKinematics.h:112
float getY() const
Access the Inelasticity (P.q/P.k)
Definition InclusiveKinematics.cc:63
float getX() const
Access the Bjorken x (Q2/2P.q)
Definition InclusiveKinematics.cc:60
float getW() const
Access the Invariant mass of final state [GeV].
Definition InclusiveKinematics.cc:62
friend class InclusiveKinematicsCollection
Definition InclusiveKinematics.h:45
InclusiveKinematics()
default constructor
Definition InclusiveKinematics.cc:21
float getQ2() const
Access the Four-momentum transfer squared [GeV^2].
Definition InclusiveKinematics.cc:61
const edm4eic::ReconstructedParticle getScat() const
Access the Associated scattered electron (if identified)
Definition InclusiveKinematics.cc:66
bool isAvailable() const
check whether the object is actually available
Definition InclusiveKinematics.cc:78
bool operator!=(const InclusiveKinematics &other) const
Definition InclusiveKinematics.h:111
friend class MutableInclusiveKinematics
Definition InclusiveKinematics.h:44
float getNu() const
Access the Energy transfer P.q/M [GeV].
Definition InclusiveKinematics.cc:64
static InclusiveKinematics makeEmpty()
Definition InclusiveKinematics.cc:56
static constexpr auto typeName
Definition InclusiveKinematics.h:80
MutableInclusiveKinematics clone(bool cloneRelations=true) const
Definition InclusiveKinematics.cc:38
void unlink()
disconnect from InclusiveKinematicsObj instance
Definition InclusiveKinematics.h:106
bool operator<(const InclusiveKinematics &other) const
Definition InclusiveKinematics.h:115
podio::ObjectID id() const
Definition InclusiveKinematics.h:117
bool operator==(const InclusiveKinematics &other) const
Definition InclusiveKinematics.h:108
const podio::ObjectID getObjectID() const
Definition InclusiveKinematics.cc:82
~InclusiveKinematics()=default
destructor
Definition InclusiveKinematicsObj.h:21
Definition MutableInclusiveKinematics.h:34
Definition ReconstructedParticle.h:54
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150