Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-18 09:56:49

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/detail/OrderKey.h"
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 // forward declarations
0021 namespace ActsPodioEdm {
0022 class TrackStateCollection;
0023 }
0024 
0025 namespace podio::detail {
0026 // Internal function used in less comparison operators of the datatypes and
0027 // interface types
0028 OrderKey getOrderKey(const ActsPodioEdm::TrackState& obj);
0029 };  // namespace podio::detail
0030 
0031 namespace ActsPodioEdm {
0032 
0033 class MutableTrackState;
0034 class TrackStateCollection;
0035 class TrackStateCollectionData;
0036 
0037 /** @class TrackState
0038  *  Local state on a track
0039  *  @author: Paul Gessinger, CERN
0040  */
0041 class TrackState {
0042   friend class MutableTrackState;
0043   friend class TrackStateCollection;
0044   friend class ActsPodioEdm::TrackStateCollectionData;
0045   friend class TrackStateCollectionIterator;
0046   friend podio::detail::OrderKey podio::detail::getOrderKey(
0047       const TrackState& obj);
0048 
0049  public:
0050   using mutable_type = MutableTrackState;
0051   using collection_type = TrackStateCollection;
0052 
0053   /// default constructor
0054   TrackState() = default;
0055 
0056   /// Constructor initializing all members
0057   TrackState(const ActsPodioEdm::TrackStateInfo& data,
0058              const ActsPodioEdm::Surface& referenceSurface);
0059 
0060   /// copy constructor
0061   TrackState(const TrackState& other) noexcept = default;
0062 
0063   /// move constructor
0064   TrackState(TrackState&& other) noexcept = default;
0065 
0066   /// copy-assignment operator
0067   TrackState& operator=(
0068       TrackState other) &;  // Rebind this to other's internal object
0069   TrackState& operator=(TrackState other) && =
0070       delete;  // Prevent rebinding temporary as the changes wouldn't persist
0071 
0072   /// create a mutable deep-copy of the object with identical relations
0073   /// if cloneRelations=false, the relations are not cloned and will be empty
0074   MutableTrackState clone(bool cloneRelations = true) const;
0075 
0076   /// destructor
0077   ~TrackState() = default;
0078 
0079   /// converting constructor from mutable object
0080   TrackState(const MutableTrackState& other);
0081 
0082   static TrackState makeEmpty();
0083 
0084  public:
0085   static constexpr std::string_view typeName = "ActsPodioEdm::TrackState";
0086 
0087   /// Access the local information
0088   const ActsPodioEdm::TrackStateInfo& getData() const;
0089 
0090   /// Access the reference surface
0091   const ActsPodioEdm::Surface& getReferenceSurface() const;
0092 
0093   /// check whether the object is actually available
0094   bool isAvailable() const;
0095   /// disconnect from TrackStateObj instance
0096   void unlink() {
0097     m_obj = podio::utils::MaybeSharedPtr<TrackStateObj>{nullptr};
0098   }
0099 
0100   constexpr bool operator==(const TrackState& other) const {
0101     return m_obj == other.m_obj;
0102   }
0103   bool operator==(const MutableTrackState& other) const;
0104 
0105   constexpr bool operator!=(const TrackState& other) const {
0106     return !(*this == other);
0107   }
0108   bool operator!=(const MutableTrackState& other) const {
0109     return !(*this == other);
0110   }
0111 
0112   // less comparison operator, so that objects can be e.g. stored in sets.
0113   bool operator<(const TrackState& other) const {
0114     return podio::detail::getOrderKey(*this) <
0115            podio::detail::getOrderKey(other);
0116   }
0117 
0118   podio::ObjectID id() const { return getObjectID(); }
0119 
0120   const podio::ObjectID getObjectID() const;
0121 
0122   friend std::hash<TrackState>;
0123 
0124   friend void swap(TrackState& a, TrackState& b) {
0125     using std::swap;
0126     swap(a.m_obj, b.m_obj);  // swap out the internal pointers
0127   }
0128 
0129  private:
0130   /// constructor from existing TrackStateObj
0131   explicit TrackState(podio::utils::MaybeSharedPtr<TrackStateObj> obj);
0132   TrackState(TrackStateObj* obj);
0133 
0134   podio::utils::MaybeSharedPtr<TrackStateObj> m_obj{new TrackStateObj{},
0135                                                     podio::utils::MarkOwned};
0136 };
0137 
0138 std::ostream& operator<<(std::ostream& o, const TrackState& value);
0139 
0140 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0141 void to_json(nlohmann::json& j, const TrackState& value);
0142 #endif
0143 
0144 }  // namespace ActsPodioEdm
0145 
0146 template <>
0147 struct std::hash<ActsPodioEdm::TrackState> {
0148   std::size_t operator()(const ActsPodioEdm::TrackState& obj) const {
0149     return std::hash<ActsPodioEdm::TrackStateObj*>{}(obj.m_obj.get());
0150   }
0151 };
0152 
0153 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0154 // until it's fixed in ROOT. See
0155 // https://github.com/root-project/root/issues/18489 and
0156 // https://github.com/AIDASoft/podio/issues/770
0157 #if defined(__clang__)
0158 #pragma clang diagnostic push
0159 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0160 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0161 #pragma clang diagnostic ignored "-Wdeprecated"
0162 constexpr std::string_view ActsPodioEdm::TrackState::typeName;
0163 #pragma clang diagnostic pop
0164 #elif defined(__GNUC__)
0165 #pragma GCC diagnostic push
0166 #pragma GCC diagnostic ignored "-Wdeprecated"
0167 constexpr std::string_view ActsPodioEdm::TrackState::typeName;
0168 #pragma GCC diagnostic pop
0169 #endif
0170 
0171 #endif