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