File indexing completed on 2025-01-18 09:55:31
0001
0002
0003 #ifndef EDM4EIC_MutableTrackParameters_H
0004 #define EDM4EIC_MutableTrackParameters_H
0005
0006 #include "edm4eic/TrackParametersObj.h"
0007
0008 #include "edm4eic/TrackParameters.h"
0009
0010 #include "edm4eic/Cov6f.h"
0011 #include "edm4hep/Vector2f.h"
0012 #include <cstdint>
0013
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015
0016 #include <cstdint>
0017
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021
0022
0023
0024 namespace edm4eic {
0025
0026
0027
0028
0029
0030
0031 class MutableTrackParameters {
0032
0033 friend class TrackParametersCollection;
0034 friend class TrackParametersMutableCollectionIterator;
0035 friend class TrackParameters;
0036
0037 public:
0038 using object_type = TrackParameters;
0039 using collection_type = TrackParametersCollection;
0040
0041
0042 MutableTrackParameters();
0043
0044
0045 MutableTrackParameters(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);
0046
0047
0048 MutableTrackParameters(const MutableTrackParameters& other) = default;
0049
0050
0051 MutableTrackParameters& operator=(MutableTrackParameters other);
0052
0053
0054
0055 MutableTrackParameters clone(bool cloneRelations=true) const;
0056
0057
0058 ~MutableTrackParameters() = default;
0059
0060
0061 public:
0062
0063
0064 std::int32_t getType() const;
0065
0066
0067 std::uint64_t getSurface() const;
0068
0069
0070 const edm4hep::Vector2f& getLoc() const;
0071
0072
0073 float getTheta() const;
0074
0075
0076 float getPhi() const;
0077
0078
0079 float getQOverP() const;
0080
0081
0082 float getTime() const;
0083
0084
0085 std::int32_t getPdg() const;
0086
0087
0088 const edm4eic::Cov6f& getCovariance() const;
0089
0090
0091
0092
0093 void setType(std::int32_t value);
0094
0095 std::int32_t& getType();
0096
0097 [[deprecated("use getType instead")]]
0098 std::int32_t& type();
0099
0100
0101 void setSurface(std::uint64_t value);
0102
0103 std::uint64_t& getSurface();
0104
0105 [[deprecated("use getSurface instead")]]
0106 std::uint64_t& surface();
0107
0108
0109 void setLoc(edm4hep::Vector2f value);
0110
0111 edm4hep::Vector2f& getLoc();
0112
0113 [[deprecated("use getLoc instead")]]
0114 edm4hep::Vector2f& loc();
0115
0116
0117 void setTheta(float value);
0118
0119 float& getTheta();
0120
0121 [[deprecated("use getTheta instead")]]
0122 float& theta();
0123
0124
0125 void setPhi(float value);
0126
0127 float& getPhi();
0128
0129 [[deprecated("use getPhi instead")]]
0130 float& phi();
0131
0132
0133 void setQOverP(float value);
0134
0135 float& getQOverP();
0136
0137 [[deprecated("use getQOverP instead")]]
0138 float& qOverP();
0139
0140
0141 void setTime(float value);
0142
0143 float& getTime();
0144
0145 [[deprecated("use getTime instead")]]
0146 float& time();
0147
0148
0149 void setPdg(std::int32_t value);
0150
0151 std::int32_t& getPdg();
0152
0153 [[deprecated("use getPdg instead")]]
0154 std::int32_t& pdg();
0155
0156
0157 void setCovariance(edm4eic::Cov6f value);
0158
0159 edm4eic::Cov6f& getCovariance();
0160
0161 [[deprecated("use getCovariance instead")]]
0162 edm4eic::Cov6f& covariance();
0163
0164
0165
0166
0167
0168
0169
0170 bool isAvailable() const;
0171
0172 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
0173
0174 bool operator==(const MutableTrackParameters& other) const { return m_obj == other.m_obj; }
0175 bool operator==(const TrackParameters& other) const;
0176
0177 bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
0178 bool operator!=(const TrackParameters& other) const { return !(*this == other); }
0179
0180
0181 bool operator<(const MutableTrackParameters& other) const { return m_obj < other.m_obj; }
0182
0183 podio::ObjectID id() const { return getObjectID(); }
0184
0185 const podio::ObjectID getObjectID() const;
0186
0187 friend void swap(MutableTrackParameters& a, MutableTrackParameters& b) {
0188 using std::swap;
0189 swap(a.m_obj, b.m_obj);
0190 }
0191
0192 private:
0193
0194 explicit MutableTrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
0195
0196 podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
0197 };
0198
0199 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0200 void to_json(nlohmann::json& j, const MutableTrackParameters& value);
0201 #endif
0202
0203
0204 }
0205
0206
0207 #endif