Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-03 08:33:25

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableTrackerHit3D_H
0004 #define EDM4HEP_MutableTrackerHit3D_H
0005 
0006 #include "edm4hep/TrackerHit3DObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/TrackerHit3D.h"
0009 
0010 #include "edm4hep/CovMatrix3f.h"
0011 #include "edm4hep/Vector3d.h"
0012 #include <cstdint>
0013 #include <edm4hep/Constants.h>
0014 
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
0017 #include <cstdint>
0018 
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022 
0023 // forward declarations
0024 namespace edm4hep {
0025 class TrackerHit3DCollection;
0026 class TrackerHit;
0027 } // namespace edm4hep
0028 
0029 namespace edm4hep {
0030 
0031 /** @class MutableTrackerHit3D
0032  *  Tracker hit
0033  *  @author: EDM4hep authors
0034  */
0035 class MutableTrackerHit3D {
0036 
0037   friend class TrackerHit3DCollection;
0038   friend class TrackerHit3DMutableCollectionIterator;
0039   friend class TrackerHit3D;
0040 
0041 public:
0042   using object_type = TrackerHit3D;
0043   using collection_type = TrackerHit3DCollection;
0044 
0045   /// default constructor
0046   MutableTrackerHit3D();
0047 
0048   /// Constructor initializing all members
0049   MutableTrackerHit3D(std::uint64_t cellID, std::int32_t type, std::int32_t quality, float time, float eDep,
0050                       float eDepError, edm4hep::Vector3d position, edm4hep::CovMatrix3f covMatrix);
0051 
0052   /// copy constructor
0053   MutableTrackerHit3D(const MutableTrackerHit3D& other) = default;
0054 
0055   /// copy-assignment operator
0056   MutableTrackerHit3D& operator=(MutableTrackerHit3D other);
0057 
0058   /// create a mutable deep-copy of the object with identical relations
0059   /// if cloneRelations=false, the relations are not cloned and will be empty
0060   MutableTrackerHit3D clone(bool cloneRelations = true) const;
0061 
0062   /// destructor
0063   ~MutableTrackerHit3D() = default;
0064 
0065 public:
0066   /// Access the ID of the sensor that created this hit
0067   std::uint64_t getCellID() const;
0068 
0069   /// Access the type of raw data hit
0070   std::int32_t getType() const;
0071 
0072   /// Access the quality bit flag of the hit
0073   std::int32_t getQuality() const;
0074 
0075   /// Access the time of the hit [ns]
0076   float getTime() const;
0077 
0078   /// Access the energy deposited on the hit [GeV]
0079   float getEDep() const;
0080 
0081   /// Access the error measured on EDep [GeV]
0082   float getEDepError() const;
0083 
0084   /// Access the hit position [mm]
0085   const edm4hep::Vector3d& getPosition() const;
0086 
0087   /// Access the covariance matrix of the position (x,y,z)
0088   const edm4hep::CovMatrix3f& getCovMatrix() const;
0089 
0090   /// Set the ID of the sensor that created this hit
0091   void setCellID(std::uint64_t value);
0092   /// Get mutable reference to ID of the sensor that created this hit
0093   std::uint64_t& getCellID();
0094   /// Get reference to ID of the sensor that created this hit
0095   [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0096 
0097   /// Set the type of raw data hit
0098   void setType(std::int32_t value);
0099   /// Get mutable reference to type of raw data hit
0100   std::int32_t& getType();
0101   /// Get reference to type of raw data hit
0102   [[deprecated("use getType instead")]] std::int32_t& type();
0103 
0104   /// Set the quality bit flag of the hit
0105   void setQuality(std::int32_t value);
0106   /// Get mutable reference to quality bit flag of the hit
0107   std::int32_t& getQuality();
0108   /// Get reference to quality bit flag of the hit
0109   [[deprecated("use getQuality instead")]] std::int32_t& quality();
0110 
0111   /// Set the time of the hit [ns]
0112   void setTime(float value);
0113   /// Get mutable reference to time of the hit [ns]
0114   float& getTime();
0115   /// Get reference to time of the hit [ns]
0116   [[deprecated("use getTime instead")]] float& time();
0117 
0118   /// Set the energy deposited on the hit [GeV]
0119   void setEDep(float value);
0120   /// Get mutable reference to energy deposited on the hit [GeV]
0121   float& getEDep();
0122   /// Get reference to energy deposited on the hit [GeV]
0123   [[deprecated("use getEDep instead")]] float& eDep();
0124 
0125   /// Set the error measured on EDep [GeV]
0126   void setEDepError(float value);
0127   /// Get mutable reference to error measured on EDep [GeV]
0128   float& getEDepError();
0129   /// Get reference to error measured on EDep [GeV]
0130   [[deprecated("use getEDepError instead")]] float& eDepError();
0131 
0132   /// Set the hit position [mm]
0133   void setPosition(edm4hep::Vector3d value);
0134   /// Get mutable reference to hit position [mm]
0135   edm4hep::Vector3d& getPosition();
0136   /// Get reference to hit position [mm]
0137   [[deprecated("use getPosition instead")]] edm4hep::Vector3d& position();
0138 
0139   /// Set the covariance matrix of the position (x,y,z)
0140   void setCovMatrix(edm4hep::CovMatrix3f value);
0141   /// Get mutable reference to covariance matrix of the position (x,y,z)
0142   edm4hep::CovMatrix3f& getCovMatrix();
0143   /// Get reference to covariance matrix of the position (x,y,z)
0144   [[deprecated("use getCovMatrix instead")]] edm4hep::CovMatrix3f& covMatrix();
0145 
0146   /// Get the position covariance matrix value for the two passed dimensions
0147   float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const {
0148     return getCovMatrix().getValue(dimI, dimJ);
0149   }
0150 
0151   /// Set the position covariance matrix value for the two passed dimensions
0152   void setCovMatrix(float value, edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) {
0153     getCovMatrix().setValue(value, dimI, dimJ);
0154   }
0155 
0156   /// check whether the object is actually available
0157   bool isAvailable() const;
0158   /// disconnect from TrackerHit3DObj instance
0159   void unlink() {
0160     m_obj = podio::utils::MaybeSharedPtr<TrackerHit3DObj>{nullptr};
0161   }
0162 
0163   bool operator==(const MutableTrackerHit3D& other) const {
0164     return m_obj == other.m_obj;
0165   }
0166   bool operator==(const TrackerHit3D& other) const;
0167 
0168   bool operator!=(const MutableTrackerHit3D& other) const {
0169     return !(*this == other);
0170   }
0171   bool operator!=(const TrackerHit3D& other) const {
0172     return !(*this == other);
0173   }
0174 
0175   // less comparison operator, so that objects can be e.g. stored in sets.
0176   bool operator<(const MutableTrackerHit3D& other) const {
0177     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0178   }
0179 
0180   podio::ObjectID id() const {
0181     return getObjectID();
0182   }
0183 
0184   const podio::ObjectID getObjectID() const;
0185 
0186   friend void swap(MutableTrackerHit3D& a, MutableTrackerHit3D& b) {
0187     using std::swap;
0188     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0189   }
0190 
0191 private:
0192   /// constructor from existing TrackerHit3DObj
0193   explicit MutableTrackerHit3D(podio::utils::MaybeSharedPtr<TrackerHit3DObj> obj);
0194 
0195   podio::utils::MaybeSharedPtr<TrackerHit3DObj> m_obj{nullptr};
0196 };
0197 
0198 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0199 void to_json(nlohmann::json& j, const MutableTrackerHit3D& value);
0200 #endif
0201 
0202 } // namespace edm4hep
0203 
0204 #endif