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