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 {
21class Cluster;
22class MutableCluster;
23class Track;
24class MutableTrack;
25}
26
27
28namespace edm4eic {
29
30
31/** @class MutableTrackClusterMatch
32 * Match between a Cluster and a Track
33 * @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
34 */
36
39 friend class TrackClusterMatch;
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 MutableTrackClusterMatch 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 cluster
72 const edm4eic::Cluster getCluster() const;
73 /// Access the reference to the track
74 const edm4eic::Track getTrack() 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 cluster
86 void setCluster(const edm4eic::Cluster& value);
87 /// Set the reference to the track
88 void setTrack(const edm4eic::Track& value);
89
90
91
92
93 /// check whether the object is actually available
94 bool isAvailable() const;
95 /// disconnect from TrackClusterMatchObj instance
96 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
97
98 bool operator==(const MutableTrackClusterMatch& other) const { return m_obj == other.m_obj; }
99 bool operator==(const TrackClusterMatch& other) const;
100
101 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
102 bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
103
104 // less comparison operator, so that objects can be e.g. stored in sets.
105 bool operator<(const MutableTrackClusterMatch& 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 TrackClusterMatchObj
118 explicit MutableTrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
119
120 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
121};
122
123#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
124void to_json(nlohmann::json& j, const MutableTrackClusterMatch& value);
125#endif
126
127
128} // namespace edm4eic
129
130
131#endif
Definition Cluster.h:38
Definition MutableTrackClusterMatch.h:35
friend void swap(MutableTrackClusterMatch &a, MutableTrackClusterMatch &b)
Definition MutableTrackClusterMatch.h:111
MutableTrackClusterMatch()
default constructor
Definition MutableTrackClusterMatch.cc:20
MutableTrackClusterMatch(const MutableTrackClusterMatch &other)=default
copy constructor
void unlink()
disconnect from TrackClusterMatchObj instance
Definition MutableTrackClusterMatch.h:96
void setTrack(const edm4eic::Track &value)
Set the reference to the track.
Definition MutableTrackClusterMatch.cc:69
bool operator!=(const TrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:102
void setCluster(const edm4eic::Cluster &value)
Set the reference to the cluster.
Definition MutableTrackClusterMatch.cc:64
friend class TrackClusterMatchCollection
Definition MutableTrackClusterMatch.h:37
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:80
podio::ObjectID id() const
Definition MutableTrackClusterMatch.h:107
const podio::ObjectID getObjectID() const
Definition MutableTrackClusterMatch.cc:84
friend class TrackClusterMatch
Definition MutableTrackClusterMatch.h:39
bool operator!=(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:101
MutableTrackClusterMatch & operator=(MutableTrackClusterMatch other)
copy-assignment operator
Definition MutableTrackClusterMatch.cc:28
void setWeight(float value)
Set the weight of this association.
Definition MutableTrackClusterMatch.cc:60
bool operator<(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:105
bool operator==(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:98
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
Definition TrackClusterMatchCollection.h:92
Definition TrackClusterMatch.h:37
Definition TrackClusterMatchCollection.h:63
Definition Track.h:41
Definition CalorimeterHit.cc:17