Back to home page

EIC code displayed by LXR

 
 

    


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