EICd
EIC data model
MCRecoParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MCRecoParticleAssociation_H
4#define EICD_MCRecoParticleAssociation_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 ReconstructedParticle;
19class MutableReconstructedParticle;
20}
21namespace edm4hep {
22class MCParticle;
23class MutableMCParticle;
24}
25
26
27namespace eicd {
28
29class MutableMCRecoParticleAssociation;
30
31/** @class MCRecoParticleAssociation
32 * Used to keep track of the correspondence between MC and reconstructed particles
33 * @author: S. Joosten
34 */
36
40
41public:
42 /// default constructor
44 MCRecoParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
45
46 /// constructor from existing MCRecoParticleAssociationObj
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 ReconstructedParticle (position in ReconstructedParticles 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 reconstructed particle
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 MCRecoParticleAssociationObj instance
84 void unlink() { m_obj = nullptr; }
85
86 bool operator==(const MCRecoParticleAssociation& other) const { return m_obj == other.m_obj; }
87 bool operator==(const MutableMCRecoParticleAssociation& other) const;
88
89 // less comparison operator, so that objects can be e.g. stored in sets.
90 bool operator<(const MCRecoParticleAssociation& 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 MCRecoParticleAssociation& value);
106
107#ifdef PODIO_JSON_OUTPUT
108void to_json(nlohmann::json& j, const MCRecoParticleAssociation& value);
109#endif
110
111
112} // namespace eicd
113
114
115#endif
Definition: MCRecoParticleAssociationCollection.h:82
Definition: MCRecoParticleAssociationCollection.h:35
Definition: MCRecoParticleAssociation.h:35
friend void swap(MCRecoParticleAssociation &a, MCRecoParticleAssociation &b)
Definition: MCRecoParticleAssociation.h:96
const podio::ObjectID getObjectID() const
Definition: MCRecoParticleAssociation.cc:84
void unlink()
disconnect from MCRecoParticleAssociationObj instance
Definition: MCRecoParticleAssociation.h:84
const eicd::ReconstructedParticle getRec() const
Access the reference to the reconstructed particle.
Definition: MCRecoParticleAssociation.cc:58
const float & getWeight() const
Access the weight of this association.
Definition: MCRecoParticleAssociation.cc:56
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition: MCRecoParticleAssociation.cc:65
const std::uint32_t & getRecID() const
Access the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition: MCRecoParticleAssociation.cc:55
MutableMCRecoParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition: MCRecoParticleAssociation.cc:44
bool operator==(const MCRecoParticleAssociation &other) const
Definition: MCRecoParticleAssociation.h:86
MCRecoParticleAssociation & operator=(MCRecoParticleAssociation other)
copy-assignment operator
Definition: MCRecoParticleAssociation.cc:33
MCRecoParticleAssociation()
default constructor
Definition: MCRecoParticleAssociation.cc:18
unsigned int id() const
Definition: MCRecoParticleAssociation.h:92
bool operator<(const MCRecoParticleAssociation &other) const
Definition: MCRecoParticleAssociation.h:90
bool isAvailable() const
check whether the object is actually available
Definition: MCRecoParticleAssociation.cc:77
~MCRecoParticleAssociation()
destructor
Definition: MCRecoParticleAssociation.cc:48
const std::uint32_t & getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition: MCRecoParticleAssociation.cc:54
Definition: MCRecoParticleAssociationObj.h:24
Definition: MutableMCRecoParticleAssociation.h:36
Definition: ReconstructedParticle.h:42
Definition: MCRecoClusterParticleAssociation.h:21
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93