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 TrackClusterMatchCollection;
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
57
58 /// create a mutable deep-copy of the object with identical relations
59 /// if cloneRelations=false, the relations are not cloned and will be empty
60 MutableTrackClusterMatch clone(bool cloneRelations=true) const;
61
62 /// destructor
64
65
66public:
67
68 /// Access the weight of this association
69 float getWeight() const;
70
71
72 /// Access the reference to the cluster
73 const edm4eic::Cluster getCluster() const;
74 /// Access the reference to the track
75 const edm4eic::Track getTrack() const;
76
77 /// Set the weight of this association
78 void setWeight(float value);
79 /// Get mutable reference to weight of this association
80 float& getWeight();
81 /// Get reference to weight of this association
82 [[deprecated("use getWeight instead")]]
83 float& weight();
84
85
86 /// Set the reference to the cluster
87 void setCluster(const edm4eic::Cluster& value);
88 /// Set the reference to the track
89 void setTrack(const edm4eic::Track& value);
90
91
92
93
94 /// check whether the object is actually available
95 bool isAvailable() const;
96 /// disconnect from TrackClusterMatchObj instance
97 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
98
99 bool operator==(const MutableTrackClusterMatch& other) const { return m_obj == other.m_obj; }
100 bool operator==(const TrackClusterMatch& other) const;
101
102 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
103 bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
104
105 // less comparison operator, so that objects can be e.g. stored in sets.
107
108 podio::ObjectID id() const { return getObjectID(); }
109
110 const podio::ObjectID getObjectID() const;
111
113 using std::swap;
114 swap(a.m_obj, b.m_obj); // swap out the internal pointers
115 }
116
117private:
118 /// constructor from existing TrackClusterMatchObj
119 explicit MutableTrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
120
121 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
122};
123
124#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
125void to_json(nlohmann::json& j, const MutableTrackClusterMatch& value);
126#endif
127
128
129} // namespace edm4eic
130
131
132#endif
Definition Cluster.h:48
Definition MutableTrackClusterMatch.h:36
friend void swap(MutableTrackClusterMatch &a, MutableTrackClusterMatch &b)
Definition MutableTrackClusterMatch.h:112
MutableTrackClusterMatch()
default constructor
Definition MutableTrackClusterMatch.cc:20
MutableTrackClusterMatch(const MutableTrackClusterMatch &other)=default
copy constructor
void unlink()
disconnect from TrackClusterMatchObj instance
Definition MutableTrackClusterMatch.h:97
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:103
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:108
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:102
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:106
bool operator==(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:99
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:91
Definition TrackClusterMatch.h:44
Definition TrackClusterMatchCollection.h:62
Definition Track.h:48
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150