Warning, file /include/edm4eic/MutableRingImage.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 EDM4EIC_MutableRingImage_H
0004 #define EDM4EIC_MutableRingImage_H
0005
0006 #include "edm4eic/RingImageObj.h"
0007
0008 #include "edm4eic/RingImage.h"
0009
0010 #include "edm4hep/Vector3f.h"
0011
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013
0014 #include <cstdint>
0015
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019
0020
0021 namespace edm4eic {
0022 class RingImageCollection;
0023 }
0024
0025
0026 namespace edm4eic {
0027
0028
0029
0030
0031
0032
0033 class MutableRingImage {
0034
0035 friend class RingImageCollection;
0036 friend class RingImageMutableCollectionIterator;
0037 friend class RingImage;
0038
0039 public:
0040 using object_type = RingImage;
0041 using collection_type = RingImageCollection;
0042
0043
0044 MutableRingImage();
0045
0046
0047 MutableRingImage(const float npe, const edm4hep::Vector3f& position, const edm4hep::Vector3f& positionError, const float theta, const float thetaError, const float radius, const float radiusError);
0048
0049
0050 MutableRingImage(const MutableRingImage& other) = default;
0051
0052
0053 MutableRingImage& operator=(MutableRingImage other) &;
0054 MutableRingImage& operator=(MutableRingImage other) && = delete;
0055
0056
0057
0058 MutableRingImage clone(bool cloneRelations=true) const;
0059
0060
0061 ~MutableRingImage() = default;
0062
0063
0064 public:
0065
0066
0067 float getNpe() const;
0068
0069
0070 const edm4hep::Vector3f& getPosition() const;
0071
0072
0073 const edm4hep::Vector3f& getPositionError() const;
0074
0075
0076 float getTheta() const;
0077
0078
0079 float getThetaError() const;
0080
0081
0082 float getRadius() const;
0083
0084
0085 float getRadiusError() const;
0086
0087
0088
0089
0090 void setNpe(const float npe);
0091
0092 float& getNpe();
0093
0094 [[deprecated("use getNpe instead")]]
0095 float& npe();
0096
0097
0098 void setPosition(const edm4hep::Vector3f& position);
0099
0100 edm4hep::Vector3f& getPosition();
0101
0102 [[deprecated("use getPosition instead")]]
0103 edm4hep::Vector3f& position();
0104
0105
0106 void setPositionError(const edm4hep::Vector3f& positionError);
0107
0108 edm4hep::Vector3f& getPositionError();
0109
0110 [[deprecated("use getPositionError instead")]]
0111 edm4hep::Vector3f& positionError();
0112
0113
0114 void setTheta(const float theta);
0115
0116 float& getTheta();
0117
0118 [[deprecated("use getTheta instead")]]
0119 float& theta();
0120
0121
0122 void setThetaError(const float thetaError);
0123
0124 float& getThetaError();
0125
0126 [[deprecated("use getThetaError instead")]]
0127 float& thetaError();
0128
0129
0130 void setRadius(const float radius);
0131
0132 float& getRadius();
0133
0134 [[deprecated("use getRadius instead")]]
0135 float& radius();
0136
0137
0138 void setRadiusError(const float radiusError);
0139
0140 float& getRadiusError();
0141
0142 [[deprecated("use getRadiusError instead")]]
0143 float& radiusError();
0144
0145
0146
0147
0148
0149
0150
0151 bool isAvailable() const;
0152
0153 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
0154
0155 bool operator==(const MutableRingImage& other) const { return m_obj == other.m_obj; }
0156 bool operator==(const RingImage& other) const;
0157
0158 bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
0159 bool operator!=(const RingImage& other) const { return !(*this == other); }
0160
0161
0162 bool operator<(const MutableRingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0163
0164 podio::ObjectID id() const { return getObjectID(); }
0165
0166 const podio::ObjectID getObjectID() const;
0167
0168 friend std::hash<MutableRingImage>;
0169
0170 friend void swap(MutableRingImage& a, MutableRingImage& b) {
0171 using std::swap;
0172 swap(a.m_obj, b.m_obj);
0173 }
0174
0175 private:
0176
0177 explicit MutableRingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
0178
0179 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{nullptr};
0180 };
0181
0182 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0183 void to_json(nlohmann::json& j, const MutableRingImage& value);
0184 #endif
0185
0186
0187 }
0188
0189
0190
0191 template<>
0192 struct std::hash<edm4eic::MutableRingImage> {
0193 std::size_t operator()(const edm4eic::MutableRingImage& obj) const {
0194 return std::hash<edm4eic::RingImageObj*>{}(obj.m_obj.get());
0195 }
0196 };
0197
0198
0199 #endif