File indexing completed on 2025-01-18 09:55:31
0001
0002
0003 #ifndef EDM4EIC_MutableTrackClusterMatch_H
0004 #define EDM4EIC_MutableTrackClusterMatch_H
0005
0006 #include "edm4eic/TrackClusterMatchObj.h"
0007
0008 #include "edm4eic/TrackClusterMatch.h"
0009
0010
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012
0013 #include <cstdint>
0014
0015 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0016 #include "nlohmann/json_fwd.hpp"
0017 #endif
0018
0019
0020 namespace edm4eic {
0021 class Cluster;
0022 class MutableCluster;
0023 class Track;
0024 class MutableTrack;
0025 }
0026
0027
0028 namespace edm4eic {
0029
0030
0031
0032
0033
0034
0035 class MutableTrackClusterMatch {
0036
0037 friend class TrackClusterMatchCollection;
0038 friend class TrackClusterMatchMutableCollectionIterator;
0039 friend class TrackClusterMatch;
0040
0041 public:
0042 using object_type = TrackClusterMatch;
0043 using collection_type = TrackClusterMatchCollection;
0044
0045
0046 MutableTrackClusterMatch();
0047
0048
0049 MutableTrackClusterMatch(float weight);
0050
0051
0052 MutableTrackClusterMatch(const MutableTrackClusterMatch& other) = default;
0053
0054
0055 MutableTrackClusterMatch& operator=(MutableTrackClusterMatch other);
0056
0057
0058
0059 MutableTrackClusterMatch clone(bool cloneRelations=true) const;
0060
0061
0062 ~MutableTrackClusterMatch() = default;
0063
0064
0065 public:
0066
0067
0068 float getWeight() const;
0069
0070
0071
0072 const edm4eic::Cluster getCluster() const;
0073
0074 const edm4eic::Track getTrack() const;
0075
0076
0077 void setWeight(float value);
0078
0079 float& getWeight();
0080
0081 [[deprecated("use getWeight instead")]]
0082 float& weight();
0083
0084
0085
0086 void setCluster(const edm4eic::Cluster& value);
0087
0088 void setTrack(const edm4eic::Track& value);
0089
0090
0091
0092
0093
0094 bool isAvailable() const;
0095
0096 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackClusterMatchObj>{nullptr}; }
0097
0098 bool operator==(const MutableTrackClusterMatch& other) const { return m_obj == other.m_obj; }
0099 bool operator==(const TrackClusterMatch& other) const;
0100
0101 bool operator!=(const MutableTrackClusterMatch& other) const { return !(*this == other); }
0102 bool operator!=(const TrackClusterMatch& other) const { return !(*this == other); }
0103
0104
0105 bool operator<(const MutableTrackClusterMatch& other) const { return m_obj < other.m_obj; }
0106
0107 podio::ObjectID id() const { return getObjectID(); }
0108
0109 const podio::ObjectID getObjectID() const;
0110
0111 friend void swap(MutableTrackClusterMatch& a, MutableTrackClusterMatch& b) {
0112 using std::swap;
0113 swap(a.m_obj, b.m_obj);
0114 }
0115
0116 private:
0117
0118 explicit MutableTrackClusterMatch(podio::utils::MaybeSharedPtr<TrackClusterMatchObj> obj);
0119
0120 podio::utils::MaybeSharedPtr<TrackClusterMatchObj> m_obj{nullptr};
0121 };
0122
0123 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0124 void to_json(nlohmann::json& j, const MutableTrackClusterMatch& value);
0125 #endif
0126
0127
0128 }
0129
0130
0131 #endif