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 ProtoCluster;
24class Track;
25class MutableTrack;
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
50 MutableTrackProtoClusterMatch(const float weight);
51
52 /// copy constructor
54
55 /// move constructor
57
58 /// copy-assignment operator
59 MutableTrackProtoClusterMatch& operator=(MutableTrackProtoClusterMatch other) &; // Rebind this to other's internal object
60 MutableTrackProtoClusterMatch& operator=(MutableTrackProtoClusterMatch other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
61
62 /// create a mutable deep-copy of the object with identical relations
63 /// if cloneRelations=false, the relations are not cloned and will be empty
64 MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const;
65
66 /// destructor
68
69
70public:
71
72 /// Access the weight of this association
73 float getWeight() const;
74
75
76 /// Access the reference to the protocluster
77 const edm4eic::ProtoCluster getFrom() const;
78 /// Access the reference to the track
79 const edm4eic::Track getTo() const;
80
81 /// Set the weight of this association
82 void setWeight(const float weight);
83 /// Get mutable reference to weight of this association
84 float& getWeight();
85
86
87 /// Set the reference to the protocluster
88 void setFrom(const edm4eic::ProtoCluster& value);
89 /// Set the reference to the track
90 void setTo(const edm4eic::Track& 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 constexpr bool operator==(const MutableTrackProtoClusterMatch& other) const { return m_obj == other.m_obj; }
101 bool operator==(const TrackProtoClusterMatch& other) const;
102
103 constexpr 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{new TrackProtoClusterMatchObj{}, podio::utils::MarkOwned};
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
~MutableTrackProtoClusterMatch()=default
destructor
friend class TrackProtoClusterMatch
Definition MutableTrackProtoClusterMatch.h:40
void setTo(const edm4eic::Track &value)
Set the reference to the track.
Definition MutableTrackProtoClusterMatch.cc:63
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackProtoClusterMatch.cc:73
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:39
const edm4eic::Track getTo() const
Access the reference to the track.
Definition MutableTrackProtoClusterMatch.cc:48
podio::ObjectID id() const
Definition MutableTrackProtoClusterMatch.h:109
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:24
constexpr bool operator==(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:100
MutableTrackProtoClusterMatch(MutableTrackProtoClusterMatch &&other) noexcept=default
move constructor
MutableTrackProtoClusterMatch()=default
default constructor
void setWeight(const float weight)
Set the weight of this association.
Definition MutableTrackProtoClusterMatch.cc:56
MutableTrackProtoClusterMatch(const MutableTrackProtoClusterMatch &other) noexcept=default
copy constructor
bool operator!=(const TrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:104
void unlink()
disconnect from TrackProtoClusterMatchObj instance
Definition MutableTrackProtoClusterMatch.h:98
void setFrom(const edm4eic::ProtoCluster &value)
Set the reference to the protocluster.
Definition MutableTrackProtoClusterMatch.cc:59
friend class TrackProtoClusterMatchCollection
Definition MutableTrackProtoClusterMatch.h:38
const edm4eic::ProtoCluster getFrom() const
Access the reference to the protocluster.
Definition MutableTrackProtoClusterMatch.cc:41
MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const
Definition MutableTrackProtoClusterMatch.cc:29
const podio::ObjectID getObjectID() const
Definition MutableTrackProtoClusterMatch.cc:77
constexpr bool operator!=(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:103
friend void swap(MutableTrackProtoClusterMatch &a, MutableTrackProtoClusterMatch &b)
Definition MutableTrackProtoClusterMatch.h:115
Definition ProtoCluster.h:43
Definition Track.h:48
Definition TrackProtoClusterMatchCollection.h:139
Definition TrackProtoClusterMatch.h:44
Definition TrackProtoClusterMatchObj.h:22
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrackProtoClusterMatch &obj) const
Definition MutableTrackProtoClusterMatch.h:138