File indexing completed on 2025-07-11 08:30:10
0001
0002
0003 #ifndef EDM4EIC_TrackParameters_H
0004 #define EDM4EIC_TrackParameters_H
0005
0006 #include "edm4eic/TrackParametersObj.h"
0007
0008 #include "edm4eic/Cov6f.h"
0009 #include "edm4hep/Vector2f.h"
0010 #include <cstdint>
0011
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013 #include "podio/detail/OrderKey.h"
0014
0015 #include <ostream>
0016 #include <cstdint>
0017
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021
0022
0023 namespace edm4eic {
0024 class TrackParametersCollection;
0025 }
0026
0027
0028 namespace podio::detail {
0029
0030 OrderKey getOrderKey(const edm4eic::TrackParameters& obj);
0031 };
0032
0033 namespace edm4eic {
0034
0035 class MutableTrackParameters;
0036 class TrackParametersCollection;
0037 class TrackParametersCollectionData;
0038
0039
0040
0041
0042
0043 class TrackParameters {
0044
0045 friend class MutableTrackParameters;
0046 friend class TrackParametersCollection;
0047 friend class edm4eic::TrackParametersCollectionData;
0048 friend class TrackParametersCollectionIterator;
0049 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackParameters & obj);
0050
0051 public:
0052 using mutable_type = MutableTrackParameters;
0053 using collection_type = TrackParametersCollection;
0054
0055
0056 TrackParameters();
0057
0058
0059 TrackParameters(std::int32_t type, std::uint64_t surface, edm4hep::Vector2f loc, float theta, float phi, float qOverP, float time, std::int32_t pdg, edm4eic::Cov6f covariance);
0060
0061
0062 TrackParameters(const TrackParameters& other) = default;
0063
0064
0065 TrackParameters& operator=(TrackParameters other);
0066
0067
0068
0069 MutableTrackParameters clone(bool cloneRelations=true) const;
0070
0071
0072 ~TrackParameters() = default;
0073
0074
0075 TrackParameters(const MutableTrackParameters& other);
0076
0077 static TrackParameters makeEmpty();
0078
0079 public:
0080
0081 static constexpr auto typeName = "edm4eic::TrackParameters";
0082
0083
0084 std::int32_t getType() const;
0085
0086
0087 std::uint64_t getSurface() const;
0088
0089
0090 const edm4hep::Vector2f& getLoc() const;
0091
0092
0093 float getTheta() const;
0094
0095
0096 float getPhi() const;
0097
0098
0099 float getQOverP() const;
0100
0101
0102 float getTime() const;
0103
0104
0105 std::int32_t getPdg() const;
0106
0107
0108 const edm4eic::Cov6f& getCovariance() const;
0109
0110
0111
0112
0113
0114
0115 bool isAvailable() const;
0116
0117 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
0118
0119 bool operator==(const TrackParameters& other) const { return m_obj == other.m_obj; }
0120 bool operator==(const MutableTrackParameters& other) const;
0121
0122 bool operator!=(const TrackParameters& other) const { return !(*this == other); }
0123 bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
0124
0125
0126 bool operator<(const TrackParameters& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0127
0128 podio::ObjectID id() const { return getObjectID(); }
0129
0130 const podio::ObjectID getObjectID() const;
0131
0132 friend void swap(TrackParameters& a, TrackParameters& b) {
0133 using std::swap;
0134 swap(a.m_obj, b.m_obj);
0135 }
0136
0137 private:
0138
0139 explicit TrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
0140 TrackParameters(TrackParametersObj* obj);
0141
0142 podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
0143 };
0144
0145 std::ostream& operator<<(std::ostream& o, const TrackParameters& value);
0146
0147 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0148 void to_json(nlohmann::json& j, const TrackParameters& value);
0149 #endif
0150
0151
0152 }
0153
0154
0155 #endif