File indexing completed on 2025-07-05 08:52:37
0001
0002
0003 #ifndef EDM4HEP_TrackerHitPlane_H
0004 #define EDM4HEP_TrackerHitPlane_H
0005
0006 #include "edm4hep/TrackerHitPlaneObj.h"
0007
0008 #include "edm4hep/CovMatrix3f.h"
0009 #include "edm4hep/Vector2f.h"
0010 #include "edm4hep/Vector3d.h"
0011 #include <cstdint>
0012 #include <edm4hep/Constants.h>
0013
0014 #include "podio/detail/OrderKey.h"
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016
0017 #include <cstdint>
0018 #include <ostream>
0019
0020 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0021 #include "nlohmann/json_fwd.hpp"
0022 #endif
0023
0024
0025 namespace edm4hep {
0026 class TrackerHitPlaneCollection;
0027 class TrackerHit;
0028 }
0029
0030 namespace podio::detail {
0031
0032 OrderKey getOrderKey(const edm4hep::TrackerHitPlane& obj);
0033 };
0034
0035 namespace edm4hep {
0036
0037 class MutableTrackerHitPlane;
0038 class TrackerHitPlaneCollection;
0039 class TrackerHitPlaneCollectionData;
0040
0041
0042
0043
0044
0045 class TrackerHitPlane {
0046
0047 friend class MutableTrackerHitPlane;
0048 friend class TrackerHitPlaneCollection;
0049 friend class edm4hep::TrackerHitPlaneCollectionData;
0050 friend class TrackerHitPlaneCollectionIterator;
0051 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackerHitPlane& obj);
0052
0053 public:
0054 using mutable_type = MutableTrackerHitPlane;
0055 using collection_type = TrackerHitPlaneCollection;
0056
0057
0058 TrackerHitPlane();
0059
0060
0061 TrackerHitPlane(std::uint64_t cellID, std::int32_t type, std::int32_t quality, float time, float eDep,
0062 float eDepError, edm4hep::Vector2f u, edm4hep::Vector2f v, float du, float dv,
0063 edm4hep::Vector3d position, edm4hep::CovMatrix3f covMatrix);
0064
0065
0066 TrackerHitPlane(const TrackerHitPlane& other) = default;
0067
0068
0069 TrackerHitPlane& operator=(TrackerHitPlane other);
0070
0071
0072
0073 MutableTrackerHitPlane clone(bool cloneRelations = true) const;
0074
0075
0076 ~TrackerHitPlane() = default;
0077
0078
0079 TrackerHitPlane(const MutableTrackerHitPlane& other);
0080
0081 static TrackerHitPlane makeEmpty();
0082
0083 public:
0084 static constexpr auto typeName = "edm4hep::TrackerHitPlane";
0085
0086
0087 std::uint64_t getCellID() const;
0088
0089
0090 std::int32_t getType() const;
0091
0092
0093 std::int32_t getQuality() const;
0094
0095
0096 float getTime() const;
0097
0098
0099 float getEDep() const;
0100
0101
0102 float getEDepError() const;
0103
0104
0105 const edm4hep::Vector2f& getU() const;
0106
0107
0108 const edm4hep::Vector2f& getV() const;
0109
0110
0111 float getDu() const;
0112
0113
0114 float getDv() const;
0115
0116
0117 const edm4hep::Vector3d& getPosition() const;
0118
0119
0120 const edm4hep::CovMatrix3f& getCovMatrix() const;
0121
0122
0123 float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const {
0124 return getCovMatrix().getValue(dimI, dimJ);
0125 }
0126
0127
0128 bool isAvailable() const;
0129
0130 void unlink() {
0131 m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr};
0132 }
0133
0134 bool operator==(const TrackerHitPlane& other) const {
0135 return m_obj == other.m_obj;
0136 }
0137 bool operator==(const MutableTrackerHitPlane& other) const;
0138
0139 bool operator!=(const TrackerHitPlane& other) const {
0140 return !(*this == other);
0141 }
0142 bool operator!=(const MutableTrackerHitPlane& other) const {
0143 return !(*this == other);
0144 }
0145
0146
0147 bool operator<(const TrackerHitPlane& other) const {
0148 return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0149 }
0150
0151 podio::ObjectID id() const {
0152 return getObjectID();
0153 }
0154
0155 const podio::ObjectID getObjectID() const;
0156
0157 friend void swap(TrackerHitPlane& a, TrackerHitPlane& b) {
0158 using std::swap;
0159 swap(a.m_obj, b.m_obj);
0160 }
0161
0162 private:
0163
0164 explicit TrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0165 TrackerHitPlane(TrackerHitPlaneObj* obj);
0166
0167 podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0168 };
0169
0170 std::ostream& operator<<(std::ostream& o, const TrackerHitPlane& value);
0171
0172 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0173 void to_json(nlohmann::json& j, const TrackerHitPlane& value);
0174 #endif
0175
0176 }
0177
0178 #endif