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