Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-04 08:12:05

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_TrackerHitLocal_H
0004 #define ACTSPODIOEDM_TrackerHitLocal_H
0005 
0006 #include "ActsPodioEdm/TrackerHitLocalObj.h"
0007 
0008 #include <cstdint>
0009 #include <ostream>
0010 #include <vector>
0011 
0012 #include "edm4hep/Vector3d.h"
0013 #include "podio/RelationRange.h"
0014 #include "podio/detail/OrderKey.h"
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
0017 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0018 #include "nlohmann/json_fwd.hpp"
0019 #endif
0020 
0021 // forward declarations
0022 namespace ActsPodioEdm {
0023 class TrackerHitLocalCollection;
0024 }
0025 
0026 namespace podio::detail {
0027 // Internal function used in less comparison operators of the datatypes and
0028 // interface types
0029 OrderKey getOrderKey(const ActsPodioEdm::TrackerHitLocal& obj);
0030 };  // namespace podio::detail
0031 
0032 namespace ActsPodioEdm {
0033 
0034 class MutableTrackerHitLocal;
0035 class TrackerHitLocalCollection;
0036 class TrackerHitLocalCollectionData;
0037 
0038 /** @class TrackerHitLocal
0039  *  Sensor-local tracker hit
0040  *  @author: Paul Gessinger, CERN
0041  */
0042 class TrackerHitLocal {
0043   friend class MutableTrackerHitLocal;
0044   friend class TrackerHitLocalCollection;
0045   friend class ActsPodioEdm::TrackerHitLocalCollectionData;
0046   friend class TrackerHitLocalCollectionIterator;
0047   friend podio::detail::OrderKey podio::detail::getOrderKey(
0048       const TrackerHitLocal& obj);
0049 
0050  public:
0051   using mutable_type = MutableTrackerHitLocal;
0052   using collection_type = TrackerHitLocalCollection;
0053 
0054   /// default constructor
0055   TrackerHitLocal() = default;
0056 
0057   /// Constructor initializing all members
0058   TrackerHitLocal(const std::uint64_t cellID, const std::int32_t type,
0059                   const std::int32_t quality, const float time,
0060                   const float eDep, const float eDepError,
0061                   const edm4hep::Vector3d& position);
0062 
0063   /// copy constructor
0064   TrackerHitLocal(const TrackerHitLocal& other) = default;
0065 
0066   /// copy-assignment operator
0067   TrackerHitLocal& operator=(
0068       TrackerHitLocal other) &;  // Rebind this to other's internal object
0069   TrackerHitLocal& operator=(TrackerHitLocal other) && =
0070       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   MutableTrackerHitLocal clone(bool cloneRelations = true) const;
0075 
0076   /// destructor
0077   ~TrackerHitLocal() = default;
0078 
0079   /// converting constructor from mutable object
0080   TrackerHitLocal(const MutableTrackerHitLocal& other);
0081 
0082   static TrackerHitLocal makeEmpty();
0083 
0084  public:
0085   static constexpr std::string_view typeName = "ActsPodioEdm::TrackerHitLocal";
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, use depends on writer
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 (depends on measurement type) [ns]
0097   float getTime() const;
0098 
0099   /// Access the energy deposited on the hit (optional) [GeV]
0100   float getEDep() const;
0101 
0102   /// Access the error measured on EDep (optional) [GeV]
0103   float getEDepError() const;
0104 
0105   /// Access the global hit position (depends on measurement type) [mm]
0106   const edm4hep::Vector3d& getPosition() const;
0107 
0108   std::size_t measurement_size() const;
0109   float getMeasurement(std::size_t) const;
0110   std::vector<float>::const_iterator measurement_begin() const;
0111   std::vector<float>::const_iterator measurement_end() const;
0112   podio::RelationRange<float> getMeasurement() const;
0113   std::size_t covariance_size() const;
0114   float getCovariance(std::size_t) const;
0115   std::vector<float>::const_iterator covariance_begin() const;
0116   std::vector<float>::const_iterator covariance_end() const;
0117   podio::RelationRange<float> getCovariance() const;
0118 
0119   /// check whether the object is actually available
0120   bool isAvailable() const;
0121   /// disconnect from TrackerHitLocalObj instance
0122   void unlink() {
0123     m_obj = podio::utils::MaybeSharedPtr<TrackerHitLocalObj>{nullptr};
0124   }
0125 
0126   bool operator==(const TrackerHitLocal& other) const {
0127     return m_obj == other.m_obj;
0128   }
0129   bool operator==(const MutableTrackerHitLocal& other) const;
0130 
0131   bool operator!=(const TrackerHitLocal& other) const {
0132     return !(*this == other);
0133   }
0134   bool operator!=(const MutableTrackerHitLocal& other) const {
0135     return !(*this == other);
0136   }
0137 
0138   // less comparison operator, so that objects can be e.g. stored in sets.
0139   bool operator<(const TrackerHitLocal& other) const {
0140     return podio::detail::getOrderKey(*this) <
0141            podio::detail::getOrderKey(other);
0142   }
0143 
0144   podio::ObjectID id() const { return getObjectID(); }
0145 
0146   const podio::ObjectID getObjectID() const;
0147 
0148   friend std::hash<TrackerHitLocal>;
0149 
0150   friend void swap(TrackerHitLocal& a, TrackerHitLocal& 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 TrackerHitLocalObj
0157   explicit TrackerHitLocal(
0158       podio::utils::MaybeSharedPtr<TrackerHitLocalObj> obj);
0159   TrackerHitLocal(TrackerHitLocalObj* obj);
0160 
0161   podio::utils::MaybeSharedPtr<TrackerHitLocalObj> m_obj{
0162       new TrackerHitLocalObj{}, podio::utils::MarkOwned};
0163 };
0164 
0165 std::ostream& operator<<(std::ostream& o, const TrackerHitLocal& value);
0166 
0167 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0168 void to_json(nlohmann::json& j, const TrackerHitLocal& value);
0169 #endif
0170 
0171 }  // namespace ActsPodioEdm
0172 
0173 template <>
0174 struct std::hash<ActsPodioEdm::TrackerHitLocal> {
0175   std::size_t operator()(const ActsPodioEdm::TrackerHitLocal& obj) const {
0176     return std::hash<ActsPodioEdm::TrackerHitLocalObj*>{}(obj.m_obj.get());
0177   }
0178 };
0179 
0180 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0181 // until it's fixed in ROOT. See
0182 // https://github.com/root-project/root/issues/18489 and
0183 // https://github.com/AIDASoft/podio/issues/770
0184 #if defined(__clang__)
0185 #pragma clang diagnostic push
0186 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0187 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0188 #pragma clang diagnostic ignored "-Wdeprecated"
0189 constexpr std::string_view ActsPodioEdm::TrackerHitLocal::typeName;
0190 #pragma clang diagnostic pop
0191 #elif defined(__GNUC__)
0192 #pragma GCC diagnostic push
0193 #pragma GCC diagnostic ignored "-Wdeprecated"
0194 constexpr std::string_view ActsPodioEdm::TrackerHitLocal::typeName;
0195 #pragma GCC diagnostic pop
0196 #endif
0197 
0198 #endif