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 <ostream>
15#include <cstddef>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21// forward declarations
22namespace edm4eic {
23class Cluster;
24class MutableCluster;
25}
26namespace edm4hep {
27class MCParticle;
28class MutableMCParticle;
29}
30
31
32namespace edm4eic {
33
34
35/** @class MutableMCRecoClusterParticleAssociation
36 * Association between a Cluster and a MCParticle
37 * @author: S. Joosten
38 */
40
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableMCRecoClusterParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
54
55 /// copy constructor
57
58 /// copy-assignment operator
60
61 /// create a mutable deep-copy of the object with identical relations
63
64 /// destructor
66
67
68 /// conversion to const object
69 operator MCRecoClusterParticleAssociation() const;
70
71public:
72
73 /// Access the Index of corresponding MCParticle (position in MCParticles array)
74 std::uint32_t getSimID() const;
75
76 /// Access the Index of corresponding Cluster (position in Clusters array)
77 std::uint32_t getRecID() const;
78
79 /// Access the weight of this association
80 float getWeight() const;
81
82
83 /// Access the reference to the cluster
84 const edm4eic::Cluster getRec() const;
85 /// Access the reference to the Monte-Carlo particle
86 const edm4hep::MCParticle getSim() const;
87
88 /// Set the Index of corresponding MCParticle (position in MCParticles array)
89 void setSimID(std::uint32_t value);
90
91 /// Set the Index of corresponding Cluster (position in Clusters array)
92 void setRecID(std::uint32_t value);
93
94 /// Set the weight of this association
95 void setWeight(float value);
96
97
98 /// Set the reference to the cluster
99 void setRec(edm4eic::Cluster value);
100 /// Set the reference to the Monte-Carlo particle
101 void setSim(edm4hep::MCParticle value);
102
103
104
105
106 /// check whether the object is actually available
107 bool isAvailable() const;
108 /// disconnect from MCRecoClusterParticleAssociationObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj>{nullptr}; }
110
111 bool operator==(const MutableMCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
112 bool operator==(const MCRecoClusterParticleAssociation& other) const;
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
115 bool operator<(const MutableMCRecoClusterParticleAssociation& other) const { return m_obj < other.m_obj; }
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 MCRecoClusterParticleAssociationObj
128 explicit MutableMCRecoClusterParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> obj);
129
130 podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> m_obj{nullptr};
131};
132
133#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
134void to_json(nlohmann::json& j, const MutableMCRecoClusterParticleAssociation& value);
135#endif
136
137
138} // namespace edm4eic
139
140
141#endif
Definition Cluster.h:38
Definition MCRecoClusterParticleAssociationCollection.h:95
Definition MCRecoClusterParticleAssociation.h:40
Definition MCRecoClusterParticleAssociationCollection.h:66
Definition MutableMCRecoClusterParticleAssociation.h:39
bool operator==(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:111
const podio::ObjectID getObjectID() const
Definition MutableMCRecoClusterParticleAssociation.cc:95
MutableMCRecoClusterParticleAssociation()
default constructor
Definition MutableMCRecoClusterParticleAssociation.cc:23
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MutableMCRecoClusterParticleAssociation.cc:56
friend class MCRecoClusterParticleAssociation
Definition MutableMCRecoClusterParticleAssociation.h:43
MutableMCRecoClusterParticleAssociation & operator=(MutableMCRecoClusterParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoClusterParticleAssociation.cc:33
void setRec(edm4eic::Cluster value)
Set the reference to the cluster.
Definition MutableMCRecoClusterParticleAssociation.cc:68
bool operator<(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:115
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 setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoClusterParticleAssociation.cc:66
~MutableMCRecoClusterParticleAssociation()=default
destructor
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition MutableMCRecoClusterParticleAssociation.h:109
MutableMCRecoClusterParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableMCRecoClusterParticleAssociation.cc:38
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoClusterParticleAssociation.cc:47
void setSim(edm4hep::MCParticle value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoClusterParticleAssociation.cc:75
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoClusterParticleAssociation.cc:88
MutableMCRecoClusterParticleAssociation(const MutableMCRecoClusterParticleAssociation &other)=default
copy constructor
friend class MCRecoClusterParticleAssociationCollection
Definition MutableMCRecoClusterParticleAssociation.h:41
friend void swap(MutableMCRecoClusterParticleAssociation &a, MutableMCRecoClusterParticleAssociation &b)
Definition MutableMCRecoClusterParticleAssociation.h:121
void setRecID(std::uint32_t value)
Set the Index of corresponding Cluster (position in Clusters array)
Definition MutableMCRecoClusterParticleAssociation.cc:65
podio::ObjectID id() const
Definition MutableMCRecoClusterParticleAssociation.h:117
const edm4eic::Cluster getRec() const
Access the reference to the cluster.
Definition MutableMCRecoClusterParticleAssociation.cc:49
Definition CalorimeterHit.cc:18
Definition CalorimeterHit.h:21