Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-03 10:42:15

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_TrackSeed_H
0004 #define EDM4EIC_TrackSeed_H
0005 
0006 #include "edm4eic/TrackSeedObj.h"
0007 
0008 #include "edm4eic/TrackerHit.h"
0009 #include "edm4hep/Vector3f.h"
0010 #include "podio/RelationRange.h"
0011 #include <vector>
0012 
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014 #include "podio/detail/OrderKey.h"
0015 
0016 #include <ostream>
0017 #include <cstdint>
0018 
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022 
0023 // forward declarations
0024 namespace edm4eic {
0025 class TrackSeedCollection;
0026 class TrackParameters;
0027 class MutableTrackParameters;
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 edm4eic::TrackSeed& obj);
0034 };
0035 
0036 namespace edm4eic {
0037 
0038 class MutableTrackSeed;
0039 class TrackSeedCollection;
0040 class TrackSeedCollectionData;
0041 
0042 /** @class TrackSeed
0043  *  Seed info from the realistic seed finder
0044  *  @author: S. Li, B. Schmookler, J. Osborn
0045  */
0046 class TrackSeed {
0047 
0048   friend class MutableTrackSeed;
0049   friend class TrackSeedCollection;
0050   friend class edm4eic::TrackSeedCollectionData;
0051   friend class TrackSeedCollectionIterator;
0052   friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackSeed & obj);
0053 
0054 public:
0055   using mutable_type = MutableTrackSeed;
0056   using collection_type = TrackSeedCollection;
0057 
0058   /// default constructor
0059   TrackSeed() = default;
0060 
0061   /// Constructor initializing all members
0062   TrackSeed(const edm4hep::Vector3f& perigee, const float quality);
0063 
0064   /// copy constructor
0065   TrackSeed(const TrackSeed& other) noexcept = default;
0066 
0067   /// move constructor
0068   TrackSeed(TrackSeed&& other) noexcept = default;
0069 
0070   /// copy-assignment operator
0071   TrackSeed& operator=(TrackSeed other) &; // Rebind this to other's internal object
0072   TrackSeed& operator=(TrackSeed other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0073 
0074   /// create a mutable deep-copy of the object with identical relations
0075   /// if cloneRelations=false, the relations are not cloned and will be empty
0076   MutableTrackSeed clone(bool cloneRelations=true) const;
0077 
0078   /// destructor
0079   ~TrackSeed() = default;
0080 
0081   /// converting constructor from mutable object
0082   TrackSeed(const MutableTrackSeed& other);
0083 
0084   static TrackSeed makeEmpty();
0085 
0086 public:
0087 
0088   static constexpr std::string_view typeName = "edm4eic::TrackSeed";
0089 
0090   /// Access the Vector for the perigee (line surface)
0091   const edm4hep::Vector3f& getPerigee() const;
0092 
0093   /// Access the Seed quality reported by finder
0094   float getQuality() const;
0095 
0096 
0097   /// Access the Initial track parameters
0098   const edm4eic::TrackParameters getParams() const;
0099 
0100   std::size_t hits_size() const;
0101   edm4eic::TrackerHit getHits(std::size_t) const;
0102   std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
0103   std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
0104   podio::RelationRange<edm4eic::TrackerHit> getHits() const;
0105 
0106 
0107   /// check whether the object is actually available
0108   bool isAvailable() const;
0109   /// disconnect from TrackSeedObj instance
0110   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
0111 
0112   constexpr bool operator==(const TrackSeed& other) const { return m_obj == other.m_obj; }
0113   bool operator==(const MutableTrackSeed& other) const;
0114 
0115   constexpr bool operator!=(const TrackSeed& other) const { return !(*this == other); }
0116   bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
0117 
0118   // less comparison operator, so that objects can be e.g. stored in sets.
0119   bool operator<(const TrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0120 
0121   podio::ObjectID id() const { return getObjectID(); }
0122 
0123   const podio::ObjectID getObjectID() const;
0124 
0125   friend std::hash<TrackSeed>;
0126 
0127   friend void swap(TrackSeed& a, TrackSeed& b) {
0128     using std::swap;
0129     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0130   }
0131 
0132 private:
0133   /// constructor from existing TrackSeedObj
0134   explicit TrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
0135   TrackSeed(TrackSeedObj* obj);
0136 
0137   podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
0138 };
0139 
0140 std::ostream& operator<<(std::ostream& o, const TrackSeed& value);
0141 
0142 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0143 void to_json(nlohmann::json& j, const TrackSeed& value);
0144 #endif
0145 
0146 
0147 } // namespace edm4eic
0148 
0149 
0150 
0151 template<>
0152 struct std::hash<edm4eic::TrackSeed> {
0153   std::size_t operator()(const edm4eic::TrackSeed& obj) const {
0154     return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
0155   }
0156 };
0157 
0158 
0159 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0160 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0161 // and https://github.com/AIDASoft/podio/issues/770
0162 #if defined(__clang__)
0163   #pragma clang diagnostic push
0164   #pragma clang diagnostic ignored "-Wunknown-warning-option"
0165   #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0166   #pragma clang diagnostic ignored "-Wdeprecated"
0167 constexpr std::string_view edm4eic::TrackSeed::typeName;
0168   #pragma clang diagnostic pop
0169 #elif defined(__GNUC__)
0170   #pragma GCC diagnostic push
0171   #pragma GCC diagnostic ignored "-Wdeprecated"
0172 constexpr std::string_view edm4eic::TrackSeed::typeName;
0173   #pragma GCC diagnostic pop
0174 #endif
0175 
0176 
0177 #endif