EDM4eic
EIC data model
Loading...
Searching...
No Matches
TrackClusterMatch.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_TrackClusterMatch_H
4#define EDM4EIC_TrackClusterMatch_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 Cluster;
23class MutableCluster;
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::TrackClusterMatch& obj);
32};
33
34namespace edm4eic {
35
39
40/** @class TrackClusterMatch
41 * Match between a Cluster and a Track
42 * @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
43 */
45
50 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackClusterMatch & obj);
51
52public:
55
56 /// default constructor
57 TrackClusterMatch() = default;
58
59 /// Constructor initializing all members
60 TrackClusterMatch(const float weight);
61
62 /// copy constructor
63 TrackClusterMatch(const TrackClusterMatch& other) noexcept = default;
64
65 /// move constructor
66 TrackClusterMatch(TrackClusterMatch&& other) noexcept = default;
67
68 /// copy-assignment operator
69 TrackClusterMatch& operator=(TrackClusterMatch other) &; // Rebind this to other's internal object
70 TrackClusterMatch& operator=(TrackClusterMatch 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 MutableTrackClusterMatch clone(bool cloneRelations=true) const;
75
76 /// destructor
77 ~TrackClusterMatch() = default;
78
79 /// converting constructor from mutable object
81
83
84public:
85
86 static constexpr std::string_view typeName = "edm4eic::TrackClusterMatch";
87
88 /// Access the weight of this association
89 float getWeight() const;
90
91
92 /// Access the reference to the cluster
93 const edm4eic::Cluster getCluster() const;
94 /// Access the reference to the track
95 const edm4eic::Track getTrack() const;
96
97
98
99 /// check whether the object is actually available
100 bool isAvailable() const;
101 /// disconnect from TrackClusterMatchObj instance
102 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
103
104 constexpr bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
105 bool operator==(const MutableTrackClusterMatch& other) const;
106
107 constexpr bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
108 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
109
110 // less comparison operator, so that objects can be e.g. stored in sets.
111 bool operator<(const TrackClusterMatch& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
112
113 podio::ObjectID id() const { return getObjectID(); }
114
115 const podio::ObjectID getObjectID() const;
116
117 friend std::hash<TrackClusterMatch>;
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 TrackClusterMatchObj
126 explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
128
129 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{new TrackClusterMatchObj{}, podio::utils::MarkOwned};
130};
131
132std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
133
134#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
135void to_json(nlohmann::json& j, const TrackClusterMatch& value);
136#endif
137
138
139} // namespace edm4eic
140
141
142
143template<>
144struct std::hash<edm4eic::TrackClusterMatch> {
145 std::size_t operator()(const edm4eic::TrackClusterMatch& obj) const {
146 return std::hash<edm4eic::TrackClusterMatchObj*>{}(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::TrackClusterMatch::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::TrackClusterMatch::typeName;
165 #pragma GCC diagnostic pop
166#endif
167
168
169#endif
Definition Cluster.h:49
Definition MutableCluster.h:41
Definition MutableTrackClusterMatch.h:36
Definition MutableTrack.h:40
Definition TrackClusterMatchCollectionData.h:33
Definition TrackClusterMatchCollection.h:139
Definition TrackClusterMatch.h:44
static TrackClusterMatch makeEmpty()
Definition TrackClusterMatch.cc:52
constexpr bool operator!=(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:107
const edm4eic::Cluster getCluster() const
Access the reference to the cluster.
Definition TrackClusterMatch.cc:58
const edm4eic::Track getTrack() const
Access the reference to the track.
Definition TrackClusterMatch.cc:65
bool isAvailable() const
check whether the object is actually available
Definition TrackClusterMatch.cc:77
~TrackClusterMatch()=default
destructor
constexpr bool operator==(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:104
friend class TrackClusterMatchCollection
Definition TrackClusterMatch.h:47
TrackClusterMatch & operator=(TrackClusterMatch other) &
copy-assignment operator
Definition TrackClusterMatch.cc:26
void unlink()
disconnect from TrackClusterMatchObj instance
Definition TrackClusterMatch.h:102
MutableTrackClusterMatch mutable_type
Definition TrackClusterMatch.h:53
TrackClusterMatch(const TrackClusterMatch &other) noexcept=default
copy constructor
TrackClusterMatch()=default
default constructor
bool operator<(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:111
MutableTrackClusterMatch clone(bool cloneRelations=true) const
Definition TrackClusterMatch.cc:31
TrackClusterMatch(TrackClusterMatch &&other) noexcept=default
move constructor
friend class MutableTrackClusterMatch
Definition TrackClusterMatch.h:46
float getWeight() const
Access the weight of this association.
Definition TrackClusterMatch.cc:56
static constexpr std::string_view typeName
Definition TrackClusterMatch.h:86
friend void swap(TrackClusterMatch &a, TrackClusterMatch &b)
Definition TrackClusterMatch.h:119
podio::ObjectID id() const
Definition TrackClusterMatch.h:113
friend class TrackClusterMatchCollectionIterator
Definition TrackClusterMatch.h:49
bool operator!=(const MutableTrackClusterMatch &other) const
Definition TrackClusterMatch.h:108
TrackClusterMatchCollection collection_type
Definition TrackClusterMatch.h:54
const podio::ObjectID getObjectID() const
Definition TrackClusterMatch.cc:81
TrackClusterMatch & operator=(TrackClusterMatch other) &&=delete
Definition TrackClusterMatchObj.h:22
Definition Track.h:48
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::TrackClusterMatch &obj) const
Definition TrackClusterMatch.h:145