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