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