Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-13 08:05:15

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_MutableTrackState_H
0004 #define ACTSPODIOEDM_MutableTrackState_H
0005 
0006 #include "ActsPodioEdm/TrackStateObj.h"
0007 // Make the immutable class available from its mutable version but not vice
0008 // versa
0009 #include "ActsPodioEdm/Surface.h"
0010 #include "ActsPodioEdm/TrackState.h"
0011 #include "ActsPodioEdm/TrackStateInfo.h"
0012 
0013 #include <cstdint>
0014 
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 TrackStateCollection;
0024 }
0025 
0026 namespace ActsPodioEdm {
0027 
0028 /** @class MutableTrackState
0029  *  Local state on a track
0030  *  @author: Paul Gessinger, CERN
0031  */
0032 class MutableTrackState {
0033   friend class TrackStateCollection;
0034   friend class TrackStateMutableCollectionIterator;
0035   friend class TrackState;
0036 
0037  public:
0038   using object_type = TrackState;
0039   using collection_type = TrackStateCollection;
0040 
0041   /// default constructor
0042   MutableTrackState();
0043 
0044   /// Constructor initializing all members
0045   MutableTrackState(ActsPodioEdm::TrackStateInfo data,
0046                     ActsPodioEdm::Surface referenceSurface);
0047 
0048   /// copy constructor
0049   MutableTrackState(const MutableTrackState& other) = default;
0050 
0051   /// copy-assignment operator
0052   MutableTrackState& operator=(MutableTrackState other);
0053 
0054   /// create a mutable deep-copy of the object with identical relations
0055   /// if cloneRelations=false, the relations are not cloned and will be empty
0056   MutableTrackState clone(bool cloneRelations = true) const;
0057 
0058   /// destructor
0059   ~MutableTrackState() = default;
0060 
0061  public:
0062   /// Access the local information
0063   const ActsPodioEdm::TrackStateInfo& getData() const;
0064 
0065   /// Access the reference surface
0066   const ActsPodioEdm::Surface& getReferenceSurface() const;
0067 
0068   /// Set the local information
0069   void setData(ActsPodioEdm::TrackStateInfo value);
0070   /// Get mutable reference to local information
0071   ActsPodioEdm::TrackStateInfo& getData();
0072   /// Get reference to local information
0073   [[deprecated("use getData instead")]] ActsPodioEdm::TrackStateInfo& 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   /// check whether the object is actually available
0084   bool isAvailable() const;
0085   /// disconnect from TrackStateObj instance
0086   void unlink() {
0087     m_obj = podio::utils::MaybeSharedPtr<TrackStateObj>{nullptr};
0088   }
0089 
0090   bool operator==(const MutableTrackState& other) const {
0091     return m_obj == other.m_obj;
0092   }
0093   bool operator==(const TrackState& other) const;
0094 
0095   bool operator!=(const MutableTrackState& other) const {
0096     return !(*this == other);
0097   }
0098   bool operator!=(const TrackState& other) const { return !(*this == other); }
0099 
0100   // less comparison operator, so that objects can be e.g. stored in sets.
0101   bool operator<(const MutableTrackState& other) const {
0102     return podio::detail::getOrderKey(*this) <
0103            podio::detail::getOrderKey(other);
0104   }
0105 
0106   podio::ObjectID id() const { return getObjectID(); }
0107 
0108   const podio::ObjectID getObjectID() const;
0109 
0110   friend void swap(MutableTrackState& a, MutableTrackState& b) {
0111     using std::swap;
0112     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0113   }
0114 
0115  private:
0116   /// constructor from existing TrackStateObj
0117   explicit MutableTrackState(podio::utils::MaybeSharedPtr<TrackStateObj> obj);
0118 
0119   podio::utils::MaybeSharedPtr<TrackStateObj> m_obj{nullptr};
0120 };
0121 
0122 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0123 void to_json(nlohmann::json& j, const MutableTrackState& value);
0124 #endif
0125 
0126 }  // namespace ActsPodioEdm
0127 
0128 #endif