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 /// copy-assignment operator
68 MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation other) &; // Rebind this to other's internal object
69 MCRecoCalorimeterHitAssociation& operator=(MCRecoCalorimeterHitAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
70
71 /// create a mutable deep-copy of the object with identical relations
72 /// if cloneRelations=false, the relations are not cloned and will be empty
73 MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const;
74
75 /// destructor
77
78 /// converting constructor from mutable object
80
82
83public:
84
85 static constexpr std::string_view typeName = "edm4eic::MCRecoCalorimeterHitAssociation";
86
87 /// Access the weight of this association
88 float getWeight() const;
89
90
91 /// Access the reference to the digitized calorimeter hit
92 const edm4hep::RawCalorimeterHit getRawHit() const;
93 /// Access the reference to the simulated calorimeter hit
94 const edm4hep::SimCalorimeterHit getSimHit() const;
95
96
97
98 /// check whether the object is actually available
99 bool isAvailable() const;
100 /// disconnect from MCRecoCalorimeterHitAssociationObj instance
101 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj>{nullptr}; }
102
103 bool operator==(const MCRecoCalorimeterHitAssociation& other) const { return m_obj == other.m_obj; }
104 bool operator==(const MutableMCRecoCalorimeterHitAssociation& other) const;
105
106 bool operator!=(const MCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
107 bool operator!=(const MutableMCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
108
109 // less comparison operator, so that objects can be e.g. stored in sets.
111
112 podio::ObjectID id() const { return getObjectID(); }
113
114 const podio::ObjectID getObjectID() const;
115
116 friend std::hash<MCRecoCalorimeterHitAssociation>;
117
119 using std::swap;
120 swap(a.m_obj, b.m_obj); // swap out the internal pointers
121 }
122
123private:
124 /// constructor from existing MCRecoCalorimeterHitAssociationObj
125 explicit MCRecoCalorimeterHitAssociation(podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> obj);
127
128 podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> m_obj{nullptr};
129};
130
131std::ostream& operator<<(std::ostream& o, const MCRecoCalorimeterHitAssociation& value);
132
133#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
134void to_json(nlohmann::json& j, const MCRecoCalorimeterHitAssociation& value);
135#endif
136
137
138} // namespace edm4eic
139
140
141
142template<>
143struct std::hash<edm4eic::MCRecoCalorimeterHitAssociation> {
145 return std::hash<edm4eic::MCRecoCalorimeterHitAssociationObj*>{}(obj.m_obj.get());
146 }
147};
148
149
150// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
151// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
152// and https://github.com/AIDASoft/podio/issues/770
153#if defined(__clang__)
154#pragma clang diagnostic push
155#pragma clang diagnostic ignored "-Wunknown-warning-option"
156#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
157#pragma clang diagnostic ignored "-Wdeprecated"
159#pragma clang diagnostic pop
160#elif defined(__GNUC__)
161#pragma GCC diagnostic push
162#pragma GCC diagnostic ignored "-Wdeprecated"
164#pragma GCC diagnostic pop
165#endif
166
167#endif
Definition MCRecoCalorimeterHitAssociationCollectionData.h:32
Definition MCRecoCalorimeterHitAssociationCollection.h:137
Definition MCRecoCalorimeterHitAssociation.h:46
MutableMCRecoCalorimeterHitAssociation mutable_type
Definition MCRecoCalorimeterHitAssociation.h:55
bool operator!=(const MCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:106
static constexpr std::string_view typeName
Definition MCRecoCalorimeterHitAssociation.h:85
bool operator<(const MCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:110
bool isAvailable() const
check whether the object is actually available
Definition MCRecoCalorimeterHitAssociation.cc:81
void unlink()
disconnect from MCRecoCalorimeterHitAssociationObj instance
Definition MCRecoCalorimeterHitAssociation.h:101
MCRecoCalorimeterHitAssociation & operator=(MCRecoCalorimeterHitAssociation other) &
copy-assignment operator
Definition MCRecoCalorimeterHitAssociation.cc:30
bool operator==(const MCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:103
bool operator!=(const MutableMCRecoCalorimeterHitAssociation &other) const
Definition MCRecoCalorimeterHitAssociation.h:107
MCRecoCalorimeterHitAssociation(const MCRecoCalorimeterHitAssociation &other)=default
copy constructor
friend void swap(MCRecoCalorimeterHitAssociation &a, MCRecoCalorimeterHitAssociation &b)
Definition MCRecoCalorimeterHitAssociation.h:118
MCRecoCalorimeterHitAssociation()
default constructor
Definition MCRecoCalorimeterHitAssociation.cc:22
MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const
Definition MCRecoCalorimeterHitAssociation.cc:35
const podio::ObjectID getObjectID() const
Definition MCRecoCalorimeterHitAssociation.cc:85
MCRecoCalorimeterHitAssociationCollection collection_type
Definition MCRecoCalorimeterHitAssociation.h:56
MCRecoCalorimeterHitAssociation & operator=(MCRecoCalorimeterHitAssociation other) &&=delete
const edm4hep::SimCalorimeterHit getSimHit() const
Access the reference to the simulated calorimeter hit.
Definition MCRecoCalorimeterHitAssociation.cc:69
const edm4hep::RawCalorimeterHit getRawHit() const
Access the reference to the digitized calorimeter hit.
Definition MCRecoCalorimeterHitAssociation.cc:62
podio::ObjectID id() const
Definition MCRecoCalorimeterHitAssociation.h:112
static MCRecoCalorimeterHitAssociation makeEmpty()
Definition MCRecoCalorimeterHitAssociation.cc:56
~MCRecoCalorimeterHitAssociation()=default
destructor
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:60
Definition MCRecoCalorimeterHitAssociationObj.h:22
Definition MutableMCRecoCalorimeterHitAssociation.h:38
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:25
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MCRecoCalorimeterHitAssociation &obj) const
Definition MCRecoCalorimeterHitAssociation.h:144