EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrackSegment.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrackSegment_H
4#define EDM4EIC_MutableTrackSegment_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include "edm4eic/TrackPoint.h"
11#include "podio/RelationRange.h"
12#include <vector>
13
14#include "podio/utilities/MaybeSharedPtr.h"
15
16#include <cstdint>
17
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
20#endif
21
22// forward declarations
23namespace edm4eic {
24class Track;
25class MutableTrack;
26}
27
28
29namespace edm4eic {
30
31
32/** @class MutableTrackSegment
33 * A track segment defined by one or more points along a track.
34 * @author: S. Joosten
35 */
37
40 friend class TrackSegment;
41
42public:
45
46 /// default constructor
48
49 /// Constructor initializing all members
51
52 /// copy constructor
54
55 /// copy-assignment operator
57
58 /// create a mutable deep-copy of the object with identical relations
59 /// if cloneRelations=false, the relations are not cloned and will be empty
60 MutableTrackSegment clone(bool cloneRelations=true) const;
61
62 /// destructor
64
65
66public:
67
68 /// Access the Pathlength from the first to the last point
69 float getLength() const;
70
71 /// Access the Error on the segment length
72 float getLengthError() const;
73
74
75 /// Access the Track used for this projection
76 const edm4eic::Track getTrack() const;
77
78 /// Set the Pathlength from the first to the last point
79 void setLength(float value);
80 /// Get mutable reference to Pathlength from the first to the last point
81 float& getLength();
82 /// Get reference to Pathlength from the first to the last point
83 [[deprecated("use getLength instead")]]
84 float& length();
85
86 /// Set the Error on the segment length
87 void setLengthError(float value);
88 /// Get mutable reference to Error on the segment length
89 float& getLengthError();
90 /// Get reference to Error on the segment length
91 [[deprecated("use getLengthError instead")]]
92 float& lengthError();
93
94
95 /// Set the Track used for this projection
96 void setTrack(const edm4eic::Track& value);
97
99 std::size_t points_size() const;
100 edm4eic::TrackPoint getPoints(std::size_t) const;
101 std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
102 std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
103 podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
104
105
106
107 /// check whether the object is actually available
108 bool isAvailable() const;
109 /// disconnect from TrackSegmentObj instance
110 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
111
112 bool operator==(const MutableTrackSegment& other) const { return m_obj == other.m_obj; }
113 bool operator==(const TrackSegment& other) const;
114
115 bool operator!=(const MutableTrackSegment& other) const { return !(*this == other); }
116 bool operator!=(const TrackSegment& other) const { return !(*this == other); }
117
118 // less comparison operator, so that objects can be e.g. stored in sets.
119 bool operator<(const MutableTrackSegment& other) const { return m_obj < other.m_obj; }
120
121 podio::ObjectID id() const { return getObjectID(); }
122
123 const podio::ObjectID getObjectID() const;
124
126 using std::swap;
127 swap(a.m_obj, b.m_obj); // swap out the internal pointers
128 }
129
130private:
131 /// constructor from existing TrackSegmentObj
132 explicit MutableTrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
133
134 podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
135};
136
137#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
138void to_json(nlohmann::json& j, const MutableTrackSegment& value);
139#endif
140
141
142} // namespace edm4eic
143
144
145#endif
Definition MutableTrackSegment.h:36
friend class TrackSegmentCollection
Definition MutableTrackSegment.h:38
podio::RelationRange< edm4eic::TrackPoint > getPoints() const
Definition MutableTrackSegment.cc:98
MutableTrackSegment clone(bool cloneRelations=true) const
Definition MutableTrackSegment.cc:33
MutableTrackSegment()
default constructor
Definition MutableTrackSegment.cc:19
std::vector< edm4eic::TrackPoint >::const_iterator points_begin() const
Definition MutableTrackSegment.cc:75
bool operator<(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:119
std::vector< edm4eic::TrackPoint >::const_iterator points_end() const
Definition MutableTrackSegment.cc:81
float & lengthError()
Get reference to Error on the segment length.
Definition MutableTrackSegment.cc:62
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackSegment.cc:111
float & length()
Get reference to Pathlength from the first to the last point.
Definition MutableTrackSegment.cc:59
MutableTrackSegment(const MutableTrackSegment &other)=default
copy constructor
friend class TrackSegment
Definition MutableTrackSegment.h:40
friend void swap(MutableTrackSegment &a, MutableTrackSegment &b)
Definition MutableTrackSegment.h:125
bool operator!=(const TrackSegment &other) const
Definition MutableTrackSegment.h:116
~MutableTrackSegment()=default
destructor
void unlink()
disconnect from TrackSegmentObj instance
Definition MutableTrackSegment.h:110
void setLengthError(float value)
Set the Error on the segment length.
Definition MutableTrackSegment.cc:60
std::size_t points_size() const
Definition MutableTrackSegment.cc:87
bool operator==(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:112
const edm4eic::Track getTrack() const
Access the Track used for this projection.
Definition MutableTrackSegment.cc:49
bool operator!=(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:115
void setTrack(const edm4eic::Track &value)
Set the Track used for this projection.
Definition MutableTrackSegment.cc:64
const podio::ObjectID getObjectID() const
Definition MutableTrackSegment.cc:115
podio::ObjectID id() const
Definition MutableTrackSegment.h:121
float getLengthError() const
Access the Error on the segment length.
Definition MutableTrackSegment.cc:47
float getLength() const
Access the Pathlength from the first to the last point.
Definition MutableTrackSegment.cc:46
void addToPoints(const edm4eic::TrackPoint &)
Definition MutableTrackSegment.cc:70
void setLength(float value)
Set the Pathlength from the first to the last point.
Definition MutableTrackSegment.cc:57
MutableTrackSegment & operator=(MutableTrackSegment other)
copy-assignment operator
Definition MutableTrackSegment.cc:28
Definition Track.h:41
Definition TrackPoint.h:22
Definition TrackSegmentCollection.h:92
Definition TrackSegment.h:38
Definition TrackSegmentCollection.h:63
Definition CalorimeterHit.cc:17