EICd
EIC data model
MutableMCRecoParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableMCRecoParticleAssociation_H
4#define EICD_MutableMCRecoParticleAssociation_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include <cstdint>
11#include "podio/ObjectID.h"
12#include <ostream>
13
14#ifdef PODIO_JSON_OUTPUT
15#include "nlohmann/json.hpp"
16#endif
17
18// forward declarations
19namespace eicd {
20class ReconstructedParticle;
21class MutableReconstructedParticle;
22}
23namespace edm4hep {
24class MCParticle;
25class MutableMCParticle;
26}
27
28
29namespace eicd {
30
31
32/** @class MutableMCRecoParticleAssociation
33 * Used to keep track of the correspondence between MC and reconstructed particles
34 * @author: S. Joosten
35 */
37
41
42public:
43
44 /// default constructor
46 MutableMCRecoParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
47
48 /// constructor from existing MCRecoParticleAssociationObj
50
51 /// copy constructor
53
54 /// copy-assignment operator
56
57 /// create a mutable deep-copy of the object with identical relations
59
60 /// destructor
62
63 /// conversion to const object
64 operator MCRecoParticleAssociation() const;
65
66public:
67
68 /// Access the Index of corresponding MCParticle (position in MCParticles array)
69 const std::uint32_t& getSimID() const;
70
71 /// Access the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
72 const std::uint32_t& getRecID() const;
73
74 /// Access the weight of this association
75 const float& getWeight() const;
76
77
78 /// Access the reference to the reconstructed particle
80 /// Access the reference to the Monte-Carlo particle
81 const edm4hep::MCParticle getSim() const;
82
83 /// Set the Index of corresponding MCParticle (position in MCParticles array)
84 void setSimID(std::uint32_t value);
85
86 /// Set the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
87 void setRecID(std::uint32_t value);
88
89 /// Set the weight of this association
90 void setWeight(float value);
91
92
93 /// Set the reference to the reconstructed particle
95 /// Set the reference to the Monte-Carlo particle
96 void setSim(edm4hep::MCParticle value);
97
98
99
100
101 /// check whether the object is actually available
102 bool isAvailable() const;
103 /// disconnect from MCRecoParticleAssociationObj instance
104 void unlink() { m_obj = nullptr; }
105
106 bool operator==(const MutableMCRecoParticleAssociation& other) const { return m_obj == other.m_obj; }
107 bool operator==(const MCRecoParticleAssociation& other) const;
108
109 // less comparison operator, so that objects can be e.g. stored in sets.
110 bool operator<(const MutableMCRecoParticleAssociation& other) const { return m_obj < other.m_obj; }
111
112 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
113
114 const podio::ObjectID getObjectID() const;
115
117 using std::swap;
118 swap(a.m_obj, b.m_obj); // swap out the internal pointers
119 }
120
121private:
123};
124
125#ifdef PODIO_JSON_OUTPUT
126void to_json(nlohmann::json& j, const MutableMCRecoParticleAssociation& value);
127#endif
128
129
130} // namespace eicd
131
132
133#endif
Definition: MCRecoParticleAssociationCollection.h:82
Definition: MCRecoParticleAssociation.h:35
Definition: MCRecoParticleAssociationCollection.h:57
Definition: MCRecoParticleAssociationObj.h:24
Definition: MutableMCRecoParticleAssociation.h:36
MutableMCRecoParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableMCRecoParticleAssociation.cc:44
const std::uint32_t & getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition: MutableMCRecoParticleAssociation.cc:55
bool isAvailable() const
check whether the object is actually available
Definition: MutableMCRecoParticleAssociation.cc:98
bool operator<(const MutableMCRecoParticleAssociation &other) const
Definition: MutableMCRecoParticleAssociation.h:110
void setRecID(std::uint32_t value)
Set the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition: MutableMCRecoParticleAssociation.cc:75
void setRec(eicd::ReconstructedParticle value)
Set the reference to the reconstructed particle.
Definition: MutableMCRecoParticleAssociation.cc:78
void unlink()
disconnect from MCRecoParticleAssociationObj instance
Definition: MutableMCRecoParticleAssociation.h:104
bool operator==(const MutableMCRecoParticleAssociation &other) const
Definition: MutableMCRecoParticleAssociation.h:106
MutableMCRecoParticleAssociation & operator=(MutableMCRecoParticleAssociation other)
copy-assignment operator
Definition: MutableMCRecoParticleAssociation.cc:33
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition: MutableMCRecoParticleAssociation.cc:74
const float & getWeight() const
Access the weight of this association.
Definition: MutableMCRecoParticleAssociation.cc:57
const std::uint32_t & getRecID() const
Access the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition: MutableMCRecoParticleAssociation.cc:56
~MutableMCRecoParticleAssociation()
destructor
Definition: MutableMCRecoParticleAssociation.cc:48
const eicd::ReconstructedParticle getRec() const
Access the reference to the reconstructed particle.
Definition: MutableMCRecoParticleAssociation.cc:59
friend void swap(MutableMCRecoParticleAssociation &a, MutableMCRecoParticleAssociation &b)
Definition: MutableMCRecoParticleAssociation.h:116
MutableMCRecoParticleAssociation()
default constructor
Definition: MutableMCRecoParticleAssociation.cc:18
void setSim(edm4hep::MCParticle value)
Set the reference to the Monte-Carlo particle.
Definition: MutableMCRecoParticleAssociation.cc:85
friend class MCRecoParticleAssociation
Definition: MutableMCRecoParticleAssociation.h:40
const podio::ObjectID getObjectID() const
Definition: MutableMCRecoParticleAssociation.cc:105
unsigned int id() const
Definition: MutableMCRecoParticleAssociation.h:112
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition: MutableMCRecoParticleAssociation.cc:66
void setWeight(float value)
Set the weight of this association.
Definition: MutableMCRecoParticleAssociation.cc:76
Definition: ReconstructedParticle.h:42
Definition: MCRecoClusterParticleAssociation.h:21
Definition: CalorimeterHit.cc:13