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 <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 Vertex;
24class MutableVertex;
25}
26namespace edm4hep {
27class MCParticle;
28class MutableMCParticle;
29}
30
31
32namespace edm4eic {
33
34
35/** @class MutableMCRecoVertexParticleAssociation
36 * Association between a Vertex and a MCParticle
37 * @author: S. Joosten
38 */
40
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableMCRecoVertexParticleAssociation(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 MCRecoVertexParticleAssociation() 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 Vertex (position in Vertices 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 vertex
84 const edm4eic::Vertex 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 Vertex (position in Vertices 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 vertex
99 void setRec(edm4eic::Vertex 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 MCRecoVertexParticleAssociationObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj>{nullptr}; }
110
111 bool operator==(const MutableMCRecoVertexParticleAssociation& other) const { return m_obj == other.m_obj; }
112 bool operator==(const MCRecoVertexParticleAssociation& other) const;
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
115 bool operator<(const MutableMCRecoVertexParticleAssociation& 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 MCRecoVertexParticleAssociationObj
128 explicit MutableMCRecoVertexParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> obj);
129
130 podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> m_obj{nullptr};
131};
132
133#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
134void to_json(nlohmann::json& j, const MutableMCRecoVertexParticleAssociation& value);
135#endif
136
137
138} // namespace edm4eic
139
140
141#endif
Definition MCRecoVertexParticleAssociationCollection.h:95
Definition MCRecoVertexParticleAssociation.h:40
Definition MCRecoVertexParticleAssociationCollection.h:66
Definition MutableMCRecoVertexParticleAssociation.h:39
bool operator<(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:115
void setRec(edm4eic::Vertex value)
Set the reference to the vertex.
Definition MutableMCRecoVertexParticleAssociation.cc:68
podio::ObjectID id() const
Definition MutableMCRecoVertexParticleAssociation.h:117
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
void setSim(edm4hep::MCParticle value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoVertexParticleAssociation.cc:75
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoVertexParticleAssociation.cc:88
friend class MCRecoVertexParticleAssociation
Definition MutableMCRecoVertexParticleAssociation.h:43
const podio::ObjectID getObjectID() const
Definition MutableMCRecoVertexParticleAssociation.cc:95
bool operator==(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:111
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoVertexParticleAssociation.cc:66
friend void swap(MutableMCRecoVertexParticleAssociation &a, MutableMCRecoVertexParticleAssociation &b)
Definition MutableMCRecoVertexParticleAssociation.h:121
MutableMCRecoVertexParticleAssociation & operator=(MutableMCRecoVertexParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoVertexParticleAssociation.cc:33
void setRecID(std::uint32_t value)
Set the Index of corresponding Vertex (position in Vertices array)
Definition MutableMCRecoVertexParticleAssociation.cc:65
std::uint32_t getRecID() const
Access the Index of corresponding Vertex (position in Vertices array)
Definition MutableMCRecoVertexParticleAssociation.cc:46
friend class MCRecoVertexParticleAssociationCollection
Definition MutableMCRecoVertexParticleAssociation.h:41
~MutableMCRecoVertexParticleAssociation()=default
destructor
void unlink()
disconnect from MCRecoVertexParticleAssociationObj instance
Definition MutableMCRecoVertexParticleAssociation.h:109
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoVertexParticleAssociation.cc:45
MutableMCRecoVertexParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableMCRecoVertexParticleAssociation.cc:38
MutableMCRecoVertexParticleAssociation()
default constructor
Definition MutableMCRecoVertexParticleAssociation.cc:23
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoVertexParticleAssociation.cc:47
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MutableMCRecoVertexParticleAssociation.cc:56
Definition Vertex.h:36
Definition CalorimeterHit.cc:18
Definition CalorimeterHit.h:21