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