Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:28:34

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();
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   bool operator==(const Track& other) const { return m_obj == other.m_obj; }
0099   bool operator==(const MutableTrack& other) const;
0100 
0101   bool operator!=(const Track& other) const { return !(*this == other); }
0102   bool operator!=(const MutableTrack& other) const { return !(*this == other); }
0103 
0104   // less comparison operator, so that objects can be e.g. stored in sets.
0105   bool operator<(const Track& other) const {
0106     return podio::detail::getOrderKey(*this) <
0107            podio::detail::getOrderKey(other);
0108   }
0109 
0110   podio::ObjectID id() const { return getObjectID(); }
0111 
0112   const podio::ObjectID getObjectID() const;
0113 
0114   friend std::hash<Track>;
0115 
0116   friend void swap(Track& a, Track& b) {
0117     using std::swap;
0118     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0119   }
0120 
0121  private:
0122   /// constructor from existing TrackObj
0123   explicit Track(podio::utils::MaybeSharedPtr<TrackObj> obj);
0124   Track(TrackObj* obj);
0125 
0126   podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
0127 };
0128 
0129 std::ostream& operator<<(std::ostream& o, const Track& value);
0130 
0131 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0132 void to_json(nlohmann::json& j, const Track& value);
0133 #endif
0134 
0135 }  // namespace ActsPodioEdm
0136 
0137 template <>
0138 struct std::hash<ActsPodioEdm::Track> {
0139   std::size_t operator()(const ActsPodioEdm::Track& obj) const {
0140     return std::hash<ActsPodioEdm::TrackObj*>{}(obj.m_obj.get());
0141   }
0142 };
0143 
0144 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0145 // until it's fixed in ROOT. See
0146 // https://github.com/root-project/root/issues/18489 and
0147 // https://github.com/AIDASoft/podio/issues/770
0148 #if defined(__clang__)
0149 #pragma clang diagnostic push
0150 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0151 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0152 #pragma clang diagnostic ignored "-Wdeprecated"
0153 constexpr std::string_view ActsPodioEdm::Track::typeName;
0154 #pragma clang diagnostic pop
0155 #elif defined(__GNUC__)
0156 #pragma GCC diagnostic push
0157 #pragma GCC diagnostic ignored "-Wdeprecated"
0158 constexpr std::string_view ActsPodioEdm::Track::typeName;
0159 #pragma GCC diagnostic pop
0160 #endif
0161 
0162 #endif