EDM4eic
EIC data model
Loading...
Searching...
No Matches
Trajectory.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Trajectory_H
4#define EDM4EIC_Trajectory_H
5
7
10#include "podio/RelationRange.h"
11#include <cstdint>
12#include <vector>
13
14#include "podio/utilities/MaybeSharedPtr.h"
15
16#include <ostream>
17#include <cstdint>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23// forward declarations
24namespace edm4eic {
25class TrackSeed;
26class MutableTrackSeed;
27}
28
29
30namespace edm4eic {
31
32class MutableTrajectory;
33class TrajectoryCollection;
34class TrajectoryCollectionData;
35
36/** @class Trajectory
37 * Raw trajectory from the tracking algorithm. What is called hit here is 2d measurement indeed.
38 * @author: S. Joosten, S. Li
39 */
41
42 friend class MutableTrajectory;
46
47public:
50
51 /// default constructor
52 Trajectory();
53
54 /// Constructor initializing all members
55 Trajectory(std::uint32_t type, std::uint32_t nStates, std::uint32_t nMeasurements, std::uint32_t nOutliers, std::uint32_t nHoles, std::uint32_t nSharedHits);
56
57 /// copy constructor
58 Trajectory(const Trajectory& other) = default;
59
60 /// copy-assignment operator
62
63 /// create a mutable deep-copy of the object with identical relations
64 /// if cloneRelations=false, the relations are not cloned and will be empty
65 MutableTrajectory clone(bool cloneRelations=true) const;
66
67 /// destructor
68 ~Trajectory() = default;
69
70 /// converting constructor from mutable object
71 Trajectory(const MutableTrajectory& other);
72
73 static Trajectory makeEmpty();
74
75public:
76
77 /// Access the 0 (does not have good track fit), 1 (has good track fit)
78 std::uint32_t getType() const;
79
80 /// Access the Number of tracking steps
81 std::uint32_t getNStates() const;
82
83 /// Access the Number of hits used
84 std::uint32_t getNMeasurements() const;
85
86 /// Access the Number of hits not considered
87 std::uint32_t getNOutliers() const;
88
89 /// Access the Number of missing hits
90 std::uint32_t getNHoles() const;
91
92 /// Access the Number of shared hits with other trajectories
93 std::uint32_t getNSharedHits() const;
94
95
96 /// Access the Corresponding track seed
97 const edm4eic::TrackSeed getSeed() const;
98
99 std::size_t trackParameters_size() const;
101 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_begin() const;
102 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_end() const;
103 podio::RelationRange<edm4eic::TrackParameters> getTrackParameters() const;
104 std::size_t measurements_deprecated_size() const;
106 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_begin() const;
107 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_end() const;
108 podio::RelationRange<edm4eic::Measurement2D> getMeasurements_deprecated() const;
109 std::size_t outliers_deprecated_size() const;
111 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_begin() const;
112 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_end() const;
113 podio::RelationRange<edm4eic::Measurement2D> getOutliers_deprecated() const;
114 std::size_t measurementChi2_size() const;
115 float getMeasurementChi2(std::size_t) const;
116 std::vector<float>::const_iterator measurementChi2_begin() const;
117 std::vector<float>::const_iterator measurementChi2_end() const;
118 podio::RelationRange<float> getMeasurementChi2() const;
119 std::size_t outlierChi2_size() const;
120 float getOutlierChi2(std::size_t) const;
121 std::vector<float>::const_iterator outlierChi2_begin() const;
122 std::vector<float>::const_iterator outlierChi2_end() const;
123 podio::RelationRange<float> getOutlierChi2() const;
124
125
126 /// check whether the object is actually available
127 bool isAvailable() const;
128 /// disconnect from TrajectoryObj instance
129 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrajectoryObj>{nullptr}; }
130
131 bool operator==(const Trajectory& other) const { return m_obj == other.m_obj; }
132 bool operator==(const MutableTrajectory& other) const;
133
134 bool operator!=(const Trajectory& other) const { return !(*this == other); }
135 bool operator!=(const MutableTrajectory& other) const { return !(*this == other); }
136
137 // less comparison operator, so that objects can be e.g. stored in sets.
138 bool operator<(const Trajectory& other) const { return m_obj < other.m_obj; }
139
140 podio::ObjectID id() const { return getObjectID(); }
141
142 const podio::ObjectID getObjectID() const;
143
144 friend void swap(Trajectory& a, Trajectory& b) {
145 using std::swap;
146 swap(a.m_obj, b.m_obj); // swap out the internal pointers
147 }
148
149private:
150 /// constructor from existing TrajectoryObj
151 explicit Trajectory(podio::utils::MaybeSharedPtr<TrajectoryObj> obj);
153
154 podio::utils::MaybeSharedPtr<TrajectoryObj> m_obj{nullptr};
155};
156
157std::ostream& operator<<(std::ostream& o, const Trajectory& value);
158
159#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
160void to_json(nlohmann::json& j, const Trajectory& value);
161#endif
162
163
164} // namespace edm4eic
165
166
167#endif
Definition Measurement2D.h:36
Definition MutableTrajectory.h:38
Definition TrackParameters.h:33
Definition TrackSeed.h:39
Definition TrajectoryCollectionData.h:33
Definition TrajectoryCollection.h:92
Definition TrajectoryCollection.h:37
Definition Trajectory.h:40
MutableTrajectory clone(bool cloneRelations=true) const
Definition Trajectory.cc:39
Trajectory & operator=(Trajectory other)
copy-assignment operator
Definition Trajectory.cc:34
static Trajectory makeEmpty()
Definition Trajectory.cc:112
bool isAvailable() const
check whether the object is actually available
Definition Trajectory.cc:295
std::vector< edm4eic::Measurement2D >::const_iterator outliers_deprecated_end() const
Definition Trajectory.cc:202
podio::RelationRange< float > getMeasurementChi2() const
Definition Trajectory.cc:251
bool operator==(const Trajectory &other) const
Definition Trajectory.h:131
podio::RelationRange< edm4eic::TrackParameters > getTrackParameters() const
Definition Trajectory.cc:155
podio::RelationRange< float > getOutlierChi2() const
Definition Trajectory.cc:283
std::vector< float >::const_iterator outlierChi2_begin() const
Definition Trajectory.cc:260
std::vector< edm4eic::TrackParameters >::const_iterator trackParameters_end() const
Definition Trajectory.cc:138
std::vector< edm4eic::TrackParameters >::const_iterator trackParameters_begin() const
Definition Trajectory.cc:132
std::uint32_t getNHoles() const
Access the Number of missing hits.
Definition Trajectory.cc:120
Trajectory()
default constructor
Definition Trajectory.cc:21
~Trajectory()=default
destructor
bool operator!=(const MutableTrajectory &other) const
Definition Trajectory.h:135
friend void swap(Trajectory &a, Trajectory &b)
Definition Trajectory.h:144
std::uint32_t getNSharedHits() const
Access the Number of shared hits with other trajectories.
Definition Trajectory.cc:121
std::uint32_t getType() const
Access the 0 (does not have good track fit), 1 (has good track fit)
Definition Trajectory.cc:116
bool operator!=(const Trajectory &other) const
Definition Trajectory.h:134
friend class TrajectoryCollection
Definition Trajectory.h:43
std::uint32_t getNMeasurements() const
Access the Number of hits used.
Definition Trajectory.cc:118
std::vector< edm4eic::Measurement2D >::const_iterator outliers_deprecated_begin() const
Definition Trajectory.cc:196
std::vector< float >::const_iterator measurementChi2_begin() const
Definition Trajectory.cc:228
std::size_t measurementChi2_size() const
Definition Trajectory.cc:240
std::uint32_t getNOutliers() const
Access the Number of hits not considered.
Definition Trajectory.cc:119
const edm4eic::TrackSeed getSeed() const
Access the Corresponding track seed.
Definition Trajectory.cc:123
Trajectory(const Trajectory &other)=default
copy constructor
podio::RelationRange< edm4eic::Measurement2D > getMeasurements_deprecated() const
Definition Trajectory.cc:187
std::vector< float >::const_iterator outlierChi2_end() const
Definition Trajectory.cc:266
std::vector< edm4eic::Measurement2D >::const_iterator measurements_deprecated_end() const
Definition Trajectory.cc:170
std::uint32_t getNStates() const
Access the Number of tracking steps.
Definition Trajectory.cc:117
void unlink()
disconnect from TrajectoryObj instance
Definition Trajectory.h:129
podio::ObjectID id() const
Definition Trajectory.h:140
friend class MutableTrajectory
Definition Trajectory.h:42
const podio::ObjectID getObjectID() const
Definition Trajectory.cc:299
std::size_t outliers_deprecated_size() const
Definition Trajectory.cc:208
bool operator<(const Trajectory &other) const
Definition Trajectory.h:138
std::vector< float >::const_iterator measurementChi2_end() const
Definition Trajectory.cc:234
std::size_t trackParameters_size() const
Definition Trajectory.cc:144
podio::RelationRange< edm4eic::Measurement2D > getOutliers_deprecated() const
Definition Trajectory.cc:219
std::vector< edm4eic::Measurement2D >::const_iterator measurements_deprecated_begin() const
Definition Trajectory.cc:164
std::size_t outlierChi2_size() const
Definition Trajectory.cc:272
std::size_t measurements_deprecated_size() const
Definition Trajectory.cc:176
Definition TrajectoryObj.h:24
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103