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 Track;
23class MutableTrack;
24class ProtoCluster;
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 /// copy-assignment operator
56 MutableTrackProtoClusterMatch& operator=(MutableTrackProtoClusterMatch other) &; // Rebind this to other's internal object
57 MutableTrackProtoClusterMatch& operator=(MutableTrackProtoClusterMatch 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 MutableTrackProtoClusterMatch 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 track
74 const edm4eic::Track getFrom() const;
75 /// Access the reference to the protocluster
76 const edm4eic::ProtoCluster getTo() 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
83
84 /// Set the reference to the track
85 void setFrom(const edm4eic::Track& value);
86 /// Set the reference to the protocluster
87 void setTo(const edm4eic::ProtoCluster& value);
88
89
90
91
92 /// check whether the object is actually available
93 bool isAvailable() const;
94 /// disconnect from TrackProtoClusterMatchObj instance
95 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj>{nullptr}; }
96
97 constexpr bool operator==(const MutableTrackProtoClusterMatch& other) const { return m_obj == other.m_obj; }
98 bool operator==(const TrackProtoClusterMatch& other) const;
99
100 constexpr bool operator!=(const MutableTrackProtoClusterMatch& other) const { return !(*this == other); }
101 bool operator!=(const TrackProtoClusterMatch& other) const { return !(*this == other); }
102
103 // less comparison operator, so that objects can be e.g. stored in sets.
105
106 podio::ObjectID id() const { return getObjectID(); }
107
108 const podio::ObjectID getObjectID() const;
109
110 friend std::hash<MutableTrackProtoClusterMatch>;
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 TrackProtoClusterMatchObj
119 explicit MutableTrackProtoClusterMatch(podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> obj);
120
121 podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> m_obj{new TrackProtoClusterMatchObj{}, podio::utils::MarkOwned};
122};
123
124#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
125void to_json(nlohmann::json& j, const MutableTrackProtoClusterMatch& value);
126#endif
127
128
129} // namespace edm4eic
130
131
132
133template<>
134struct std::hash<edm4eic::MutableTrackProtoClusterMatch> {
136 return std::hash<edm4eic::TrackProtoClusterMatchObj*>{}(obj.m_obj.get());
137 }
138};
139
140
141#endif
Definition MutableProtoCluster.h:35
Definition MutableTrack.h:40
Definition MutableTrackProtoClusterMatch.h:36
~MutableTrackProtoClusterMatch()=default
destructor
friend class TrackProtoClusterMatch
Definition MutableTrackProtoClusterMatch.h:40
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 getFrom() const
Access the reference to the track.
Definition MutableTrackProtoClusterMatch.cc:41
podio::ObjectID id() const
Definition MutableTrackProtoClusterMatch.h:106
MutableTrackProtoClusterMatch(const MutableTrackProtoClusterMatch &other)=default
copy constructor
MutableTrackProtoClusterMatch & operator=(MutableTrackProtoClusterMatch other) &&=delete
TrackProtoClusterMatch object_type
Definition MutableTrackProtoClusterMatch.h:43
bool operator<(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:104
MutableTrackProtoClusterMatch & operator=(MutableTrackProtoClusterMatch other) &
copy-assignment operator
Definition MutableTrackProtoClusterMatch.cc:24
constexpr bool operator==(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:97
MutableTrackProtoClusterMatch()=default
default constructor
void setWeight(const float weight)
Set the weight of this association.
Definition MutableTrackProtoClusterMatch.cc:56
void setTo(const edm4eic::ProtoCluster &value)
Set the reference to the protocluster.
Definition MutableTrackProtoClusterMatch.cc:63
bool operator!=(const TrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:101
void unlink()
disconnect from TrackProtoClusterMatchObj instance
Definition MutableTrackProtoClusterMatch.h:95
friend class TrackProtoClusterMatchCollection
Definition MutableTrackProtoClusterMatch.h:38
MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const
Definition MutableTrackProtoClusterMatch.cc:29
const edm4eic::ProtoCluster getTo() const
Access the reference to the protocluster.
Definition MutableTrackProtoClusterMatch.cc:48
void setFrom(const edm4eic::Track &value)
Set the reference to the track.
Definition MutableTrackProtoClusterMatch.cc:59
const podio::ObjectID getObjectID() const
Definition MutableTrackProtoClusterMatch.cc:77
constexpr bool operator!=(const MutableTrackProtoClusterMatch &other) const
Definition MutableTrackProtoClusterMatch.h:100
friend void swap(MutableTrackProtoClusterMatch &a, MutableTrackProtoClusterMatch &b)
Definition MutableTrackProtoClusterMatch.h:112
Definition ProtoCluster.h:43
Definition Track.h:48
Definition TrackProtoClusterMatchCollection.h:139
Definition TrackProtoClusterMatch.h:44
Definition TrackProtoClusterMatchObj.h:22
Definition ArrowMapper.cc:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrackProtoClusterMatch &obj) const
Definition MutableTrackProtoClusterMatch.h:135