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