Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:33:42

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(const ActsPodioEdm::TrackStateInfo& data,
0046                     const ActsPodioEdm::Surface& referenceSurface);
0047 
0048   /// copy constructor
0049   MutableTrackState(const MutableTrackState& other) = default;
0050 
0051   /// copy-assignment operator
0052   MutableTrackState& operator=(
0053       MutableTrackState other) &;  // Rebind this to other's internal object
0054   MutableTrackState& operator=(MutableTrackState other) && =
0055       delete;  // Prevent rebinding temporary as the changes wouldn't persist
0056 
0057   /// create a mutable deep-copy of the object with identical relations
0058   /// if cloneRelations=false, the relations are not cloned and will be empty
0059   MutableTrackState clone(bool cloneRelations = true) const;
0060 
0061   /// destructor
0062   ~MutableTrackState() = default;
0063 
0064  public:
0065   /// Access the local information
0066   const ActsPodioEdm::TrackStateInfo& getData() const;
0067 
0068   /// Access the reference surface
0069   const ActsPodioEdm::Surface& getReferenceSurface() const;
0070 
0071   /// Set the local information
0072   void setData(const ActsPodioEdm::TrackStateInfo& data);
0073   /// Get mutable reference to local information
0074   ActsPodioEdm::TrackStateInfo& getData();
0075   /// Get reference to local information
0076   [[deprecated("use getData instead")]]
0077   ActsPodioEdm::TrackStateInfo& data();
0078 
0079   /// Set the reference surface
0080   void setReferenceSurface(const ActsPodioEdm::Surface& referenceSurface);
0081   /// Get mutable reference to reference surface
0082   ActsPodioEdm::Surface& getReferenceSurface();
0083   /// Get reference to reference surface
0084   [[deprecated("use getReferenceSurface instead")]]
0085   ActsPodioEdm::Surface& referenceSurface();
0086 
0087   /// check whether the object is actually available
0088   bool isAvailable() const;
0089   /// disconnect from TrackStateObj instance
0090   void unlink() {
0091     m_obj = podio::utils::MaybeSharedPtr<TrackStateObj>{nullptr};
0092   }
0093 
0094   bool operator==(const MutableTrackState& other) const {
0095     return m_obj == other.m_obj;
0096   }
0097   bool operator==(const TrackState& other) const;
0098 
0099   bool operator!=(const MutableTrackState& other) const {
0100     return !(*this == other);
0101   }
0102   bool operator!=(const TrackState& other) const { return !(*this == other); }
0103 
0104   // less comparison operator, so that objects can be e.g. stored in sets.
0105   bool operator<(const MutableTrackState& 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<MutableTrackState>;
0115 
0116   friend void swap(MutableTrackState& a, MutableTrackState& 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 TrackStateObj
0123   explicit MutableTrackState(podio::utils::MaybeSharedPtr<TrackStateObj> obj);
0124 
0125   podio::utils::MaybeSharedPtr<TrackStateObj> m_obj{nullptr};
0126 };
0127 
0128 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0129 void to_json(nlohmann::json& j, const MutableTrackState& value);
0130 #endif
0131 
0132 }  // namespace ActsPodioEdm
0133 
0134 template <>
0135 struct std::hash<ActsPodioEdm::MutableTrackState> {
0136   std::size_t operator()(const ActsPodioEdm::MutableTrackState& obj) const {
0137     return std::hash<ActsPodioEdm::TrackStateObj*>{}(obj.m_obj.get());
0138   }
0139 };
0140 
0141 #endif