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 TrackSegmentCollection;
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
52
53 /// copy constructor
55
56 /// copy-assignment operator
58
59 /// create a mutable deep-copy of the object with identical relations
60 /// if cloneRelations=false, the relations are not cloned and will be empty
61 MutableTrackSegment clone(bool cloneRelations=true) const;
62
63 /// destructor
65
66
67public:
68
69 /// Access the Pathlength from the first to the last point
70 float getLength() const;
71
72 /// Access the Error on the segment length
73 float getLengthError() const;
74
75
76 /// Access the Track used for this projection
77 const edm4eic::Track getTrack() const;
78
79 /// Set the Pathlength from the first to the last point
80 void setLength(float value);
81 /// Get mutable reference to Pathlength from the first to the last point
82 float& getLength();
83 /// Get reference to Pathlength from the first to the last point
84 [[deprecated("use getLength instead")]]
85 float& length();
86
87 /// Set the Error on the segment length
88 void setLengthError(float value);
89 /// Get mutable reference to Error on the segment length
90 float& getLengthError();
91 /// Get reference to Error on the segment length
92 [[deprecated("use getLengthError instead")]]
93 float& lengthError();
94
95
96 /// Set the Track used for this projection
97 void setTrack(const edm4eic::Track& value);
98
100 std::size_t points_size() const;
101 edm4eic::TrackPoint getPoints(std::size_t) const;
102 std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
103 std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
104 podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
105
106
107
108 /// check whether the object is actually available
109 bool isAvailable() const;
110 /// disconnect from TrackSegmentObj instance
111 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
112
113 bool operator==(const MutableTrackSegment& other) const { return m_obj == other.m_obj; }
114 bool operator==(const TrackSegment& other) const;
115
116 bool operator!=(const MutableTrackSegment& other) const { return !(*this == other); }
117 bool operator!=(const TrackSegment& other) const { return !(*this == other); }
118
119 // less comparison operator, so that objects can be e.g. stored in sets.
120 bool operator<(const MutableTrackSegment& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
121
122 podio::ObjectID id() const { return getObjectID(); }
123
124 const podio::ObjectID getObjectID() const;
125
127 using std::swap;
128 swap(a.m_obj, b.m_obj); // swap out the internal pointers
129 }
130
131private:
132 /// constructor from existing TrackSegmentObj
133 explicit MutableTrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
134
135 podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
136};
137
138#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
139void to_json(nlohmann::json& j, const MutableTrackSegment& value);
140#endif
141
142
143} // namespace edm4eic
144
145
146#endif
Definition MutableTrackSegment.h:37
friend class TrackSegmentCollection
Definition MutableTrackSegment.h:39
podio::RelationRange< edm4eic::TrackPoint > getPoints() const
Definition MutableTrackSegment.cc:97
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:74
bool operator<(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:120
std::vector< edm4eic::TrackPoint >::const_iterator points_end() const
Definition MutableTrackSegment.cc:80
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:110
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:41
friend void swap(MutableTrackSegment &a, MutableTrackSegment &b)
Definition MutableTrackSegment.h:126
bool operator!=(const TrackSegment &other) const
Definition MutableTrackSegment.h:117
~MutableTrackSegment()=default
destructor
void unlink()
disconnect from TrackSegmentObj instance
Definition MutableTrackSegment.h:111
void setLengthError(float value)
Set the Error on the segment length.
Definition MutableTrackSegment.cc:60
std::size_t points_size() const
Definition MutableTrackSegment.cc:86
bool operator==(const MutableTrackSegment &other) const
Definition MutableTrackSegment.h:113
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:116
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:114
podio::ObjectID id() const
Definition MutableTrackSegment.h:122
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:69
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:48
Definition TrackPoint.h:22
Definition TrackSegmentCollection.h:91
Definition TrackSegment.h:45
Definition TrackSegmentCollection.h:62
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150