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