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