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 {
21class MCRecoTrackerHitAssociationCollection;
22class RawTrackerHit;
23class MutableRawTrackerHit;
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
53
54 /// copy constructor
56
57 /// copy-assignment operator
59
60 /// create a mutable deep-copy of the object with identical relations
61 /// if cloneRelations=false, the relations are not cloned and will be empty
62 MutableMCRecoTrackerHitAssociation clone(bool cloneRelations=true) const;
63
64 /// destructor
66
67
68public:
69
70 /// Access the weight of this association
71 float getWeight() const;
72
73
74 /// Access the reference to the digitized hit
76 /// Access the reference to the simulated hit
77 const edm4hep::SimTrackerHit getSimHit() const;
78
79 /// Set the weight of this association
80 void setWeight(float value);
81 /// Get mutable reference to weight of this association
82 float& getWeight();
83 /// Get reference to weight of this association
84 [[deprecated("use getWeight instead")]]
85 float& weight();
86
87
88 /// Set the reference to the digitized hit
89 void setRawHit(const edm4eic::RawTrackerHit& value);
90 /// Set the reference to the simulated hit
91 void setSimHit(const edm4hep::SimTrackerHit& value);
92
93
94
95
96 /// check whether the object is actually available
97 bool isAvailable() const;
98 /// disconnect from MCRecoTrackerHitAssociationObj instance
99 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj>{nullptr}; }
100
101 bool operator==(const MutableMCRecoTrackerHitAssociation& other) const { return m_obj == other.m_obj; }
102 bool operator==(const MCRecoTrackerHitAssociation& other) const;
103
104 bool operator!=(const MutableMCRecoTrackerHitAssociation& other) const { return !(*this == other); }
105 bool operator!=(const MCRecoTrackerHitAssociation& other) const { return !(*this == other); }
106
107 // less comparison operator, so that objects can be e.g. stored in sets.
109
110 podio::ObjectID id() const { return getObjectID(); }
111
112 const podio::ObjectID getObjectID() const;
113
115 using std::swap;
116 swap(a.m_obj, b.m_obj); // swap out the internal pointers
117 }
118
119private:
120 /// constructor from existing MCRecoTrackerHitAssociationObj
121 explicit MutableMCRecoTrackerHitAssociation(podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj> obj);
122
123 podio::utils::MaybeSharedPtr<MCRecoTrackerHitAssociationObj> m_obj{nullptr};
124};
125
126#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
127void to_json(nlohmann::json& j, const MutableMCRecoTrackerHitAssociation& value);
128#endif
129
130
131} // namespace edm4eic
132
133
134#endif
Definition MCRecoTrackerHitAssociationCollection.h:91
Definition MCRecoTrackerHitAssociation.h:46
Definition MCRecoTrackerHitAssociationCollection.h:62
Definition MutableMCRecoTrackerHitAssociation.h:38
~MutableMCRecoTrackerHitAssociation()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoTrackerHitAssociation.cc:78
bool operator!=(const MCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:105
void setRawHit(const edm4eic::RawTrackerHit &value)
Set the reference to the digitized hit.
Definition MutableMCRecoTrackerHitAssociation.cc:64
const edm4eic::RawTrackerHit getRawHit() const
Access the reference to the digitized hit.
Definition MutableMCRecoTrackerHitAssociation.cc:45
MutableMCRecoTrackerHitAssociation & operator=(MutableMCRecoTrackerHitAssociation other)
copy-assignment operator
Definition MutableMCRecoTrackerHitAssociation.cc:28
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoTrackerHitAssociation.cc:43
MutableMCRecoTrackerHitAssociation(const MutableMCRecoTrackerHitAssociation &other)=default
copy constructor
const podio::ObjectID getObjectID() const
Definition MutableMCRecoTrackerHitAssociation.cc:82
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoTrackerHitAssociation.cc:60
void setSimHit(const edm4hep::SimTrackerHit &value)
Set the reference to the simulated hit.
Definition MutableMCRecoTrackerHitAssociation.cc:68
const edm4hep::SimTrackerHit getSimHit() const
Access the reference to the simulated hit.
Definition MutableMCRecoTrackerHitAssociation.cc:52
podio::ObjectID id() const
Definition MutableMCRecoTrackerHitAssociation.h:110
friend class MCRecoTrackerHitAssociation
Definition MutableMCRecoTrackerHitAssociation.h:42
MutableMCRecoTrackerHitAssociation()
default constructor
Definition MutableMCRecoTrackerHitAssociation.cc:20
bool operator<(const MutableMCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:108
bool operator!=(const MutableMCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:104
MutableMCRecoTrackerHitAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoTrackerHitAssociation.cc:33
bool operator==(const MutableMCRecoTrackerHitAssociation &other) const
Definition MutableMCRecoTrackerHitAssociation.h:101
float & weight()
Get reference to weight of this association.
Definition MutableMCRecoTrackerHitAssociation.cc:62
friend void swap(MutableMCRecoTrackerHitAssociation &a, MutableMCRecoTrackerHitAssociation &b)
Definition MutableMCRecoTrackerHitAssociation.h:114
void unlink()
disconnect from MCRecoTrackerHitAssociationObj instance
Definition MutableMCRecoTrackerHitAssociation.h:99
friend class MCRecoTrackerHitAssociationCollection
Definition MutableMCRecoTrackerHitAssociation.h:40
Definition RawTrackerHit.h:41
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150