Warning, file /include/edm4hep/TrackerHit3D.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003 #ifndef EDM4HEP_TrackerHit3D_H
0004 #define EDM4HEP_TrackerHit3D_H
0005
0006 #include "edm4hep/TrackerHit3DObj.h"
0007
0008 #include "edm4hep/CovMatrix3f.h"
0009 #include "edm4hep/Vector3d.h"
0010 #include <cstdint>
0011 #include <edm4hep/Constants.h>
0012
0013 #include "podio/detail/OrderKey.h"
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015
0016 #include <cstdint>
0017 #include <ostream>
0018
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022
0023
0024 namespace edm4hep {
0025 class TrackerHit3DCollection;
0026 class TrackerHit;
0027 }
0028
0029 namespace podio::detail {
0030
0031 OrderKey getOrderKey(const edm4hep::TrackerHit3D& obj);
0032 };
0033
0034 namespace edm4hep {
0035
0036 class MutableTrackerHit3D;
0037 class TrackerHit3DCollection;
0038 class TrackerHit3DCollectionData;
0039
0040
0041
0042
0043
0044 class TrackerHit3D {
0045
0046 friend class MutableTrackerHit3D;
0047 friend class TrackerHit3DCollection;
0048 friend class edm4hep::TrackerHit3DCollectionData;
0049 friend class TrackerHit3DCollectionIterator;
0050 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackerHit3D& obj);
0051
0052 public:
0053 using mutable_type = MutableTrackerHit3D;
0054 using collection_type = TrackerHit3DCollection;
0055
0056
0057 TrackerHit3D() = default;
0058
0059
0060 TrackerHit3D(const std::uint64_t cellID, const std::int32_t type, const std::int32_t quality, const float time,
0061 const float eDep, const float eDepError, const edm4hep::Vector3d& position,
0062 const edm4hep::CovMatrix3f& covMatrix);
0063
0064
0065 TrackerHit3D(const TrackerHit3D& other) = default;
0066
0067
0068 TrackerHit3D& operator=(TrackerHit3D other) &;
0069 TrackerHit3D&
0070 operator=(TrackerHit3D other) && = delete;
0071
0072
0073
0074 MutableTrackerHit3D clone(bool cloneRelations = true) const;
0075
0076
0077 ~TrackerHit3D() = default;
0078
0079
0080 TrackerHit3D(const MutableTrackerHit3D& other);
0081
0082 static TrackerHit3D makeEmpty();
0083
0084 public:
0085 static constexpr std::string_view typeName = "edm4hep::TrackerHit3D";
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
0109 const edm4hep::CovMatrix3f& getCovMatrix() const;
0110
0111
0112 float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const {
0113 return getCovMatrix().getValue(dimI, dimJ);
0114 }
0115
0116
0117 bool isAvailable() const;
0118
0119 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHit3DObj>{nullptr}; }
0120
0121 bool operator==(const TrackerHit3D& other) const { return m_obj == other.m_obj; }
0122 bool operator==(const MutableTrackerHit3D& other) const;
0123
0124 bool operator!=(const TrackerHit3D& other) const { return !(*this == other); }
0125 bool operator!=(const MutableTrackerHit3D& other) const { return !(*this == other); }
0126
0127
0128 bool operator<(const TrackerHit3D& other) const {
0129 return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0130 }
0131
0132 podio::ObjectID id() const { return getObjectID(); }
0133
0134 const podio::ObjectID getObjectID() const;
0135
0136 friend std::hash<TrackerHit3D>;
0137
0138 friend void swap(TrackerHit3D& a, TrackerHit3D& b) {
0139 using std::swap;
0140 swap(a.m_obj, b.m_obj);
0141 }
0142
0143 private:
0144
0145 explicit TrackerHit3D(podio::utils::MaybeSharedPtr<TrackerHit3DObj> obj);
0146 TrackerHit3D(TrackerHit3DObj* obj);
0147
0148 podio::utils::MaybeSharedPtr<TrackerHit3DObj> m_obj{new TrackerHit3DObj{}, podio::utils::MarkOwned};
0149 };
0150
0151 std::ostream& operator<<(std::ostream& o, const TrackerHit3D& value);
0152
0153 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0154 void to_json(nlohmann::json& j, const TrackerHit3D& value);
0155 #endif
0156
0157 }
0158
0159 template <>
0160 struct std::hash<edm4hep::TrackerHit3D> {
0161 std::size_t operator()(const edm4hep::TrackerHit3D& obj) const {
0162 return std::hash<edm4hep::TrackerHit3DObj*>{}(obj.m_obj.get());
0163 }
0164 };
0165
0166
0167
0168
0169 #if defined(__clang__)
0170 #pragma clang diagnostic push
0171 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0172 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0173 #pragma clang diagnostic ignored "-Wdeprecated"
0174 constexpr std::string_view edm4hep::TrackerHit3D::typeName;
0175 #pragma clang diagnostic pop
0176 #elif defined(__GNUC__)
0177 #pragma GCC diagnostic push
0178 #pragma GCC diagnostic ignored "-Wdeprecated"
0179 constexpr std::string_view edm4hep::TrackerHit3D::typeName;
0180 #pragma GCC diagnostic pop
0181 #endif
0182
0183 #endif