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