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 MCRecoClusterParticleAssociationCollection;
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
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableMCRecoClusterParticleAssociation clone(bool cloneRelations=true) const;
64
65 /// destructor
67
68
69public:
70
71 /// Access the Index of corresponding MCParticle (position in MCParticles array)
72 std::uint32_t getSimID() const;
73
74 /// Access the Index of corresponding Cluster (position in Clusters array)
75 std::uint32_t getRecID() const;
76
77 /// Access the weight of this association
78 float getWeight() const;
79
80
81 /// Access the reference to the cluster
82 const edm4eic::Cluster getRec() const;
83 /// Access the reference to the Monte-Carlo particle
84 const edm4hep::MCParticle getSim() const;
85
86 /// Set the Index of corresponding MCParticle (position in MCParticles array)
87 void setSimID(std::uint32_t value);
88 /// Get mutable reference to Index of corresponding MCParticle (position in MCParticles array)
89 std::uint32_t& getSimID();
90 /// Get reference to Index of corresponding MCParticle (position in MCParticles array)
91 [[deprecated("use getSimID instead")]]
92 std::uint32_t& simID();
93
94 /// Set the Index of corresponding Cluster (position in Clusters array)
95 void setRecID(std::uint32_t value);
96 /// Get mutable reference to Index of corresponding Cluster (position in Clusters array)
97 std::uint32_t& getRecID();
98 /// Get reference to Index of corresponding Cluster (position in Clusters array)
99 [[deprecated("use getRecID instead")]]
100 std::uint32_t& recID();
101
102 /// Set the weight of this association
103 void setWeight(float value);
104 /// Get mutable reference to weight of this association
105 float& getWeight();
106 /// Get reference to weight of this association
107 [[deprecated("use getWeight instead")]]
108 float& weight();
109
110
111 /// Set the reference to the cluster
112 void setRec(const edm4eic::Cluster& value);
113 /// Set the reference to the Monte-Carlo particle
114 void setSim(const edm4hep::MCParticle& value);
115
116
117
118
119 /// check whether the object is actually available
120 bool isAvailable() const;
121 /// disconnect from MCRecoClusterParticleAssociationObj instance
122 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj>{nullptr}; }
123
124 bool operator==(const MutableMCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
125 bool operator==(const MCRecoClusterParticleAssociation& other) const;
126
127 bool operator!=(const MutableMCRecoClusterParticleAssociation& other) const { return !(*this == other); }
128 bool operator!=(const MCRecoClusterParticleAssociation& other) const { return !(*this == other); }
129
130 // less comparison operator, so that objects can be e.g. stored in sets.
132
133 podio::ObjectID id() const { return getObjectID(); }
134
135 const podio::ObjectID getObjectID() const;
136
138 using std::swap;
139 swap(a.m_obj, b.m_obj); // swap out the internal pointers
140 }
141
142private:
143 /// constructor from existing MCRecoClusterParticleAssociationObj
144 explicit MutableMCRecoClusterParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> obj);
145
146 podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> m_obj{nullptr};
147};
148
149#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
150void to_json(nlohmann::json& j, const MutableMCRecoClusterParticleAssociation& value);
151#endif
152
153
154} // namespace edm4eic
155
156
157#endif
Definition Cluster.h:48
Definition MCRecoClusterParticleAssociationCollection.h:91
Definition MCRecoClusterParticleAssociation.h:47
Definition MCRecoClusterParticleAssociationCollection.h:62
Definition MutableMCRecoClusterParticleAssociation.h:39
bool operator==(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:124
const podio::ObjectID getObjectID() const
Definition MutableMCRecoClusterParticleAssociation.cc:92
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:43
MutableMCRecoClusterParticleAssociation & operator=(MutableMCRecoClusterParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoClusterParticleAssociation.cc:30
bool operator<(const MutableMCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:131
bool operator!=(const MCRecoClusterParticleAssociation &other) const
Definition MutableMCRecoClusterParticleAssociation.h:128
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:127
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:122
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:88
MutableMCRecoClusterParticleAssociation(const MutableMCRecoClusterParticleAssociation &other)=default
copy constructor
friend class MCRecoClusterParticleAssociationCollection
Definition MutableMCRecoClusterParticleAssociation.h:41
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:137
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:78
podio::ObjectID id() const
Definition MutableMCRecoClusterParticleAssociation.h:133
const edm4eic::Cluster getRec() const
Access the reference to the cluster.
Definition MutableMCRecoClusterParticleAssociation.cc:49
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150