Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 08:33:54

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_Track_H
0004 #define ACTSPODIOEDM_Track_H
0005 
0006 #include "ActsPodioEdm/ParticleHypothesis.h"
0007 #include "ActsPodioEdm/Surface.h"
0008 #include "ActsPodioEdm/TrackInfo.h"
0009 #include "ActsPodioEdm/TrackObj.h"
0010 
0011 #include <cstdint>
0012 #include <ostream>
0013 
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 TrackCollection;
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::Track& obj);
0030 };  // namespace podio::detail
0031 
0032 namespace ActsPodioEdm {
0033 
0034 class MutableTrack;
0035 class TrackCollection;
0036 class TrackCollectionData;
0037 
0038 /** @class Track
0039  *  Reconstructed track
0040  *  @author: Paul Gessinger, CERN
0041  */
0042 class Track {
0043   friend class MutableTrack;
0044   friend class TrackCollection;
0045   friend class ActsPodioEdm::TrackCollectionData;
0046   friend class TrackCollectionIterator;
0047   friend podio::detail::OrderKey podio::detail::getOrderKey(const Track& obj);
0048 
0049  public:
0050   using mutable_type = MutableTrack;
0051   using collection_type = TrackCollection;
0052 
0053   /// default constructor
0054   Track() = default;
0055 
0056   /// Constructor initializing all members
0057   Track(const ActsPodioEdm::TrackInfo& data,
0058         const ActsPodioEdm::Surface& referenceSurface,
0059         const ActsPodioEdm::ParticleHypothesis& particleHypothesis);
0060 
0061   /// copy constructor
0062   Track(const Track& other) = default;
0063 
0064   /// copy-assignment operator
0065   Track& operator=(Track other) &;  // Rebind this to other's internal object
0066   Track& operator=(Track other) && =
0067       delete;  // Prevent rebinding temporary as the changes wouldn't persist
0068 
0069   /// create a mutable deep-copy of the object with identical relations
0070   /// if cloneRelations=false, the relations are not cloned and will be empty
0071   MutableTrack clone(bool cloneRelations = true) const;
0072 
0073   /// destructor
0074   ~Track() = default;
0075 
0076   /// converting constructor from mutable object
0077   Track(const MutableTrack& other);
0078 
0079   static Track makeEmpty();
0080 
0081  public:
0082   static constexpr std::string_view typeName = "ActsPodioEdm::Track";
0083 
0084   /// Access the local parameters and covariance
0085   const ActsPodioEdm::TrackInfo& getData() const;
0086 
0087   /// Access the reference surface
0088   const ActsPodioEdm::Surface& getReferenceSurface() const;
0089 
0090   /// Access the particle hypothesis
0091   const ActsPodioEdm::ParticleHypothesis& getParticleHypothesis() const;
0092 
0093   /// check whether the object is actually available
0094   bool isAvailable() const;
0095   /// disconnect from TrackObj instance
0096   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
0097 
0098   constexpr bool operator==(const Track& other) const {
0099     return m_obj == other.m_obj;
0100   }
0101   bool operator==(const MutableTrack& other) const;
0102 
0103   constexpr bool operator!=(const Track& other) const {
0104     return !(*this == other);
0105   }
0106   bool operator!=(const MutableTrack& other) const { return !(*this == other); }
0107 
0108   // less comparison operator, so that objects can be e.g. stored in sets.
0109   bool operator<(const Track& other) const {
0110     return podio::detail::getOrderKey(*this) <
0111            podio::detail::getOrderKey(other);
0112   }
0113 
0114   podio::ObjectID id() const { return getObjectID(); }
0115 
0116   const podio::ObjectID getObjectID() const;
0117 
0118   friend std::hash<Track>;
0119 
0120   friend void swap(Track& a, Track& b) {
0121     using std::swap;
0122     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0123   }
0124 
0125  private:
0126   /// constructor from existing TrackObj
0127   explicit Track(podio::utils::MaybeSharedPtr<TrackObj> obj);
0128   Track(TrackObj* obj);
0129 
0130   podio::utils::MaybeSharedPtr<TrackObj> m_obj{new TrackObj{},
0131                                                podio::utils::MarkOwned};
0132 };
0133 
0134 std::ostream& operator<<(std::ostream& o, const Track& value);
0135 
0136 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0137 void to_json(nlohmann::json& j, const Track& value);
0138 #endif
0139 
0140 }  // namespace ActsPodioEdm
0141 
0142 template <>
0143 struct std::hash<ActsPodioEdm::Track> {
0144   std::size_t operator()(const ActsPodioEdm::Track& obj) const {
0145     return std::hash<ActsPodioEdm::TrackObj*>{}(obj.m_obj.get());
0146   }
0147 };
0148 
0149 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0150 // until it's fixed in ROOT. See
0151 // https://github.com/root-project/root/issues/18489 and
0152 // https://github.com/AIDASoft/podio/issues/770
0153 #if defined(__clang__)
0154 #pragma clang diagnostic push
0155 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0156 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0157 #pragma clang diagnostic ignored "-Wdeprecated"
0158 constexpr std::string_view ActsPodioEdm::Track::typeName;
0159 #pragma clang diagnostic pop
0160 #elif defined(__GNUC__)
0161 #pragma GCC diagnostic push
0162 #pragma GCC diagnostic ignored "-Wdeprecated"
0163 constexpr std::string_view ActsPodioEdm::Track::typeName;
0164 #pragma GCC diagnostic pop
0165 #endif
0166 
0167 #endif