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 Track;
23class MutableTrack;
24class ProtoCluster;
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
64
65 /// copy-assignment operator
66 TrackProtoClusterMatch& operator=(TrackProtoClusterMatch other) &; // Rebind this to other's internal object
67 TrackProtoClusterMatch& operator=(TrackProtoClusterMatch other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
68
69 /// create a mutable deep-copy of the object with identical relations
70 /// if cloneRelations=false, the relations are not cloned and will be empty
71 MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const;
72
73 /// destructor
75
76 /// converting constructor from mutable object
78
80
81public:
82
83 static constexpr std::string_view typeName = "edm4eic::TrackProtoClusterMatch";
84
85 /// Access the weight of this association
86 float getWeight() const;
87
88
89 /// Access the reference to the track
90 const edm4eic::Track getFrom() const;
91 /// Access the reference to the protocluster
92 const edm4eic::ProtoCluster getTo() const;
93
94
95
96 /// check whether the object is actually available
97 bool isAvailable() const;
98 /// disconnect from TrackProtoClusterMatchObj instance
99 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj>{nullptr}; }
100
101 bool operator==(const TrackProtoClusterMatch& other) const { return m_obj == other.m_obj; }
102 bool operator==(const MutableTrackProtoClusterMatch& other) const;
103
104 bool operator!=(const TrackProtoClusterMatch& other) const { return !(*this == other); }
105 bool operator!=(const MutableTrackProtoClusterMatch& other) const { return !(*this == other); }
106
107 // less comparison operator, so that objects can be e.g. stored in sets.
109
110 podio::ObjectID id() const { return getObjectID(); }
111
112 const podio::ObjectID getObjectID() const;
113
114 friend std::hash<TrackProtoClusterMatch>;
115
117 using std::swap;
118 swap(a.m_obj, b.m_obj); // swap out the internal pointers
119 }
120
121private:
122 /// constructor from existing TrackProtoClusterMatchObj
123 explicit TrackProtoClusterMatch(podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> obj);
125
126 podio::utils::MaybeSharedPtr<TrackProtoClusterMatchObj> m_obj{nullptr};
127};
128
129std::ostream& operator<<(std::ostream& o, const TrackProtoClusterMatch& value);
130
131#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
132void to_json(nlohmann::json& j, const TrackProtoClusterMatch& value);
133#endif
134
135
136} // namespace edm4eic
137
138
139
140template<>
141struct std::hash<edm4eic::TrackProtoClusterMatch> {
142 std::size_t operator()(const edm4eic::TrackProtoClusterMatch& obj) const {
143 return std::hash<edm4eic::TrackProtoClusterMatchObj*>{}(obj.m_obj.get());
144 }
145};
146
147
148// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
149// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
150// and https://github.com/AIDASoft/podio/issues/770
151#if defined(__clang__)
152#pragma clang diagnostic push
153#pragma clang diagnostic ignored "-Wunknown-warning-option"
154#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
155#pragma clang diagnostic ignored "-Wdeprecated"
156constexpr std::string_view edm4eic::TrackProtoClusterMatch::typeName;
157#pragma clang diagnostic pop
158#elif defined(__GNUC__)
159#pragma GCC diagnostic push
160#pragma GCC diagnostic ignored "-Wdeprecated"
161constexpr std::string_view edm4eic::TrackProtoClusterMatch::typeName;
162#pragma GCC diagnostic pop
163#endif
164
165#endif
Definition MutableProtoCluster.h:35
Definition MutableTrack.h:40
Definition MutableTrackProtoClusterMatch.h:36
Definition ProtoCluster.h:43
Definition Track.h:48
Definition TrackProtoClusterMatchCollectionData.h:32
Definition TrackProtoClusterMatchCollection.h:137
Definition TrackProtoClusterMatch.h:44
~TrackProtoClusterMatch()=default
destructor
friend void swap(TrackProtoClusterMatch &a, TrackProtoClusterMatch &b)
Definition TrackProtoClusterMatch.h:116
float getWeight() const
Access the weight of this association.
Definition TrackProtoClusterMatch.cc:60
static TrackProtoClusterMatch makeEmpty()
Definition TrackProtoClusterMatch.cc:56
friend class TrackProtoClusterMatchCollectionIterator
Definition TrackProtoClusterMatch.h:49
static constexpr std::string_view typeName
Definition TrackProtoClusterMatch.h:83
TrackProtoClusterMatch(const TrackProtoClusterMatch &other)=default
copy constructor
const podio::ObjectID getObjectID() const
Definition TrackProtoClusterMatch.cc:85
bool isAvailable() const
check whether the object is actually available
Definition TrackProtoClusterMatch.cc:81
bool operator!=(const MutableTrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:105
TrackProtoClusterMatch & operator=(TrackProtoClusterMatch other) &
copy-assignment operator
Definition TrackProtoClusterMatch.cc:30
bool operator<(const TrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:108
const edm4eic::Track getFrom() const
Access the reference to the track.
Definition TrackProtoClusterMatch.cc:62
TrackProtoClusterMatch()
default constructor
Definition TrackProtoClusterMatch.cc:22
friend class MutableTrackProtoClusterMatch
Definition TrackProtoClusterMatch.h:46
TrackProtoClusterMatchCollection collection_type
Definition TrackProtoClusterMatch.h:54
TrackProtoClusterMatch & operator=(TrackProtoClusterMatch other) &&=delete
const edm4eic::ProtoCluster getTo() const
Access the reference to the protocluster.
Definition TrackProtoClusterMatch.cc:69
void unlink()
disconnect from TrackProtoClusterMatchObj instance
Definition TrackProtoClusterMatch.h:99
bool operator!=(const TrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:104
friend class TrackProtoClusterMatchCollection
Definition TrackProtoClusterMatch.h:47
bool operator==(const TrackProtoClusterMatch &other) const
Definition TrackProtoClusterMatch.h:101
podio::ObjectID id() const
Definition TrackProtoClusterMatch.h:110
MutableTrackProtoClusterMatch clone(bool cloneRelations=true) const
Definition TrackProtoClusterMatch.cc:35
MutableTrackProtoClusterMatch mutable_type
Definition TrackProtoClusterMatch.h:53
Definition TrackProtoClusterMatchObj.h:22
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::TrackProtoClusterMatch &obj) const
Definition TrackProtoClusterMatch.h:142