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 /// move constructor
71
72 /// copy-assignment operator
73 MCRecoClusterParticleAssociation& operator=(MCRecoClusterParticleAssociation other) &; // Rebind this to other's internal object
74 MCRecoClusterParticleAssociation& operator=(MCRecoClusterParticleAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
75
76 /// create a mutable deep-copy of the object with identical relations
77 /// if cloneRelations=false, the relations are not cloned and will be empty
78 MutableMCRecoClusterParticleAssociation clone(bool cloneRelations=true) const;
79
80 /// destructor
82
83 /// converting constructor from mutable object
85
87
88public:
89
90 static constexpr std::string_view typeName = "edm4eic::MCRecoClusterParticleAssociation";
91
92 /// Access the weight of this association
93 float getWeight() const;
94
95
96 /// Access the reference to the cluster
97 const edm4eic::Cluster getRec() const;
98 /// Access the reference to the Monte-Carlo particle
99 const edm4hep::MCParticle getSim() const;
100
101
102 [[deprecated("use getSim().getObjectID().index instead")]] int getSimID() const { return getSim().getObjectID().index; }
103 [[deprecated("use getRec().getObjectID().index instead")]] int getRecID() const { return getRec().getObjectID().index; }
104
105
106 /// check whether the object is actually available
107 bool isAvailable() const;
108 /// disconnect from MCRecoClusterParticleAssociationObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj>{nullptr}; }
110
111 constexpr bool operator==(const MCRecoClusterParticleAssociation& other) const { return m_obj == other.m_obj; }
113
114 constexpr bool operator!=(const MCRecoClusterParticleAssociation& other) const { return !(*this == other); }
115 bool operator!=(const MutableMCRecoClusterParticleAssociation& other) const { return !(*this == other); }
116
117 // less comparison operator, so that objects can be e.g. stored in sets.
119
120 podio::ObjectID id() const { return getObjectID(); }
121
122 const podio::ObjectID getObjectID() const;
123
124 friend std::hash<MCRecoClusterParticleAssociation>;
125
127 using std::swap;
128 swap(a.m_obj, b.m_obj); // swap out the internal pointers
129 }
130
131private:
132 /// constructor from existing MCRecoClusterParticleAssociationObj
133 explicit MCRecoClusterParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> obj);
135
136 podio::utils::MaybeSharedPtr<MCRecoClusterParticleAssociationObj> m_obj{new MCRecoClusterParticleAssociationObj{}, podio::utils::MarkOwned};
137};
138
139std::ostream& operator<<(std::ostream& o, const MCRecoClusterParticleAssociation& value);
140
141#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
142void to_json(nlohmann::json& j, const MCRecoClusterParticleAssociation& value);
143#endif
144
145
146} // namespace edm4eic
147
148
149
150template<>
151struct std::hash<edm4eic::MCRecoClusterParticleAssociation> {
153 return std::hash<edm4eic::MCRecoClusterParticleAssociationObj*>{}(obj.m_obj.get());
154 }
155};
156
157
158// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
159// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
160// and https://github.com/AIDASoft/podio/issues/770
161#if defined(__clang__)
162 #pragma clang diagnostic push
163 #pragma clang diagnostic ignored "-Wunknown-warning-option"
164 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
165 #pragma clang diagnostic ignored "-Wdeprecated"
167 #pragma clang diagnostic pop
168#elif defined(__GNUC__)
169 #pragma GCC diagnostic push
170 #pragma GCC diagnostic ignored "-Wdeprecated"
172 #pragma GCC diagnostic pop
173#endif
174
175
176#endif
Definition Cluster.h:49
const podio::ObjectID getObjectID() const
Definition Cluster.cc:347
Definition MCRecoClusterParticleAssociationCollectionData.h:33
Definition MCRecoClusterParticleAssociationCollection.h:139
Definition MCRecoClusterParticleAssociation.h:48
constexpr bool operator!=(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:114
const podio::ObjectID getObjectID() const
Definition MCRecoClusterParticleAssociation.cc:81
friend void swap(MCRecoClusterParticleAssociation &a, MCRecoClusterParticleAssociation &b)
Definition MCRecoClusterParticleAssociation.h:126
MCRecoClusterParticleAssociation(const MCRecoClusterParticleAssociation &other) noexcept=default
copy constructor
friend class MCRecoClusterParticleAssociationCollectionIterator
Definition MCRecoClusterParticleAssociation.h:53
static MCRecoClusterParticleAssociation makeEmpty()
Definition MCRecoClusterParticleAssociation.cc:52
MCRecoClusterParticleAssociation & operator=(MCRecoClusterParticleAssociation other) &&=delete
friend class MutableMCRecoClusterParticleAssociation
Definition MCRecoClusterParticleAssociation.h:50
constexpr bool operator==(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:111
MutableMCRecoClusterParticleAssociation mutable_type
Definition MCRecoClusterParticleAssociation.h:57
void unlink()
disconnect from MCRecoClusterParticleAssociationObj instance
Definition MCRecoClusterParticleAssociation.h:109
MCRecoClusterParticleAssociation()=default
default constructor
int getSimID() const
Definition MCRecoClusterParticleAssociation.h:102
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:90
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MCRecoClusterParticleAssociation.cc:65
int getRecID() const
Definition MCRecoClusterParticleAssociation.h:103
bool operator<(const MCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:118
~MCRecoClusterParticleAssociation()=default
destructor
MCRecoClusterParticleAssociation(MCRecoClusterParticleAssociation &&other) noexcept=default
move constructor
friend class MCRecoClusterParticleAssociationCollection
Definition MCRecoClusterParticleAssociation.h:51
bool operator!=(const MutableMCRecoClusterParticleAssociation &other) const
Definition MCRecoClusterParticleAssociation.h:115
podio::ObjectID id() const
Definition MCRecoClusterParticleAssociation.h:120
MutableMCRecoClusterParticleAssociation clone(bool cloneRelations=true) const
Definition MCRecoClusterParticleAssociation.cc:31
MCRecoClusterParticleAssociationCollection collection_type
Definition MCRecoClusterParticleAssociation.h:58
Definition MCRecoClusterParticleAssociationObj.h:24
Definition MutableCluster.h:41
Definition MutableMCRecoClusterParticleAssociation.h:40
Definition ArrowMapper.cc:63
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:152