Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:35:25

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