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
11#include <ostream>
12#include <cstdint>
13
14#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
15#include "nlohmann/json_fwd.hpp"
16#endif
17
18// forward declarations
19namespace edm4eic {
20class Cluster;
21class MutableCluster;
22class Track;
23class MutableTrack;
24}
25
26
27namespace edm4eic {
28
29class MutableTrackClusterMatch;
30class TrackClusterMatchCollection;
31class TrackClusterMatchCollectionData;
32
33/** @class TrackClusterMatch
34 * Match between a Cluster and a Track
35 * @author: D. Anderson, D. Brandenburg, D. Kalinkin, S. Joosten
36 */
38
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 TrackClusterMatch(float weight);
53
54 /// copy constructor
55 TrackClusterMatch(const TrackClusterMatch& other) = default;
56
57 /// copy-assignment operator
59
60 /// create a mutable deep-copy of the object with identical relations
61 /// if cloneRelations=false, the relations are not cloned and will be empty
62 MutableTrackClusterMatch clone(bool cloneRelations=true) const;
63
64 /// destructor
65 ~TrackClusterMatch() = default;
66
67 /// converting constructor from mutable object
69
71
72public:
73
74 /// Access the weight of this association
75 float getWeight() const;
76
77
78 /// Access the reference to the cluster
79 const edm4eic::Cluster getCluster() const;
80 /// Access the reference to the track
81 const edm4eic::Track getTrack() const;
82
83
84
85 /// check whether the object is actually available
86 bool isAvailable() const;
87 /// disconnect from TrackClusterMatchObj instance
88 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
89
90 bool operator==(const TrackClusterMatch& other) const { return m_obj == other.m_obj; }
91 bool operator==(const MutableTrackClusterMatch& other) const;
92
93 bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
94 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
95
96 // less comparison operator, so that objects can be e.g. stored in sets.
97 bool operator<(const TrackClusterMatch& other) const { return m_obj < other.m_obj; }
98
99 podio::ObjectID id() const { return getObjectID(); }
100
101 const podio::ObjectID getObjectID() const;
102
104 using std::swap;
105 swap(a.m_obj, b.m_obj); // swap out the internal pointers
106 }
107
108private:
109 /// constructor from existing TrackClusterMatchObj
110 explicit TrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
112
113 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
114};
115
116std::ostream& operator<<(std::ostream& o, const TrackClusterMatch& value);
117
118#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
119void to_json(nlohmann::json& j, const TrackClusterMatch& value);
120#endif
121
122
123} // namespace edm4eic
124
125
126#endif
Definition Cluster.h:38
Definition MutableTrackClusterMatch.h:35
Definition TrackClusterMatchCollectionData.h:32
Definition TrackClusterMatchCollection.h:92
Definition TrackClusterMatchCollection.h:37
Definition TrackClusterMatch.h:37
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:40
void unlink()
disconnect from TrackClusterMatchObj instance
Definition TrackClusterMatch.h:88
bool operator<(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:97
MutableTrackClusterMatch clone(bool cloneRelations=true) const
Definition TrackClusterMatch.cc:35
bool operator==(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:90
TrackClusterMatch(const TrackClusterMatch &other)=default
copy constructor
friend class MutableTrackClusterMatch
Definition TrackClusterMatch.h:39
bool operator!=(const TrackClusterMatch &other) const
Definition TrackClusterMatch.h:93
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:103
podio::ObjectID id() const
Definition TrackClusterMatch.h:99
bool operator!=(const MutableTrackClusterMatch &other) const
Definition TrackClusterMatch.h:94
const podio::ObjectID getObjectID() const
Definition TrackClusterMatch.cc:85
Definition TrackClusterMatchObj.h:22
Definition Track.h:41
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103