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