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#include "podio/detail/OrderKey.h"
14
15#include <ostream>
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 podio::detail {
31// Internal function used in less comparison operators of the datatypes and interface types
32OrderKey getOrderKey(const edm4eic::TrackSegment& obj);
33};
34
35namespace edm4eic {
36
37class MutableTrackSegment;
38class TrackSegmentCollection;
39class TrackSegmentCollectionData;
40
41/** @class TrackSegment
42 * A track segment defined by one or more points along a track.
43 * @author: S. Joosten
44 */
46
47 friend class MutableTrackSegment;
51 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackSegment & obj);
52
53public:
56
57 /// default constructor
59
60 /// Constructor initializing all members
61 TrackSegment(float length, float lengthError);
62
63 /// copy constructor
64 TrackSegment(const TrackSegment& other) = default;
65
66 /// copy-assignment operator
68
69 /// create a mutable deep-copy of the object with identical relations
70 /// if cloneRelations=false, the relations are not cloned and will be empty
71 MutableTrackSegment clone(bool cloneRelations=true) const;
72
73 /// destructor
74 ~TrackSegment() = default;
75
76 /// converting constructor from mutable object
78
79 static TrackSegment makeEmpty();
80
81public:
82
83 static constexpr auto typeName = "edm4eic::TrackSegment";
84
85 /// Access the Pathlength from the first to the last point
86 float getLength() const;
87
88 /// Access the Error on the segment length
89 float getLengthError() const;
90
91
92 /// Access the Track used for this projection
93 const edm4eic::Track getTrack() const;
94
95 std::size_t points_size() const;
96 edm4eic::TrackPoint getPoints(std::size_t) const;
97 std::vector<edm4eic::TrackPoint>::const_iterator points_begin() const;
98 std::vector<edm4eic::TrackPoint>::const_iterator points_end() const;
99 podio::RelationRange<edm4eic::TrackPoint> getPoints() const;
100
101
102 /// check whether the object is actually available
103 bool isAvailable() const;
104 /// disconnect from TrackSegmentObj instance
105 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSegmentObj>{nullptr}; }
106
107 bool operator==(const TrackSegment& other) const { return m_obj == other.m_obj; }
108 bool operator==(const MutableTrackSegment& other) const;
109
110 bool operator!=(const TrackSegment& other) const { return !(*this == other); }
111 bool operator!=(const MutableTrackSegment& other) const { return !(*this == other); }
112
113 // less comparison operator, so that objects can be e.g. stored in sets.
114 bool operator<(const TrackSegment& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
115
116 podio::ObjectID id() const { return getObjectID(); }
117
118 const podio::ObjectID getObjectID() const;
119
120 friend void swap(TrackSegment& a, TrackSegment& b) {
121 using std::swap;
122 swap(a.m_obj, b.m_obj); // swap out the internal pointers
123 }
124
125private:
126 /// constructor from existing TrackSegmentObj
127 explicit TrackSegment(podio::utils::MaybeSharedPtr<TrackSegmentObj> obj);
129
130 podio::utils::MaybeSharedPtr<TrackSegmentObj> m_obj{nullptr};
131};
132
133std::ostream& operator<<(std::ostream& o, const TrackSegment& value);
134
135#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
136void to_json(nlohmann::json& j, const TrackSegment& value);
137#endif
138
139
140} // namespace edm4eic
141
142
143#endif
Definition MutableTrackSegment.h:37
Definition Track.h:48
Definition TrackPoint.h:22
Definition TrackSegmentCollectionData.h:31
Definition TrackSegmentCollection.h:91
Definition TrackSegmentCollection.h:36
Definition TrackSegment.h:45
friend class TrackSegmentCollection
Definition TrackSegment.h:48
float getLength() const
Access the Pathlength from the first to the last point.
Definition TrackSegment.cc:68
friend class MutableTrackSegment
Definition TrackSegment.h:47
std::size_t points_size() const
Definition TrackSegment.cc:92
const podio::ObjectID getObjectID() const
Definition TrackSegment.cc:119
static constexpr auto typeName
Definition TrackSegment.h:83
MutableTrackSegment clone(bool cloneRelations=true) const
Definition TrackSegment.cc:35
void unlink()
disconnect from TrackSegmentObj instance
Definition TrackSegment.h:105
~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:114
TrackSegment(const TrackSegment &other)=default
copy constructor
bool operator!=(const MutableTrackSegment &other) const
Definition TrackSegment.h:111
friend void swap(TrackSegment &a, TrackSegment &b)
Definition TrackSegment.h:120
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:116
bool operator==(const TrackSegment &other) const
Definition TrackSegment.h:107
static TrackSegment makeEmpty()
Definition TrackSegment.cc:64
bool operator!=(const TrackSegment &other) const
Definition TrackSegment.h:110
float getLengthError() const
Access the Error on the segment length.
Definition TrackSegment.cc:69
Definition TrackSegmentObj.h:24
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150