Warning, file /include/edm4eic/MutableTrackSegment.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_MutableTrackSegment_H
0004 #define EDM4EIC_MutableTrackSegment_H
0005
0006 #include "edm4eic/TrackSegmentObj.h"
0007
0008 #include "edm4eic/TrackSegment.h"
0009
0010 #include "edm4eic/TrackPoint.h"
0011 #include "podio/RelationRange.h"
0012 #include <vector>
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 TrackSegmentCollection;
0025 class Track;
0026 class MutableTrack;
0027 }
0028
0029
0030 namespace edm4eic {
0031
0032
0033
0034
0035
0036
0037 class MutableTrackSegment {
0038
0039 friend class TrackSegmentCollection;
0040 friend class TrackSegmentMutableCollectionIterator;
0041 friend class TrackSegment;
0042
0043 public:
0044 using object_type = TrackSegment;
0045 using collection_type = TrackSegmentCollection;
0046
0047
0048 MutableTrackSegment();
0049
0050
0051 MutableTrackSegment(float length, float lengthError);
0052
0053
0054 MutableTrackSegment(const MutableTrackSegment& other) = default;
0055
0056
0057 MutableTrackSegment& operator=(MutableTrackSegment other);
0058
0059
0060
0061 MutableTrackSegment clone(bool cloneRelations=true) const;
0062
0063
0064 ~MutableTrackSegment() = default;
0065
0066
0067 public:
0068
0069
0070 float getLength() const;
0071
0072
0073 float getLengthError() const;
0074
0075
0076
0077 const edm4eic::Track getTrack() const;
0078
0079
0080 void setLength(float value);
0081
0082 float& getLength();
0083
0084 [[deprecated("use getLength instead")]]
0085 float& length();
0086
0087
0088 void setLengthError(float value);
0089
0090 float& getLengthError();
0091
0092 [[deprecated("use getLengthError instead")]]
0093 float& lengthError();
0094
0095
0096
0097 void setTrack(const edm4eic::Track& value);
0098
0099 void addToPoints(const edm4eic::TrackPoint&);
0100 std::size_t points_size() const;
0101 edm4eic::TrackPoint getPoints(std::size_t) const;
0102 std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
0103 std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
0104 podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
0105
0106
0107
0108
0109 bool isAvailable() const;
0110
0111 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
0112
0113 bool operator==(const MutableTrackSegment& other) const { return m_obj == other.m_obj; }
0114 bool operator==(const TrackSegment& other) const;
0115
0116 bool operator!=(const MutableTrackSegment& other) const { return !(*this == other); }
0117 bool operator!=(const TrackSegment& other) const { return !(*this == other); }
0118
0119
0120 bool operator<(const MutableTrackSegment& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0121
0122 podio::ObjectID id() const { return getObjectID(); }
0123
0124 const podio::ObjectID getObjectID() const;
0125
0126 friend void swap(MutableTrackSegment& a, MutableTrackSegment& b) {
0127 using std::swap;
0128 swap(a.m_obj, b.m_obj);
0129 }
0130
0131 private:
0132
0133 explicit MutableTrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
0134
0135 podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
0136 };
0137
0138 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0139 void to_json(nlohmann::json& j, const MutableTrackSegment& value);
0140 #endif
0141
0142
0143 }
0144
0145
0146 #endif