EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrackProtoClusterMatch.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrackProtoClusterMatch_H
4#define EDM4EIC_MutableTrackProtoClusterMatch_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 Track;
23class MutableTrack;
24class ProtoCluster;
26}
27
28
29namespace edm4eic {
30
31
32/** @class MutableTrackProtoClusterMatch
33 * Match between a ProtoCluster and a Track
34 * @author: D. Anderson, D. Kalinkin
35 */
37
41
42public:
45
46 /// default constructor
48
49 /// Constructor initializing all members
51
52 /// copy constructor
54
55 /// copy-assignment operator
56 MutableTrackProtoClusterMatch& operator=(MutableTrackProtoClusterMatch other) &; // Rebind this to other's internal object
57 MutableTrackProtoClusterMatch& operator=(MutableTrackProtoClusterMatch other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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 MutableTrackProtoClusterMatch 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 track
74 const edm4eic::Track getFrom() const;
75 /// Access the reference to the protocluster
76 const edm4eic::ProtoCluster getTo() const;
77
78 /// Set the weight of this association
79 void setWeight(const float weight);
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 track
88 void setFrom(const edm4eic::Track& value);
89 /// Set the reference to the protocluster
90 void setTo(const edm4eic::ProtoCluster& value);
91
92
93
94
95 /// check whether the object is actually available
96 bool isAvailable() const;
97 /// disconnect from TrackProtoClusterMatchObj instance
98 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj>{nullptr}; }
99
100 bool operator==(const MutableTrackProtoClusterMatch& other) const { return m_obj == other.m_obj; }
101 bool operator==(const TrackProtoClusterMatch& other) const;
102
103 bool operator!=(const MutableTrackProtoClusterMatch& other) const { return !(*this == other); }
104 bool operator!=(const TrackProtoClusterMatch& other) const { return !(*this == other); }
105
106 // less comparison operator, so that objects can be e.g. stored in sets.
108
109 podio::ObjectID id() const { return getObjectID(); }
110
111 const podio::ObjectID getObjectID() const;
112
113 friend std::hash<MutableTrackProtoClusterMatch>;
114
116 using std::swap;
117 swap(a.m_obj, b.m_obj); // swap out the internal pointers
118 }
119
120private:
121 /// constructor from existing TrackProtoClusterMatchObj
122 explicit MutableTrackProtoClusterMatch(podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> obj);
123
124 podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> m_obj{nullptr};
125};
126
127#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
128void to_json(nlohmann::json& j, const MutableTrackProtoClusterMatch& value);
129#endif
130
131
132} // namespace edm4eic
133
134
135
136template<>
137struct std::hash<edm4eic::MutableTrackProtoClusterMatch> {
139 return std::hash<edm4eic::TrackProtoClusterMatchObj*>{}(obj.m_obj.get());
140 }
141};
142
143
144#endif
Definition MutableProtoCluster.h:35
Definition MutableTrack.h:40
Definition MutableTrackProtoClusterMatch.h:36
bool operator!=(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:103
~MutableTrackProtoClusterMatch()=default
destructor
MutableTrackProtoClusterMatch()
default constructor
Definition MutableTrackProtoClusterMatch.cc:20
friend class TrackProtoClusterMatch
Definition MutableTrackProtoClusterMatch.h:40
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackProtoClusterMatch.cc:78
TrackProtoClusterMatchCollection collection_type
Definition MutableTrackProtoClusterMatch.h:44
friend class TrackProtoClusterMatchMutableCollectionIterator
Definition MutableTrackProtoClusterMatch.h:39
float getWeight() const
Access the weight of this association.
Definition MutableTrackProtoClusterMatch.cc:43
const edm4eic::Track getFrom() const
Access the reference to the track.
Definition MutableTrackProtoClusterMatch.cc:45
podio::ObjectID id() const
Definition MutableTrackProtoClusterMatch.h:109
MutableTrackProtoClusterMatch(const MutableTrackProtoClusterMatch &other)=default
copy constructor
MutableTrackProtoClusterMatch & operator=(MutableTrackProtoClusterMatch other) &&=delete
TrackProtoClusterMatch object_type
Definition MutableTrackProtoClusterMatch.h:43
bool operator<(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:107
MutableTrackProtoClusterMatch & operator=(MutableTrackProtoClusterMatch other) &
copy-assignment operator
Definition MutableTrackProtoClusterMatch.cc:28
float & weight()
Get reference to weight of this association.
Definition MutableTrackProtoClusterMatch.cc:62
void setWeight(const float weight)
Set the weight of this association.
Definition MutableTrackProtoClusterMatch.cc:60
void setTo(const edm4eic::ProtoCluster &value)
Set the reference to the protocluster.
Definition MutableTrackProtoClusterMatch.cc:68
bool operator!=(const TrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:104
void unlink()
disconnect from TrackProtoClusterMatchObj instance
Definition MutableTrackProtoClusterMatch.h:98
friend class TrackProtoClusterMatchCollection
Definition MutableTrackProtoClusterMatch.h:38
bool operator==(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:100
MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const
Definition MutableTrackProtoClusterMatch.cc:33
const edm4eic::ProtoCluster getTo() const
Access the reference to the protocluster.
Definition MutableTrackProtoClusterMatch.cc:52
void setFrom(const edm4eic::Track &value)
Set the reference to the track.
Definition MutableTrackProtoClusterMatch.cc:64
const podio::ObjectID getObjectID() const
Definition MutableTrackProtoClusterMatch.cc:82
friend void swap(MutableTrackProtoClusterMatch &a, MutableTrackProtoClusterMatch &b)
Definition MutableTrackProtoClusterMatch.h:115
Definition ProtoCluster.h:43
Definition Track.h:48
Definition TrackProtoClusterMatchCollection.h:137
Definition TrackProtoClusterMatch.h:44
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableTrackProtoClusterMatch &obj) const
Definition MutableTrackProtoClusterMatch.h:138