EDM4eic
EIC data model
Loading...
Searching...
No Matches
MCRecoClusterParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MCRecoClusterParticleAssociation_H
4#define EDM4EIC_MCRecoClusterParticleAssociation_H
5
7
8#include <cstdint>
9
10#include "podio/utilities/MaybeSharedPtr.h"
11
12#include <ostream>
13#include <cstddef>
14
15#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
16#include "nlohmann/json_fwd.hpp"
17#endif
18
19// forward declarations
20namespace edm4eic {
21class Cluster;
22class MutableCluster;
23}
24namespace edm4hep {
25class MCParticle;
26class MutableMCParticle;
27}
28
29
30namespace edm4eic {
31
32class MutableMCRecoClusterParticleAssociation;
33class MCRecoClusterParticleAssociationCollection;
34class MCRecoClusterParticleAssociationCollectionData;
35
36/** @class MCRecoClusterParticleAssociation
37 * Association between a Cluster and a MCParticle
38 * @author: S. Joosten
39 */
41
46
47public:
50
51 /// default constructor
53
54 /// Constructor initializing all members
55 MCRecoClusterParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
56
57 /// copy constructor
59
60 /// copy-assignment operator
62
63 /// create a mutable deep-copy of the object with identical relations
65
66 /// destructor
68
69
71
72public:
73
74 /// Access the Index of corresponding MCParticle (position in MCParticles array)
75 std::uint32_t getSimID() const;
76
77 /// Access the Index of corresponding Cluster (position in Clusters array)
78 std::uint32_t getRecID() const;
79
80 /// Access the weight of this association
81 float getWeight() const;
82
83
84 /// Access the reference to the cluster
85 const edm4eic::Cluster getRec() const;
86 /// Access the reference to the Monte-Carlo particle
87 const edm4hep::MCParticle getSim() const;
88
89
90
91 /// check whether the object is actually available
92 bool isAvailable() const;
93 /// disconnect from MCRecoClusterParticleAssociationObj instance
94 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj>{nullptr}; }
95
96 bool operator==(const MCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
98
99 // less comparison operator, so that objects can be e.g. stored in sets.
100 bool operator<(const MCRecoClusterParticleAssociation& other) const { return m_obj < other.m_obj; }
101
102 podio::ObjectID id() const { return getObjectID(); }
103
104 const podio::ObjectID getObjectID() const;
105
107 using std::swap;
108 swap(a.m_obj, b.m_obj); // swap out the internal pointers
109 }
110
111private:
112 /// constructor from existing MCRecoClusterParticleAssociationObj
113 explicit MCRecoClusterParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> obj);
115
116 podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> m_obj{nullptr};
117};
118
119std::ostream& operator<<(std::ostream& o, const MCRecoClusterParticleAssociation& value);
120
121#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
122void to_json(nlohmann::json& j, const MCRecoClusterParticleAssociation& value);
123#endif
124
125
126} // namespace edm4eic
127
128
129#endif
Definition Cluster.h:38
Definition MCRecoClusterParticleAssociationCollectionData.h:32
Definition MCRecoClusterParticleAssociationCollection.h:95
Definition MCRecoClusterParticleAssociationCollection.h:40
Definition MCRecoClusterParticleAssociation.h:40
const podio::ObjectID getObjectID() const
Definition MCRecoClusterParticleAssociation.cc:80
friend void swap(MCRecoClusterParticleAssociation &a, MCRecoClusterParticleAssociation &b)
Definition MCRecoClusterParticleAssociation.h:106
std::uint32_t getRecID() const
Access the Index of corresponding Cluster (position in Clusters array)
Definition MCRecoClusterParticleAssociation.cc:51
static MCRecoClusterParticleAssociation makeEmpty()
Definition MCRecoClusterParticleAssociation.cc:46
MCRecoClusterParticleAssociation(const MCRecoClusterParticleAssociation &other)=default
copy constructor
MCRecoClusterParticleAssociation()
default constructor
Definition MCRecoClusterParticleAssociation.cc:23
friend class MutableMCRecoClusterParticleAssociation
Definition MCRecoClusterParticleAssociation.h:42
bool operator==(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:96
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition MCRecoClusterParticleAssociation.h:94
float getWeight() const
Access the weight of this association.
Definition MCRecoClusterParticleAssociation.cc:52
bool isAvailable() const
check whether the object is actually available
Definition MCRecoClusterParticleAssociation.cc:73
const edm4eic::Cluster getRec() const
Access the reference to the cluster.
Definition MCRecoClusterParticleAssociation.cc:54
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MCRecoClusterParticleAssociation.cc:61
bool operator<(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:100
~MCRecoClusterParticleAssociation()=default
destructor
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MCRecoClusterParticleAssociation.cc:50
friend class MCRecoClusterParticleAssociationCollection
Definition MCRecoClusterParticleAssociation.h:43
MutableMCRecoClusterParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition MCRecoClusterParticleAssociation.cc:38
podio::ObjectID id() const
Definition MCRecoClusterParticleAssociation.h:102
MCRecoClusterParticleAssociation & operator=(MCRecoClusterParticleAssociation other)
copy-assignment operator
Definition MCRecoClusterParticleAssociation.cc:33
Definition MCRecoClusterParticleAssociationObj.h:24
Definition MutableMCRecoClusterParticleAssociation.h:39
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
Definition CalorimeterHit.h:21