EDM4eic
EIC data model
Loading...
Searching...
No Matches
MCRecoParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MCRecoParticleAssociation_H
4#define EDM4EIC_MCRecoParticleAssociation_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 ReconstructedParticle;
22class MutableReconstructedParticle;
23}
24namespace edm4hep {
25class MCParticle;
26class MutableMCParticle;
27}
28
29
30namespace edm4eic {
31
32class MutableMCRecoParticleAssociation;
33class MCRecoParticleAssociationCollection;
34class MCRecoParticleAssociationCollectionData;
35
36/** @class MCRecoParticleAssociation
37 * Used to keep track of the correspondence between MC and reconstructed particles
38 * @author: S. Joosten
39 */
41
46
47public:
50
51 /// default constructor
53
54 /// Constructor initializing all members
55 MCRecoParticleAssociation(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 ReconstructedParticle (position in ReconstructedParticles 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 reconstructed particle
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 MCRecoParticleAssociationObj instance
94 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj>{nullptr}; }
95
96 bool operator==(const MCRecoParticleAssociation& other) const { return m_obj == other.m_obj; }
97 bool operator==(const MutableMCRecoParticleAssociation& other) const;
98
99 // less comparison operator, so that objects can be e.g. stored in sets.
100 bool operator<(const MCRecoParticleAssociation& 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 MCRecoParticleAssociationObj
113 explicit MCRecoParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj> obj);
115
116 podio::utils::MaybeSharedPtr<MCRecoParticleAssociationObj> m_obj{nullptr};
117};
118
119std::ostream& operator<<(std::ostream& o, const MCRecoParticleAssociation& value);
120
121#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
122void to_json(nlohmann::json& j, const MCRecoParticleAssociation& value);
123#endif
124
125
126} // namespace edm4eic
127
128
129#endif
Definition MCRecoParticleAssociationCollectionData.h:32
Definition MCRecoParticleAssociationCollection.h:95
Definition MCRecoParticleAssociationCollection.h:40
Definition MCRecoParticleAssociation.h:40
friend class MutableMCRecoParticleAssociation
Definition MCRecoParticleAssociation.h:42
friend void swap(MCRecoParticleAssociation &a, MCRecoParticleAssociation &b)
Definition MCRecoParticleAssociation.h:106
bool operator<(const MCRecoParticleAssociation &other) const
Definition MCRecoParticleAssociation.h:100
MutableMCRecoParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition MCRecoParticleAssociation.cc:38
const podio::ObjectID getObjectID() const
Definition MCRecoParticleAssociation.cc:80
const edm4eic::ReconstructedParticle getRec() const
Access the reference to the reconstructed particle.
Definition MCRecoParticleAssociation.cc:54
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MCRecoParticleAssociation.cc:61
bool operator==(const MCRecoParticleAssociation &other) const
Definition MCRecoParticleAssociation.h:96
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MCRecoParticleAssociation.cc:50
void unlink()
disconnect from MCRecoParticleAssociationObj instance
Definition MCRecoParticleAssociation.h:94
~MCRecoParticleAssociation()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition MCRecoParticleAssociation.cc:73
MCRecoParticleAssociation(const MCRecoParticleAssociation &other)=default
copy constructor
float getWeight() const
Access the weight of this association.
Definition MCRecoParticleAssociation.cc:52
std::uint32_t getRecID() const
Access the Index of corresponding ReconstructedParticle (position in ReconstructedParticles array)
Definition MCRecoParticleAssociation.cc:51
static MCRecoParticleAssociation makeEmpty()
Definition MCRecoParticleAssociation.cc:46
MCRecoParticleAssociation()
default constructor
Definition MCRecoParticleAssociation.cc:23
MCRecoParticleAssociation & operator=(MCRecoParticleAssociation other)
copy-assignment operator
Definition MCRecoParticleAssociation.cc:33
friend class MCRecoParticleAssociationCollection
Definition MCRecoParticleAssociation.h:43
podio::ObjectID id() const
Definition MCRecoParticleAssociation.h:102
Definition MCRecoParticleAssociationObj.h:24
Definition MutableMCRecoParticleAssociation.h:39
Definition ReconstructedParticle.h:47
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97
Definition CalorimeterHit.h:21