EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMCRecoClusterParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMCRecoClusterParticleAssociation_H
4#define EDM4EIC_MutableMCRecoClusterParticleAssociation_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include <cstdint>
11
12#include "podio/utilities/MaybeSharedPtr.h"
13
14#include <cstdint>
15
16#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
17#include "nlohmann/json_fwd.hpp"
18#endif
19
20// forward declarations
21namespace edm4eic {
22class Cluster;
23class MutableCluster;
24}
25namespace edm4hep {
26class MCParticle;
27class MutableMCParticle;
28}
29
30
31namespace edm4eic {
32
33
34/** @class MutableMCRecoClusterParticleAssociation
35 * Association between a Cluster and a MCParticle
36 * @author: S. Joosten
37 */
39
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 MutableMCRecoClusterParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
53
54 /// copy constructor
56
57 /// copy-assignment operator
59
60 /// create a mutable deep-copy of the object with identical relations
61 /// if cloneRelations=false, the relations are not cloned and will be empty
62 MutableMCRecoClusterParticleAssociation clone(bool cloneRelations=true) const;
63
64 /// destructor
66
67
68public:
69
70 /// Access the Index of corresponding MCParticle (position in MCParticles array)
71 std::uint32_t getSimID() const;
72
73 /// Access the Index of corresponding Cluster (position in Clusters array)
74 std::uint32_t getRecID() const;
75
76 /// Access the weight of this association
77 float getWeight() const;
78
79
80 /// Access the reference to the cluster
81 const edm4eic::Cluster getRec() const;
82 /// Access the reference to the Monte-Carlo particle
83 const edm4hep::MCParticle getSim() const;
84
85 /// Set the Index of corresponding MCParticle (position in MCParticles array)
86 void setSimID(std::uint32_t value);
87 /// Get mutable reference to Index of corresponding MCParticle (position in MCParticles array)
88 std::uint32_t& getSimID();
89 /// Get reference to Index of corresponding MCParticle (position in MCParticles array)
90 [[deprecated("use getSimID instead")]]
91 std::uint32_t& simID();
92
93 /// Set the Index of corresponding Cluster (position in Clusters array)
94 void setRecID(std::uint32_t value);
95 /// Get mutable reference to Index of corresponding Cluster (position in Clusters array)
96 std::uint32_t& getRecID();
97 /// Get reference to Index of corresponding Cluster (position in Clusters array)
98 [[deprecated("use getRecID instead")]]
99 std::uint32_t& recID();
100
101 /// Set the weight of this association
102 void setWeight(float value);
103 /// Get mutable reference to weight of this association
104 float& getWeight();
105 /// Get reference to weight of this association
106 [[deprecated("use getWeight instead")]]
107 float& weight();
108
109
110 /// Set the reference to the cluster
111 void setRec(const edm4eic::Cluster& value);
112 /// Set the reference to the Monte-Carlo particle
113 void setSim(const edm4hep::MCParticle& value);
114
115
116
117
118 /// check whether the object is actually available
119 bool isAvailable() const;
120 /// disconnect from MCRecoClusterParticleAssociationObj instance
121 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj>{nullptr}; }
122
123 bool operator==(const MutableMCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
124 bool operator==(const MCRecoClusterParticleAssociation& other) const;
125
126 bool operator!=(const MutableMCRecoClusterParticleAssociation& other) const { return !(*this == other); }
127 bool operator!=(const MCRecoClusterParticleAssociation& other) const { return !(*this == other); }
128
129 // less comparison operator, so that objects can be e.g. stored in sets.
130 bool operator<(const MutableMCRecoClusterParticleAssociation& other) const { return m_obj < other.m_obj; }
131
132 podio::ObjectID id() const { return getObjectID(); }
133
134 const podio::ObjectID getObjectID() const;
135
137 using std::swap;
138 swap(a.m_obj, b.m_obj); // swap out the internal pointers
139 }
140
141private:
142 /// constructor from existing MCRecoClusterParticleAssociationObj
143 explicit MutableMCRecoClusterParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> obj);
144
145 podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> m_obj{nullptr};
146};
147
148#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
149void to_json(nlohmann::json& j, const MutableMCRecoClusterParticleAssociation& value);
150#endif
151
152
153} // namespace edm4eic
154
155
156#endif
Definition Cluster.h:38
Definition MCRecoClusterParticleAssociationCollection.h:92
Definition MCRecoClusterParticleAssociation.h:40
Definition MCRecoClusterParticleAssociationCollection.h:63
Definition MutableMCRecoClusterParticleAssociation.h:38
bool operator==(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:123
const podio::ObjectID getObjectID() const
Definition MutableMCRecoClusterParticleAssociation.cc:94
MutableMCRecoClusterParticleAssociation()
default constructor
Definition MutableMCRecoClusterParticleAssociation.cc:20
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MutableMCRecoClusterParticleAssociation.cc:56
friend class MCRecoClusterParticleAssociation
Definition MutableMCRecoClusterParticleAssociation.h:42
MutableMCRecoClusterParticleAssociation & operator=(MutableMCRecoClusterParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoClusterParticleAssociation.cc:30
bool operator<(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:130
bool operator!=(const MCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:127
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoClusterParticleAssociation.cc:64
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoClusterParticleAssociation.cc:45
std::uint32_t getRecID() const
Access the Index of corresponding Cluster (position in Clusters array)
Definition MutableMCRecoClusterParticleAssociation.cc:46
void setRec(const edm4eic::Cluster &value)
Set the reference to the cluster.
Definition MutableMCRecoClusterParticleAssociation.cc:74
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoClusterParticleAssociation.cc:70
bool operator!=(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:126
std::uint32_t & simID()
Get reference to Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoClusterParticleAssociation.cc:66
~MutableMCRecoClusterParticleAssociation()=default
destructor
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition MutableMCRecoClusterParticleAssociation.h:121
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoClusterParticleAssociation.cc:47
MutableMCRecoClusterParticleAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoClusterParticleAssociation.cc:35
float & weight()
Get reference to weight of this association.
Definition MutableMCRecoClusterParticleAssociation.cc:72
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoClusterParticleAssociation.cc:90
MutableMCRecoClusterParticleAssociation(const MutableMCRecoClusterParticleAssociation &other)=default
copy constructor
friend class MCRecoClusterParticleAssociationCollection
Definition MutableMCRecoClusterParticleAssociation.h:40
std::uint32_t & recID()
Get reference to Index of corresponding Cluster (position in Clusters array)
Definition MutableMCRecoClusterParticleAssociation.cc:69
friend void swap(MutableMCRecoClusterParticleAssociation &a, MutableMCRecoClusterParticleAssociation &b)
Definition MutableMCRecoClusterParticleAssociation.h:136
void setRecID(std::uint32_t value)
Set the Index of corresponding Cluster (position in Clusters array)
Definition MutableMCRecoClusterParticleAssociation.cc:67
void setSim(const edm4hep::MCParticle &value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoClusterParticleAssociation.cc:79
podio::ObjectID id() const
Definition MutableMCRecoClusterParticleAssociation.h:132
const edm4eic::Cluster getRec() const
Access the reference to the cluster.
Definition MutableMCRecoClusterParticleAssociation.cc:49
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:21