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 <ostream>
17#include <cstddef>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23// forward declarations
24namespace edm4eic {
25class Track;
26class MutableTrack;
27}
28
29
30namespace edm4eic {
31
32
33/** @class MutableTrackSegment
34 * A track segment defined by one or more points along a track.
35 * @author: S. Joosten
36 */
38
41 friend class TrackSegment;
42
43public:
46
47 /// default constructor
49
50 /// Constructor initializing all members
51 MutableTrackSegment(float length, float lengthError);
52
53 /// copy constructor
55
56 /// copy-assignment operator
58
59 /// create a mutable deep-copy of the object with identical relations
61
62 /// destructor
64
65
66 /// conversion to const object
67 operator TrackSegment() const;
68
69public:
70
71 /// Access the Pathlength from the first to the last point
72 float getLength() const;
73
74 /// Access the Error on the segment length
75 float getLengthError() const;
76
77
78 /// Access the Track used for this projection
79 const edm4eic::Track getTrack() const;
80
81 /// Set the Pathlength from the first to the last point
82 void setLength(float value);
83
84 /// Set the Error on the segment length
85 void setLengthError(float value);
86
87
88 /// Set the Track used for this projection
89 void setTrack(edm4eic::Track value);
90
92 std::size_t points_size() const;
93 edm4eic::TrackPoint getPoints(std::size_t) const;
94 std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
95 std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
96 podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
97
98
99
100 /// check whether the object is actually available
101 bool isAvailable() const;
102 /// disconnect from TrackSegmentObj instance
103 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
104
105 bool operator==(const MutableTrackSegment& other) const { return m_obj == other.m_obj; }
106 bool operator==(const TrackSegment& other) const;
107
108 // less comparison operator, so that objects can be e.g. stored in sets.
109 bool operator<(const MutableTrackSegment& other) const { return m_obj < other.m_obj; }
110
111 podio::ObjectID id() const { return getObjectID(); }
112
113 const podio::ObjectID getObjectID() const;
114
116 using std::swap;
117 swap(a.m_obj, b.m_obj); // swap out the internal pointers
118 }
119
120private:
121 /// constructor from existing TrackSegmentObj
122 explicit MutableTrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
123
124 podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
125};
126
127#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
128void to_json(nlohmann::json& j, const MutableTrackSegment& value);
129#endif
130
131
132} // namespace edm4eic
133
134
135#endif
Definition MutableTrackSegment.h:37
friend class TrackSegmentCollection
Definition MutableTrackSegment.h:39
podio::RelationRange< edm4eic::TrackPoint > getPoints() const
Definition MutableTrackSegment.cc:93
MutableTrackSegment()
default constructor
Definition MutableTrackSegment.cc:22
void addToPoints(edm4eic::TrackPoint)
Definition MutableTrackSegment.cc:65
std::vector< edm4eic::TrackPoint >::const_iterator points_begin() const
Definition MutableTrackSegment.cc:70
bool operator<(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:109
std::vector< edm4eic::TrackPoint >::const_iterator points_end() const
Definition MutableTrackSegment.cc:76
void setTrack(edm4eic::Track value)
Set the Track used for this projection.
Definition MutableTrackSegment.cc:57
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackSegment.cc:106
MutableTrackSegment(const MutableTrackSegment &other)=default
copy constructor
friend class TrackSegment
Definition MutableTrackSegment.h:41
friend void swap(MutableTrackSegment &a, MutableTrackSegment &b)
Definition MutableTrackSegment.h:115
MutableTrackSegment clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableTrackSegment.cc:36
~MutableTrackSegment()=default
destructor
void unlink()
disconnect from TrackSegmentObj instance
Definition MutableTrackSegment.h:103
void setLengthError(float value)
Set the Error on the segment length.
Definition MutableTrackSegment.cc:55
std::size_t points_size() const
Definition MutableTrackSegment.cc:82
bool operator==(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:105
const edm4eic::Track getTrack() const
Access the Track used for this projection.
Definition MutableTrackSegment.cc:46
const podio::ObjectID getObjectID() const
Definition MutableTrackSegment.cc:113
podio::ObjectID id() const
Definition MutableTrackSegment.h:111
float getLengthError() const
Access the Error on the segment length.
Definition MutableTrackSegment.cc:44
float getLength() const
Access the Pathlength from the first to the last point.
Definition MutableTrackSegment.cc:43
void setLength(float value)
Set the Pathlength from the first to the last point.
Definition MutableTrackSegment.cc:54
MutableTrackSegment & operator=(MutableTrackSegment other)
copy-assignment operator
Definition MutableTrackSegment.cc:31
Definition Track.h:41
Definition TrackPoint.h:22
Definition TrackSegmentCollection.h:95
Definition TrackSegment.h:38
Definition TrackSegmentCollection.h:66
Definition CalorimeterHit.cc:18