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
58
59 /// Constructor initializing all members
60 TrackClusterMatch(const float weight);
61
62 /// copy constructor
63 TrackClusterMatch(const TrackClusterMatch& other) = default;
64
65 /// copy-assignment operator
66 TrackClusterMatch& operator=(TrackClusterMatch other) &; // Rebind this to other's internal object
67 TrackClusterMatch& operator=(TrackClusterMatch 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 MutableTrackClusterMatch clone(bool cloneRelations=true) const;
72
73 /// destructor
74 ~TrackClusterMatch() = default;
75
76 /// converting constructor from mutable object
78
80
81public:
82
83 static constexpr std::string_view typeName = "edm4eic::TrackClusterMatch";
84
85 /// Access the weight of this association
86 float getWeight() const;
87
88
89 /// Access the reference to the cluster
90 const edm4eic::Cluster getCluster() const;
91 /// Access the reference to the track
92 const edm4eic::Track getTrack() const;
93
94
95
96 /// check whether the object is actually available
97 bool isAvailable() const;
98 /// disconnect from TrackClusterMatchObj instance
99 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
100
101 bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
102 bool operator==(const MutableTrackClusterMatch& other) const;
103
104 bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
105 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
106
107 // less comparison operator, so that objects can be e.g. stored in sets.
108 bool operator<(const TrackClusterMatch& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
109
110 podio::ObjectID id() const { return getObjectID(); }
111
112 const podio::ObjectID getObjectID() const;
113
114 friend std::hash<TrackClusterMatch>;
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 TrackClusterMatchObj
123 explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
125
126 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
127};
128
129std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
130
131#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
132void to_json(nlohmann::json& j, const TrackClusterMatch& value);
133#endif
134
135
136} // namespace edm4eic
137
138
139
140template<>
141struct std::hash<edm4eic::TrackClusterMatch> {
142 std::size_t operator()(const edm4eic::TrackClusterMatch& obj) const {
143 return std::hash<edm4eic::TrackClusterMatchObj*>{}(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::TrackClusterMatch::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::TrackClusterMatch::typeName;
162#pragma GCC diagnostic pop
163#endif
164
165#endif
Definition Cluster.h:48
Definition MutableCluster.h:40
Definition MutableTrackClusterMatch.h:36
Definition MutableTrack.h:40
Definition TrackClusterMatchCollectionData.h:32
Definition TrackClusterMatchCollection.h:137
Definition TrackClusterMatch.h:44
static TrackClusterMatch makeEmpty()
Definition TrackClusterMatch.cc:56
const edm4eic::Cluster getCluster() const
Access the reference to the cluster.
Definition TrackClusterMatch.cc:62
const edm4eic::Track getTrack() const
Access the reference to the track.
Definition TrackClusterMatch.cc:69
bool isAvailable() const
check whether the object is actually available
Definition TrackClusterMatch.cc:81
~TrackClusterMatch()=default
destructor
friend class TrackClusterMatchCollection
Definition TrackClusterMatch.h:47
TrackClusterMatch & operator=(TrackClusterMatch other) &
copy-assignment operator
Definition TrackClusterMatch.cc:30
void unlink()
disconnect from TrackClusterMatchObj instance
Definition TrackClusterMatch.h:99
MutableTrackClusterMatch mutable_type
Definition TrackClusterMatch.h:53
bool operator<(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:108
MutableTrackClusterMatch clone(bool cloneRelations=true) const
Definition TrackClusterMatch.cc:35
bool operator==(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:101
TrackClusterMatch(const TrackClusterMatch &other)=default
copy constructor
friend class MutableTrackClusterMatch
Definition TrackClusterMatch.h:46
bool operator!=(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:104
TrackClusterMatch()
default constructor
Definition TrackClusterMatch.cc:22
float getWeight() const
Access the weight of this association.
Definition TrackClusterMatch.cc:60
static constexpr std::string_view typeName
Definition TrackClusterMatch.h:83
friend void swap(TrackClusterMatch &a, TrackClusterMatch &b)
Definition TrackClusterMatch.h:116
podio::ObjectID id() const
Definition TrackClusterMatch.h:110
friend class TrackClusterMatchCollectionIterator
Definition TrackClusterMatch.h:49
bool operator!=(const MutableTrackClusterMatch &other) const
Definition TrackClusterMatch.h:105
TrackClusterMatchCollection collection_type
Definition TrackClusterMatch.h:54
const podio::ObjectID getObjectID() const
Definition TrackClusterMatch.cc:85
TrackClusterMatch & operator=(TrackClusterMatch other) &&=delete
Definition TrackClusterMatchObj.h:22
Definition Track.h:48
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::TrackClusterMatch &obj) const
Definition TrackClusterMatch.h:142