Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-23 08:10:05

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableTrackSeed_H
0004 #define EDM4EIC_MutableTrackSeed_H
0005 
0006 #include "edm4eic/TrackSeedObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/TrackSeed.h"
0009 
0010 #include "edm4eic/TrackerHit.h"
0011 #include "edm4hep/Vector3f.h"
0012 #include "podio/RelationRange.h"
0013 #include <vector>
0014 
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
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 edm4eic {
0032 
0033 
0034 /** @class MutableTrackSeed
0035  *  Seed info from the realistic seed finder
0036  *  @author: S. Li, B. Schmookler, J. Osborn
0037  */
0038 class MutableTrackSeed {
0039 
0040   friend class TrackSeedCollection;
0041   friend class TrackSeedMutableCollectionIterator;
0042   friend class TrackSeed;
0043 
0044 public:
0045   using object_type = TrackSeed;
0046   using collection_type = TrackSeedCollection;
0047 
0048   /// default constructor
0049   MutableTrackSeed() = default;
0050 
0051   /// Constructor initializing all members
0052   MutableTrackSeed(const edm4hep::Vector3f& perigee, const float quality);
0053 
0054   /// copy constructor
0055   MutableTrackSeed(const MutableTrackSeed& other) = default;
0056 
0057   /// copy-assignment operator
0058   MutableTrackSeed& operator=(MutableTrackSeed other) &; // Rebind this to other's internal object
0059   MutableTrackSeed& operator=(MutableTrackSeed other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0060 
0061   /// create a mutable deep-copy of the object with identical relations
0062   /// if cloneRelations=false, the relations are not cloned and will be empty
0063   MutableTrackSeed clone(bool cloneRelations=true) const;
0064 
0065   /// destructor
0066   ~MutableTrackSeed() = default;
0067 
0068 
0069 public:
0070 
0071   /// Access the Vector for the perigee (line surface)
0072   const edm4hep::Vector3f& getPerigee() const;
0073 
0074   /// Access the Seed quality reported by finder
0075   float getQuality() const;
0076 
0077 
0078   /// Access the Initial track parameters
0079   const edm4eic::TrackParameters getParams() const;
0080 
0081   /// Set the Vector for the perigee (line surface)
0082   void setPerigee(const edm4hep::Vector3f& perigee);
0083   /// Get mutable reference to Vector for the perigee (line surface)
0084   edm4hep::Vector3f& getPerigee();
0085   /// Get reference to Vector for the perigee (line surface)
0086   [[deprecated("use getPerigee instead")]]
0087   edm4hep::Vector3f& perigee();
0088 
0089   /// Set the Seed quality reported by finder
0090   void setQuality(const float quality);
0091   /// Get mutable reference to Seed quality reported by finder
0092   float& getQuality();
0093   /// Get reference to Seed quality reported by finder
0094   [[deprecated("use getQuality instead")]]
0095   float& quality();
0096 
0097 
0098   /// Set the Initial track parameters
0099   void setParams(const edm4eic::TrackParameters& value);
0100 
0101   void addToHits(const edm4eic::TrackerHit&);
0102   std::size_t hits_size() const;
0103   edm4eic::TrackerHit getHits(std::size_t) const;
0104   std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
0105   std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
0106   podio::RelationRange<edm4eic::TrackerHit> getHits() const;
0107 
0108 
0109 
0110   /// check whether the object is actually available
0111   bool isAvailable() const;
0112   /// disconnect from TrackSeedObj instance
0113   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
0114 
0115   bool operator==(const MutableTrackSeed& other) const { return m_obj == other.m_obj; }
0116   bool operator==(const TrackSeed& other) const;
0117 
0118   bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
0119   bool operator!=(const TrackSeed& other) const { return !(*this == other); }
0120 
0121   // less comparison operator, so that objects can be e.g. stored in sets.
0122   bool operator<(const MutableTrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0123 
0124   podio::ObjectID id() const { return getObjectID(); }
0125 
0126   const podio::ObjectID getObjectID() const;
0127 
0128   friend std::hash<MutableTrackSeed>;
0129 
0130   friend void swap(MutableTrackSeed& a, MutableTrackSeed& b) {
0131     using std::swap;
0132     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0133   }
0134 
0135 private:
0136   /// constructor from existing TrackSeedObj
0137   explicit MutableTrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
0138 
0139   podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
0140 };
0141 
0142 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0143 void to_json(nlohmann::json& j, const MutableTrackSeed& value);
0144 #endif
0145 
0146 
0147 } // namespace edm4eic
0148 
0149 
0150 
0151 template<>
0152 struct std::hash<edm4eic::MutableTrackSeed> {
0153   std::size_t operator()(const edm4eic::MutableTrackSeed& obj) const {
0154     return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
0155   }
0156 };
0157 
0158 
0159 #endif