EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableHadronicFinalState.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableHadronicFinalState_H
4#define EDM4EIC_MutableHadronicFinalState_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
11#include "podio/RelationRange.h"
12#include <vector>
13
14#include "podio/utilities/MaybeSharedPtr.h"
15
16#include <cstdint>
17
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
20#endif
21
22
23
24namespace edm4eic {
25
26
27/** @class MutableHadronicFinalState
28 * Summed quantities of the hadronic final state
29 * @author: T. Kutz
30 */
32
35 friend class HadronicFinalState;
36
37public:
40
41 /// default constructor
43
44 /// Constructor initializing all members
45 MutableHadronicFinalState(float sigma, float pT, float gamma);
46
47 /// copy constructor
49
50 /// copy-assignment operator
52
53 /// create a mutable deep-copy of the object with identical relations
54 /// if cloneRelations=false, the relations are not cloned and will be empty
55 MutableHadronicFinalState clone(bool cloneRelations=true) const;
56
57 /// destructor
59
60
61public:
62
63 /// Access the Longitudinal energy-momentum balance (aka E - pz)
64 float getSigma() const;
65
66 /// Access the Transverse momentum
67 float getPT() const;
68
69 /// Access the Hadronic angle
70 float getGamma() const;
71
72
73
74 /// Set the Longitudinal energy-momentum balance (aka E - pz)
75 void setSigma(float value);
76 /// Get mutable reference to Longitudinal energy-momentum balance (aka E - pz)
77 float& getSigma();
78 /// Get reference to Longitudinal energy-momentum balance (aka E - pz)
79 [[deprecated("use getSigma instead")]]
80 float& sigma();
81
82 /// Set the Transverse momentum
83 void setPT(float value);
84 /// Get mutable reference to Transverse momentum
85 float& getPT();
86 /// Get reference to Transverse momentum
87 [[deprecated("use getPT instead")]]
88 float& pT();
89
90 /// Set the Hadronic angle
91 void setGamma(float value);
92 /// Get mutable reference to Hadronic angle
93 float& getGamma();
94 /// Get reference to Hadronic angle
95 [[deprecated("use getGamma instead")]]
96 float& gamma();
97
98
99
101 std::size_t hadrons_size() const;
103 std::vector<edm4eic::ReconstructedParticle>::const_iterator hadrons_begin() const;
104 std::vector<edm4eic::ReconstructedParticle>::const_iterator hadrons_end() const;
105 podio::RelationRange<edm4eic::ReconstructedParticle> getHadrons() const;
106
107
108
109 /// check whether the object is actually available
110 bool isAvailable() const;
111 /// disconnect from HadronicFinalStateObj instance
112 void unlink() { m_obj = podio::utils::MaybeSharedPtr<HadronicFinalStateObj>{nullptr}; }
113
114 bool operator==(const MutableHadronicFinalState& other) const { return m_obj == other.m_obj; }
115 bool operator==(const HadronicFinalState& other) const;
116
117 bool operator!=(const MutableHadronicFinalState& other) const { return !(*this == other); }
118 bool operator!=(const HadronicFinalState& other) const { return !(*this == other); }
119
120 // less comparison operator, so that objects can be e.g. stored in sets.
121 bool operator<(const MutableHadronicFinalState& other) const { return m_obj < other.m_obj; }
122
123 podio::ObjectID id() const { return getObjectID(); }
124
125 const podio::ObjectID getObjectID() const;
126
128 using std::swap;
129 swap(a.m_obj, b.m_obj); // swap out the internal pointers
130 }
131
132private:
133 /// constructor from existing HadronicFinalStateObj
134 explicit MutableHadronicFinalState(podio::utils::MaybeSharedPtr<HadronicFinalStateObj> obj);
135
136 podio::utils::MaybeSharedPtr<HadronicFinalStateObj> m_obj{nullptr};
137};
138
139#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
140void to_json(nlohmann::json& j, const MutableHadronicFinalState& value);
141#endif
142
143
144} // namespace edm4eic
145
146
147#endif
Definition HadronicFinalStateCollection.h:92
Definition HadronicFinalState.h:33
Definition HadronicFinalStateCollection.h:63
Definition MutableHadronicFinalState.h:31
float & sigma()
Get reference to Longitudinal energy-momentum balance (aka E - pz)
Definition MutableHadronicFinalState.cc:53
float & pT()
Get reference to Transverse momentum.
Definition MutableHadronicFinalState.cc:56
bool operator!=(const HadronicFinalState &other) const
Definition MutableHadronicFinalState.h:118
MutableHadronicFinalState()
default constructor
Definition MutableHadronicFinalState.cc:18
friend void swap(MutableHadronicFinalState &a, MutableHadronicFinalState &b)
Definition MutableHadronicFinalState.h:127
float getGamma() const
Access the Hadronic angle.
Definition MutableHadronicFinalState.cc:48
std::vector< edm4eic::ReconstructedParticle >::const_iterator hadrons_end() const
Definition MutableHadronicFinalState.cc:73
std::vector< edm4eic::ReconstructedParticle >::const_iterator hadrons_begin() const
Definition MutableHadronicFinalState.cc:67
float getSigma() const
Access the Longitudinal energy-momentum balance (aka E - pz)
Definition MutableHadronicFinalState.cc:46
void addToHadrons(const edm4eic::ReconstructedParticle &)
Definition MutableHadronicFinalState.cc:62
void unlink()
disconnect from HadronicFinalStateObj instance
Definition MutableHadronicFinalState.h:112
bool isAvailable() const
check whether the object is actually available
Definition MutableHadronicFinalState.cc:103
bool operator==(const MutableHadronicFinalState &other) const
Definition MutableHadronicFinalState.h:114
bool operator<(const MutableHadronicFinalState &other) const
Definition MutableHadronicFinalState.h:121
MutableHadronicFinalState & operator=(MutableHadronicFinalState other)
copy-assignment operator
Definition MutableHadronicFinalState.cc:28
float getPT() const
Access the Transverse momentum.
Definition MutableHadronicFinalState.cc:47
friend class HadronicFinalState
Definition MutableHadronicFinalState.h:35
std::size_t hadrons_size() const
Definition MutableHadronicFinalState.cc:79
float & gamma()
Get reference to Hadronic angle.
Definition MutableHadronicFinalState.cc:59
podio::RelationRange< edm4eic::ReconstructedParticle > getHadrons() const
Definition MutableHadronicFinalState.cc:90
MutableHadronicFinalState clone(bool cloneRelations=true) const
Definition MutableHadronicFinalState.cc:33
void setSigma(float value)
Set the Longitudinal energy-momentum balance (aka E - pz)
Definition MutableHadronicFinalState.cc:51
void setGamma(float value)
Set the Hadronic angle.
Definition MutableHadronicFinalState.cc:57
~MutableHadronicFinalState()=default
destructor
podio::ObjectID id() const
Definition MutableHadronicFinalState.h:123
const podio::ObjectID getObjectID() const
Definition MutableHadronicFinalState.cc:107
bool operator!=(const MutableHadronicFinalState &other) const
Definition MutableHadronicFinalState.h:117
void setPT(float value)
Set the Transverse momentum.
Definition MutableHadronicFinalState.cc:54
friend class HadronicFinalStateCollection
Definition MutableHadronicFinalState.h:33
MutableHadronicFinalState(const MutableHadronicFinalState &other)=default
copy constructor
Definition ReconstructedParticle.h:47
Definition CalorimeterHit.cc:17