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 MCRecoVertexParticleAssociationCollection;
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
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableMCRecoVertexParticleAssociation 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 Vertex (position in Vertices 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 vertex
82 const edm4eic::Vertex 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 Vertex (position in Vertices array)
95 void setRecID(std::uint32_t value);
96 /// Get mutable reference to Index of corresponding Vertex (position in Vertices array)
97 std::uint32_t& getRecID();
98 /// Get reference to Index of corresponding Vertex (position in Vertices 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 vertex
112 void setRec(const edm4eic::Vertex& 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 MCRecoVertexParticleAssociationObj instance
122 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj>{nullptr}; }
123
124 bool operator==(const MutableMCRecoVertexParticleAssociation& other) const { return m_obj == other.m_obj; }
125 bool operator==(const MCRecoVertexParticleAssociation& other) const;
126
127 bool operator!=(const MutableMCRecoVertexParticleAssociation& other) const { return !(*this == other); }
128 bool operator!=(const MCRecoVertexParticleAssociation& 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 MCRecoVertexParticleAssociationObj
144 explicit MutableMCRecoVertexParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> obj);
145
146 podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> m_obj{nullptr};
147};
148
149#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
150void to_json(nlohmann::json& j, const MutableMCRecoVertexParticleAssociation& value);
151#endif
152
153
154} // namespace edm4eic
155
156
157#endif
Definition MCRecoVertexParticleAssociationCollection.h:91
Definition MCRecoVertexParticleAssociation.h:47
Definition MCRecoVertexParticleAssociationCollection.h:62
Definition MutableMCRecoVertexParticleAssociation.h:39
bool operator<(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:131
podio::ObjectID id() const
Definition MutableMCRecoVertexParticleAssociation.h:133
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:88
friend class MCRecoVertexParticleAssociation
Definition MutableMCRecoVertexParticleAssociation.h:43
const podio::ObjectID getObjectID() const
Definition MutableMCRecoVertexParticleAssociation.cc:92
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:124
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:137
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:128
friend class MCRecoVertexParticleAssociationCollection
Definition MutableMCRecoVertexParticleAssociation.h:41
MutableMCRecoVertexParticleAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoVertexParticleAssociation.cc:35
bool operator!=(const MutableMCRecoVertexParticleAssociation &other) const
Definition MutableMCRecoVertexParticleAssociation.h:127
~MutableMCRecoVertexParticleAssociation()=default
destructor
void unlink()
disconnect from MCRecoVertexParticleAssociationObj instance
Definition MutableMCRecoVertexParticleAssociation.h:122
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:78
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:46
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150