File indexing completed on 2026-06-04 08:12:05
0001
0002
0003 #ifndef ACTSPODIOEDM_TrackerHitLocal_H
0004 #define ACTSPODIOEDM_TrackerHitLocal_H
0005
0006 #include "ActsPodioEdm/TrackerHitLocalObj.h"
0007
0008 #include <cstdint>
0009 #include <ostream>
0010 #include <vector>
0011
0012 #include "edm4hep/Vector3d.h"
0013 #include "podio/RelationRange.h"
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 TrackerHitLocalCollection;
0024 }
0025
0026 namespace podio::detail {
0027
0028
0029 OrderKey getOrderKey(const ActsPodioEdm::TrackerHitLocal& obj);
0030 };
0031
0032 namespace ActsPodioEdm {
0033
0034 class MutableTrackerHitLocal;
0035 class TrackerHitLocalCollection;
0036 class TrackerHitLocalCollectionData;
0037
0038
0039
0040
0041
0042 class TrackerHitLocal {
0043 friend class MutableTrackerHitLocal;
0044 friend class TrackerHitLocalCollection;
0045 friend class ActsPodioEdm::TrackerHitLocalCollectionData;
0046 friend class TrackerHitLocalCollectionIterator;
0047 friend podio::detail::OrderKey podio::detail::getOrderKey(
0048 const TrackerHitLocal& obj);
0049
0050 public:
0051 using mutable_type = MutableTrackerHitLocal;
0052 using collection_type = TrackerHitLocalCollection;
0053
0054
0055 TrackerHitLocal() = default;
0056
0057
0058 TrackerHitLocal(const std::uint64_t cellID, const std::int32_t type,
0059 const std::int32_t quality, const float time,
0060 const float eDep, const float eDepError,
0061 const edm4hep::Vector3d& position);
0062
0063
0064 TrackerHitLocal(const TrackerHitLocal& other) = default;
0065
0066
0067 TrackerHitLocal& operator=(
0068 TrackerHitLocal other) &;
0069 TrackerHitLocal& operator=(TrackerHitLocal other) && =
0070 delete;
0071
0072
0073
0074 MutableTrackerHitLocal clone(bool cloneRelations = true) const;
0075
0076
0077 ~TrackerHitLocal() = default;
0078
0079
0080 TrackerHitLocal(const MutableTrackerHitLocal& other);
0081
0082 static TrackerHitLocal makeEmpty();
0083
0084 public:
0085 static constexpr std::string_view typeName = "ActsPodioEdm::TrackerHitLocal";
0086
0087
0088 std::uint64_t getCellID() const;
0089
0090
0091 std::int32_t getType() const;
0092
0093
0094 std::int32_t getQuality() const;
0095
0096
0097 float getTime() const;
0098
0099
0100 float getEDep() const;
0101
0102
0103 float getEDepError() const;
0104
0105
0106 const edm4hep::Vector3d& getPosition() const;
0107
0108 std::size_t measurement_size() const;
0109 float getMeasurement(std::size_t) const;
0110 std::vector<float>::const_iterator measurement_begin() const;
0111 std::vector<float>::const_iterator measurement_end() const;
0112 podio::RelationRange<float> getMeasurement() const;
0113 std::size_t covariance_size() const;
0114 float getCovariance(std::size_t) const;
0115 std::vector<float>::const_iterator covariance_begin() const;
0116 std::vector<float>::const_iterator covariance_end() const;
0117 podio::RelationRange<float> getCovariance() const;
0118
0119
0120 bool isAvailable() const;
0121
0122 void unlink() {
0123 m_obj = podio::utils::MaybeSharedPtr<TrackerHitLocalObj>{nullptr};
0124 }
0125
0126 bool operator==(const TrackerHitLocal& other) const {
0127 return m_obj == other.m_obj;
0128 }
0129 bool operator==(const MutableTrackerHitLocal& other) const;
0130
0131 bool operator!=(const TrackerHitLocal& other) const {
0132 return !(*this == other);
0133 }
0134 bool operator!=(const MutableTrackerHitLocal& other) const {
0135 return !(*this == other);
0136 }
0137
0138
0139 bool operator<(const TrackerHitLocal& other) const {
0140 return podio::detail::getOrderKey(*this) <
0141 podio::detail::getOrderKey(other);
0142 }
0143
0144 podio::ObjectID id() const { return getObjectID(); }
0145
0146 const podio::ObjectID getObjectID() const;
0147
0148 friend std::hash<TrackerHitLocal>;
0149
0150 friend void swap(TrackerHitLocal& a, TrackerHitLocal& b) {
0151 using std::swap;
0152 swap(a.m_obj, b.m_obj);
0153 }
0154
0155 private:
0156
0157 explicit TrackerHitLocal(
0158 podio::utils::MaybeSharedPtr<TrackerHitLocalObj> obj);
0159 TrackerHitLocal(TrackerHitLocalObj* obj);
0160
0161 podio::utils::MaybeSharedPtr<TrackerHitLocalObj> m_obj{
0162 new TrackerHitLocalObj{}, podio::utils::MarkOwned};
0163 };
0164
0165 std::ostream& operator<<(std::ostream& o, const TrackerHitLocal& value);
0166
0167 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0168 void to_json(nlohmann::json& j, const TrackerHitLocal& value);
0169 #endif
0170
0171 }
0172
0173 template <>
0174 struct std::hash<ActsPodioEdm::TrackerHitLocal> {
0175 std::size_t operator()(const ActsPodioEdm::TrackerHitLocal& obj) const {
0176 return std::hash<ActsPodioEdm::TrackerHitLocalObj*>{}(obj.m_obj.get());
0177 }
0178 };
0179
0180
0181
0182
0183
0184 #if defined(__clang__)
0185 #pragma clang diagnostic push
0186 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0187 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0188 #pragma clang diagnostic ignored "-Wdeprecated"
0189 constexpr std::string_view ActsPodioEdm::TrackerHitLocal::typeName;
0190 #pragma clang diagnostic pop
0191 #elif defined(__GNUC__)
0192 #pragma GCC diagnostic push
0193 #pragma GCC diagnostic ignored "-Wdeprecated"
0194 constexpr std::string_view ActsPodioEdm::TrackerHitLocal::typeName;
0195 #pragma GCC diagnostic pop
0196 #endif
0197
0198 #endif