File indexing completed on 2025-07-03 08:34:33
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(float npe, edm4hep::Vector3f position, edm4hep::Vector3f positionError, float theta, float thetaError, float radius, float radiusError);
0048
0049
0050 MutableRingImage(const MutableRingImage& other) = default;
0051
0052
0053 MutableRingImage& operator=(MutableRingImage other);
0054
0055
0056
0057 MutableRingImage clone(bool cloneRelations=true) const;
0058
0059
0060 ~MutableRingImage() = default;
0061
0062
0063 public:
0064
0065
0066 float getNpe() const;
0067
0068
0069 const edm4hep::Vector3f& getPosition() const;
0070
0071
0072 const edm4hep::Vector3f& getPositionError() const;
0073
0074
0075 float getTheta() const;
0076
0077
0078 float getThetaError() const;
0079
0080
0081 float getRadius() const;
0082
0083
0084 float getRadiusError() const;
0085
0086
0087
0088
0089 void setNpe(float value);
0090
0091 float& getNpe();
0092
0093 [[deprecated("use getNpe instead")]]
0094 float& npe();
0095
0096
0097 void setPosition(edm4hep::Vector3f value);
0098
0099 edm4hep::Vector3f& getPosition();
0100
0101 [[deprecated("use getPosition instead")]]
0102 edm4hep::Vector3f& position();
0103
0104
0105 void setPositionError(edm4hep::Vector3f value);
0106
0107 edm4hep::Vector3f& getPositionError();
0108
0109 [[deprecated("use getPositionError instead")]]
0110 edm4hep::Vector3f& positionError();
0111
0112
0113 void setTheta(float value);
0114
0115 float& getTheta();
0116
0117 [[deprecated("use getTheta instead")]]
0118 float& theta();
0119
0120
0121 void setThetaError(float value);
0122
0123 float& getThetaError();
0124
0125 [[deprecated("use getThetaError instead")]]
0126 float& thetaError();
0127
0128
0129 void setRadius(float value);
0130
0131 float& getRadius();
0132
0133 [[deprecated("use getRadius instead")]]
0134 float& radius();
0135
0136
0137 void setRadiusError(float value);
0138
0139 float& getRadiusError();
0140
0141 [[deprecated("use getRadiusError instead")]]
0142 float& radiusError();
0143
0144
0145
0146
0147
0148
0149
0150 bool isAvailable() const;
0151
0152 void unlink() { m_obj = podio::utils::MaybeSharedPtr<RingImageObj>{nullptr}; }
0153
0154 bool operator==(const MutableRingImage& other) const { return m_obj == other.m_obj; }
0155 bool operator==(const RingImage& other) const;
0156
0157 bool operator!=(const MutableRingImage& other) const { return !(*this == other); }
0158 bool operator!=(const RingImage& other) const { return !(*this == other); }
0159
0160
0161 bool operator<(const MutableRingImage& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0162
0163 podio::ObjectID id() const { return getObjectID(); }
0164
0165 const podio::ObjectID getObjectID() const;
0166
0167 friend void swap(MutableRingImage& a, MutableRingImage& b) {
0168 using std::swap;
0169 swap(a.m_obj, b.m_obj);
0170 }
0171
0172 private:
0173
0174 explicit MutableRingImage(podio::utils::MaybeSharedPtr<RingImageObj> obj);
0175
0176 podio::utils::MaybeSharedPtr<RingImageObj> m_obj{nullptr};
0177 };
0178
0179 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0180 void to_json(nlohmann::json& j, const MutableRingImage& value);
0181 #endif
0182
0183
0184 }
0185
0186
0187 #endif