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