Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:10:59

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_TrackerHitPlane_H
0004 #define EDM4HEP_TrackerHitPlane_H
0005 
0006 #include "edm4hep/TrackerHitPlaneObj.h"
0007 
0008 #include "edm4hep/CovMatrix3f.h"
0009 #include "edm4hep/Vector2f.h"
0010 #include "edm4hep/Vector3d.h"
0011 #include <edm4hep/Constants.h>
0012 #include <cstdint>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 #include "podio/detail/OrderKey.h"
0016 
0017 #include <ostream>
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 podio::detail {
0032 // Internal function used in less comparison operators of the datatypes and interface types
0033 OrderKey getOrderKey(const edm4hep::TrackerHitPlane& obj);
0034 };
0035 
0036 namespace edm4hep {
0037 
0038 class MutableTrackerHitPlane;
0039 class TrackerHitPlaneCollection;
0040 class TrackerHitPlaneCollectionData;
0041 
0042 /** @class TrackerHitPlane
0043  *  Tracker hit plane
0044  *  @author: EDM4hep authors
0045  */
0046 class TrackerHitPlane {
0047 
0048   friend class MutableTrackerHitPlane;
0049   friend class TrackerHitPlaneCollection;
0050   friend class edm4hep::TrackerHitPlaneCollectionData;
0051   friend class TrackerHitPlaneCollectionIterator;
0052   friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackerHitPlane & obj);
0053 
0054 public:
0055   using mutable_type = MutableTrackerHitPlane;
0056   using collection_type = TrackerHitPlaneCollection;
0057 
0058   /// default constructor
0059   TrackerHitPlane();
0060 
0061   /// Constructor initializing all members
0062   TrackerHitPlane(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);
0063 
0064   /// copy constructor
0065   TrackerHitPlane(const TrackerHitPlane& other) = default;
0066 
0067   /// copy-assignment operator
0068   TrackerHitPlane& operator=(TrackerHitPlane other) &; // Rebind this to other's internal object
0069   TrackerHitPlane& operator=(TrackerHitPlane other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0070 
0071   /// create a mutable deep-copy of the object with identical relations
0072   /// if cloneRelations=false, the relations are not cloned and will be empty
0073   MutableTrackerHitPlane clone(bool cloneRelations=true) const;
0074 
0075   /// destructor
0076   ~TrackerHitPlane() = default;
0077 
0078   /// converting constructor from mutable object
0079   TrackerHitPlane(const MutableTrackerHitPlane& other);
0080 
0081   static TrackerHitPlane makeEmpty();
0082 
0083 public:
0084 
0085   static constexpr std::string_view typeName = "edm4hep::TrackerHitPlane";
0086 
0087   /// Access the ID of the sensor that created this hit
0088   std::uint64_t getCellID() const;
0089 
0090   /// Access the type of raw data hit
0091   std::int32_t getType() const;
0092 
0093   /// Access the quality bit flag of the hit
0094   std::int32_t getQuality() const;
0095 
0096   /// Access the time of the hit [ns]
0097   float getTime() const;
0098 
0099   /// Access the energy deposited on the hit [GeV]
0100   float getEDep() const;
0101 
0102   /// Access the error measured on EDep [GeV]
0103   float getEDepError() const;
0104 
0105   /// Access the measurement direction vector, u lies in the x-y plane
0106   const edm4hep::Vector2f& getU() const;
0107 
0108   /// Access the measurement direction vector, v is along z
0109   const edm4hep::Vector2f& getV() const;
0110 
0111   /// Access the measurement error along the direction
0112   float getDu() const;
0113 
0114   /// Access the measurement error along the direction
0115   float getDv() const;
0116 
0117   /// Access the hit position [mm]
0118   const edm4hep::Vector3d& getPosition() const;
0119 
0120   /// Access the covariance of the position (x,y,z)
0121   const edm4hep::CovMatrix3f& getCovMatrix() const;
0122 
0123 
0124 
0125 
0126  /// Get the position covariance matrix value for the two passed dimensions
0127  float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const { return getCovMatrix().getValue(dimI, dimJ); }
0128  
0129 
0130   /// check whether the object is actually available
0131   bool isAvailable() const;
0132   /// disconnect from TrackerHitPlaneObj instance
0133   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr}; }
0134 
0135   bool operator==(const TrackerHitPlane& other) const { return m_obj == other.m_obj; }
0136   bool operator==(const MutableTrackerHitPlane& other) const;
0137 
0138   bool operator!=(const TrackerHitPlane& other) const { return !(*this == other); }
0139   bool operator!=(const MutableTrackerHitPlane& other) const { return !(*this == other); }
0140 
0141   // less comparison operator, so that objects can be e.g. stored in sets.
0142   bool operator<(const TrackerHitPlane& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0143 
0144   podio::ObjectID id() const { return getObjectID(); }
0145 
0146   const podio::ObjectID getObjectID() const;
0147 
0148   friend std::hash<TrackerHitPlane>;
0149 
0150   friend void swap(TrackerHitPlane& a, TrackerHitPlane& b) {
0151     using std::swap;
0152     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0153   }
0154 
0155 private:
0156   /// constructor from existing TrackerHitPlaneObj
0157   explicit TrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0158   TrackerHitPlane(TrackerHitPlaneObj* obj);
0159 
0160   podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0161 };
0162 
0163 std::ostream& operator<<(std::ostream& o, const TrackerHitPlane& value);
0164 
0165 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0166 void to_json(nlohmann::json& j, const TrackerHitPlane& value);
0167 #endif
0168 
0169 
0170 } // namespace edm4hep
0171 
0172 
0173 
0174 template<>
0175 struct std::hash<edm4hep::TrackerHitPlane> {
0176   std::size_t operator()(const edm4hep::TrackerHitPlane& obj) const {
0177     return std::hash<edm4hep::TrackerHitPlaneObj*>{}(obj.m_obj.get());
0178   }
0179 };
0180 
0181 
0182 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0183 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0184 // and https://github.com/AIDASoft/podio/issues/770
0185 #if defined(__clang__)
0186 #pragma clang diagnostic push
0187 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0188 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0189 #pragma clang diagnostic ignored "-Wdeprecated"
0190 constexpr std::string_view edm4hep::TrackerHitPlane::typeName;
0191 #pragma clang diagnostic pop
0192 #elif defined(__GNUC__)
0193 #pragma GCC diagnostic push
0194 #pragma GCC diagnostic ignored "-Wdeprecated"
0195 constexpr std::string_view edm4hep::TrackerHitPlane::typeName;
0196 #pragma GCC diagnostic pop
0197 #endif
0198 
0199 #endif