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 <cstdint>
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
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableTrackSegment clone(bool cloneRelations=true) const;
64
65 /// destructor
66 ~TrackSegment() = default;
67
68 /// converting constructor from mutable object
70
71 static TrackSegment makeEmpty();
72
73public:
74
75 /// Access the Pathlength from the first to the last point
76 float getLength() const;
77
78 /// Access the Error on the segment length
79 float getLengthError() const;
80
81
82 /// Access the Track used for this projection
83 const edm4eic::Track getTrack() const;
84
85 std::size_t points_size() const;
86 edm4eic::TrackPoint getPoints(std::size_t) const;
87 std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
88 std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
89 podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
90
91
92 /// check whether the object is actually available
93 bool isAvailable() const;
94 /// disconnect from TrackSegmentObj instance
95 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
96
97 bool operator==(const TrackSegment& other) const { return m_obj == other.m_obj; }
98 bool operator==(const MutableTrackSegment& other) const;
99
100 bool operator!=(const TrackSegment& other) const { return !(*this == other); }
101 bool operator!=(const MutableTrackSegment& other) const { return !(*this == other); }
102
103 // less comparison operator, so that objects can be e.g. stored in sets.
104 bool operator<(const TrackSegment& other) const { return m_obj < other.m_obj; }
105
106 podio::ObjectID id() const { return getObjectID(); }
107
108 const podio::ObjectID getObjectID() const;
109
110 friend void swap(TrackSegment& a, TrackSegment& b) {
111 using std::swap;
112 swap(a.m_obj, b.m_obj); // swap out the internal pointers
113 }
114
115private:
116 /// constructor from existing TrackSegmentObj
117 explicit TrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
119
120 podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
121};
122
123std::ostream& operator<<(std::ostream& o, const TrackSegment& value);
124
125#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
126void to_json(nlohmann::json& j, const TrackSegment& value);
127#endif
128
129
130} // namespace edm4eic
131
132
133#endif
Definition MutableTrackSegment.h:36
Definition Track.h:41
Definition TrackPoint.h:22
Definition TrackSegmentCollectionData.h:31
Definition TrackSegmentCollection.h:92
Definition TrackSegmentCollection.h:37
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:68
friend class MutableTrackSegment
Definition TrackSegment.h:40
std::size_t points_size() const
Definition TrackSegment.cc:92
const podio::ObjectID getObjectID() const
Definition TrackSegment.cc:119
MutableTrackSegment clone(bool cloneRelations=true) const
Definition TrackSegment.cc:35
void unlink()
disconnect from TrackSegmentObj instance
Definition TrackSegment.h:95
~TrackSegment()=default
destructor
std::vector< edm4eic::TrackPoint >::const_iterator points_begin() const
Definition TrackSegment.cc:80
std::vector< edm4eic::TrackPoint >::const_iterator points_end() const
Definition TrackSegment.cc:86
bool isAvailable() const
check whether the object is actually available
Definition TrackSegment.cc:115
TrackSegment & operator=(TrackSegment other)
copy-assignment operator
Definition TrackSegment.cc:30
podio::RelationRange< edm4eic::TrackPoint > getPoints() const
Definition TrackSegment.cc:103
bool operator<(const TrackSegment &other) const
Definition TrackSegment.h:104
TrackSegment(const TrackSegment &other)=default
copy constructor
bool operator!=(const MutableTrackSegment &other) const
Definition TrackSegment.h:101
friend void swap(TrackSegment &a, TrackSegment &b)
Definition TrackSegment.h:110
TrackSegment()
default constructor
Definition TrackSegment.cc:21
const edm4eic::Track getTrack() const
Access the Track used for this projection.
Definition TrackSegment.cc:71
podio::ObjectID id() const
Definition TrackSegment.h:106
bool operator==(const TrackSegment &other) const
Definition TrackSegment.h:97
static TrackSegment makeEmpty()
Definition TrackSegment.cc:64
bool operator!=(const TrackSegment &other) const
Definition TrackSegment.h:100
float getLengthError() const
Access the Error on the segment length.
Definition TrackSegment.cc:69
Definition TrackSegmentObj.h:23
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103