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 <ostream>
17#include <cstddef>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23
24
25namespace edm4eic {
26
27
28/** @class MutableHadronicFinalState
29 * Summed quantities of the hadronic final state
30 * @author: T. Kutz
31 */
33
36 friend class HadronicFinalState;
37
38public:
41
42 /// default constructor
44
45 /// Constructor initializing all members
46 MutableHadronicFinalState(float sigma, float pT, float gamma);
47
48 /// copy constructor
50
51 /// copy-assignment operator
53
54 /// create a mutable deep-copy of the object with identical relations
56
57 /// destructor
59
60
61 /// conversion to const object
62 operator HadronicFinalState() const;
63
64public:
65
66 /// Access the Longitudinal energy-momentum balance (aka E - pz)
67 float getSigma() const;
68
69 /// Access the Transverse momentum
70 float getPT() const;
71
72 /// Access the Hadronic angle
73 float getGamma() const;
74
75
76
77 /// Set the Longitudinal energy-momentum balance (aka E - pz)
78 void setSigma(float value);
79
80 /// Set the Transverse momentum
81 void setPT(float value);
82
83 /// Set the Hadronic angle
84 void setGamma(float value);
85
86
87
89 std::size_t hadrons_size() const;
91 std::vector<edm4eic::ReconstructedParticle>::const_iterator hadrons_begin() const;
92 std::vector<edm4eic::ReconstructedParticle>::const_iterator hadrons_end() const;
93 podio::RelationRange<edm4eic::ReconstructedParticle> getHadrons() const;
94
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from HadronicFinalStateObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<HadronicFinalStateObj>{nullptr}; }
101
102 bool operator==(const MutableHadronicFinalState& other) const { return m_obj == other.m_obj; }
103 bool operator==(const HadronicFinalState& other) const;
104
105 // less comparison operator, so that objects can be e.g. stored in sets.
106 bool operator<(const MutableHadronicFinalState& other) const { return m_obj < other.m_obj; }
107
108 podio::ObjectID id() const { return getObjectID(); }
109
110 const podio::ObjectID getObjectID() const;
111
113 using std::swap;
114 swap(a.m_obj, b.m_obj); // swap out the internal pointers
115 }
116
117private:
118 /// constructor from existing HadronicFinalStateObj
119 explicit MutableHadronicFinalState(podio::utils::MaybeSharedPtr<HadronicFinalStateObj> obj);
120
121 podio::utils::MaybeSharedPtr<HadronicFinalStateObj> m_obj{nullptr};
122};
123
124#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
125void to_json(nlohmann::json& j, const MutableHadronicFinalState& value);
126#endif
127
128
129} // namespace edm4eic
130
131
132#endif
Definition HadronicFinalStateCollection.h:95
Definition HadronicFinalState.h:33
Definition HadronicFinalStateCollection.h:66
Definition MutableHadronicFinalState.h:32
MutableHadronicFinalState()
default constructor
Definition MutableHadronicFinalState.cc:21
friend void swap(MutableHadronicFinalState &a, MutableHadronicFinalState &b)
Definition MutableHadronicFinalState.h:112
float getGamma() const
Access the Hadronic angle.
Definition MutableHadronicFinalState.cc:45
std::vector< edm4eic::ReconstructedParticle >::const_iterator hadrons_end() const
Definition MutableHadronicFinalState.cc:64
std::vector< edm4eic::ReconstructedParticle >::const_iterator hadrons_begin() const
Definition MutableHadronicFinalState.cc:58
float getSigma() const
Access the Longitudinal energy-momentum balance (aka E - pz)
Definition MutableHadronicFinalState.cc:43
void unlink()
disconnect from HadronicFinalStateObj instance
Definition MutableHadronicFinalState.h:100
bool isAvailable() const
check whether the object is actually available
Definition MutableHadronicFinalState.cc:94
bool operator==(const MutableHadronicFinalState &other) const
Definition MutableHadronicFinalState.h:102
bool operator<(const MutableHadronicFinalState &other) const
Definition MutableHadronicFinalState.h:106
MutableHadronicFinalState & operator=(MutableHadronicFinalState other)
copy-assignment operator
Definition MutableHadronicFinalState.cc:31
float getPT() const
Access the Transverse momentum.
Definition MutableHadronicFinalState.cc:44
friend class HadronicFinalState
Definition MutableHadronicFinalState.h:36
std::size_t hadrons_size() const
Definition MutableHadronicFinalState.cc:70
MutableHadronicFinalState clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableHadronicFinalState.cc:36
podio::RelationRange< edm4eic::ReconstructedParticle > getHadrons() const
Definition MutableHadronicFinalState.cc:81
void setSigma(float value)
Set the Longitudinal energy-momentum balance (aka E - pz)
Definition MutableHadronicFinalState.cc:48
void setGamma(float value)
Set the Hadronic angle.
Definition MutableHadronicFinalState.cc:50
~MutableHadronicFinalState()=default
destructor
void addToHadrons(edm4eic::ReconstructedParticle)
Definition MutableHadronicFinalState.cc:53
podio::ObjectID id() const
Definition MutableHadronicFinalState.h:108
const podio::ObjectID getObjectID() const
Definition MutableHadronicFinalState.cc:101
void setPT(float value)
Set the Transverse momentum.
Definition MutableHadronicFinalState.cc:49
friend class HadronicFinalStateCollection
Definition MutableHadronicFinalState.h:34
MutableHadronicFinalState(const MutableHadronicFinalState &other)=default
copy constructor
Definition ReconstructedParticle.h:47
Definition CalorimeterHit.cc:18