Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:52:37

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 <cstdint>
0012 #include <edm4hep/Constants.h>
0013 
0014 #include "podio/detail/OrderKey.h"
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
0017 #include <cstdint>
0018 #include <ostream>
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 podio::detail {
0031 // Internal function used in less comparison operators of the datatypes and interface types
0032 OrderKey getOrderKey(const edm4hep::TrackerHitPlane& obj);
0033 }; // namespace podio::detail
0034 
0035 namespace edm4hep {
0036 
0037 class MutableTrackerHitPlane;
0038 class TrackerHitPlaneCollection;
0039 class TrackerHitPlaneCollectionData;
0040 
0041 /** @class TrackerHitPlane
0042  *  Tracker hit plane
0043  *  @author: EDM4hep authors
0044  */
0045 class TrackerHitPlane {
0046 
0047   friend class MutableTrackerHitPlane;
0048   friend class TrackerHitPlaneCollection;
0049   friend class edm4hep::TrackerHitPlaneCollectionData;
0050   friend class TrackerHitPlaneCollectionIterator;
0051   friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackerHitPlane& obj);
0052 
0053 public:
0054   using mutable_type = MutableTrackerHitPlane;
0055   using collection_type = TrackerHitPlaneCollection;
0056 
0057   /// default constructor
0058   TrackerHitPlane();
0059 
0060   /// Constructor initializing all members
0061   TrackerHitPlane(std::uint64_t cellID, std::int32_t type, std::int32_t quality, float time, float eDep,
0062                   float eDepError, edm4hep::Vector2f u, edm4hep::Vector2f v, float du, float dv,
0063                   edm4hep::Vector3d position, edm4hep::CovMatrix3f covMatrix);
0064 
0065   /// copy constructor
0066   TrackerHitPlane(const TrackerHitPlane& other) = default;
0067 
0068   /// copy-assignment operator
0069   TrackerHitPlane& operator=(TrackerHitPlane other);
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   static constexpr auto typeName = "edm4hep::TrackerHitPlane";
0085 
0086   /// Access the ID of the sensor that created this hit
0087   std::uint64_t getCellID() const;
0088 
0089   /// Access the type of raw data hit
0090   std::int32_t getType() const;
0091 
0092   /// Access the quality bit flag of the hit
0093   std::int32_t getQuality() const;
0094 
0095   /// Access the time of the hit [ns]
0096   float getTime() const;
0097 
0098   /// Access the energy deposited on the hit [GeV]
0099   float getEDep() const;
0100 
0101   /// Access the error measured on EDep [GeV]
0102   float getEDepError() const;
0103 
0104   /// Access the measurement direction vector, u lies in the x-y plane
0105   const edm4hep::Vector2f& getU() const;
0106 
0107   /// Access the measurement direction vector, v is along z
0108   const edm4hep::Vector2f& getV() const;
0109 
0110   /// Access the measurement error along the direction
0111   float getDu() const;
0112 
0113   /// Access the measurement error along the direction
0114   float getDv() const;
0115 
0116   /// Access the hit position [mm]
0117   const edm4hep::Vector3d& getPosition() const;
0118 
0119   /// Access the covariance of the position (x,y,z)
0120   const edm4hep::CovMatrix3f& getCovMatrix() const;
0121 
0122   /// Get the position covariance matrix value for the two passed dimensions
0123   float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const {
0124     return getCovMatrix().getValue(dimI, dimJ);
0125   }
0126 
0127   /// check whether the object is actually available
0128   bool isAvailable() const;
0129   /// disconnect from TrackerHitPlaneObj instance
0130   void unlink() {
0131     m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr};
0132   }
0133 
0134   bool operator==(const TrackerHitPlane& other) const {
0135     return m_obj == other.m_obj;
0136   }
0137   bool operator==(const MutableTrackerHitPlane& other) const;
0138 
0139   bool operator!=(const TrackerHitPlane& other) const {
0140     return !(*this == other);
0141   }
0142   bool operator!=(const MutableTrackerHitPlane& other) const {
0143     return !(*this == other);
0144   }
0145 
0146   // less comparison operator, so that objects can be e.g. stored in sets.
0147   bool operator<(const TrackerHitPlane& other) const {
0148     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0149   }
0150 
0151   podio::ObjectID id() const {
0152     return getObjectID();
0153   }
0154 
0155   const podio::ObjectID getObjectID() const;
0156 
0157   friend void swap(TrackerHitPlane& a, TrackerHitPlane& b) {
0158     using std::swap;
0159     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0160   }
0161 
0162 private:
0163   /// constructor from existing TrackerHitPlaneObj
0164   explicit TrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0165   TrackerHitPlane(TrackerHitPlaneObj* obj);
0166 
0167   podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0168 };
0169 
0170 std::ostream& operator<<(std::ostream& o, const TrackerHitPlane& value);
0171 
0172 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0173 void to_json(nlohmann::json& j, const TrackerHitPlane& value);
0174 #endif
0175 
0176 } // namespace edm4hep
0177 
0178 #endif