EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMCRecoCalorimeterHitAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMCRecoCalorimeterHitAssociation_H
4#define EDM4EIC_MutableMCRecoCalorimeterHitAssociation_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10
11#include "podio/utilities/MaybeSharedPtr.h"
12
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 edm4eic {
32
33
34/** @class MutableMCRecoCalorimeterHitAssociation
35 * Association between a RawCalorimeterHit and a SimCalorimeterHit
36 * @author: S. Rahman
37 */
39
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
53
54 /// copy constructor
56
57 /// copy-assignment operator
58 MutableMCRecoCalorimeterHitAssociation& operator=(MutableMCRecoCalorimeterHitAssociation other) &; // Rebind this to other's internal object
59 MutableMCRecoCalorimeterHitAssociation& operator=(MutableMCRecoCalorimeterHitAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
60
61 /// create a mutable deep-copy of the object with identical relations
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const;
64
65 /// destructor
67
68
69public:
70
71 /// Access the weight of this association
72 float getWeight() const;
73
74
75 /// Access the reference to the digitized calorimeter hit
76 const edm4hep::RawCalorimeterHit getRawHit() const;
77 /// Access the reference to the simulated calorimeter hit
78 const edm4hep::SimCalorimeterHit getSimHit() const;
79
80 /// Set the weight of this association
81 void setWeight(const float weight);
82 /// Get mutable reference to weight of this association
83 float& getWeight();
84 /// Get reference to weight of this association
85 [[deprecated("use getWeight instead")]]
86 float& weight();
87
88
89 /// Set the reference to the digitized calorimeter hit
90 void setRawHit(const edm4hep::RawCalorimeterHit& value);
91 /// Set the reference to the simulated calorimeter hit
92 void setSimHit(const edm4hep::SimCalorimeterHit& value);
93
94
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from MCRecoCalorimeterHitAssociationObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj>{nullptr}; }
101
102 bool operator==(const MutableMCRecoCalorimeterHitAssociation& other) const { return m_obj == other.m_obj; }
103 bool operator==(const MCRecoCalorimeterHitAssociation& other) const;
104
105 bool operator!=(const MutableMCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
106 bool operator!=(const MCRecoCalorimeterHitAssociation& other) const { return !(*this == other); }
107
108 // less comparison operator, so that objects can be e.g. stored in sets.
110
111 podio::ObjectID id() const { return getObjectID(); }
112
113 const podio::ObjectID getObjectID() const;
114
115 friend std::hash<MutableMCRecoCalorimeterHitAssociation>;
116
118 using std::swap;
119 swap(a.m_obj, b.m_obj); // swap out the internal pointers
120 }
121
122private:
123 /// constructor from existing MCRecoCalorimeterHitAssociationObj
124 explicit MutableMCRecoCalorimeterHitAssociation(podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> obj);
125
126 podio::utils::MaybeSharedPtr<MCRecoCalorimeterHitAssociationObj> m_obj{nullptr};
127};
128
129#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
130void to_json(nlohmann::json& j, const MutableMCRecoCalorimeterHitAssociation& value);
131#endif
132
133
134} // namespace edm4eic
135
136
137
138template<>
139struct std::hash<edm4eic::MutableMCRecoCalorimeterHitAssociation> {
141 return std::hash<edm4eic::MCRecoCalorimeterHitAssociationObj*>{}(obj.m_obj.get());
142 }
143};
144
145
146#endif
Definition MCRecoCalorimeterHitAssociationCollection.h:137
Definition MCRecoCalorimeterHitAssociation.h:46
Definition MutableMCRecoCalorimeterHitAssociation.h:38
friend class MCRecoCalorimeterHitAssociationMutableCollectionIterator
Definition MutableMCRecoCalorimeterHitAssociation.h:41
MutableMCRecoCalorimeterHitAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoCalorimeterHitAssociation.cc:33
MCRecoCalorimeterHitAssociationCollection collection_type
Definition MutableMCRecoCalorimeterHitAssociation.h:46
const podio::ObjectID getObjectID() const
Definition MutableMCRecoCalorimeterHitAssociation.cc:82
MutableMCRecoCalorimeterHitAssociation & operator=(MutableMCRecoCalorimeterHitAssociation other) &&=delete
MutableMCRecoCalorimeterHitAssociation & operator=(MutableMCRecoCalorimeterHitAssociation other) &
copy-assignment operator
Definition MutableMCRecoCalorimeterHitAssociation.cc:28
MCRecoCalorimeterHitAssociation object_type
Definition MutableMCRecoCalorimeterHitAssociation.h:45
friend void swap(MutableMCRecoCalorimeterHitAssociation &a, MutableMCRecoCalorimeterHitAssociation &b)
Definition MutableMCRecoCalorimeterHitAssociation.h:117
void setRawHit(const edm4hep::RawCalorimeterHit &value)
Set the reference to the digitized calorimeter hit.
Definition MutableMCRecoCalorimeterHitAssociation.cc:64
float & weight()
Get reference to weight of this association.
Definition MutableMCRecoCalorimeterHitAssociation.cc:62
const edm4hep::SimCalorimeterHit getSimHit() const
Access the reference to the simulated calorimeter hit.
Definition MutableMCRecoCalorimeterHitAssociation.cc:52
void setSimHit(const edm4hep::SimCalorimeterHit &value)
Set the reference to the simulated calorimeter hit.
Definition MutableMCRecoCalorimeterHitAssociation.cc:68
bool operator!=(const MutableMCRecoCalorimeterHitAssociation &other) const
Definition MutableMCRecoCalorimeterHitAssociation.h:105
MutableMCRecoCalorimeterHitAssociation(const MutableMCRecoCalorimeterHitAssociation &other)=default
copy constructor
void setWeight(const float weight)
Set the weight of this association.
Definition MutableMCRecoCalorimeterHitAssociation.cc:60
podio::ObjectID id() const
Definition MutableMCRecoCalorimeterHitAssociation.h:111
bool operator<(const MutableMCRecoCalorimeterHitAssociation &other) const
Definition MutableMCRecoCalorimeterHitAssociation.h:109
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoCalorimeterHitAssociation.cc:78
friend class MCRecoCalorimeterHitAssociation
Definition MutableMCRecoCalorimeterHitAssociation.h:42
bool operator==(const MutableMCRecoCalorimeterHitAssociation &other) const
Definition MutableMCRecoCalorimeterHitAssociation.h:102
MutableMCRecoCalorimeterHitAssociation()
default constructor
Definition MutableMCRecoCalorimeterHitAssociation.cc:20
~MutableMCRecoCalorimeterHitAssociation()=default
destructor
const edm4hep::RawCalorimeterHit getRawHit() const
Access the reference to the digitized calorimeter hit.
Definition MutableMCRecoCalorimeterHitAssociation.cc:45
void unlink()
disconnect from MCRecoCalorimeterHitAssociationObj instance
Definition MutableMCRecoCalorimeterHitAssociation.h:100
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoCalorimeterHitAssociation.cc:43
friend class MCRecoCalorimeterHitAssociationCollection
Definition MutableMCRecoCalorimeterHitAssociation.h:40
bool operator!=(const MCRecoCalorimeterHitAssociation &other) const
Definition MutableMCRecoCalorimeterHitAssociation.h:106
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableMCRecoCalorimeterHitAssociation &obj) const
Definition MutableMCRecoCalorimeterHitAssociation.h:140