EDM4eic
EIC data model
Loading...
Searching...
No Matches
MCRecoTrackerHitAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MCRecoTrackerHitAssociation_H
4#define EDM4EIC_MCRecoTrackerHitAssociation_H
5
7
8
9#include "podio/utilities/MaybeSharedPtr.h"
10#include "podio/detail/OrderKey.h"
11
12#include <ostream>
13#include <cstdint>
14
15#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
16#include "nlohmann/json_fwd.hpp"
17#endif
18
19// forward declarations
20namespace edm4eic {
22class RawTrackerHit;
24}
25namespace edm4hep {
26class SimTrackerHit;
27class MutableSimTrackerHit;
28}
29
30
31namespace podio::detail {
32// Internal function used in less comparison operators of the datatypes and interface types
33OrderKey getOrderKey(const edm4eic::MCRecoTrackerHitAssociation& obj);
34};
35
36namespace edm4eic {
37
41
42/** @class MCRecoTrackerHitAssociation
43 * Association between a RawTrackerHit and a SimTrackerHit
44 * @author: C. Dilks, W. Deconinck
45 */
47
52 friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoTrackerHitAssociation & obj);
53
54public:
57
58 /// default constructor
60
61 /// Constructor initializing all members
62 MCRecoTrackerHitAssociation(const float weight);
63
64 /// copy constructor
66
67 /// move constructor
69
70 /// copy-assignment operator
71 MCRecoTrackerHitAssociation& operator=(MCRecoTrackerHitAssociation other) &; // Rebind this to other's internal object
72 MCRecoTrackerHitAssociation& operator=(MCRecoTrackerHitAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
73
74 /// create a mutable deep-copy of the object with identical relations
75 /// if cloneRelations=false, the relations are not cloned and will be empty
76 MutableMCRecoTrackerHitAssociation clone(bool cloneRelations=true) const;
77
78 /// destructor
80
81 /// converting constructor from mutable object
83
85
86public:
87
88 static constexpr std::string_view typeName = "edm4eic::MCRecoTrackerHitAssociation";
89
90 /// Access the weight of this association
91 float getWeight() const;
92
93
94 /// Access the reference to the digitized hit
96 /// Access the reference to the simulated hit
97 const edm4hep::SimTrackerHit getSimHit() const;
98
99
100
101 /// check whether the object is actually available
102 bool isAvailable() const;
103 /// disconnect from MCRecoTrackerHitAssociationObj instance
104 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj>{nullptr}; }
105
106 constexpr bool operator==(const MCRecoTrackerHitAssociation& other) const { return m_obj == other.m_obj; }
107 bool operator==(const MutableMCRecoTrackerHitAssociation& other) const;
108
109 constexpr bool operator!=(const MCRecoTrackerHitAssociation& other) const { return !(*this == other); }
110 bool operator!=(const MutableMCRecoTrackerHitAssociation& other) const { return !(*this == other); }
111
112 // less comparison operator, so that objects can be e.g. stored in sets.
114
115 podio::ObjectID id() const { return getObjectID(); }
116
117 const podio::ObjectID getObjectID() const;
118
119 friend std::hash<MCRecoTrackerHitAssociation>;
120
122 using std::swap;
123 swap(a.m_obj, b.m_obj); // swap out the internal pointers
124 }
125
126private:
127 /// constructor from existing MCRecoTrackerHitAssociationObj
128 explicit MCRecoTrackerHitAssociation(podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj> obj);
130
131 podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj> m_obj{new MCRecoTrackerHitAssociationObj{}, podio::utils::MarkOwned};
132};
133
134std::ostream& operator<<(std::ostream& o, const MCRecoTrackerHitAssociation& value);
135
136#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
137void to_json(nlohmann::json& j, const MCRecoTrackerHitAssociation& value);
138#endif
139
140
141} // namespace edm4eic
142
143
144
145template<>
146struct std::hash<edm4eic::MCRecoTrackerHitAssociation> {
147 std::size_t operator()(const edm4eic::MCRecoTrackerHitAssociation& obj) const {
148 return std::hash<edm4eic::MCRecoTrackerHitAssociationObj*>{}(obj.m_obj.get());
149 }
150};
151
152
153// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
154// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
155// and https://github.com/AIDASoft/podio/issues/770
156#if defined(__clang__)
157 #pragma clang diagnostic push
158 #pragma clang diagnostic ignored "-Wunknown-warning-option"
159 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
160 #pragma clang diagnostic ignored "-Wdeprecated"
161constexpr std::string_view edm4eic::MCRecoTrackerHitAssociation::typeName;
162 #pragma clang diagnostic pop
163#elif defined(__GNUC__)
164 #pragma GCC diagnostic push
165 #pragma GCC diagnostic ignored "-Wdeprecated"
166constexpr std::string_view edm4eic::MCRecoTrackerHitAssociation::typeName;
167 #pragma GCC diagnostic pop
168#endif
169
170
171#endif
Definition MCRecoTrackerHitAssociationCollectionData.h:33
Definition MCRecoTrackerHitAssociationCollection.h:139
Definition MCRecoTrackerHitAssociation.h:46
MutableMCRecoTrackerHitAssociation clone(bool cloneRelations=true) const
Definition MCRecoTrackerHitAssociation.cc:31
MCRecoTrackerHitAssociation()=default
default constructor
MCRecoTrackerHitAssociation(const MCRecoTrackerHitAssociation &other) noexcept=default
copy constructor
friend void swap(MCRecoTrackerHitAssociation &a, MCRecoTrackerHitAssociation &b)
Definition MCRecoTrackerHitAssociation.h:121
~MCRecoTrackerHitAssociation()=default
destructor
MCRecoTrackerHitAssociation & operator=(MCRecoTrackerHitAssociation other) &&=delete
bool operator<(const MCRecoTrackerHitAssociation &other) const
Definition MCRecoTrackerHitAssociation.h:113
friend class MCRecoTrackerHitAssociationCollectionIterator
Definition MCRecoTrackerHitAssociation.h:51
bool isAvailable() const
check whether the object is actually available
Definition MCRecoTrackerHitAssociation.cc:77
float getWeight() const
Access the weight of this association.
Definition MCRecoTrackerHitAssociation.cc:56
static constexpr std::string_view typeName
Definition MCRecoTrackerHitAssociation.h:88
MCRecoTrackerHitAssociation & operator=(MCRecoTrackerHitAssociation other) &
copy-assignment operator
Definition MCRecoTrackerHitAssociation.cc:26
friend class MutableMCRecoTrackerHitAssociation
Definition MCRecoTrackerHitAssociation.h:48
bool operator!=(const MutableMCRecoTrackerHitAssociation &other) const
Definition MCRecoTrackerHitAssociation.h:110
constexpr bool operator==(const MCRecoTrackerHitAssociation &other) const
Definition MCRecoTrackerHitAssociation.h:106
static MCRecoTrackerHitAssociation makeEmpty()
Definition MCRecoTrackerHitAssociation.cc:52
MCRecoTrackerHitAssociationCollection collection_type
Definition MCRecoTrackerHitAssociation.h:56
MutableMCRecoTrackerHitAssociation mutable_type
Definition MCRecoTrackerHitAssociation.h:55
constexpr bool operator!=(const MCRecoTrackerHitAssociation &other) const
Definition MCRecoTrackerHitAssociation.h:109
void unlink()
disconnect from MCRecoTrackerHitAssociationObj instance
Definition MCRecoTrackerHitAssociation.h:104
MCRecoTrackerHitAssociation(MCRecoTrackerHitAssociation &&other) noexcept=default
move constructor
const podio::ObjectID getObjectID() const
Definition MCRecoTrackerHitAssociation.cc:81
podio::ObjectID id() const
Definition MCRecoTrackerHitAssociation.h:115
friend class MCRecoTrackerHitAssociationCollection
Definition MCRecoTrackerHitAssociation.h:49
const edm4eic::RawTrackerHit getRawHit() const
Access the reference to the digitized hit.
Definition MCRecoTrackerHitAssociation.cc:58
const edm4hep::SimTrackerHit getSimHit() const
Access the reference to the simulated hit.
Definition MCRecoTrackerHitAssociation.cc:65
Definition MCRecoTrackerHitAssociationObj.h:24
Definition MutableMCRecoTrackerHitAssociation.h:38
Definition MutableRawTrackerHit.h:33
Definition RawTrackerHit.h:41
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::MCRecoTrackerHitAssociation &obj) const
Definition MCRecoTrackerHitAssociation.h:147