EICd
EIC data model
MCRecoClusterParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MCRecoClusterParticleAssociation_H
4#define EICD_MCRecoClusterParticleAssociation_H
5
7
8#include <cstdint>
9#include "podio/ObjectID.h"
10#include <ostream>
11
12#ifdef PODIO_JSON_OUTPUT
13#include "nlohmann/json.hpp"
14#endif
15
16// forward declarations
17namespace eicd {
18class Cluster;
19class MutableCluster;
20}
21namespace edm4hep {
22class MCParticle;
23class MutableMCParticle;
24}
25
26
27namespace eicd {
28
29class MutableMCRecoClusterParticleAssociation;
30
31/** @class MCRecoClusterParticleAssociation
32 * Association between a Cluster and a MCParticle
33 * @author: S. Joosten
34 */
36
40
41public:
42 /// default constructor
44 MCRecoClusterParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
45
46 /// constructor from existing MCRecoClusterParticleAssociationObj
48
49 /// copy constructor
51
52 /// copy-assignment operator
54
55 /// create a mutable deep-copy of the object with identical relations
57
58 /// destructor
60
61
62public:
63
64 /// Access the Index of corresponding MCParticle (position in MCParticles array)
65 const std::uint32_t& getSimID() const;
66
67 /// Access the Index of corresponding Cluster (position in Clusters array)
68 const std::uint32_t& getRecID() const;
69
70 /// Access the weight of this association
71 const float& getWeight() const;
72
73
74 /// Access the reference to the cluster
75 const eicd::Cluster getRec() const;
76 /// Access the reference to the Monte-Carlo particle
77 const edm4hep::MCParticle getSim() const;
78
79
80
81 /// check whether the object is actually available
82 bool isAvailable() const;
83 /// disconnect from MCRecoClusterParticleAssociationObj instance
84 void unlink() { m_obj = nullptr; }
85
86 bool operator==(const MCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
88
89 // less comparison operator, so that objects can be e.g. stored in sets.
90 bool operator<(const MCRecoClusterParticleAssociation& other) const { return m_obj < other.m_obj; }
91
92 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
93
94 const podio::ObjectID getObjectID() const;
95
97 using std::swap;
98 swap(a.m_obj, b.m_obj); // swap out the internal pointers
99 }
100
101private:
103};
104
105std::ostream& operator<<(std::ostream& o, const MCRecoClusterParticleAssociation& value);
106
107#ifdef PODIO_JSON_OUTPUT
108void to_json(nlohmann::json& j, const MCRecoClusterParticleAssociation& value);
109#endif
110
111
112} // namespace eicd
113
114
115#endif
Definition: Cluster.h:33
Definition: MCRecoClusterParticleAssociationCollection.h:82
Definition: MCRecoClusterParticleAssociationCollection.h:35
Definition: MCRecoClusterParticleAssociation.h:35
MCRecoClusterParticleAssociation()
default constructor
Definition: MCRecoClusterParticleAssociation.cc:18
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition: MCRecoClusterParticleAssociation.h:84
friend void swap(MCRecoClusterParticleAssociation &a, MCRecoClusterParticleAssociation &b)
Definition: MCRecoClusterParticleAssociation.h:96
bool operator<(const MCRecoClusterParticleAssociation &other) const
Definition: MCRecoClusterParticleAssociation.h:90
const std::uint32_t & getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition: MCRecoClusterParticleAssociation.cc:54
MutableMCRecoClusterParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition: MCRecoClusterParticleAssociation.cc:44
const float & getWeight() const
Access the weight of this association.
Definition: MCRecoClusterParticleAssociation.cc:56
const eicd::Cluster getRec() const
Access the reference to the cluster.
Definition: MCRecoClusterParticleAssociation.cc:58
~MCRecoClusterParticleAssociation()
destructor
Definition: MCRecoClusterParticleAssociation.cc:48
MCRecoClusterParticleAssociation & operator=(MCRecoClusterParticleAssociation other)
copy-assignment operator
Definition: MCRecoClusterParticleAssociation.cc:33
bool operator==(const MCRecoClusterParticleAssociation &other) const
Definition: MCRecoClusterParticleAssociation.h:86
unsigned int id() const
Definition: MCRecoClusterParticleAssociation.h:92
bool isAvailable() const
check whether the object is actually available
Definition: MCRecoClusterParticleAssociation.cc:77
const podio::ObjectID getObjectID() const
Definition: MCRecoClusterParticleAssociation.cc:84
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition: MCRecoClusterParticleAssociation.cc:65
const std::uint32_t & getRecID() const
Access the Index of corresponding Cluster (position in Clusters array)
Definition: MCRecoClusterParticleAssociation.cc:55
Definition: MCRecoClusterParticleAssociationObj.h:24
Definition: MutableMCRecoClusterParticleAssociation.h:36
Definition: MCRecoClusterParticleAssociation.h:21
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93