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