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 <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 MCRecoParticleAssociationCollection;
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
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableMCRecoParticleAssociation 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 ReconstructedParticle (position in ReconstructedParticles 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 reconstructed particle
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 ReconstructedParticle (position in ReconstructedParticles array)
95 void setRecID(std::uint32_t value);
96 /// Get mutable reference to Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
97 std::uint32_t& getRecID();
98 /// Get reference to Index of corresponding ReconstructedParticle (position in ReconstructedParticles 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 reconstructed particle
112 void setRec(const edm4eic::ReconstructedParticle& 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 MCRecoParticleAssociationObj instance
122 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj>{nullptr}; }
123
124 bool operator==(const MutableMCRecoParticleAssociation& other) const { return m_obj == other.m_obj; }
125 bool operator==(const MCRecoParticleAssociation& other) const;
126
127 bool operator!=(const MutableMCRecoParticleAssociation& other) const { return !(*this == other); }
128 bool operator!=(const MCRecoParticleAssociation& 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 MCRecoParticleAssociationObj
144 explicit MutableMCRecoParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj> obj);
145
146 podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj> m_obj{nullptr};
147};
148
149#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
150void to_json(nlohmann::json& j, const MutableMCRecoParticleAssociation& value);
151#endif
152
153
154} // namespace edm4eic
155
156
157#endif
Definition MCRecoParticleAssociationCollection.h:91
Definition MCRecoParticleAssociation.h:47
Definition MCRecoParticleAssociationCollection.h:62
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
bool operator!=(const MutableMCRecoParticleAssociation &other) const
Definition MutableMCRecoParticleAssociation.h:127
MutableMCRecoParticleAssociation(const MutableMCRecoParticleAssociation &other)=default
copy constructor
const podio::ObjectID getObjectID() const
Definition MutableMCRecoParticleAssociation.cc:92
void setRec(const edm4eic::ReconstructedParticle &value)
Set the reference to the reconstructed particle.
Definition MutableMCRecoParticleAssociation.cc:74
float & weight()
Get reference to weight of this association.
Definition MutableMCRecoParticleAssociation.cc:72
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoParticleAssociation.cc:70
void setRecID(std::uint32_t value)
Set the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition MutableMCRecoParticleAssociation.cc:67
podio::ObjectID id() const
Definition MutableMCRecoParticleAssociation.h:133
void unlink()
disconnect from MCRecoParticleAssociationObj instance
Definition MutableMCRecoParticleAssociation.h:122
MutableMCRecoParticleAssociation()
default constructor
Definition MutableMCRecoParticleAssociation.cc:20
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoParticleAssociation.cc:64
std::uint32_t & simID()
Get reference to Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoParticleAssociation.cc:66
bool operator<(const MutableMCRecoParticleAssociation &other) const
Definition MutableMCRecoParticleAssociation.h:131
void setSim(const edm4hep::MCParticle &value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoParticleAssociation.cc:78
std::uint32_t & recID()
Get reference to Index of corresponding ReconstructedParticle (position in ReconstructedParticles arr...
Definition MutableMCRecoParticleAssociation.cc:69
MutableMCRecoParticleAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoParticleAssociation.cc:35
friend void swap(MutableMCRecoParticleAssociation &a, MutableMCRecoParticleAssociation &b)
Definition MutableMCRecoParticleAssociation.h:137
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 MCRecoParticleAssociation &other) const
Definition MutableMCRecoParticleAssociation.h:128
bool operator==(const MutableMCRecoParticleAssociation &other) const
Definition MutableMCRecoParticleAssociation.h:124
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
MutableMCRecoParticleAssociation & operator=(MutableMCRecoParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoParticleAssociation.cc:30
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoParticleAssociation.cc:88
friend class MCRecoParticleAssociationCollection
Definition MutableMCRecoParticleAssociation.h:41
Definition ReconstructedParticle.h:54
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150