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 <edm4eic/Vertex.h>
9#include <edm4hep/MCParticle.h>
10
11#include "podio/utilities/MaybeSharedPtr.h"
12#include "podio/detail/OrderKey.h"
13
14#include <ostream>
15#include <cstdint>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21// forward declarations
22namespace edm4eic {
24class Vertex;
25class MutableVertex;
26}
27namespace edm4hep {
28class MCParticle;
29class MutableMCParticle;
30}
31
32
33namespace podio::detail {
34// Internal function used in less comparison operators of the datatypes and interface types
35OrderKey getOrderKey(const edm4eic::MCRecoVertexParticleAssociation& obj);
36};
37
38namespace edm4eic {
39
43
44/** @class MCRecoVertexParticleAssociation
45 * Association between a Vertex and a MCParticle
46 * @author: S. Joosten
47 */
49
54 friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoVertexParticleAssociation & obj);
55
56public:
59
60 /// default constructor
62
63 /// Constructor initializing all members
64 MCRecoVertexParticleAssociation(const float weight);
65
66 /// copy constructor
68
69 /// copy-assignment operator
70 MCRecoVertexParticleAssociation& operator=(MCRecoVertexParticleAssociation other) &; // Rebind this to other's internal object
71 MCRecoVertexParticleAssociation& operator=(MCRecoVertexParticleAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
72
73 /// create a mutable deep-copy of the object with identical relations
74 /// if cloneRelations=false, the relations are not cloned and will be empty
75 MutableMCRecoVertexParticleAssociation clone(bool cloneRelations=true) const;
76
77 /// destructor
79
80 /// converting constructor from mutable object
82
84
85public:
86
87 static constexpr std::string_view typeName = "edm4eic::MCRecoVertexParticleAssociation";
88
89 /// Access the weight of this association
90 float getWeight() const;
91
92
93 /// Access the reference to the vertex
94 const edm4eic::Vertex getRec() const;
95 /// Access the reference to the Monte-Carlo particle
96 const edm4hep::MCParticle getSim() const;
97
98
99 [[deprecated("use getSim().getObjectID().index instead")]] int getSimID() const { return getSim().getObjectID().index; }
100 [[deprecated("use getRec().getObjectID().index instead")]] int getRecID() const { return getRec().getObjectID().index; }
101
102
103 /// check whether the object is actually available
104 bool isAvailable() const;
105 /// disconnect from MCRecoVertexParticleAssociationObj instance
106 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj>{nullptr}; }
107
108 bool operator==(const MCRecoVertexParticleAssociation& other) const { return m_obj == other.m_obj; }
109 bool operator==(const MutableMCRecoVertexParticleAssociation& other) const;
110
111 bool operator!=(const MCRecoVertexParticleAssociation& other) const { return !(*this == other); }
112 bool operator!=(const MutableMCRecoVertexParticleAssociation& other) const { return !(*this == other); }
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
116
117 podio::ObjectID id() const { return getObjectID(); }
118
119 const podio::ObjectID getObjectID() const;
120
121 friend std::hash<MCRecoVertexParticleAssociation>;
122
124 using std::swap;
125 swap(a.m_obj, b.m_obj); // swap out the internal pointers
126 }
127
128private:
129 /// constructor from existing MCRecoVertexParticleAssociationObj
130 explicit MCRecoVertexParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> obj);
132
133 podio::utils::MaybeSharedPtr<MCRecoVertexParticleAssociationObj> m_obj{new MCRecoVertexParticleAssociationObj{}, podio::utils::MarkOwned};
134};
135
136std::ostream& operator<<(std::ostream& o, const MCRecoVertexParticleAssociation& value);
137
138#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
139void to_json(nlohmann::json& j, const MCRecoVertexParticleAssociation& value);
140#endif
141
142
143} // namespace edm4eic
144
145
146
147template<>
148struct std::hash<edm4eic::MCRecoVertexParticleAssociation> {
150 return std::hash<edm4eic::MCRecoVertexParticleAssociationObj*>{}(obj.m_obj.get());
151 }
152};
153
154
155// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
156// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
157// and https://github.com/AIDASoft/podio/issues/770
158#if defined(__clang__)
159 #pragma clang diagnostic push
160 #pragma clang diagnostic ignored "-Wunknown-warning-option"
161 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
162 #pragma clang diagnostic ignored "-Wdeprecated"
164 #pragma clang diagnostic pop
165#elif defined(__GNUC__)
166 #pragma GCC diagnostic push
167 #pragma GCC diagnostic ignored "-Wdeprecated"
169 #pragma GCC diagnostic pop
170#endif
171
172
173#endif
Definition MCRecoVertexParticleAssociationCollectionData.h:33
Definition MCRecoVertexParticleAssociationCollection.h:138
Definition MCRecoVertexParticleAssociation.h:48
bool operator<(const MCRecoVertexParticleAssociation &other) const
Definition MCRecoVertexParticleAssociation.h:115
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MCRecoVertexParticleAssociation.cc:65
podio::ObjectID id() const
Definition MCRecoVertexParticleAssociation.h:117
bool operator!=(const MCRecoVertexParticleAssociation &other) const
Definition MCRecoVertexParticleAssociation.h:111
friend void swap(MCRecoVertexParticleAssociation &a, MCRecoVertexParticleAssociation &b)
Definition MCRecoVertexParticleAssociation.h:123
MutableMCRecoVertexParticleAssociation mutable_type
Definition MCRecoVertexParticleAssociation.h:57
int getSimID() const
Definition MCRecoVertexParticleAssociation.h:99
MCRecoVertexParticleAssociation(const MCRecoVertexParticleAssociation &other)=default
copy constructor
float getWeight() const
Access the weight of this association.
Definition MCRecoVertexParticleAssociation.cc:56
MCRecoVertexParticleAssociation()=default
default constructor
int getRecID() const
Definition MCRecoVertexParticleAssociation.h:100
MutableMCRecoVertexParticleAssociation clone(bool cloneRelations=true) const
Definition MCRecoVertexParticleAssociation.cc:31
MCRecoVertexParticleAssociation & operator=(MCRecoVertexParticleAssociation other) &&=delete
static constexpr std::string_view typeName
Definition MCRecoVertexParticleAssociation.h:87
friend class MCRecoVertexParticleAssociationCollectionIterator
Definition MCRecoVertexParticleAssociation.h:53
friend class MCRecoVertexParticleAssociationCollection
Definition MCRecoVertexParticleAssociation.h:51
friend class MutableMCRecoVertexParticleAssociation
Definition MCRecoVertexParticleAssociation.h:50
bool operator==(const MCRecoVertexParticleAssociation &other) const
Definition MCRecoVertexParticleAssociation.h:108
MCRecoVertexParticleAssociationCollection collection_type
Definition MCRecoVertexParticleAssociation.h:58
MCRecoVertexParticleAssociation & operator=(MCRecoVertexParticleAssociation other) &
copy-assignment operator
Definition MCRecoVertexParticleAssociation.cc:26
static MCRecoVertexParticleAssociation makeEmpty()
Definition MCRecoVertexParticleAssociation.cc:52
void unlink()
disconnect from MCRecoVertexParticleAssociationObj instance
Definition MCRecoVertexParticleAssociation.h:106
bool isAvailable() const
check whether the object is actually available
Definition MCRecoVertexParticleAssociation.cc:77
bool operator!=(const MutableMCRecoVertexParticleAssociation &other) const
Definition MCRecoVertexParticleAssociation.h:112
const podio::ObjectID getObjectID() const
Definition MCRecoVertexParticleAssociation.cc:81
~MCRecoVertexParticleAssociation()=default
destructor
const edm4eic::Vertex getRec() const
Access the reference to the vertex.
Definition MCRecoVertexParticleAssociation.cc:58
Definition MCRecoVertexParticleAssociationObj.h:24
Definition MutableMCRecoVertexParticleAssociation.h:40
Definition MutableVertex.h:38
Definition Vertex.h:46
const podio::ObjectID getObjectID() const
Definition Vertex.cc:110
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:25
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MCRecoVertexParticleAssociation &obj) const
Definition MCRecoVertexParticleAssociation.h:149