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