EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMCRecoVertexParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMCRecoVertexParticleAssociation_H
4#define EDM4EIC_MutableMCRecoVertexParticleAssociation_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 Vertex;
23class MutableVertex;
24}
25namespace edm4hep {
26class MCParticle;
27class MutableMCParticle;
28}
29
30
31namespace edm4eic {
32
33
34/** @class MutableMCRecoVertexParticleAssociation
35 * Association between a Vertex and a MCParticle
36 * @author: S. Joosten
37 */
39
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 MutableMCRecoVertexParticleAssociation(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 MutableMCRecoVertexParticleAssociation 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 Vertex (position in Vertices 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 vertex
81 const edm4eic::Vertex 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 Vertex (position in Vertices array)
94 void setRecID(std::uint32_t value);
95 /// Get mutable reference to Index of corresponding Vertex (position in Vertices array)
96 std::uint32_t& getRecID();
97 /// Get reference to Index of corresponding Vertex (position in Vertices 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 vertex
111 void setRec(const edm4eic::Vertex& 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 MCRecoVertexParticleAssociationObj instance
121 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj>{nullptr}; }
122
123 bool operator==(const MutableMCRecoVertexParticleAssociation& other) const { return m_obj == other.m_obj; }
124 bool operator==(const MCRecoVertexParticleAssociation& other) const;
125
126 bool operator!=(const MutableMCRecoVertexParticleAssociation& other) const { return !(*this == other); }
127 bool operator!=(const MCRecoVertexParticleAssociation& other) const { return !(*this == other); }
128
129 // less comparison operator, so that objects can be e.g. stored in sets.
130 bool operator<(const MutableMCRecoVertexParticleAssociation& 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 MCRecoVertexParticleAssociationObj
143 explicit MutableMCRecoVertexParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> obj);
144
145 podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> m_obj{nullptr};
146};
147
148#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
149void to_json(nlohmann::json& j, const MutableMCRecoVertexParticleAssociation& value);
150#endif
151
152
153} // namespace edm4eic
154
155
156#endif
Definition MCRecoVertexParticleAssociationCollection.h:92
Definition MCRecoVertexParticleAssociation.h:40
Definition MCRecoVertexParticleAssociationCollection.h:63
Definition MutableMCRecoVertexParticleAssociation.h:38
bool operator<(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:130
podio::ObjectID id() const
Definition MutableMCRecoVertexParticleAssociation.h:132
MutableMCRecoVertexParticleAssociation(const MutableMCRecoVertexParticleAssociation &other)=default
copy constructor
const edm4eic::Vertex getRec() const
Access the reference to the vertex.
Definition MutableMCRecoVertexParticleAssociation.cc:49
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoVertexParticleAssociation.cc:64
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoVertexParticleAssociation.cc:90
friend class MCRecoVertexParticleAssociation
Definition MutableMCRecoVertexParticleAssociation.h:42
const podio::ObjectID getObjectID() const
Definition MutableMCRecoVertexParticleAssociation.cc:94
std::uint32_t & simID()
Get reference to Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoVertexParticleAssociation.cc:66
bool operator==(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:123
void setRec(const edm4eic::Vertex &value)
Set the reference to the vertex.
Definition MutableMCRecoVertexParticleAssociation.cc:74
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoVertexParticleAssociation.cc:70
friend void swap(MutableMCRecoVertexParticleAssociation &a, MutableMCRecoVertexParticleAssociation &b)
Definition MutableMCRecoVertexParticleAssociation.h:136
MutableMCRecoVertexParticleAssociation & operator=(MutableMCRecoVertexParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoVertexParticleAssociation.cc:30
void setRecID(std::uint32_t value)
Set the Index of corresponding Vertex (position in Vertices array)
Definition MutableMCRecoVertexParticleAssociation.cc:67
std::uint32_t getRecID() const
Access the Index of corresponding Vertex (position in Vertices array)
Definition MutableMCRecoVertexParticleAssociation.cc:46
bool operator!=(const MCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:127
friend class MCRecoVertexParticleAssociationCollection
Definition MutableMCRecoVertexParticleAssociation.h:40
MutableMCRecoVertexParticleAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoVertexParticleAssociation.cc:35
bool operator!=(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:126
~MutableMCRecoVertexParticleAssociation()=default
destructor
void unlink()
disconnect from MCRecoVertexParticleAssociationObj instance
Definition MutableMCRecoVertexParticleAssociation.h:121
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoVertexParticleAssociation.cc:45
MutableMCRecoVertexParticleAssociation()
default constructor
Definition MutableMCRecoVertexParticleAssociation.cc:20
void setSim(const edm4hep::MCParticle &value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoVertexParticleAssociation.cc:79
float & weight()
Get reference to weight of this association.
Definition MutableMCRecoVertexParticleAssociation.cc:72
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoVertexParticleAssociation.cc:47
std::uint32_t & recID()
Get reference to Index of corresponding Vertex (position in Vertices array)
Definition MutableMCRecoVertexParticleAssociation.cc:69
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MutableMCRecoVertexParticleAssociation.cc:56
Definition Vertex.h:36
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:21