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