EDM4eic
EIC data model
Loading...
Searching...
No Matches
MCRecoCalorimeterHitAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MCRecoCalorimeterHitAssociation_H
4#define EDM4EIC_MCRecoCalorimeterHitAssociation_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 {
22}
23namespace edm4hep {
24class RawCalorimeterHit;
25class MutableRawCalorimeterHit;
26class SimCalorimeterHit;
27class MutableSimCalorimeterHit;
28}
29
30
31namespace podio::detail {
32// Internal function used in less comparison operators of the datatypes and interface types
33OrderKey getOrderKey(const edm4eic::MCRecoCalorimeterHitAssociation& obj);
34};
35
36namespace edm4eic {
37
41
42/** @class MCRecoCalorimeterHitAssociation
43 * Association between a RawCalorimeterHit and a SimCalorimeterHit
44 * @author: S. Rahman
45 */
47
52 friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoCalorimeterHitAssociation & obj);
53
54public:
57
58 /// default constructor
60
61 /// Constructor initializing all members
62 MCRecoCalorimeterHitAssociation(const float weight);
63
64 /// copy constructor
66
67 /// move constructor
69
70 /// copy-assignment operator
71 MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation other) &; // Rebind this to other's internal object
72 MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation 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 MutableMCRecoCalorimeterHitAssociation 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::MCRecoCalorimeterHitAssociation";
89
90 /// Access the weight of this association
91 float getWeight() const;
92
93
94 /// Access the reference to the digitized calorimeter hit
95 const edm4hep::RawCalorimeterHit getRawHit() const;
96 /// Access the reference to the simulated calorimeter hit
97 const edm4hep::SimCalorimeterHit getSimHit() const;
98
99
100
101 /// check whether the object is actually available
102 bool isAvailable() const;
103 /// disconnect from MCRecoCalorimeterHitAssociationObj instance
104 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj>{nullptr}; }
105
106 constexpr bool operator==(const MCRecoCalorimeterHitAssociation& other) const { return m_obj == other.m_obj; }
107 bool operator==(const MutableMCRecoCalorimeterHitAssociation& other) const;
108
109 constexpr bool operator!=(const MCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
110 bool operator!=(const MutableMCRecoCalorimeterHitAssociation& 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<MCRecoCalorimeterHitAssociation>;
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 MCRecoCalorimeterHitAssociationObj
128 explicit MCRecoCalorimeterHitAssociation(podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> obj);
130
131 podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> m_obj{new MCRecoCalorimeterHitAssociationObj{}, podio::utils::MarkOwned};
132};
133
134std::ostream& operator<<(std::ostream& o, const MCRecoCalorimeterHitAssociation& value);
135
136#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
137void to_json(nlohmann::json& j, const MCRecoCalorimeterHitAssociation& value);
138#endif
139
140
141} // namespace edm4eic
142
143
144
145template<>
146struct std::hash<edm4eic::MCRecoCalorimeterHitAssociation> {
148 return std::hash<edm4eic::MCRecoCalorimeterHitAssociationObj*>{}(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"
162 #pragma clang diagnostic pop
163#elif defined(__GNUC__)
164 #pragma GCC diagnostic push
165 #pragma GCC diagnostic ignored "-Wdeprecated"
167 #pragma GCC diagnostic pop
168#endif
169
170
171#endif
Definition MCRecoCalorimeterHitAssociationCollectionData.h:33
Definition MCRecoCalorimeterHitAssociationCollection.h:139
Definition MCRecoCalorimeterHitAssociation.h:46
MCRecoCalorimeterHitAssociation(const MCRecoCalorimeterHitAssociation &other) noexcept=default
copy constructor
MutableMCRecoCalorimeterHitAssociation mutable_type
Definition MCRecoCalorimeterHitAssociation.h:55
static constexpr std::string_view typeName
Definition MCRecoCalorimeterHitAssociation.h:88
bool operator<(const MCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:113
bool isAvailable() const
check whether the object is actually available
Definition MCRecoCalorimeterHitAssociation.cc:77
void unlink()
disconnect from MCRecoCalorimeterHitAssociationObj instance
Definition MCRecoCalorimeterHitAssociation.h:104
MCRecoCalorimeterHitAssociation & operator=(MCRecoCalorimeterHitAssociation other) &
copy-assignment operator
Definition MCRecoCalorimeterHitAssociation.cc:26
bool operator!=(const MutableMCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:110
friend void swap(MCRecoCalorimeterHitAssociation &a, MCRecoCalorimeterHitAssociation &b)
Definition MCRecoCalorimeterHitAssociation.h:121
MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const
Definition MCRecoCalorimeterHitAssociation.cc:31
const podio::ObjectID getObjectID() const
Definition MCRecoCalorimeterHitAssociation.cc:81
MCRecoCalorimeterHitAssociationCollection collection_type
Definition MCRecoCalorimeterHitAssociation.h:56
MCRecoCalorimeterHitAssociation & operator=(MCRecoCalorimeterHitAssociation other) &&=delete
MCRecoCalorimeterHitAssociation(MCRecoCalorimeterHitAssociation &&other) noexcept=default
move constructor
MCRecoCalorimeterHitAssociation()=default
default constructor
const edm4hep::SimCalorimeterHit getSimHit() const
Access the reference to the simulated calorimeter hit.
Definition MCRecoCalorimeterHitAssociation.cc:65
const edm4hep::RawCalorimeterHit getRawHit() const
Access the reference to the digitized calorimeter hit.
Definition MCRecoCalorimeterHitAssociation.cc:58
podio::ObjectID id() const
Definition MCRecoCalorimeterHitAssociation.h:115
static MCRecoCalorimeterHitAssociation makeEmpty()
Definition MCRecoCalorimeterHitAssociation.cc:52
~MCRecoCalorimeterHitAssociation()=default
destructor
constexpr bool operator==(const MCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:106
constexpr bool operator!=(const MCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:109
friend class MCRecoCalorimeterHitAssociationCollection
Definition MCRecoCalorimeterHitAssociation.h:49
friend class MCRecoCalorimeterHitAssociationCollectionIterator
Definition MCRecoCalorimeterHitAssociation.h:51
friend class MutableMCRecoCalorimeterHitAssociation
Definition MCRecoCalorimeterHitAssociation.h:48
float getWeight() const
Access the weight of this association.
Definition MCRecoCalorimeterHitAssociation.cc:56
Definition MCRecoCalorimeterHitAssociationObj.h:22
Definition MutableMCRecoCalorimeterHitAssociation.h:38
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::MCRecoCalorimeterHitAssociation &obj) const
Definition MCRecoCalorimeterHitAssociation.h:147