Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:31

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