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 <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 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
50 MutableTrackClusterMatch(float weight);
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 TrackClusterMatch() const;
67
68public:
69
70 /// Access the weight of this association
71 float getWeight() const;
72
73
74 /// Access the reference to the cluster
75 const edm4eic::Cluster getCluster() const;
76 /// Access the reference to the track
77 const edm4eic::Track getTrack() const;
78
79 /// Set the weight of this association
80 void setWeight(float value);
81
82
83 /// Set the reference to the cluster
84 void setCluster(edm4eic::Cluster value);
85 /// Set the reference to the track
86 void setTrack(edm4eic::Track value);
87
88
89
90
91 /// check whether the object is actually available
92 bool isAvailable() const;
93 /// disconnect from TrackClusterMatchObj instance
94 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
95
96 bool operator==(const MutableTrackClusterMatch& other) const { return m_obj == other.m_obj; }
97 bool operator==(const TrackClusterMatch& other) const;
98
99 // less comparison operator, so that objects can be e.g. stored in sets.
100 bool operator<(const MutableTrackClusterMatch& 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 TrackClusterMatchObj
113 explicit MutableTrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
114
115 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
116};
117
118#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
119void to_json(nlohmann::json& j, const MutableTrackClusterMatch& value);
120#endif
121
122
123} // namespace edm4eic
124
125
126#endif
Definition Cluster.h:38
Definition MutableTrackClusterMatch.h:36
friend void swap(MutableTrackClusterMatch &a, MutableTrackClusterMatch &b)
Definition MutableTrackClusterMatch.h:106
MutableTrackClusterMatch()
default constructor
Definition MutableTrackClusterMatch.cc:23
MutableTrackClusterMatch(const MutableTrackClusterMatch &other)=default
copy constructor
void unlink()
disconnect from TrackClusterMatchObj instance
Definition MutableTrackClusterMatch.h:94
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:82
podio::ObjectID id() const
Definition MutableTrackClusterMatch.h:102
const podio::ObjectID getObjectID() const
Definition MutableTrackClusterMatch.cc:89
friend class TrackClusterMatch
Definition MutableTrackClusterMatch.h:40
void setTrack(edm4eic::Track value)
Set the reference to the track.
Definition MutableTrackClusterMatch.cc:69
MutableTrackClusterMatch & operator=(MutableTrackClusterMatch other)
copy-assignment operator
Definition MutableTrackClusterMatch.cc:31
void setWeight(float value)
Set the weight of this association.
Definition MutableTrackClusterMatch.cc:60
bool operator<(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:100
MutableTrackClusterMatch clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableTrackClusterMatch.cc:36
bool operator==(const MutableTrackClusterMatch &other) const
Definition MutableTrackClusterMatch.h:96
float getWeight() const
Access the weight of this association.
Definition MutableTrackClusterMatch.cc:43
~MutableTrackClusterMatch()=default
destructor
const edm4eic::Cluster getCluster() const
Access the reference to the cluster.
Definition MutableTrackClusterMatch.cc:45
void setCluster(edm4eic::Cluster value)
Set the reference to the cluster.
Definition MutableTrackClusterMatch.cc:62
Definition TrackClusterMatchCollection.h:95
Definition TrackClusterMatch.h:37
Definition TrackClusterMatchCollection.h:66
Definition Track.h:41
Definition CalorimeterHit.cc:18