File indexing completed on 2025-01-18 09:55:33
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
0014 #include <ostream>
0015 #include <cstdint>
0016
0017 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0018 #include "nlohmann/json_fwd.hpp"
0019 #endif
0020
0021
0022
0023 namespace edm4eic {
0024
0025 class MutableTrackParameters;
0026 class TrackParametersCollection;
0027 class TrackParametersCollectionData;
0028
0029
0030
0031
0032
0033 class TrackParameters {
0034
0035 friend class MutableTrackParameters;
0036 friend class TrackParametersCollection;
0037 friend class edm4eic::TrackParametersCollectionData;
0038 friend class TrackParametersCollectionIterator;
0039
0040 public:
0041 using mutable_type = MutableTrackParameters;
0042 using collection_type = TrackParametersCollection;
0043
0044
0045 TrackParameters();
0046
0047
0048 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);
0049
0050
0051 TrackParameters(const TrackParameters& other) = default;
0052
0053
0054 TrackParameters& operator=(TrackParameters other);
0055
0056
0057
0058 MutableTrackParameters clone(bool cloneRelations=true) const;
0059
0060
0061 ~TrackParameters() = default;
0062
0063
0064 TrackParameters(const MutableTrackParameters& other);
0065
0066 static TrackParameters makeEmpty();
0067
0068 public:
0069
0070
0071 std::int32_t getType() const;
0072
0073
0074 std::uint64_t getSurface() const;
0075
0076
0077 const edm4hep::Vector2f& getLoc() const;
0078
0079
0080 float getTheta() const;
0081
0082
0083 float getPhi() const;
0084
0085
0086 float getQOverP() const;
0087
0088
0089 float getTime() const;
0090
0091
0092 std::int32_t getPdg() const;
0093
0094
0095 const edm4eic::Cov6f& getCovariance() const;
0096
0097
0098
0099
0100
0101
0102 bool isAvailable() const;
0103
0104 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
0105
0106 bool operator==(const TrackParameters& other) const { return m_obj == other.m_obj; }
0107 bool operator==(const MutableTrackParameters& other) const;
0108
0109 bool operator!=(const TrackParameters& other) const { return !(*this == other); }
0110 bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
0111
0112
0113 bool operator<(const TrackParameters& other) const { return m_obj < other.m_obj; }
0114
0115 podio::ObjectID id() const { return getObjectID(); }
0116
0117 const podio::ObjectID getObjectID() const;
0118
0119 friend void swap(TrackParameters& a, TrackParameters& b) {
0120 using std::swap;
0121 swap(a.m_obj, b.m_obj);
0122 }
0123
0124 private:
0125
0126 explicit TrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
0127 TrackParameters(TrackParametersObj* obj);
0128
0129 podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
0130 };
0131
0132 std::ostream& operator<<(std::ostream& o, const TrackParameters& value);
0133
0134 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0135 void to_json(nlohmann::json& j, const TrackParameters& value);
0136 #endif
0137
0138
0139 }
0140
0141
0142 #endif