EICd
EIC data model
MutableMCRecoClusterParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableMCRecoClusterParticleAssociation_H
4#define EICD_MutableMCRecoClusterParticleAssociation_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 Cluster;
21class MutableCluster;
22}
23namespace edm4hep {
24class MCParticle;
25class MutableMCParticle;
26}
27
28
29namespace eicd {
30
31
32/** @class MutableMCRecoClusterParticleAssociation
33 * Association between a Cluster and a MCParticle
34 * @author: S. Joosten
35 */
37
41
42public:
43
44 /// default constructor
46 MutableMCRecoClusterParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
47
48 /// constructor from existing MCRecoClusterParticleAssociationObj
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 MCRecoClusterParticleAssociation() 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 Cluster (position in Clusters 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 cluster
79 const eicd::Cluster getRec() const;
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 Cluster (position in Clusters 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 cluster
94 void setRec(eicd::Cluster value);
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 MCRecoClusterParticleAssociationObj instance
104 void unlink() { m_obj = nullptr; }
105
106 bool operator==(const MutableMCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
107 bool operator==(const MCRecoClusterParticleAssociation& other) const;
108
109 // less comparison operator, so that objects can be e.g. stored in sets.
110 bool operator<(const MutableMCRecoClusterParticleAssociation& 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 MutableMCRecoClusterParticleAssociation& value);
127#endif
128
129
130} // namespace eicd
131
132
133#endif
Definition: Cluster.h:33
Definition: MCRecoClusterParticleAssociationCollection.h:82
Definition: MCRecoClusterParticleAssociation.h:35
Definition: MCRecoClusterParticleAssociationCollection.h:57
Definition: MCRecoClusterParticleAssociationObj.h:24
Definition: MutableMCRecoClusterParticleAssociation.h:36
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition: MutableMCRecoClusterParticleAssociation.cc:66
void setSim(edm4hep::MCParticle value)
Set the reference to the Monte-Carlo particle.
Definition: MutableMCRecoClusterParticleAssociation.cc:85
const eicd::Cluster getRec() const
Access the reference to the cluster.
Definition: MutableMCRecoClusterParticleAssociation.cc:59
friend class MCRecoClusterParticleAssociation
Definition: MutableMCRecoClusterParticleAssociation.h:40
MutableMCRecoClusterParticleAssociation()
default constructor
Definition: MutableMCRecoClusterParticleAssociation.cc:18
bool operator==(const MutableMCRecoClusterParticleAssociation &other) const
Definition: MutableMCRecoClusterParticleAssociation.h:106
MutableMCRecoClusterParticleAssociation & operator=(MutableMCRecoClusterParticleAssociation other)
copy-assignment operator
Definition: MutableMCRecoClusterParticleAssociation.cc:33
~MutableMCRecoClusterParticleAssociation()
destructor
Definition: MutableMCRecoClusterParticleAssociation.cc:48
bool isAvailable() const
check whether the object is actually available
Definition: MutableMCRecoClusterParticleAssociation.cc:98
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition: MutableMCRecoClusterParticleAssociation.h:104
const std::uint32_t & getRecID() const
Access the Index of corresponding Cluster (position in Clusters array)
Definition: MutableMCRecoClusterParticleAssociation.cc:56
bool operator<(const MutableMCRecoClusterParticleAssociation &other) const
Definition: MutableMCRecoClusterParticleAssociation.h:110
void setWeight(float value)
Set the weight of this association.
Definition: MutableMCRecoClusterParticleAssociation.cc:76
void setRecID(std::uint32_t value)
Set the Index of corresponding Cluster (position in Clusters array)
Definition: MutableMCRecoClusterParticleAssociation.cc:75
MutableMCRecoClusterParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableMCRecoClusterParticleAssociation.cc:44
void setRec(eicd::Cluster value)
Set the reference to the cluster.
Definition: MutableMCRecoClusterParticleAssociation.cc:78
const float & getWeight() const
Access the weight of this association.
Definition: MutableMCRecoClusterParticleAssociation.cc:57
const podio::ObjectID getObjectID() const
Definition: MutableMCRecoClusterParticleAssociation.cc:105
const std::uint32_t & getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition: MutableMCRecoClusterParticleAssociation.cc:55
friend void swap(MutableMCRecoClusterParticleAssociation &a, MutableMCRecoClusterParticleAssociation &b)
Definition: MutableMCRecoClusterParticleAssociation.h:116
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition: MutableMCRecoClusterParticleAssociation.cc:74
unsigned int id() const
Definition: MutableMCRecoClusterParticleAssociation.h:112
Definition: MCRecoClusterParticleAssociation.h:21
Definition: CalorimeterHit.cc:13