EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrackClusterMatch.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrackClusterMatch_H
4#define EDM4EIC_MutableTrackClusterMatch_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 Cluster;
23class MutableCluster;
24class Track;
25class MutableTrack;
26}
27
28
29namespace edm4eic {
30
31
32/** @class MutableTrackClusterMatch
33 * Match between a Cluster and a Track
34 * @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
35 */
37
40 friend class TrackClusterMatch;
41
42public:
45
46 /// default constructor
48
49 /// Constructor initializing all members
51
52 /// copy constructor
54
55 /// copy-assignment operator
56 MutableTrackClusterMatch& operator=(MutableTrackClusterMatch other) &; // Rebind this to other's internal object
57 MutableTrackClusterMatch& operator=(MutableTrackClusterMatch 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 MutableTrackClusterMatch 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 cluster
74 const edm4eic::Cluster getCluster() const;
75 /// Access the reference to the track
76 const edm4eic::Track getTrack() 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 cluster
88 void setCluster(const edm4eic::Cluster& value);
89 /// Set the reference to the track
90 void setTrack(const edm4eic::Track& value);
91
92
93
94
95 /// check whether the object is actually available
96 bool isAvailable() const;
97 /// disconnect from TrackClusterMatchObj instance
98 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
99
100 bool operator==(const MutableTrackClusterMatch& other) const { return m_obj == other.m_obj; }
101 bool operator==(const TrackClusterMatch& other) const;
102
103 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
104 bool operator!=(const TrackClusterMatch& 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<MutableTrackClusterMatch>;
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 TrackClusterMatchObj
122 explicit MutableTrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
123
124 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
125};
126
127#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
128void to_json(nlohmann::json& j, const MutableTrackClusterMatch& value);
129#endif
130
131
132} // namespace edm4eic
133
134
135
136template<>
137struct std::hash<edm4eic::MutableTrackClusterMatch> {
138 std::size_t operator()(const edm4eic::MutableTrackClusterMatch& obj) const {
139 return std::hash<edm4eic::TrackClusterMatchObj*>{}(obj.m_obj.get());
140 }
141};
142
143
144#endif
Definition Cluster.h:48
Definition MutableCluster.h:40
Definition MutableTrackClusterMatch.h:36
friend void swap(MutableTrackClusterMatch &a, MutableTrackClusterMatch &b)
Definition MutableTrackClusterMatch.h:115
MutableTrackClusterMatch & operator=(MutableTrackClusterMatch other) &&=delete
MutableTrackClusterMatch & operator=(MutableTrackClusterMatch other) &
copy-assignment operator
Definition MutableTrackClusterMatch.cc:28
MutableTrackClusterMatch()
default constructor
Definition MutableTrackClusterMatch.cc:20
TrackClusterMatchCollection collection_type
Definition MutableTrackClusterMatch.h:44
MutableTrackClusterMatch(const MutableTrackClusterMatch &other)=default
copy constructor
void unlink()
disconnect from TrackClusterMatchObj instance
Definition MutableTrackClusterMatch.h:98
TrackClusterMatch object_type
Definition MutableTrackClusterMatch.h:43
void setTrack(const edm4eic::Track &value)
Set the reference to the track.
Definition MutableTrackClusterMatch.cc:68
bool operator!=(const TrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:104
friend class TrackClusterMatchMutableCollectionIterator
Definition MutableTrackClusterMatch.h:39
void setCluster(const edm4eic::Cluster &value)
Set the reference to the cluster.
Definition MutableTrackClusterMatch.cc:64
friend class TrackClusterMatchCollection
Definition MutableTrackClusterMatch.h:38
const edm4eic::Track getTrack() const
Access the reference to the track.
Definition MutableTrackClusterMatch.cc:52
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackClusterMatch.cc:78
podio::ObjectID id() const
Definition MutableTrackClusterMatch.h:109
const podio::ObjectID getObjectID() const
Definition MutableTrackClusterMatch.cc:82
friend class TrackClusterMatch
Definition MutableTrackClusterMatch.h:40
bool operator!=(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:103
bool operator<(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:107
bool operator==(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:100
float getWeight() const
Access the weight of this association.
Definition MutableTrackClusterMatch.cc:43
~MutableTrackClusterMatch()=default
destructor
float & weight()
Get reference to weight of this association.
Definition MutableTrackClusterMatch.cc:62
MutableTrackClusterMatch clone(bool cloneRelations=true) const
Definition MutableTrackClusterMatch.cc:33
const edm4eic::Cluster getCluster() const
Access the reference to the cluster.
Definition MutableTrackClusterMatch.cc:45
void setWeight(const float weight)
Set the weight of this association.
Definition MutableTrackClusterMatch.cc:60
Definition MutableTrack.h:40
Definition TrackClusterMatchCollection.h:137
Definition TrackClusterMatch.h:44
Definition Track.h:48
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableTrackClusterMatch &obj) const
Definition MutableTrackClusterMatch.h:138