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_MutableTrack_H
0004 #define ACTSPODIOEDM_MutableTrack_H
0005 
0006 #include "ActsPodioEdm/TrackObj.h"
0007 // Make the immutable class available from its mutable version but not vice
0008 // versa
0009 #include "ActsPodioEdm/ParticleHypothesis.h"
0010 #include "ActsPodioEdm/Surface.h"
0011 #include "ActsPodioEdm/Track.h"
0012 #include "ActsPodioEdm/TrackInfo.h"
0013 
0014 #include <cstdint>
0015 
0016 #include "podio/utilities/MaybeSharedPtr.h"
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 // forward declarations
0023 namespace ActsPodioEdm {
0024 class TrackCollection;
0025 }
0026 
0027 namespace ActsPodioEdm {
0028 
0029 /** @class MutableTrack
0030  *  Reconstructed track
0031  *  @author: Paul Gessinger, CERN
0032  */
0033 class MutableTrack {
0034   friend class TrackCollection;
0035   friend class TrackMutableCollectionIterator;
0036   friend class Track;
0037 
0038  public:
0039   using object_type = Track;
0040   using collection_type = TrackCollection;
0041 
0042   /// default constructor
0043   MutableTrack();
0044 
0045   /// Constructor initializing all members
0046   MutableTrack(ActsPodioEdm::TrackInfo data,
0047                ActsPodioEdm::Surface referenceSurface,
0048                ActsPodioEdm::ParticleHypothesis particleHypothesis);
0049 
0050   /// copy constructor
0051   MutableTrack(const MutableTrack& other) = default;
0052 
0053   /// copy-assignment operator
0054   MutableTrack& operator=(MutableTrack other);
0055 
0056   /// create a mutable deep-copy of the object with identical relations
0057   /// if cloneRelations=false, the relations are not cloned and will be empty
0058   MutableTrack clone(bool cloneRelations = true) const;
0059 
0060   /// destructor
0061   ~MutableTrack() = default;
0062 
0063  public:
0064   /// Access the local parameters and covariance
0065   const ActsPodioEdm::TrackInfo& getData() const;
0066 
0067   /// Access the reference surface
0068   const ActsPodioEdm::Surface& getReferenceSurface() const;
0069 
0070   /// Access the particle hypothesis
0071   const ActsPodioEdm::ParticleHypothesis& getParticleHypothesis() const;
0072 
0073   /// Set the local parameters and covariance
0074   void setData(ActsPodioEdm::TrackInfo value);
0075   /// Get mutable reference to local parameters and covariance
0076   ActsPodioEdm::TrackInfo& getData();
0077   /// Get reference to local parameters and covariance
0078   [[deprecated("use getData instead")]] ActsPodioEdm::TrackInfo& data();
0079 
0080   /// Set the reference surface
0081   void setReferenceSurface(ActsPodioEdm::Surface value);
0082   /// Get mutable reference to reference surface
0083   ActsPodioEdm::Surface& getReferenceSurface();
0084   /// Get reference to reference surface
0085   [[deprecated("use getReferenceSurface instead")]] ActsPodioEdm::Surface&
0086   referenceSurface();
0087 
0088   /// Set the particle hypothesis
0089   void setParticleHypothesis(ActsPodioEdm::ParticleHypothesis value);
0090   /// Get mutable reference to particle hypothesis
0091   ActsPodioEdm::ParticleHypothesis& getParticleHypothesis();
0092   /// Get reference to particle hypothesis
0093   [[deprecated(
0094       "use getParticleHypothesis instead")]] ActsPodioEdm::ParticleHypothesis&
0095   particleHypothesis();
0096 
0097   /// check whether the object is actually available
0098   bool isAvailable() const;
0099   /// disconnect from TrackObj instance
0100   void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
0101 
0102   bool operator==(const MutableTrack& other) const {
0103     return m_obj == other.m_obj;
0104   }
0105   bool operator==(const Track& other) const;
0106 
0107   bool operator!=(const MutableTrack& other) const { return !(*this == other); }
0108   bool operator!=(const Track& other) const { return !(*this == other); }
0109 
0110   // less comparison operator, so that objects can be e.g. stored in sets.
0111   bool operator<(const MutableTrack& other) const {
0112     return podio::detail::getOrderKey(*this) <
0113            podio::detail::getOrderKey(other);
0114   }
0115 
0116   podio::ObjectID id() const { return getObjectID(); }
0117 
0118   const podio::ObjectID getObjectID() const;
0119 
0120   friend void swap(MutableTrack& a, MutableTrack& 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 MutableTrack(podio::utils::MaybeSharedPtr<TrackObj> obj);
0128 
0129   podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
0130 };
0131 
0132 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0133 void to_json(nlohmann::json& j, const MutableTrack& value);
0134 #endif
0135 
0136 }  // namespace ActsPodioEdm
0137 
0138 #endif