EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMCRecoParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMCRecoParticleAssociation_H
4#define EDM4EIC_MutableMCRecoParticleAssociation_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 ReconstructedParticle;
24class MutableReconstructedParticle;
25}
26namespace edm4hep {
27class MCParticle;
28class MutableMCParticle;
29}
30
31
32namespace edm4eic {
33
34
35/** @class MutableMCRecoParticleAssociation
36 * Used to keep track of the correspondence between MC and reconstructed particles
37 * @author: S. Joosten
38 */
40
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableMCRecoParticleAssociation(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 MCRecoParticleAssociation() 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 ReconstructedParticle (position in ReconstructedParticles 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 reconstructed particle
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 ReconstructedParticle (position in ReconstructedParticles 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 reconstructed particle
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 MCRecoParticleAssociationObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj>{nullptr}; }
110
111 bool operator==(const MutableMCRecoParticleAssociation& other) const { return m_obj == other.m_obj; }
112 bool operator==(const MCRecoParticleAssociation& other) const;
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
115 bool operator<(const MutableMCRecoParticleAssociation& 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 MCRecoParticleAssociationObj
128 explicit MutableMCRecoParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj> obj);
129
130 podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj> m_obj{nullptr};
131};
132
133#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
134void to_json(nlohmann::json& j, const MutableMCRecoParticleAssociation& value);
135#endif
136
137
138} // namespace edm4eic
139
140
141#endif
Definition MCRecoParticleAssociationCollection.h:95
Definition MCRecoParticleAssociation.h:40
Definition MCRecoParticleAssociationCollection.h:66
Definition MutableMCRecoParticleAssociation.h:39
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoParticleAssociation.cc:45
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MutableMCRecoParticleAssociation.cc:56
MutableMCRecoParticleAssociation(const MutableMCRecoParticleAssociation &other)=default
copy constructor
const podio::ObjectID getObjectID() const
Definition MutableMCRecoParticleAssociation.cc:95
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoParticleAssociation.cc:66
void setRecID(std::uint32_t value)
Set the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition MutableMCRecoParticleAssociation.cc:65
MutableMCRecoParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableMCRecoParticleAssociation.cc:38
podio::ObjectID id() const
Definition MutableMCRecoParticleAssociation.h:117
void unlink()
disconnect from MCRecoParticleAssociationObj instance
Definition MutableMCRecoParticleAssociation.h:109
MutableMCRecoParticleAssociation()
default constructor
Definition MutableMCRecoParticleAssociation.cc:23
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoParticleAssociation.cc:64
bool operator<(const MutableMCRecoParticleAssociation &other) const
Definition MutableMCRecoParticleAssociation.h:115
void setRec(edm4eic::ReconstructedParticle value)
Set the reference to the reconstructed particle.
Definition MutableMCRecoParticleAssociation.cc:68
friend void swap(MutableMCRecoParticleAssociation &a, MutableMCRecoParticleAssociation &b)
Definition MutableMCRecoParticleAssociation.h:121
const edm4eic::ReconstructedParticle getRec() const
Access the reference to the reconstructed particle.
Definition MutableMCRecoParticleAssociation.cc:49
friend class MCRecoParticleAssociation
Definition MutableMCRecoParticleAssociation.h:43
bool operator==(const MutableMCRecoParticleAssociation &other) const
Definition MutableMCRecoParticleAssociation.h:111
std::uint32_t getRecID() const
Access the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition MutableMCRecoParticleAssociation.cc:46
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoParticleAssociation.cc:47
~MutableMCRecoParticleAssociation()=default
destructor
void setSim(edm4hep::MCParticle value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoParticleAssociation.cc:75
MutableMCRecoParticleAssociation & operator=(MutableMCRecoParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoParticleAssociation.cc:33
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoParticleAssociation.cc:88
friend class MCRecoParticleAssociationCollection
Definition MutableMCRecoParticleAssociation.h:41
Definition ReconstructedParticle.h:47
Definition CalorimeterHit.cc:18
Definition CalorimeterHit.h:21