File indexing completed on 2025-01-18 09:55:38
0001
0002
0003 #ifndef EDM4HEP_MutableTrackerHitPlane_H
0004 #define EDM4HEP_MutableTrackerHitPlane_H
0005
0006 #include "edm4hep/TrackerHitPlaneObj.h"
0007
0008 #include "edm4hep/TrackerHitPlane.h"
0009
0010 #include "edm4hep/ObjectID.h"
0011 #include "edm4hep/Vector2f.h"
0012 #include "edm4hep/Vector3d.h"
0013 #include "podio/RelationRange.h"
0014 #include <array>
0015 #include <cstdint>
0016 #include <vector>
0017
0018 #include "podio/utilities/MaybeSharedPtr.h"
0019
0020 #include <cstdint>
0021
0022 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0023 #include "nlohmann/json_fwd.hpp"
0024 #endif
0025
0026 namespace edm4hep {
0027
0028
0029
0030
0031
0032 class MutableTrackerHitPlane {
0033
0034 friend class TrackerHitPlaneCollection;
0035 friend class TrackerHitPlaneMutableCollectionIterator;
0036 friend class TrackerHitPlane;
0037
0038 public:
0039 using object_type = TrackerHitPlane;
0040 using collection_type = TrackerHitPlaneCollection;
0041
0042
0043 MutableTrackerHitPlane();
0044
0045
0046 MutableTrackerHitPlane(std::uint64_t cellID, std::int32_t type, std::int32_t quality, float time, float eDep,
0047 float eDepError, edm4hep::Vector2f u, edm4hep::Vector2f v, float du, float dv,
0048 edm4hep::Vector3d position, std::array<float, 6> covMatrix);
0049
0050
0051 MutableTrackerHitPlane(const MutableTrackerHitPlane& other) = default;
0052
0053
0054 MutableTrackerHitPlane& operator=(MutableTrackerHitPlane other);
0055
0056
0057
0058 MutableTrackerHitPlane clone(bool cloneRelations = true) const;
0059
0060
0061 ~MutableTrackerHitPlane() = default;
0062
0063 public:
0064
0065 std::uint64_t getCellID() const;
0066
0067
0068
0069 std::int32_t getType() const;
0070
0071
0072 std::int32_t getQuality() const;
0073
0074
0075 float getTime() const;
0076
0077
0078 float getEDep() const;
0079
0080
0081 float getEDepError() const;
0082
0083
0084 const edm4hep::Vector2f& getU() const;
0085
0086
0087 const edm4hep::Vector2f& getV() const;
0088
0089
0090 float getDu() const;
0091
0092
0093 float getDv() const;
0094
0095
0096 const edm4hep::Vector3d& getPosition() const;
0097
0098
0099
0100 const std::array<float, 6>& getCovMatrix() const;
0101
0102
0103 float getCovMatrix(size_t i) const;
0104
0105
0106 void setCellID(std::uint64_t value);
0107
0108 std::uint64_t& getCellID();
0109
0110 [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0111
0112
0113
0114 void setType(std::int32_t value);
0115
0116
0117 std::int32_t& getType();
0118
0119
0120 [[deprecated("use getType instead")]] std::int32_t& type();
0121
0122
0123 void setQuality(std::int32_t value);
0124
0125 std::int32_t& getQuality();
0126
0127 [[deprecated("use getQuality instead")]] std::int32_t& quality();
0128
0129
0130 void setTime(float value);
0131
0132 float& getTime();
0133
0134 [[deprecated("use getTime instead")]] float& time();
0135
0136
0137 void setEDep(float value);
0138
0139 float& getEDep();
0140
0141 [[deprecated("use getEDep instead")]] float& eDep();
0142
0143
0144 void setEDepError(float value);
0145
0146 float& getEDepError();
0147
0148 [[deprecated("use getEDepError instead")]] float& eDepError();
0149
0150
0151 void setU(edm4hep::Vector2f value);
0152
0153 edm4hep::Vector2f& getU();
0154
0155 [[deprecated("use getU instead")]] edm4hep::Vector2f& u();
0156
0157
0158 void setV(edm4hep::Vector2f value);
0159
0160 edm4hep::Vector2f& getV();
0161
0162 [[deprecated("use getV instead")]] edm4hep::Vector2f& v();
0163
0164
0165 void setDu(float value);
0166
0167 float& getDu();
0168
0169 [[deprecated("use getDu instead")]] float& du();
0170
0171
0172 void setDv(float value);
0173
0174 float& getDv();
0175
0176 [[deprecated("use getDv instead")]] float& dv();
0177
0178
0179 void setPosition(edm4hep::Vector3d value);
0180
0181 edm4hep::Vector3d& getPosition();
0182
0183 [[deprecated("use getPosition instead")]] edm4hep::Vector3d& position();
0184
0185
0186
0187 void setCovMatrix(std::array<float, 6> value);
0188 void setCovMatrix(size_t i, float value);
0189
0190
0191 std::array<float, 6>& getCovMatrix();
0192
0193
0194 [[deprecated("use getCovMatrix instead")]] std::array<float, 6>& covMatrix();
0195
0196 void addToRawHits(const edm4hep::ObjectID&);
0197 std::size_t rawHits_size() const;
0198 edm4hep::ObjectID getRawHits(std::size_t) const;
0199 std::vector<edm4hep::ObjectID>::const_iterator rawHits_begin() const;
0200 std::vector<edm4hep::ObjectID>::const_iterator rawHits_end() const;
0201 podio::RelationRange<edm4hep::ObjectID> getRawHits() const;
0202
0203
0204 bool isAvailable() const;
0205
0206 void unlink() {
0207 m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr};
0208 }
0209
0210 bool operator==(const MutableTrackerHitPlane& other) const {
0211 return m_obj == other.m_obj;
0212 }
0213 bool operator==(const TrackerHitPlane& other) const;
0214
0215 bool operator!=(const MutableTrackerHitPlane& other) const {
0216 return !(*this == other);
0217 }
0218 bool operator!=(const TrackerHitPlane& other) const {
0219 return !(*this == other);
0220 }
0221
0222
0223 bool operator<(const MutableTrackerHitPlane& other) const {
0224 return m_obj < other.m_obj;
0225 }
0226
0227 podio::ObjectID id() const {
0228 return getObjectID();
0229 }
0230
0231 const podio::ObjectID getObjectID() const;
0232
0233 friend void swap(MutableTrackerHitPlane& a, MutableTrackerHitPlane& b) {
0234 using std::swap;
0235 swap(a.m_obj, b.m_obj);
0236 }
0237
0238 private:
0239
0240 explicit MutableTrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0241
0242 podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0243 };
0244
0245 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0246 void to_json(nlohmann::json& j, const MutableTrackerHitPlane& value);
0247 #endif
0248
0249 }
0250
0251 #endif