EICd
EIC data model
TrackSegment.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_TrackSegment_H
4#define EICD_TrackSegment_H
5
7
8#include "eicd/TrackPoint.h"
9#include "podio/RelationRange.h"
10#include <vector>
11#include "podio/ObjectID.h"
12#include <ostream>
13
14#ifdef PODIO_JSON_OUTPUT
15#include "nlohmann/json.hpp"
16#endif
17
18// forward declarations
19namespace eicd {
20class Track;
21class MutableTrack;
22}
23
24
25namespace eicd {
26
27class MutableTrackSegment;
28
29/** @class TrackSegment
30 * A track segment defined by one or more points along a track.
31 * @author: S. Joosten
32 */
34
35 friend class MutableTrackSegment;
38
39public:
40 /// default constructor
42 TrackSegment(float length, float lengthError);
43
44 /// constructor from existing TrackSegmentObj
46
47 /// copy constructor
48 TrackSegment(const TrackSegment& other);
49
50 /// copy-assignment operator
52
53 /// create a mutable deep-copy of the object with identical relations
55
56 /// destructor
58
59
60public:
61
62 /// Access the Pathlength from the first to the last point
63 const float& getLength() const;
64
65 /// Access the Error on the segment length
66 const float& getLengthError() const;
67
68
69 /// Access the Track used for this projection
70 const eicd::Track getTrack() const;
71
72 unsigned int points_size() const;
73 eicd::TrackPoint getPoints(unsigned int) const;
74 std::vector<eicd::TrackPoint>::const_iterator points_begin() const;
75 std::vector<eicd::TrackPoint>::const_iterator points_end() const;
76 podio::RelationRange<eicd::TrackPoint> getPoints() const;
77
78
79 /// check whether the object is actually available
80 bool isAvailable() const;
81 /// disconnect from TrackSegmentObj instance
82 void unlink() { m_obj = nullptr; }
83
84 bool operator==(const TrackSegment& other) const { return m_obj == other.m_obj; }
85 bool operator==(const MutableTrackSegment& other) const;
86
87 // less comparison operator, so that objects can be e.g. stored in sets.
88 bool operator<(const TrackSegment& other) const { return m_obj < other.m_obj; }
89
90 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
91
92 const podio::ObjectID getObjectID() const;
93
94 friend void swap(TrackSegment& a, TrackSegment& b) {
95 using std::swap;
96 swap(a.m_obj, b.m_obj); // swap out the internal pointers
97 }
98
99private:
100 TrackSegmentObj* m_obj;
101};
102
103std::ostream& operator<<(std::ostream& o, const TrackSegment& value);
104
105#ifdef PODIO_JSON_OUTPUT
106void to_json(nlohmann::json& j, const TrackSegment& value);
107#endif
108
109
110} // namespace eicd
111
112
113#endif
Definition: MutableTrackSegment.h:34
Definition: Track.h:32
Definition: TrackPoint.h:18
Definition: TrackSegmentCollection.h:82
Definition: TrackSegmentCollection.h:35
Definition: TrackSegment.h:33
TrackSegment()
default constructor
Definition: TrackSegment.cc:17
const eicd::Track getTrack() const
Access the Track used for this projection.
Definition: TrackSegment.cc:55
const float & getLengthError() const
Access the Error on the segment length.
Definition: TrackSegment.cc:53
std::vector< eicd::TrackPoint >::const_iterator points_end() const
Definition: TrackSegment.cc:70
const podio::ObjectID getObjectID() const
Definition: TrackSegment.cc:106
~TrackSegment()
destructor
Definition: TrackSegment.cc:46
std::vector< eicd::TrackPoint >::const_iterator points_begin() const
Definition: TrackSegment.cc:64
bool isAvailable() const
check whether the object is actually available
Definition: TrackSegment.cc:99
unsigned int id() const
Definition: TrackSegment.h:90
podio::RelationRange< eicd::TrackPoint > getPoints() const
Definition: TrackSegment.cc:87
friend void swap(TrackSegment &a, TrackSegment &b)
Definition: TrackSegment.h:94
unsigned int points_size() const
Definition: TrackSegment.cc:76
MutableTrackSegment clone() const
create a mutable deep-copy of the object with identical relations
Definition: TrackSegment.cc:42
bool operator==(const TrackSegment &other) const
Definition: TrackSegment.h:84
void unlink()
disconnect from TrackSegmentObj instance
Definition: TrackSegment.h:82
bool operator<(const TrackSegment &other) const
Definition: TrackSegment.h:88
const float & getLength() const
Access the Pathlength from the first to the last point.
Definition: TrackSegment.cc:52
TrackSegment & operator=(TrackSegment other)
copy-assignment operator
Definition: TrackSegment.cc:31
Definition: TrackSegmentObj.h:23
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93