EDM4eic
EIC data model
Loading...
Searching...
No Matches
MCRecoClusterParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MCRecoClusterParticleAssociation_H
4#define EDM4EIC_MCRecoClusterParticleAssociation_H
5
7
8#include <edm4eic/Cluster.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 Cluster;
25class MutableCluster;
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::MCRecoClusterParticleAssociation& obj);
36};
37
38namespace edm4eic {
39
43
44/** @class MCRecoClusterParticleAssociation
45 * Association between a Cluster and a MCParticle
46 * @author: S. Joosten
47 */
49
54 friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoClusterParticleAssociation & obj);
55
56public:
59
60 /// default constructor
62
63 /// Constructor initializing all members
64 MCRecoClusterParticleAssociation(const float weight);
65
66 /// copy constructor
68
69 /// copy-assignment operator
70 MCRecoClusterParticleAssociation& operator=(MCRecoClusterParticleAssociation other) &; // Rebind this to other's internal object
71 MCRecoClusterParticleAssociation& operator=(MCRecoClusterParticleAssociation 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 MutableMCRecoClusterParticleAssociation 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::MCRecoClusterParticleAssociation";
88
89 /// Access the weight of this association
90 float getWeight() const;
91
92
93 /// Access the reference to the cluster
94 const edm4eic::Cluster 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 MCRecoClusterParticleAssociationObj instance
106 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj>{nullptr}; }
107
108 bool operator==(const MCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
110
111 bool operator!=(const MCRecoClusterParticleAssociation& other) const { return !(*this == other); }
112 bool operator!=(const MutableMCRecoClusterParticleAssociation& 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<MCRecoClusterParticleAssociation>;
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 MCRecoClusterParticleAssociationObj
130 explicit MCRecoClusterParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> obj);
132
133 podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> m_obj{new MCRecoClusterParticleAssociationObj{}, podio::utils::MarkOwned};
134};
135
136std::ostream& operator<<(std::ostream& o, const MCRecoClusterParticleAssociation& value);
137
138#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
139void to_json(nlohmann::json& j, const MCRecoClusterParticleAssociation& value);
140#endif
141
142
143} // namespace edm4eic
144
145
146
147template<>
148struct std::hash<edm4eic::MCRecoClusterParticleAssociation> {
150 return std::hash<edm4eic::MCRecoClusterParticleAssociationObj*>{}(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 Cluster.h:48
const podio::ObjectID getObjectID() const
Definition Cluster.cc:337
Definition MCRecoClusterParticleAssociationCollectionData.h:33
Definition MCRecoClusterParticleAssociationCollection.h:138
Definition MCRecoClusterParticleAssociation.h:48
const podio::ObjectID getObjectID() const
Definition MCRecoClusterParticleAssociation.cc:81
friend void swap(MCRecoClusterParticleAssociation &a, MCRecoClusterParticleAssociation &b)
Definition MCRecoClusterParticleAssociation.h:123
friend class MCRecoClusterParticleAssociationCollectionIterator
Definition MCRecoClusterParticleAssociation.h:53
static MCRecoClusterParticleAssociation makeEmpty()
Definition MCRecoClusterParticleAssociation.cc:52
MCRecoClusterParticleAssociation(const MCRecoClusterParticleAssociation &other)=default
copy constructor
MCRecoClusterParticleAssociation & operator=(MCRecoClusterParticleAssociation other) &&=delete
friend class MutableMCRecoClusterParticleAssociation
Definition MCRecoClusterParticleAssociation.h:50
MutableMCRecoClusterParticleAssociation mutable_type
Definition MCRecoClusterParticleAssociation.h:57
bool operator==(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:108
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition MCRecoClusterParticleAssociation.h:106
MCRecoClusterParticleAssociation()=default
default constructor
int getSimID() const
Definition MCRecoClusterParticleAssociation.h:99
float getWeight() const
Access the weight of this association.
Definition MCRecoClusterParticleAssociation.cc:56
bool isAvailable() const
check whether the object is actually available
Definition MCRecoClusterParticleAssociation.cc:77
const edm4eic::Cluster getRec() const
Access the reference to the cluster.
Definition MCRecoClusterParticleAssociation.cc:58
MCRecoClusterParticleAssociation & operator=(MCRecoClusterParticleAssociation other) &
copy-assignment operator
Definition MCRecoClusterParticleAssociation.cc:26
static constexpr std::string_view typeName
Definition MCRecoClusterParticleAssociation.h:87
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MCRecoClusterParticleAssociation.cc:65
int getRecID() const
Definition MCRecoClusterParticleAssociation.h:100
bool operator<(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:115
~MCRecoClusterParticleAssociation()=default
destructor
friend class MCRecoClusterParticleAssociationCollection
Definition MCRecoClusterParticleAssociation.h:51
bool operator!=(const MutableMCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:112
podio::ObjectID id() const
Definition MCRecoClusterParticleAssociation.h:117
MutableMCRecoClusterParticleAssociation clone(bool cloneRelations=true) const
Definition MCRecoClusterParticleAssociation.cc:31
bool operator!=(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:111
MCRecoClusterParticleAssociationCollection collection_type
Definition MCRecoClusterParticleAssociation.h:58
Definition MCRecoClusterParticleAssociationObj.h:24
Definition MutableCluster.h:40
Definition MutableMCRecoClusterParticleAssociation.h:40
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::MCRecoClusterParticleAssociation &obj) const
Definition MCRecoClusterParticleAssociation.h:149