Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-03 08:34:33

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableRingImage_H
0004 #define EDM4EIC_MutableRingImage_H
0005 
0006 #include "edm4eic/RingImageObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
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 // forward declarations
0021 namespace edm4eic {
0022 class RingImageCollection;
0023 }
0024 
0025 
0026 namespace edm4eic {
0027 
0028 
0029 /** @class MutableRingImage
0030  *  EIC Ring Image Cluster
0031  *  @author: S. Joosten, C. Peng
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   /// default constructor
0044   MutableRingImage();
0045 
0046   /// Constructor initializing all members
0047   MutableRingImage(float npe, edm4hep::Vector3f position, edm4hep::Vector3f positionError, float theta, float thetaError, float radius, float radiusError);
0048 
0049   /// copy constructor
0050   MutableRingImage(const MutableRingImage& other) = default;
0051 
0052   /// copy-assignment operator
0053   MutableRingImage& operator=(MutableRingImage other);
0054 
0055   /// create a mutable deep-copy of the object with identical relations
0056   /// if cloneRelations=false, the relations are not cloned and will be empty
0057   MutableRingImage clone(bool cloneRelations=true) const;
0058 
0059   /// destructor
0060   ~MutableRingImage() = default;
0061 
0062 
0063 public:
0064 
0065   /// Access the Number of photo-electrons [#]
0066   float getNpe() const;
0067 
0068   /// Access the Global position of the cluster [mm]
0069   const edm4hep::Vector3f& getPosition() const;
0070 
0071   /// Access the Error on the position
0072   const edm4hep::Vector3f& getPositionError() const;
0073 
0074   /// Access the Opening angle of the ring [rad, 0->pi]
0075   float getTheta() const;
0076 
0077   /// Access the Error on the opening angle
0078   float getThetaError() const;
0079 
0080   /// Access the Radius of the best fit ring [mm]
0081   float getRadius() const;
0082 
0083   /// Access the Estimated error from the fit [mm]
0084   float getRadiusError() const;
0085 
0086 
0087 
0088   /// Set the Number of photo-electrons [#]
0089   void setNpe(float value);
0090   /// Get mutable reference to Number of photo-electrons [#]
0091   float& getNpe();
0092   /// Get reference to Number of photo-electrons [#]
0093   [[deprecated("use getNpe instead")]]
0094   float& npe();
0095 
0096   /// Set the Global position of the cluster [mm]
0097   void setPosition(edm4hep::Vector3f value);
0098   /// Get mutable reference to Global position of the cluster [mm]
0099   edm4hep::Vector3f& getPosition();
0100   /// Get reference to Global position of the cluster [mm]
0101   [[deprecated("use getPosition instead")]]
0102   edm4hep::Vector3f& position();
0103 
0104   /// Set the Error on the position
0105   void setPositionError(edm4hep::Vector3f value);
0106   /// Get mutable reference to Error on the position
0107   edm4hep::Vector3f& getPositionError();
0108   /// Get reference to Error on the position
0109   [[deprecated("use getPositionError instead")]]
0110   edm4hep::Vector3f& positionError();
0111 
0112   /// Set the Opening angle of the ring [rad, 0->pi]
0113   void setTheta(float value);
0114   /// Get mutable reference to Opening angle of the ring [rad, 0->pi]
0115   float& getTheta();
0116   /// Get reference to Opening angle of the ring [rad, 0->pi]
0117   [[deprecated("use getTheta instead")]]
0118   float& theta();
0119 
0120   /// Set the Error on the opening angle
0121   void setThetaError(float value);
0122   /// Get mutable reference to Error on the opening angle
0123   float& getThetaError();
0124   /// Get reference to Error on the opening angle
0125   [[deprecated("use getThetaError instead")]]
0126   float& thetaError();
0127 
0128   /// Set the Radius of the best fit ring [mm]
0129   void setRadius(float value);
0130   /// Get mutable reference to Radius of the best fit ring [mm]
0131   float& getRadius();
0132   /// Get reference to Radius of the best fit ring [mm]
0133   [[deprecated("use getRadius instead")]]
0134   float& radius();
0135 
0136   /// Set the Estimated error from the fit [mm]
0137   void setRadiusError(float value);
0138   /// Get mutable reference to Estimated error from the fit [mm]
0139   float& getRadiusError();
0140   /// Get reference to Estimated error from the fit [mm]
0141   [[deprecated("use getRadiusError instead")]]
0142   float& radiusError();
0143 
0144 
0145 
0146 
0147 
0148 
0149   /// check whether the object is actually available
0150   bool isAvailable() const;
0151   /// disconnect from RingImageObj instance
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   // less comparison operator, so that objects can be e.g. stored in sets.
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); // swap out the internal pointers
0170   }
0171 
0172 private:
0173   /// constructor from existing RingImageObj
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 } // namespace edm4eic
0185 
0186 
0187 #endif