Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:55:12

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableTrackerHitPlane_H
0004 #define EDM4HEP_MutableTrackerHitPlane_H
0005 
0006 #include "edm4hep/TrackerHitPlaneObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/TrackerHitPlane.h"
0009 
0010 #include "edm4hep/CovMatrix3f.h"
0011 #include "edm4hep/Vector2f.h"
0012 #include "edm4hep/Vector3d.h"
0013 #include <edm4hep/Constants.h>
0014 #include <cstdint>
0015 
0016 #include "podio/utilities/MaybeSharedPtr.h"
0017 
0018 #include <cstdint>
0019 
0020 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0021 #include "nlohmann/json_fwd.hpp"
0022 #endif
0023 
0024 // forward declarations
0025 namespace edm4hep {
0026 class TrackerHitPlaneCollection;
0027 class TrackerHit;
0028 }
0029 
0030 
0031 namespace edm4hep {
0032 
0033 
0034 /** @class MutableTrackerHitPlane
0035  *  Tracker hit plane
0036  *  @author: EDM4hep authors
0037  */
0038 class MutableTrackerHitPlane {
0039 
0040   friend class TrackerHitPlaneCollection;
0041   friend class TrackerHitPlaneMutableCollectionIterator;
0042   friend class TrackerHitPlane;
0043 
0044 public:
0045   using object_type = TrackerHitPlane;
0046   using collection_type = TrackerHitPlaneCollection;
0047 
0048   /// default constructor
0049   MutableTrackerHitPlane();
0050 
0051   /// Constructor initializing all members
0052   MutableTrackerHitPlane(const std::uint64_t cellID, const std::int32_t type, const std::int32_t quality, const float time, const float eDep, const float eDepError, const edm4hep::Vector2f& u, const edm4hep::Vector2f& v, const float du, const float dv, const edm4hep::Vector3d& position, const edm4hep::CovMatrix3f& covMatrix);
0053 
0054   /// copy constructor
0055   MutableTrackerHitPlane(const MutableTrackerHitPlane& other) = default;
0056 
0057   /// copy-assignment operator
0058   MutableTrackerHitPlane& operator=(MutableTrackerHitPlane other) &; // Rebind this to other's internal object
0059   MutableTrackerHitPlane& operator=(MutableTrackerHitPlane other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0060 
0061   /// create a mutable deep-copy of the object with identical relations
0062   /// if cloneRelations=false, the relations are not cloned and will be empty
0063   MutableTrackerHitPlane clone(bool cloneRelations=true) const;
0064 
0065   /// destructor
0066   ~MutableTrackerHitPlane() = default;
0067 
0068 
0069 public:
0070 
0071   /// Access the ID of the sensor that created this hit
0072   std::uint64_t getCellID() const;
0073 
0074   /// Access the type of raw data hit
0075   std::int32_t getType() const;
0076 
0077   /// Access the quality bit flag of the hit
0078   std::int32_t getQuality() const;
0079 
0080   /// Access the time of the hit [ns]
0081   float getTime() const;
0082 
0083   /// Access the energy deposited on the hit [GeV]
0084   float getEDep() const;
0085 
0086   /// Access the error measured on EDep [GeV]
0087   float getEDepError() const;
0088 
0089   /// Access the measurement direction vector, u lies in the x-y plane
0090   const edm4hep::Vector2f& getU() const;
0091 
0092   /// Access the measurement direction vector, v is along z
0093   const edm4hep::Vector2f& getV() const;
0094 
0095   /// Access the measurement error along the direction
0096   float getDu() const;
0097 
0098   /// Access the measurement error along the direction
0099   float getDv() const;
0100 
0101   /// Access the hit position [mm]
0102   const edm4hep::Vector3d& getPosition() const;
0103 
0104   /// Access the covariance of the position (x,y,z)
0105   const edm4hep::CovMatrix3f& getCovMatrix() const;
0106 
0107 
0108 
0109   /// Set the ID of the sensor that created this hit
0110   void setCellID(const std::uint64_t cellID);
0111   /// Get mutable reference to ID of the sensor that created this hit
0112   std::uint64_t& getCellID();
0113   /// Get reference to ID of the sensor that created this hit
0114   [[deprecated("use getCellID instead")]]
0115   std::uint64_t& cellID();
0116 
0117   /// Set the type of raw data hit
0118   void setType(const std::int32_t type);
0119   /// Get mutable reference to type of raw data hit
0120   std::int32_t& getType();
0121   /// Get reference to type of raw data hit
0122   [[deprecated("use getType instead")]]
0123   std::int32_t& type();
0124 
0125   /// Set the quality bit flag of the hit
0126   void setQuality(const std::int32_t quality);
0127   /// Get mutable reference to quality bit flag of the hit
0128   std::int32_t& getQuality();
0129   /// Get reference to quality bit flag of the hit
0130   [[deprecated("use getQuality instead")]]
0131   std::int32_t& quality();
0132 
0133   /// Set the time of the hit [ns]
0134   void setTime(const float time);
0135   /// Get mutable reference to time of the hit [ns]
0136   float& getTime();
0137   /// Get reference to time of the hit [ns]
0138   [[deprecated("use getTime instead")]]
0139   float& time();
0140 
0141   /// Set the energy deposited on the hit [GeV]
0142   void setEDep(const float eDep);
0143   /// Get mutable reference to energy deposited on the hit [GeV]
0144   float& getEDep();
0145   /// Get reference to energy deposited on the hit [GeV]
0146   [[deprecated("use getEDep instead")]]
0147   float& eDep();
0148 
0149   /// Set the error measured on EDep [GeV]
0150   void setEDepError(const float eDepError);
0151   /// Get mutable reference to error measured on EDep [GeV]
0152   float& getEDepError();
0153   /// Get reference to error measured on EDep [GeV]
0154   [[deprecated("use getEDepError instead")]]
0155   float& eDepError();
0156 
0157   /// Set the measurement direction vector, u lies in the x-y plane
0158   void setU(const edm4hep::Vector2f& u);
0159   /// Get mutable reference to measurement direction vector, u lies in the x-y plane
0160   edm4hep::Vector2f& getU();
0161   /// Get reference to measurement direction vector, u lies in the x-y plane
0162   [[deprecated("use getU instead")]]
0163   edm4hep::Vector2f& u();
0164 
0165   /// Set the measurement direction vector, v is along z
0166   void setV(const edm4hep::Vector2f& v);
0167   /// Get mutable reference to measurement direction vector, v is along z
0168   edm4hep::Vector2f& getV();
0169   /// Get reference to measurement direction vector, v is along z
0170   [[deprecated("use getV instead")]]
0171   edm4hep::Vector2f& v();
0172 
0173   /// Set the measurement error along the direction
0174   void setDu(const float du);
0175   /// Get mutable reference to measurement error along the direction
0176   float& getDu();
0177   /// Get reference to measurement error along the direction
0178   [[deprecated("use getDu instead")]]
0179   float& du();
0180 
0181   /// Set the measurement error along the direction
0182   void setDv(const float dv);
0183   /// Get mutable reference to measurement error along the direction
0184   float& getDv();
0185   /// Get reference to measurement error along the direction
0186   [[deprecated("use getDv instead")]]
0187   float& dv();
0188 
0189   /// Set the hit position [mm]
0190   void setPosition(const edm4hep::Vector3d& position);
0191   /// Get mutable reference to hit position [mm]
0192   edm4hep::Vector3d& getPosition();
0193   /// Get reference to hit position [mm]
0194   [[deprecated("use getPosition instead")]]
0195   edm4hep::Vector3d& position();
0196 
0197   /// Set the covariance of the position (x,y,z)
0198   void setCovMatrix(const edm4hep::CovMatrix3f& covMatrix);
0199   /// Get mutable reference to covariance of the position (x,y,z)
0200   edm4hep::CovMatrix3f& getCovMatrix();
0201   /// Get reference to covariance of the position (x,y,z)
0202   [[deprecated("use getCovMatrix instead")]]
0203   edm4hep::CovMatrix3f& covMatrix();
0204 
0205 
0206 
0207 
0208  /// Get the position covariance matrix value for the two passed dimensions
0209  float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const { return getCovMatrix().getValue(dimI, dimJ); }
0210  
0211 
0212  /// Set the position covariance matrix value for the two passed dimensions
0213  void setCovMatrix(float value, edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) { getCovMatrix().setValue(value, dimI, dimJ); }
0214  
0215 
0216   /// check whether the object is actually available
0217   bool isAvailable() const;
0218   /// disconnect from TrackerHitPlaneObj instance
0219   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr}; }
0220 
0221   bool operator==(const MutableTrackerHitPlane& other) const { return m_obj == other.m_obj; }
0222   bool operator==(const TrackerHitPlane& other) const;
0223 
0224   bool operator!=(const MutableTrackerHitPlane& other) const { return !(*this == other); }
0225   bool operator!=(const TrackerHitPlane& other) const { return !(*this == other); }
0226 
0227   // less comparison operator, so that objects can be e.g. stored in sets.
0228   bool operator<(const MutableTrackerHitPlane& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0229 
0230   podio::ObjectID id() const { return getObjectID(); }
0231 
0232   const podio::ObjectID getObjectID() const;
0233 
0234   friend std::hash<MutableTrackerHitPlane>;
0235 
0236   friend void swap(MutableTrackerHitPlane& a, MutableTrackerHitPlane& b) {
0237     using std::swap;
0238     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0239   }
0240 
0241 private:
0242   /// constructor from existing TrackerHitPlaneObj
0243   explicit MutableTrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0244 
0245   podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0246 };
0247 
0248 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0249 void to_json(nlohmann::json& j, const MutableTrackerHitPlane& value);
0250 #endif
0251 
0252 
0253 } // namespace edm4hep
0254 
0255 
0256 
0257 template<>
0258 struct std::hash<edm4hep::MutableTrackerHitPlane> {
0259   std::size_t operator()(const edm4hep::MutableTrackerHitPlane& obj) const {
0260     return std::hash<edm4hep::TrackerHitPlaneObj*>{}(obj.m_obj.get());
0261   }
0262 };
0263 
0264 
0265 #endif