Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:05

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