File indexing completed on 2026-05-07 08:36:43
0001
0002
0003 #ifndef EDM4EIC_TrackSeed_H
0004 #define EDM4EIC_TrackSeed_H
0005
0006 #include "edm4eic/TrackSeedObj.h"
0007
0008 #include "edm4eic/TrackerHit.h"
0009 #include "edm4hep/Vector3f.h"
0010 #include "podio/RelationRange.h"
0011 #include <vector>
0012
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014 #include "podio/detail/OrderKey.h"
0015
0016 #include <ostream>
0017 #include <cstdint>
0018
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022
0023
0024 namespace edm4eic {
0025 class TrackSeedCollection;
0026 class TrackParameters;
0027 class MutableTrackParameters;
0028 }
0029
0030
0031 namespace podio::detail {
0032
0033 OrderKey getOrderKey(const edm4eic::TrackSeed& obj);
0034 };
0035
0036 namespace edm4eic {
0037
0038 class MutableTrackSeed;
0039 class TrackSeedCollection;
0040 class TrackSeedCollectionData;
0041
0042
0043
0044
0045
0046 class TrackSeed {
0047
0048 friend class MutableTrackSeed;
0049 friend class TrackSeedCollection;
0050 friend class edm4eic::TrackSeedCollectionData;
0051 friend class TrackSeedCollectionIterator;
0052 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackSeed & obj);
0053
0054 public:
0055 using mutable_type = MutableTrackSeed;
0056 using collection_type = TrackSeedCollection;
0057
0058
0059 TrackSeed() = default;
0060
0061
0062 TrackSeed(const edm4hep::Vector3f& perigee, const float quality);
0063
0064
0065 TrackSeed(const TrackSeed& other) = default;
0066
0067
0068 TrackSeed& operator=(TrackSeed other) &;
0069 TrackSeed& operator=(TrackSeed other) && = delete;
0070
0071
0072
0073 MutableTrackSeed clone(bool cloneRelations=true) const;
0074
0075
0076 ~TrackSeed() = default;
0077
0078
0079 TrackSeed(const MutableTrackSeed& other);
0080
0081 static TrackSeed makeEmpty();
0082
0083 public:
0084
0085 static constexpr std::string_view typeName = "edm4eic::TrackSeed";
0086
0087
0088 const edm4hep::Vector3f& getPerigee() const;
0089
0090
0091 float getQuality() const;
0092
0093
0094
0095 const edm4eic::TrackParameters getParams() const;
0096
0097 std::size_t hits_size() const;
0098 edm4eic::TrackerHit getHits(std::size_t) const;
0099 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
0100 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
0101 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
0102
0103
0104
0105 bool isAvailable() const;
0106
0107 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
0108
0109 bool operator==(const TrackSeed& other) const { return m_obj == other.m_obj; }
0110 bool operator==(const MutableTrackSeed& other) const;
0111
0112 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
0113 bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
0114
0115
0116 bool operator<(const TrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0117
0118 podio::ObjectID id() const { return getObjectID(); }
0119
0120 const podio::ObjectID getObjectID() const;
0121
0122 friend std::hash<TrackSeed>;
0123
0124 friend void swap(TrackSeed& a, TrackSeed& b) {
0125 using std::swap;
0126 swap(a.m_obj, b.m_obj);
0127 }
0128
0129 private:
0130
0131 explicit TrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
0132 TrackSeed(TrackSeedObj* obj);
0133
0134 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
0135 };
0136
0137 std::ostream& operator<<(std::ostream& o, const TrackSeed& value);
0138
0139 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0140 void to_json(nlohmann::json& j, const TrackSeed& value);
0141 #endif
0142
0143
0144 }
0145
0146
0147
0148 template<>
0149 struct std::hash<edm4eic::TrackSeed> {
0150 std::size_t operator()(const edm4eic::TrackSeed& obj) const {
0151 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
0152 }
0153 };
0154
0155
0156
0157
0158
0159 #if defined(__clang__)
0160 #pragma clang diagnostic push
0161 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0162 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0163 #pragma clang diagnostic ignored "-Wdeprecated"
0164 constexpr std::string_view edm4eic::TrackSeed::typeName;
0165 #pragma clang diagnostic pop
0166 #elif defined(__GNUC__)
0167 #pragma GCC diagnostic push
0168 #pragma GCC diagnostic ignored "-Wdeprecated"
0169 constexpr std::string_view edm4eic::TrackSeed::typeName;
0170 #pragma GCC diagnostic pop
0171 #endif
0172
0173
0174 #endif