EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMCRecoTrackerHitAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMCRecoTrackerHitAssociation_H
4#define EDM4EIC_MutableMCRecoTrackerHitAssociation_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 {
22class RawTrackerHit;
24}
25namespace edm4hep {
26class SimTrackerHit;
27class MutableSimTrackerHit;
28}
29
30
31namespace edm4eic {
32
33
34/** @class MutableMCRecoTrackerHitAssociation
35 * Association between a RawTrackerHit and a SimTrackerHit
36 * @author: C. Dilks, W. Deconinck
37 */
39
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 MutableMCRecoTrackerHitAssociation(const float weight);
53
54 /// copy constructor
56
57 /// move constructor
59
60 /// copy-assignment operator
61 MutableMCRecoTrackerHitAssociation& operator=(MutableMCRecoTrackerHitAssociation other) &; // Rebind this to other's internal object
62 MutableMCRecoTrackerHitAssociation& operator=(MutableMCRecoTrackerHitAssociation other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
63
64 /// create a mutable deep-copy of the object with identical relations
65 /// if cloneRelations=false, the relations are not cloned and will be empty
66 MutableMCRecoTrackerHitAssociation clone(bool cloneRelations=true) const;
67
68 /// destructor
70
71
72public:
73
74 /// Access the weight of this association
75 float getWeight() const;
76
77
78 /// Access the reference to the digitized hit
80 /// Access the reference to the simulated hit
81 const edm4hep::SimTrackerHit getSimHit() const;
82
83 /// Set the weight of this association
84 void setWeight(const float weight);
85 /// Get mutable reference to weight of this association
86 float& getWeight();
87
88
89 /// Set the reference to the digitized hit
90 void setRawHit(const edm4eic::RawTrackerHit& value);
91 /// Set the reference to the simulated hit
92 void setSimHit(const edm4hep::SimTrackerHit& value);
93
94
95
96
97 /// check whether the object is actually available
98 bool isAvailable() const;
99 /// disconnect from MCRecoTrackerHitAssociationObj instance
100 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj>{nullptr}; }
101
102 constexpr bool operator==(const MutableMCRecoTrackerHitAssociation& other) const { return m_obj == other.m_obj; }
103 bool operator==(const MCRecoTrackerHitAssociation& other) const;
104
105 constexpr bool operator!=(const MutableMCRecoTrackerHitAssociation& other) const { return !(*this == other); }
106 bool operator!=(const MCRecoTrackerHitAssociation& 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<MutableMCRecoTrackerHitAssociation>;
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 MCRecoTrackerHitAssociationObj
124 explicit MutableMCRecoTrackerHitAssociation(podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj> obj);
125
126 podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj> m_obj{new MCRecoTrackerHitAssociationObj{}, podio::utils::MarkOwned};
127};
128
129#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
130void to_json(nlohmann::json& j, const MutableMCRecoTrackerHitAssociation& value);
131#endif
132
133
134} // namespace edm4eic
135
136
137
138template<>
139struct std::hash<edm4eic::MutableMCRecoTrackerHitAssociation> {
141 return std::hash<edm4eic::MCRecoTrackerHitAssociationObj*>{}(obj.m_obj.get());
142 }
143};
144
145
146#endif
Definition MCRecoTrackerHitAssociationCollection.h:139
Definition MCRecoTrackerHitAssociation.h:46
Definition MCRecoTrackerHitAssociationObj.h:24
Definition MutableMCRecoTrackerHitAssociation.h:38
MutableMCRecoTrackerHitAssociation(const MutableMCRecoTrackerHitAssociation &other) noexcept=default
copy constructor
MCRecoTrackerHitAssociation object_type
Definition MutableMCRecoTrackerHitAssociation.h:45
MCRecoTrackerHitAssociationCollection collection_type
Definition MutableMCRecoTrackerHitAssociation.h:46
~MutableMCRecoTrackerHitAssociation()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoTrackerHitAssociation.cc:73
bool operator!=(const MCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:106
MutableMCRecoTrackerHitAssociation()=default
default constructor
void setRawHit(const edm4eic::RawTrackerHit &value)
Set the reference to the digitized hit.
Definition MutableMCRecoTrackerHitAssociation.cc:59
MutableMCRecoTrackerHitAssociation & operator=(MutableMCRecoTrackerHitAssociation other) &&=delete
constexpr bool operator==(const MutableMCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:102
const edm4eic::RawTrackerHit getRawHit() const
Access the reference to the digitized hit.
Definition MutableMCRecoTrackerHitAssociation.cc:41
MutableMCRecoTrackerHitAssociation(MutableMCRecoTrackerHitAssociation &&other) noexcept=default
move constructor
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoTrackerHitAssociation.cc:39
constexpr bool operator!=(const MutableMCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:105
const podio::ObjectID getObjectID() const
Definition MutableMCRecoTrackerHitAssociation.cc:77
void setSimHit(const edm4hep::SimTrackerHit &value)
Set the reference to the simulated hit.
Definition MutableMCRecoTrackerHitAssociation.cc:63
const edm4hep::SimTrackerHit getSimHit() const
Access the reference to the simulated hit.
Definition MutableMCRecoTrackerHitAssociation.cc:48
podio::ObjectID id() const
Definition MutableMCRecoTrackerHitAssociation.h:111
friend class MCRecoTrackerHitAssociation
Definition MutableMCRecoTrackerHitAssociation.h:42
MutableMCRecoTrackerHitAssociation & operator=(MutableMCRecoTrackerHitAssociation other) &
copy-assignment operator
Definition MutableMCRecoTrackerHitAssociation.cc:24
void setWeight(const float weight)
Set the weight of this association.
Definition MutableMCRecoTrackerHitAssociation.cc:56
bool operator<(const MutableMCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:109
friend class MCRecoTrackerHitAssociationMutableCollectionIterator
Definition MutableMCRecoTrackerHitAssociation.h:41
MutableMCRecoTrackerHitAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoTrackerHitAssociation.cc:29
friend void swap(MutableMCRecoTrackerHitAssociation &a, MutableMCRecoTrackerHitAssociation &b)
Definition MutableMCRecoTrackerHitAssociation.h:117
void unlink()
disconnect from MCRecoTrackerHitAssociationObj instance
Definition MutableMCRecoTrackerHitAssociation.h:100
friend class MCRecoTrackerHitAssociationCollection
Definition MutableMCRecoTrackerHitAssociation.h:40
Definition MutableRawTrackerHit.h:33
Definition RawTrackerHit.h:41
Definition ArrowMapper.cc:63
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableMCRecoTrackerHitAssociation &obj) const
Definition MutableMCRecoTrackerHitAssociation.h:140