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 {
21class TrackClusterMatchCollection;
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
36class MutableTrackClusterMatch;
37class TrackClusterMatchCollection;
38class TrackClusterMatchCollectionData;
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(float weight);
61
62 /// copy constructor
63 TrackClusterMatch(const TrackClusterMatch& other) = default;
64
65 /// copy-assignment operator
67
68 /// create a mutable deep-copy of the object with identical relations
69 /// if cloneRelations=false, the relations are not cloned and will be empty
70 MutableTrackClusterMatch clone(bool cloneRelations=true) const;
71
72 /// destructor
73 ~TrackClusterMatch() = default;
74
75 /// converting constructor from mutable object
77
79
80public:
81
82 static constexpr auto typeName = "edm4eic::TrackClusterMatch";
83
84 /// Access the weight of this association
85 float getWeight() const;
86
87
88 /// Access the reference to the cluster
89 const edm4eic::Cluster getCluster() const;
90 /// Access the reference to the track
91 const edm4eic::Track getTrack() const;
92
93
94
95 /// check whether the object is actually available
96 bool isAvailable() const;
97 /// disconnect from TrackClusterMatchObj instance
98 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
99
100 bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
101 bool operator==(const MutableTrackClusterMatch& other) const;
102
103 bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
104 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
105
106 // less comparison operator, so that objects can be e.g. stored in sets.
107 bool operator<(const TrackClusterMatch& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
108
109 podio::ObjectID id() const { return getObjectID(); }
110
111 const podio::ObjectID getObjectID() const;
112
114 using std::swap;
115 swap(a.m_obj, b.m_obj); // swap out the internal pointers
116 }
117
118private:
119 /// constructor from existing TrackClusterMatchObj
120 explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
122
123 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
124};
125
126std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
127
128#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
129void to_json(nlohmann::json& j, const TrackClusterMatch& value);
130#endif
131
132
133} // namespace edm4eic
134
135
136#endif
Definition Cluster.h:48
Definition MutableTrackClusterMatch.h:36
Definition TrackClusterMatchCollectionData.h:32
Definition TrackClusterMatchCollection.h:91
Definition TrackClusterMatchCollection.h:36
Definition TrackClusterMatch.h:44
static TrackClusterMatch makeEmpty()
Definition TrackClusterMatch.cc:56
TrackClusterMatch & operator=(TrackClusterMatch other)
copy-assignment operator
Definition TrackClusterMatch.cc:30
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
void unlink()
disconnect from TrackClusterMatchObj instance
Definition TrackClusterMatch.h:98
bool operator<(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:107
MutableTrackClusterMatch clone(bool cloneRelations=true) const
Definition TrackClusterMatch.cc:35
bool operator==(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:100
TrackClusterMatch(const TrackClusterMatch &other)=default
copy constructor
friend class MutableTrackClusterMatch
Definition TrackClusterMatch.h:46
bool operator!=(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:103
TrackClusterMatch()
default constructor
Definition TrackClusterMatch.cc:22
float getWeight() const
Access the weight of this association.
Definition TrackClusterMatch.cc:60
friend void swap(TrackClusterMatch &a, TrackClusterMatch &b)
Definition TrackClusterMatch.h:113
podio::ObjectID id() const
Definition TrackClusterMatch.h:109
bool operator!=(const MutableTrackClusterMatch &other) const
Definition TrackClusterMatch.h:104
const podio::ObjectID getObjectID() const
Definition TrackClusterMatch.cc:85
static constexpr auto typeName
Definition TrackClusterMatch.h:82
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