Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef ACTSPODIOEDM_TrackState_H
0004 #define ACTSPODIOEDM_TrackState_H
0005 
0006 #include "ActsPodioEdm/Surface.h"
0007 #include "ActsPodioEdm/TrackStateInfo.h"
0008 #include "ActsPodioEdm/TrackStateObj.h"
0009 
0010 #include <cstdint>
0011 #include <ostream>
0012 
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014 
0015 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0016 #include "nlohmann/json_fwd.hpp"
0017 #endif
0018 
0019 namespace ActsPodioEdm {
0020 
0021 class MutableTrackState;
0022 class TrackStateCollection;
0023 class TrackStateCollectionData;
0024 
0025 /** @class TrackState
0026  *  Local state on a track
0027  *  @author: Paul Gessinger, CERN
0028  */
0029 class TrackState {
0030   friend class MutableTrackState;
0031   friend class TrackStateCollection;
0032   friend class ActsPodioEdm::TrackStateCollectionData;
0033   friend class TrackStateCollectionIterator;
0034 
0035  public:
0036   using mutable_type = MutableTrackState;
0037   using collection_type = TrackStateCollection;
0038 
0039   /// default constructor
0040   TrackState();
0041 
0042   /// Constructor initializing all members
0043   TrackState(ActsPodioEdm::TrackStateInfo data,
0044              ActsPodioEdm::Surface referenceSurface);
0045 
0046   /// copy constructor
0047   TrackState(const TrackState& other) = default;
0048 
0049   /// copy-assignment operator
0050   TrackState& operator=(TrackState other);
0051 
0052   /// create a mutable deep-copy of the object with identical relations
0053   /// if cloneRelations=false, the relations are not cloned and will be empty
0054   MutableTrackState clone(bool cloneRelations = true) const;
0055 
0056   /// destructor
0057   ~TrackState() = default;
0058 
0059   /// converting constructor from mutable object
0060   TrackState(const MutableTrackState& other);
0061 
0062   static TrackState makeEmpty();
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   /// check whether the object is actually available
0072   bool isAvailable() const;
0073   /// disconnect from TrackStateObj instance
0074   void unlink() {
0075     m_obj = podio::utils::MaybeSharedPtr<TrackStateObj>{nullptr};
0076   }
0077 
0078   bool operator==(const TrackState& other) const {
0079     return m_obj == other.m_obj;
0080   }
0081   bool operator==(const MutableTrackState& other) const;
0082 
0083   bool operator!=(const TrackState& other) const { return !(*this == other); }
0084   bool operator!=(const MutableTrackState& other) const {
0085     return !(*this == other);
0086   }
0087 
0088   // less comparison operator, so that objects can be e.g. stored in sets.
0089   bool operator<(const TrackState& other) const { return m_obj < other.m_obj; }
0090 
0091   podio::ObjectID id() const { return getObjectID(); }
0092 
0093   const podio::ObjectID getObjectID() const;
0094 
0095   friend void swap(TrackState& a, TrackState& b) {
0096     using std::swap;
0097     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0098   }
0099 
0100  private:
0101   /// constructor from existing TrackStateObj
0102   explicit TrackState(podio::utils::MaybeSharedPtr<TrackStateObj> obj);
0103   TrackState(TrackStateObj* obj);
0104 
0105   podio::utils::MaybeSharedPtr<TrackStateObj> m_obj{nullptr};
0106 };
0107 
0108 std::ostream& operator<<(std::ostream& o, const TrackState& value);
0109 
0110 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0111 void to_json(nlohmann::json& j, const TrackState& value);
0112 #endif
0113 
0114 }  // namespace ActsPodioEdm
0115 
0116 #endif