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#include "podio/detail/OrderKey.h"
16
17#include <ostream>
18#include <cstdint>
19
20#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
21#include "nlohmann/json_fwd.hpp"
22#endif
23
24// forward declarations
25namespace edm4eic {
27class TrackSeed;
29}
30
31
32namespace podio::detail {
33// Internal function used in less comparison operators of the datatypes and interface types
34OrderKey getOrderKey(const edm4eic::Trajectory& obj);
35};
36
37namespace edm4eic {
38
42
43/** @class Trajectory
44 * Raw trajectory from the tracking algorithm. What is called hit here is 2d measurement indeed.
45 * @author: S. Joosten, S. Li
46 */
48
49 friend class MutableTrajectory;
53 friend podio::detail::OrderKey podio::detail::getOrderKey(const Trajectory & obj);
54
55public:
58
59 /// default constructor
60 Trajectory();
61
62 /// Constructor initializing all members
63 Trajectory(const std::uint32_t type, const std::uint32_t nStates, const std::uint32_t nMeasurements, const std::uint32_t nOutliers, const std::uint32_t nHoles, const std::uint32_t nSharedHits);
64
65 /// copy constructor
66 Trajectory(const Trajectory& other) = default;
67
68 /// copy-assignment operator
69 Trajectory& operator=(Trajectory other) &; // Rebind this to other's internal object
70 Trajectory& operator=(Trajectory other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
71
72 /// create a mutable deep-copy of the object with identical relations
73 /// if cloneRelations=false, the relations are not cloned and will be empty
74 MutableTrajectory clone(bool cloneRelations=true) const;
75
76 /// destructor
77 ~Trajectory() = default;
78
79 /// converting constructor from mutable object
80 Trajectory(const MutableTrajectory& other);
81
82 static Trajectory makeEmpty();
83
84public:
85
86 static constexpr std::string_view typeName = "edm4eic::Trajectory";
87
88 /// Access the 0 (does not have good track fit), 1 (has good track fit)
89 std::uint32_t getType() const;
90
91 /// Access the Number of tracking steps
92 std::uint32_t getNStates() const;
93
94 /// Access the Number of hits used
95 std::uint32_t getNMeasurements() const;
96
97 /// Access the Number of hits not considered
98 std::uint32_t getNOutliers() const;
99
100 /// Access the Number of missing hits
101 std::uint32_t getNHoles() const;
102
103 /// Access the Number of shared hits with other trajectories
104 std::uint32_t getNSharedHits() const;
105
106
107 /// Access the Corresponding track seed
108 const edm4eic::TrackSeed getSeed() const;
109
110 std::size_t trackParameters_size() const;
112 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_begin() const;
113 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_end() const;
114 podio::RelationRange<edm4eic::TrackParameters> getTrackParameters() const;
115 std::size_t measurements_deprecated_size() const;
117 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_begin() const;
118 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_end() const;
119 podio::RelationRange<edm4eic::Measurement2D> getMeasurements_deprecated() const;
120 std::size_t outliers_deprecated_size() const;
122 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_begin() const;
123 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_end() const;
124 podio::RelationRange<edm4eic::Measurement2D> getOutliers_deprecated() const;
125 std::size_t measurementChi2_size() const;
126 float getMeasurementChi2(std::size_t) const;
127 std::vector<float>::const_iterator measurementChi2_begin() const;
128 std::vector<float>::const_iterator measurementChi2_end() const;
129 podio::RelationRange<float> getMeasurementChi2() const;
130 std::size_t outlierChi2_size() const;
131 float getOutlierChi2(std::size_t) const;
132 std::vector<float>::const_iterator outlierChi2_begin() const;
133 std::vector<float>::const_iterator outlierChi2_end() const;
134 podio::RelationRange<float> getOutlierChi2() const;
135
136
137 /// check whether the object is actually available
138 bool isAvailable() const;
139 /// disconnect from TrajectoryObj instance
140 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrajectoryObj>{nullptr}; }
141
142 bool operator==(const Trajectory& other) const { return m_obj == other.m_obj; }
143 bool operator==(const MutableTrajectory& other) const;
144
145 bool operator!=(const Trajectory& other) const { return !(*this == other); }
146 bool operator!=(const MutableTrajectory& other) const { return !(*this == other); }
147
148 // less comparison operator, so that objects can be e.g. stored in sets.
149 bool operator<(const Trajectory& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
150
151 podio::ObjectID id() const { return getObjectID(); }
152
153 const podio::ObjectID getObjectID() const;
154
155 friend std::hash<Trajectory>;
156
157 friend void swap(Trajectory& a, Trajectory& b) {
158 using std::swap;
159 swap(a.m_obj, b.m_obj); // swap out the internal pointers
160 }
161
162private:
163 /// constructor from existing TrajectoryObj
164 explicit Trajectory(podio::utils::MaybeSharedPtr<TrajectoryObj> obj);
166
167 podio::utils::MaybeSharedPtr<TrajectoryObj> m_obj{nullptr};
168};
169
170std::ostream& operator<<(std::ostream& o, const Trajectory& value);
171
172#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
173void to_json(nlohmann::json& j, const Trajectory& value);
174#endif
175
176
177} // namespace edm4eic
178
179
180
181template<>
182struct std::hash<edm4eic::Trajectory> {
183 std::size_t operator()(const edm4eic::Trajectory& obj) const {
184 return std::hash<edm4eic::TrajectoryObj*>{}(obj.m_obj.get());
185 }
186};
187
188
189// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
190// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
191// and https://github.com/AIDASoft/podio/issues/770
192#if defined(__clang__)
193#pragma clang diagnostic push
194#pragma clang diagnostic ignored "-Wunknown-warning-option"
195#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
196#pragma clang diagnostic ignored "-Wdeprecated"
197constexpr std::string_view edm4eic::Trajectory::typeName;
198#pragma clang diagnostic pop
199#elif defined(__GNUC__)
200#pragma GCC diagnostic push
201#pragma GCC diagnostic ignored "-Wdeprecated"
202constexpr std::string_view edm4eic::Trajectory::typeName;
203#pragma GCC diagnostic pop
204#endif
205
206#endif
Definition Measurement2D.h:46
Definition MutableTrackSeed.h:38
Definition MutableTrajectory.h:39
Definition TrackParameters.h:43
Definition TrackSeed.h:46
Definition TrajectoryCollectionData.h:33
Definition TrajectoryCollection.h:137
Definition Trajectory.h:47
MutableTrajectory clone(bool cloneRelations=true) const
Definition Trajectory.cc:39
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:142
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
friend class TrajectoryCollectionIterator
Definition Trajectory.h:52
Trajectory()
default constructor
Definition Trajectory.cc:21
~Trajectory()=default
destructor
bool operator!=(const MutableTrajectory &other) const
Definition Trajectory.h:146
friend void swap(Trajectory &a, Trajectory &b)
Definition Trajectory.h:157
Trajectory & operator=(Trajectory other) &&=delete
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:145
friend class TrajectoryCollection
Definition Trajectory.h:50
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
TrajectoryCollection collection_type
Definition Trajectory.h:57
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
static constexpr std::string_view typeName
Definition Trajectory.h:86
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:140
podio::ObjectID id() const
Definition Trajectory.h:151
Trajectory & operator=(Trajectory other) &
copy-assignment operator
Definition Trajectory.cc:34
friend class MutableTrajectory
Definition Trajectory.h:49
const podio::ObjectID getObjectID() const
Definition Trajectory.cc:299
MutableTrajectory mutable_type
Definition Trajectory.h:56
std::size_t outliers_deprecated_size() const
Definition Trajectory.cc:208
bool operator<(const Trajectory &other) const
Definition Trajectory.h:149
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:25
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
std::size_t operator()(const edm4eic::Trajectory &obj) const
Definition Trajectory.h:183