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