Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4hep/TrackerHit3D.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_TrackerHit3D_H
0004 #define EDM4HEP_TrackerHit3D_H
0005 
0006 #include "edm4hep/TrackerHit3DObj.h"
0007 
0008 #include "edm4hep/CovMatrix3f.h"
0009 #include "edm4hep/Vector3d.h"
0010 #include <cstdint>
0011 #include <edm4hep/Constants.h>
0012 
0013 #include "podio/detail/OrderKey.h"
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #include <cstdint>
0017 #include <ostream>
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 podio::detail {
0030 // Internal function used in less comparison operators of the datatypes and interface types
0031 OrderKey getOrderKey(const edm4hep::TrackerHit3D& obj);
0032 }; // namespace podio::detail
0033 
0034 namespace edm4hep {
0035 
0036 class MutableTrackerHit3D;
0037 class TrackerHit3DCollection;
0038 class TrackerHit3DCollectionData;
0039 
0040 /** @class TrackerHit3D
0041  *  Tracker hit
0042  *  @author: EDM4hep authors
0043  */
0044 class TrackerHit3D {
0045 
0046   friend class MutableTrackerHit3D;
0047   friend class TrackerHit3DCollection;
0048   friend class edm4hep::TrackerHit3DCollectionData;
0049   friend class TrackerHit3DCollectionIterator;
0050   friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackerHit3D& obj);
0051 
0052 public:
0053   using mutable_type = MutableTrackerHit3D;
0054   using collection_type = TrackerHit3DCollection;
0055 
0056   /// default constructor
0057   TrackerHit3D() = default;
0058 
0059   /// Constructor initializing all members
0060   TrackerHit3D(const std::uint64_t cellID, const std::int32_t type, const std::int32_t quality, const float time,
0061                const float eDep, const float eDepError, const edm4hep::Vector3d& position,
0062                const edm4hep::CovMatrix3f& covMatrix);
0063 
0064   /// copy constructor
0065   TrackerHit3D(const TrackerHit3D& other) = default;
0066 
0067   /// copy-assignment operator
0068   TrackerHit3D& operator=(TrackerHit3D other) &; // Rebind this to other's internal object
0069   TrackerHit3D&
0070   operator=(TrackerHit3D other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0071 
0072   /// create a mutable deep-copy of the object with identical relations
0073   /// if cloneRelations=false, the relations are not cloned and will be empty
0074   MutableTrackerHit3D clone(bool cloneRelations = true) const;
0075 
0076   /// destructor
0077   ~TrackerHit3D() = default;
0078 
0079   /// converting constructor from mutable object
0080   TrackerHit3D(const MutableTrackerHit3D& other);
0081 
0082   static TrackerHit3D makeEmpty();
0083 
0084 public:
0085   static constexpr std::string_view typeName = "edm4hep::TrackerHit3D";
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 hit position [mm]
0106   const edm4hep::Vector3d& getPosition() const;
0107 
0108   /// Access the covariance matrix of the position (x,y,z) [mm^2]
0109   const edm4hep::CovMatrix3f& getCovMatrix() const;
0110 
0111   /// Get the position covariance matrix value for the two passed dimensions
0112   float getCovMatrix(edm4hep::Cartesian dimI, edm4hep::Cartesian dimJ) const {
0113     return getCovMatrix().getValue(dimI, dimJ);
0114   }
0115 
0116   /// check whether the object is actually available
0117   bool isAvailable() const;
0118   /// disconnect from TrackerHit3DObj instance
0119   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHit3DObj>{nullptr}; }
0120 
0121   bool operator==(const TrackerHit3D& other) const { return m_obj == other.m_obj; }
0122   bool operator==(const MutableTrackerHit3D& other) const;
0123 
0124   bool operator!=(const TrackerHit3D& other) const { return !(*this == other); }
0125   bool operator!=(const MutableTrackerHit3D& other) const { return !(*this == other); }
0126 
0127   // less comparison operator, so that objects can be e.g. stored in sets.
0128   bool operator<(const TrackerHit3D& other) const {
0129     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0130   }
0131 
0132   podio::ObjectID id() const { return getObjectID(); }
0133 
0134   const podio::ObjectID getObjectID() const;
0135 
0136   friend std::hash<TrackerHit3D>;
0137 
0138   friend void swap(TrackerHit3D& a, TrackerHit3D& b) {
0139     using std::swap;
0140     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0141   }
0142 
0143 private:
0144   /// constructor from existing TrackerHit3DObj
0145   explicit TrackerHit3D(podio::utils::MaybeSharedPtr<TrackerHit3DObj> obj);
0146   TrackerHit3D(TrackerHit3DObj* obj);
0147 
0148   podio::utils::MaybeSharedPtr<TrackerHit3DObj> m_obj{new TrackerHit3DObj{}, podio::utils::MarkOwned};
0149 };
0150 
0151 std::ostream& operator<<(std::ostream& o, const TrackerHit3D& value);
0152 
0153 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0154 void to_json(nlohmann::json& j, const TrackerHit3D& value);
0155 #endif
0156 
0157 } // namespace edm4hep
0158 
0159 template <>
0160 struct std::hash<edm4hep::TrackerHit3D> {
0161   std::size_t operator()(const edm4hep::TrackerHit3D& obj) const {
0162     return std::hash<edm4hep::TrackerHit3DObj*>{}(obj.m_obj.get());
0163   }
0164 };
0165 
0166 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0167 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0168 // and https://github.com/AIDASoft/podio/issues/770
0169 #if defined(__clang__)
0170 #pragma clang diagnostic push
0171 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0172 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0173 #pragma clang diagnostic ignored "-Wdeprecated"
0174 constexpr std::string_view edm4hep::TrackerHit3D::typeName;
0175 #pragma clang diagnostic pop
0176 #elif defined(__GNUC__)
0177 #pragma GCC diagnostic push
0178 #pragma GCC diagnostic ignored "-Wdeprecated"
0179 constexpr std::string_view edm4hep::TrackerHit3D::typeName;
0180 #pragma GCC diagnostic pop
0181 #endif
0182 
0183 #endif