Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:27:42

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(ActsPodioEdm::TrackInfo data, ActsPodioEdm::Surface referenceSurface,
0058         ActsPodioEdm::ParticleHypothesis particleHypothesis);
0059 
0060   /// copy constructor
0061   Track(const Track& other) = default;
0062 
0063   /// copy-assignment operator
0064   Track& operator=(Track other);
0065 
0066   /// create a mutable deep-copy of the object with identical relations
0067   /// if cloneRelations=false, the relations are not cloned and will be empty
0068   MutableTrack clone(bool cloneRelations = true) const;
0069 
0070   /// destructor
0071   ~Track() = default;
0072 
0073   /// converting constructor from mutable object
0074   Track(const MutableTrack& other);
0075 
0076   static Track makeEmpty();
0077 
0078  public:
0079   static constexpr auto typeName = "ActsPodioEdm::Track";
0080 
0081   /// Access the local parameters and covariance
0082   const ActsPodioEdm::TrackInfo& getData() const;
0083 
0084   /// Access the reference surface
0085   const ActsPodioEdm::Surface& getReferenceSurface() const;
0086 
0087   /// Access the particle hypothesis
0088   const ActsPodioEdm::ParticleHypothesis& getParticleHypothesis() const;
0089 
0090   /// check whether the object is actually available
0091   bool isAvailable() const;
0092   /// disconnect from TrackObj instance
0093   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
0094 
0095   bool operator==(const Track& other) const { return m_obj == other.m_obj; }
0096   bool operator==(const MutableTrack& other) const;
0097 
0098   bool operator!=(const Track& other) const { return !(*this == other); }
0099   bool operator!=(const MutableTrack& other) const { return !(*this == other); }
0100 
0101   // less comparison operator, so that objects can be e.g. stored in sets.
0102   bool operator<(const Track& other) const {
0103     return podio::detail::getOrderKey(*this) <
0104            podio::detail::getOrderKey(other);
0105   }
0106 
0107   podio::ObjectID id() const { return getObjectID(); }
0108 
0109   const podio::ObjectID getObjectID() const;
0110 
0111   friend void swap(Track& a, Track& b) {
0112     using std::swap;
0113     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0114   }
0115 
0116  private:
0117   /// constructor from existing TrackObj
0118   explicit Track(podio::utils::MaybeSharedPtr<TrackObj> obj);
0119   Track(TrackObj* obj);
0120 
0121   podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
0122 };
0123 
0124 std::ostream& operator<<(std::ostream& o, const Track& value);
0125 
0126 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0127 void to_json(nlohmann::json& j, const Track& value);
0128 #endif
0129 
0130 }  // namespace ActsPodioEdm
0131 
0132 #endif