Back to home page

EIC code displayed by LXR

 
 

    


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 // 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(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   /// copy constructor
0050   MutableRingImage(const MutableRingImage& other) = default;
0051 
0052   /// copy-assignment operator
0053   MutableRingImage& operator=(MutableRingImage other) &; // Rebind this to other's internal object
0054   MutableRingImage& operator=(MutableRingImage other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0055 
0056   /// create a mutable deep-copy of the object with identical relations
0057   /// if cloneRelations=false, the relations are not cloned and will be empty
0058   MutableRingImage clone(bool cloneRelations=true) const;
0059 
0060   /// destructor
0061   ~MutableRingImage() = default;
0062 
0063 
0064 public:
0065 
0066   /// Access the Number of photo-electrons [#]
0067   float getNpe() const;
0068 
0069   /// Access the Global position of the cluster [mm]
0070   const edm4hep::Vector3f& getPosition() const;
0071 
0072   /// Access the Error on the position
0073   const edm4hep::Vector3f& getPositionError() const;
0074 
0075   /// Access the Opening angle of the ring [rad, 0->pi]
0076   float getTheta() const;
0077 
0078   /// Access the Error on the opening angle
0079   float getThetaError() const;
0080 
0081   /// Access the Radius of the best fit ring [mm]
0082   float getRadius() const;
0083 
0084   /// Access the Estimated error from the fit [mm]
0085   float getRadiusError() const;
0086 
0087 
0088 
0089   /// Set the Number of photo-electrons [#]
0090   void setNpe(const float npe);
0091   /// Get mutable reference to Number of photo-electrons [#]
0092   float& getNpe();
0093   /// Get reference to Number of photo-electrons [#]
0094   [[deprecated("use getNpe instead")]]
0095   float& npe();
0096 
0097   /// Set the Global position of the cluster [mm]
0098   void setPosition(const edm4hep::Vector3f& position);
0099   /// Get mutable reference to Global position of the cluster [mm]
0100   edm4hep::Vector3f& getPosition();
0101   /// Get reference to Global position of the cluster [mm]
0102   [[deprecated("use getPosition instead")]]
0103   edm4hep::Vector3f& position();
0104 
0105   /// Set the Error on the position
0106   void setPositionError(const edm4hep::Vector3f& positionError);
0107   /// Get mutable reference to Error on the position
0108   edm4hep::Vector3f& getPositionError();
0109   /// Get reference to Error on the position
0110   [[deprecated("use getPositionError instead")]]
0111   edm4hep::Vector3f& positionError();
0112 
0113   /// Set the Opening angle of the ring [rad, 0->pi]
0114   void setTheta(const float theta);
0115   /// Get mutable reference to Opening angle of the ring [rad, 0->pi]
0116   float& getTheta();
0117   /// Get reference to Opening angle of the ring [rad, 0->pi]
0118   [[deprecated("use getTheta instead")]]
0119   float& theta();
0120 
0121   /// Set the Error on the opening angle
0122   void setThetaError(const float thetaError);
0123   /// Get mutable reference to Error on the opening angle
0124   float& getThetaError();
0125   /// Get reference to Error on the opening angle
0126   [[deprecated("use getThetaError instead")]]
0127   float& thetaError();
0128 
0129   /// Set the Radius of the best fit ring [mm]
0130   void setRadius(const float radius);
0131   /// Get mutable reference to Radius of the best fit ring [mm]
0132   float& getRadius();
0133   /// Get reference to Radius of the best fit ring [mm]
0134   [[deprecated("use getRadius instead")]]
0135   float& radius();
0136 
0137   /// Set the Estimated error from the fit [mm]
0138   void setRadiusError(const float radiusError);
0139   /// Get mutable reference to Estimated error from the fit [mm]
0140   float& getRadiusError();
0141   /// Get reference to Estimated error from the fit [mm]
0142   [[deprecated("use getRadiusError instead")]]
0143   float& radiusError();
0144 
0145 
0146 
0147 
0148 
0149 
0150   /// check whether the object is actually available
0151   bool isAvailable() const;
0152   /// disconnect from RingImageObj instance
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   // less comparison operator, so that objects can be e.g. stored in sets.
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); // swap out the internal pointers
0173   }
0174 
0175 private:
0176   /// constructor from existing RingImageObj
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 } // namespace edm4eic
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