EDM4eic
EIC data model
Loading...
Searching...
No Matches
TrackProtoClusterMatch.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_TrackProtoClusterMatch_H
4#define EDM4EIC_TrackProtoClusterMatch_H
5
7
8
9#include "podio/utilities/MaybeSharedPtr.h"
10#include "podio/detail/OrderKey.h"
11
12#include <ostream>
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 podio::detail {
30// Internal function used in less comparison operators of the datatypes and interface types
31OrderKey getOrderKey(const edm4eic::TrackProtoClusterMatch& obj);
32};
33
34namespace edm4eic {
35
39
40/** @class TrackProtoClusterMatch
41 * Match between a ProtoCluster and a Track
42 * @author: D. Anderson, D. Kalinkin
43 */
45
50 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackProtoClusterMatch & obj);
51
52public:
55
56 /// default constructor
58
59 /// Constructor initializing all members
60 TrackProtoClusterMatch(const float weight);
61
62 /// copy constructor
63 TrackProtoClusterMatch(const TrackProtoClusterMatch& other) noexcept = default;
64
65 /// move constructor
67
68 /// copy-assignment operator
69 TrackProtoClusterMatch& operator=(TrackProtoClusterMatch other) &; // Rebind this to other's internal object
70 TrackProtoClusterMatch& operator=(TrackProtoClusterMatch other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
71
72 /// create a mutable deep-copy of the object with identical relations
73 /// if cloneRelations=false, the relations are not cloned and will be empty
74 MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const;
75
76 /// destructor
78
79 /// converting constructor from mutable object
81
83
84public:
85
86 static constexpr std::string_view typeName = "edm4eic::TrackProtoClusterMatch";
87
88 /// Access the weight of this association
89 float getWeight() const;
90
91
92 /// Access the reference to the protocluster
93 const edm4eic::ProtoCluster getFrom() const;
94 /// Access the reference to the track
95 const edm4eic::Track getTo() const;
96
97
98
99 /// check whether the object is actually available
100 bool isAvailable() const;
101 /// disconnect from TrackProtoClusterMatchObj instance
102 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj>{nullptr}; }
103
104 constexpr bool operator==(const TrackProtoClusterMatch& other) const { return m_obj == other.m_obj; }
105 bool operator==(const MutableTrackProtoClusterMatch& other) const;
106
107 constexpr bool operator!=(const TrackProtoClusterMatch& other) const { return !(*this == other); }
108 bool operator!=(const MutableTrackProtoClusterMatch& other) const { return !(*this == other); }
109
110 // less comparison operator, so that objects can be e.g. stored in sets.
112
113 podio::ObjectID id() const { return getObjectID(); }
114
115 const podio::ObjectID getObjectID() const;
116
117 friend std::hash<TrackProtoClusterMatch>;
118
120 using std::swap;
121 swap(a.m_obj, b.m_obj); // swap out the internal pointers
122 }
123
124private:
125 /// constructor from existing TrackProtoClusterMatchObj
126 explicit TrackProtoClusterMatch(podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> obj);
128
129 podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> m_obj{new TrackProtoClusterMatchObj{}, podio::utils::MarkOwned};
130};
131
132std::ostream& operator<<(std::ostream& o, const TrackProtoClusterMatch& value);
133
134#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
135void to_json(nlohmann::json& j, const TrackProtoClusterMatch& value);
136#endif
137
138
139} // namespace edm4eic
140
141
142
143template<>
144struct std::hash<edm4eic::TrackProtoClusterMatch> {
145 std::size_t operator()(const edm4eic::TrackProtoClusterMatch& obj) const {
146 return std::hash<edm4eic::TrackProtoClusterMatchObj*>{}(obj.m_obj.get());
147 }
148};
149
150
151// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
152// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
153// and https://github.com/AIDASoft/podio/issues/770
154#if defined(__clang__)
155 #pragma clang diagnostic push
156 #pragma clang diagnostic ignored "-Wunknown-warning-option"
157 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
158 #pragma clang diagnostic ignored "-Wdeprecated"
159constexpr std::string_view edm4eic::TrackProtoClusterMatch::typeName;
160 #pragma clang diagnostic pop
161#elif defined(__GNUC__)
162 #pragma GCC diagnostic push
163 #pragma GCC diagnostic ignored "-Wdeprecated"
164constexpr std::string_view edm4eic::TrackProtoClusterMatch::typeName;
165 #pragma GCC diagnostic pop
166#endif
167
168
169#endif
Definition MutableProtoCluster.h:35
Definition MutableTrack.h:40
Definition MutableTrackProtoClusterMatch.h:36
Definition ProtoCluster.h:43
Definition Track.h:48
Definition TrackProtoClusterMatchCollectionData.h:33
Definition TrackProtoClusterMatchCollection.h:139
Definition TrackProtoClusterMatch.h:44
constexpr bool operator!=(const TrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:107
~TrackProtoClusterMatch()=default
destructor
friend void swap(TrackProtoClusterMatch &a, TrackProtoClusterMatch &b)
Definition TrackProtoClusterMatch.h:119
float getWeight() const
Access the weight of this association.
Definition TrackProtoClusterMatch.cc:56
static TrackProtoClusterMatch makeEmpty()
Definition TrackProtoClusterMatch.cc:52
TrackProtoClusterMatch(const TrackProtoClusterMatch &other) noexcept=default
copy constructor
friend class TrackProtoClusterMatchCollectionIterator
Definition TrackProtoClusterMatch.h:49
static constexpr std::string_view typeName
Definition TrackProtoClusterMatch.h:86
TrackProtoClusterMatch()=default
default constructor
const podio::ObjectID getObjectID() const
Definition TrackProtoClusterMatch.cc:81
bool isAvailable() const
check whether the object is actually available
Definition TrackProtoClusterMatch.cc:77
bool operator!=(const MutableTrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:108
TrackProtoClusterMatch & operator=(TrackProtoClusterMatch other) &
copy-assignment operator
Definition TrackProtoClusterMatch.cc:26
bool operator<(const TrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:111
TrackProtoClusterMatch(TrackProtoClusterMatch &&other) noexcept=default
move constructor
friend class MutableTrackProtoClusterMatch
Definition TrackProtoClusterMatch.h:46
TrackProtoClusterMatchCollection collection_type
Definition TrackProtoClusterMatch.h:54
TrackProtoClusterMatch & operator=(TrackProtoClusterMatch other) &&=delete
void unlink()
disconnect from TrackProtoClusterMatchObj instance
Definition TrackProtoClusterMatch.h:102
const edm4eic::Track getTo() const
Access the reference to the track.
Definition TrackProtoClusterMatch.cc:65
friend class TrackProtoClusterMatchCollection
Definition TrackProtoClusterMatch.h:47
const edm4eic::ProtoCluster getFrom() const
Access the reference to the protocluster.
Definition TrackProtoClusterMatch.cc:58
constexpr bool operator==(const TrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:104
podio::ObjectID id() const
Definition TrackProtoClusterMatch.h:113
MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const
Definition TrackProtoClusterMatch.cc:31
MutableTrackProtoClusterMatch mutable_type
Definition TrackProtoClusterMatch.h:53
Definition TrackProtoClusterMatchObj.h:22
Definition ArrowMapper.cc:63
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::TrackProtoClusterMatch &obj) const
Definition TrackProtoClusterMatch.h:145