EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrajectory.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrajectory_H
4#define EDM4EIC_MutableTrajectory_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
12#include "podio/RelationRange.h"
13#include <cstdint>
14#include <vector>
15
16#include "podio/utilities/MaybeSharedPtr.h"
17
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 edm4eic {
33
34
35/** @class MutableTrajectory
36 * Raw trajectory from the tracking algorithm. What is called hit here is 2d measurement indeed.
37 * @author: S. Joosten, S. Li
38 */
40
43 friend class Trajectory;
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableTrajectory(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);
54
55 /// copy constructor
56 MutableTrajectory(const MutableTrajectory& other) = default;
57
58 /// copy-assignment operator
59 MutableTrajectory& operator=(MutableTrajectory other) &; // Rebind this to other's internal object
60 MutableTrajectory& operator=(MutableTrajectory other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
61
62 /// create a mutable deep-copy of the object with identical relations
63 /// if cloneRelations=false, the relations are not cloned and will be empty
64 MutableTrajectory clone(bool cloneRelations=true) const;
65
66 /// destructor
67 ~MutableTrajectory() = default;
68
69
70public:
71
72 /// Access the 0 (does not have good track fit), 1 (has good track fit)
73 std::uint32_t getType() const;
74
75 /// Access the Number of tracking steps
76 std::uint32_t getNStates() const;
77
78 /// Access the Number of hits used
79 std::uint32_t getNMeasurements() const;
80
81 /// Access the Number of hits not considered
82 std::uint32_t getNOutliers() const;
83
84 /// Access the Number of missing hits
85 std::uint32_t getNHoles() const;
86
87 /// Access the Number of shared hits with other trajectories
88 std::uint32_t getNSharedHits() const;
89
90
91 /// Access the Corresponding track seed
92 const edm4eic::TrackSeed getSeed() const;
93
94 /// Set the 0 (does not have good track fit), 1 (has good track fit)
95 void setType(const std::uint32_t type);
96 /// Get mutable reference to 0 (does not have good track fit), 1 (has good track fit)
97 std::uint32_t& getType();
98 /// Get reference to 0 (does not have good track fit), 1 (has good track fit)
99 [[deprecated("use getType instead")]]
100 std::uint32_t& type();
101
102 /// Set the Number of tracking steps
103 void setNStates(const std::uint32_t nStates);
104 /// Get mutable reference to Number of tracking steps
105 std::uint32_t& getNStates();
106 /// Get reference to Number of tracking steps
107 [[deprecated("use getNStates instead")]]
108 std::uint32_t& nStates();
109
110 /// Set the Number of hits used
111 void setNMeasurements(const std::uint32_t nMeasurements);
112 /// Get mutable reference to Number of hits used
113 std::uint32_t& getNMeasurements();
114 /// Get reference to Number of hits used
115 [[deprecated("use getNMeasurements instead")]]
116 std::uint32_t& nMeasurements();
117
118 /// Set the Number of hits not considered
119 void setNOutliers(const std::uint32_t nOutliers);
120 /// Get mutable reference to Number of hits not considered
121 std::uint32_t& getNOutliers();
122 /// Get reference to Number of hits not considered
123 [[deprecated("use getNOutliers instead")]]
124 std::uint32_t& nOutliers();
125
126 /// Set the Number of missing hits
127 void setNHoles(const std::uint32_t nHoles);
128 /// Get mutable reference to Number of missing hits
129 std::uint32_t& getNHoles();
130 /// Get reference to Number of missing hits
131 [[deprecated("use getNHoles instead")]]
132 std::uint32_t& nHoles();
133
134 /// Set the Number of shared hits with other trajectories
135 void setNSharedHits(const std::uint32_t nSharedHits);
136 /// Get mutable reference to Number of shared hits with other trajectories
137 std::uint32_t& getNSharedHits();
138 /// Get reference to Number of shared hits with other trajectories
139 [[deprecated("use getNSharedHits instead")]]
140 std::uint32_t& nSharedHits();
141
142
143 /// Set the Corresponding track seed
144 void setSeed(const edm4eic::TrackSeed& value);
145
147 std::size_t trackParameters_size() const;
149 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_begin() const;
150 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_end() const;
151 podio::RelationRange<edm4eic::TrackParameters> getTrackParameters() const;
153 std::size_t measurements_deprecated_size() const;
155 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_begin() const;
156 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_end() const;
157 podio::RelationRange<edm4eic::Measurement2D> getMeasurements_deprecated() const;
159 std::size_t outliers_deprecated_size() const;
161 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_begin() const;
162 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_end() const;
163 podio::RelationRange<edm4eic::Measurement2D> getOutliers_deprecated() const;
164 void addToMeasurementChi2(const float&);
165 std::size_t measurementChi2_size() const;
166 float getMeasurementChi2(std::size_t) const;
167 std::vector<float>::const_iterator measurementChi2_begin() const;
168 std::vector<float>::const_iterator measurementChi2_end() const;
169 podio::RelationRange<float> getMeasurementChi2() const;
170 void addToOutlierChi2(const float&);
171 std::size_t outlierChi2_size() const;
172 float getOutlierChi2(std::size_t) const;
173 std::vector<float>::const_iterator outlierChi2_begin() const;
174 std::vector<float>::const_iterator outlierChi2_end() const;
175 podio::RelationRange<float> getOutlierChi2() const;
176
177
178
179 /// check whether the object is actually available
180 bool isAvailable() const;
181 /// disconnect from TrajectoryObj instance
182 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrajectoryObj>{nullptr}; }
183
184 bool operator==(const MutableTrajectory& other) const { return m_obj == other.m_obj; }
185 bool operator==(const Trajectory& other) const;
186
187 bool operator!=(const MutableTrajectory& other) const { return !(*this == other); }
188 bool operator!=(const Trajectory& other) const { return !(*this == other); }
189
190 // less comparison operator, so that objects can be e.g. stored in sets.
191 bool operator<(const MutableTrajectory& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
192
193 podio::ObjectID id() const { return getObjectID(); }
194
195 const podio::ObjectID getObjectID() const;
196
197 friend std::hash<MutableTrajectory>;
198
200 using std::swap;
201 swap(a.m_obj, b.m_obj); // swap out the internal pointers
202 }
203
204private:
205 /// constructor from existing TrajectoryObj
206 explicit MutableTrajectory(podio::utils::MaybeSharedPtr<TrajectoryObj> obj);
207
208 podio::utils::MaybeSharedPtr<TrajectoryObj> m_obj{nullptr};
209};
210
211#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
212void to_json(nlohmann::json& j, const MutableTrajectory& value);
213#endif
214
215
216} // namespace edm4eic
217
218
219
220template<>
221struct std::hash<edm4eic::MutableTrajectory> {
222 std::size_t operator()(const edm4eic::MutableTrajectory& obj) const {
223 return std::hash<edm4eic::TrajectoryObj*>{}(obj.m_obj.get());
224 }
225};
226
227
228#endif
Definition Measurement2D.h:46
Definition MutableTrackSeed.h:38
Definition MutableTrajectory.h:39
std::uint32_t getNMeasurements() const
Access the Number of hits used.
Definition MutableTrajectory.cc:64
podio::RelationRange< edm4eic::Measurement2D > getOutliers_deprecated() const
Definition MutableTrajectory.cc:201
std::vector< float >::const_iterator outlierChi2_begin() const
Definition MutableTrajectory.cc:250
void setNOutliers(const std::uint32_t nOutliers)
Set the Number of hits not considered.
Definition MutableTrajectory.cc:86
podio::RelationRange< float > getMeasurementChi2() const
Definition MutableTrajectory.cc:237
std::size_t outliers_deprecated_size() const
Definition MutableTrajectory.cc:190
podio::RelationRange< edm4eic::TrackParameters > getTrackParameters() const
Definition MutableTrajectory.cc:129
bool operator<(const MutableTrajectory &other) const
Definition MutableTrajectory.h:191
std::uint32_t getNOutliers() const
Access the Number of hits not considered.
Definition MutableTrajectory.cc:65
void addToMeasurementChi2(const float &)
Definition MutableTrajectory.cc:209
std::vector< edm4eic::Measurement2D >::const_iterator outliers_deprecated_end() const
Definition MutableTrajectory.cc:184
void setNStates(const std::uint32_t nStates)
Set the Number of tracking steps.
Definition MutableTrajectory.cc:80
std::uint32_t & type()
Get reference to 0 (does not have good track fit), 1 (has good track fit)
Definition MutableTrajectory.cc:79
std::size_t measurements_deprecated_size() const
Definition MutableTrajectory.cc:154
std::uint32_t & nSharedHits()
Get reference to Number of shared hits with other trajectories.
Definition MutableTrajectory.cc:94
void setType(const std::uint32_t type)
Set the 0 (does not have good track fit), 1 (has good track fit)
Definition MutableTrajectory.cc:77
std::uint32_t & nOutliers()
Get reference to Number of hits not considered.
Definition MutableTrajectory.cc:88
void addToOutliers_deprecated(const edm4eic::Measurement2D &)
Definition MutableTrajectory.cc:173
podio::ObjectID id() const
Definition MutableTrajectory.h:193
bool operator==(const MutableTrajectory &other) const
Definition MutableTrajectory.h:184
MutableTrajectory(const MutableTrajectory &other)=default
copy constructor
void addToMeasurements_deprecated(const edm4eic::Measurement2D &)
Definition MutableTrajectory.cc:137
std::uint32_t & nStates()
Get reference to Number of tracking steps.
Definition MutableTrajectory.cc:82
MutableTrajectory & operator=(MutableTrajectory other) &&=delete
void addToTrackParameters(const edm4eic::TrackParameters &)
Definition MutableTrajectory.cc:101
void setNHoles(const std::uint32_t nHoles)
Set the Number of missing hits.
Definition MutableTrajectory.cc:89
std::vector< edm4eic::Measurement2D >::const_iterator measurements_deprecated_end() const
Definition MutableTrajectory.cc:148
~MutableTrajectory()=default
destructor
const edm4eic::TrackSeed getSeed() const
Access the Corresponding track seed.
Definition MutableTrajectory.cc:69
std::vector< float >::const_iterator measurementChi2_end() const
Definition MutableTrajectory.cc:220
bool operator!=(const Trajectory &other) const
Definition MutableTrajectory.h:188
friend class TrajectoryCollection
Definition MutableTrajectory.h:41
MutableTrajectory clone(bool cloneRelations=true) const
Definition MutableTrajectory.cc:37
MutableTrajectory()
default constructor
Definition MutableTrajectory.cc:19
std::vector< float >::const_iterator outlierChi2_end() const
Definition MutableTrajectory.cc:256
void setNMeasurements(const std::uint32_t nMeasurements)
Set the Number of hits used.
Definition MutableTrajectory.cc:83
Trajectory object_type
Definition MutableTrajectory.h:46
bool isAvailable() const
check whether the object is actually available
Definition MutableTrajectory.cc:286
podio::RelationRange< float > getOutlierChi2() const
Definition MutableTrajectory.cc:273
void setSeed(const edm4eic::TrackSeed &value)
Set the Corresponding track seed.
Definition MutableTrajectory.cc:96
std::uint32_t getType() const
Access the 0 (does not have good track fit), 1 (has good track fit)
Definition MutableTrajectory.cc:62
std::vector< float >::const_iterator measurementChi2_begin() const
Definition MutableTrajectory.cc:214
friend class TrajectoryMutableCollectionIterator
Definition MutableTrajectory.h:42
std::uint32_t getNStates() const
Access the Number of tracking steps.
Definition MutableTrajectory.cc:63
friend class Trajectory
Definition MutableTrajectory.h:43
const podio::ObjectID getObjectID() const
Definition MutableTrajectory.cc:290
std::uint32_t getNHoles() const
Access the Number of missing hits.
Definition MutableTrajectory.cc:66
bool operator!=(const MutableTrajectory &other) const
Definition MutableTrajectory.h:187
std::uint32_t & nMeasurements()
Get reference to Number of hits used.
Definition MutableTrajectory.cc:85
std::size_t measurementChi2_size() const
Definition MutableTrajectory.cc:226
void unlink()
disconnect from TrajectoryObj instance
Definition MutableTrajectory.h:182
std::vector< edm4eic::Measurement2D >::const_iterator measurements_deprecated_begin() const
Definition MutableTrajectory.cc:142
podio::RelationRange< edm4eic::Measurement2D > getMeasurements_deprecated() const
Definition MutableTrajectory.cc:165
TrajectoryCollection collection_type
Definition MutableTrajectory.h:47
std::uint32_t & nHoles()
Get reference to Number of missing hits.
Definition MutableTrajectory.cc:91
void addToOutlierChi2(const float &)
Definition MutableTrajectory.cc:245
void setNSharedHits(const std::uint32_t nSharedHits)
Set the Number of shared hits with other trajectories.
Definition MutableTrajectory.cc:92
MutableTrajectory & operator=(MutableTrajectory other) &
copy-assignment operator
Definition MutableTrajectory.cc:32
std::vector< edm4eic::Measurement2D >::const_iterator outliers_deprecated_begin() const
Definition MutableTrajectory.cc:178
friend void swap(MutableTrajectory &a, MutableTrajectory &b)
Definition MutableTrajectory.h:199
std::size_t outlierChi2_size() const
Definition MutableTrajectory.cc:262
std::vector< edm4eic::TrackParameters >::const_iterator trackParameters_end() const
Definition MutableTrajectory.cc:112
std::uint32_t getNSharedHits() const
Access the Number of shared hits with other trajectories.
Definition MutableTrajectory.cc:67
std::vector< edm4eic::TrackParameters >::const_iterator trackParameters_begin() const
Definition MutableTrajectory.cc:106
std::size_t trackParameters_size() const
Definition MutableTrajectory.cc:118
Definition TrackParameters.h:43
Definition TrackSeed.h:46
Definition TrajectoryCollection.h:137
Definition Trajectory.h:47
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableTrajectory &obj) const
Definition MutableTrajectory.h:222