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
50 MutableTrajectory() = default;
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) noexcept = default;
57
58 /// move constructor
59 MutableTrajectory(MutableTrajectory&& other) noexcept = default;
60
61 /// copy-assignment operator
62 MutableTrajectory& operator=(MutableTrajectory other) &; // Rebind this to other's internal object
63 MutableTrajectory& operator=(MutableTrajectory other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
64
65 /// create a mutable deep-copy of the object with identical relations
66 /// if cloneRelations=false, the relations are not cloned and will be empty
67 MutableTrajectory clone(bool cloneRelations=true) const;
68
69 /// destructor
70 ~MutableTrajectory() = default;
71
72
73public:
74
75 /// Access the 0 (does not have good track fit), 1 (has good track fit)
76 std::uint32_t getType() const;
77
78 /// Access the Number of tracking steps
79 std::uint32_t getNStates() const;
80
81 /// Access the Number of hits used
82 std::uint32_t getNMeasurements() const;
83
84 /// Access the Number of hits not considered
85 std::uint32_t getNOutliers() const;
86
87 /// Access the Number of missing hits
88 std::uint32_t getNHoles() const;
89
90 /// Access the Number of shared hits with other trajectories
91 std::uint32_t getNSharedHits() const;
92
93
94 /// Access the Corresponding track seed
95 const edm4eic::TrackSeed getSeed() const;
96
97 /// Set the 0 (does not have good track fit), 1 (has good track fit)
98 void setType(const std::uint32_t type);
99 /// Get mutable reference to 0 (does not have good track fit), 1 (has good track fit)
100 std::uint32_t& getType();
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
107 /// Set the Number of hits used
108 void setNMeasurements(const std::uint32_t nMeasurements);
109 /// Get mutable reference to Number of hits used
110 std::uint32_t& getNMeasurements();
111
112 /// Set the Number of hits not considered
113 void setNOutliers(const std::uint32_t nOutliers);
114 /// Get mutable reference to Number of hits not considered
115 std::uint32_t& getNOutliers();
116
117 /// Set the Number of missing hits
118 void setNHoles(const std::uint32_t nHoles);
119 /// Get mutable reference to Number of missing hits
120 std::uint32_t& getNHoles();
121
122 /// Set the Number of shared hits with other trajectories
123 void setNSharedHits(const std::uint32_t nSharedHits);
124 /// Get mutable reference to Number of shared hits with other trajectories
125 std::uint32_t& getNSharedHits();
126
127
128 /// Set the Corresponding track seed
129 void setSeed(const edm4eic::TrackSeed& value);
130
132 std::size_t trackParameters_size() const;
134 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_begin() const;
135 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_end() const;
136 podio::RelationRange<edm4eic::TrackParameters> getTrackParameters() const;
138 std::size_t measurements_deprecated_size() const;
140 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_begin() const;
141 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_end() const;
142 podio::RelationRange<edm4eic::Measurement2D> getMeasurements_deprecated() const;
144 std::size_t outliers_deprecated_size() const;
146 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_begin() const;
147 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_end() const;
148 podio::RelationRange<edm4eic::Measurement2D> getOutliers_deprecated() const;
149 void addToMeasurementChi2(const float&);
150 std::size_t measurementChi2_size() const;
151 float getMeasurementChi2(std::size_t) const;
152 std::vector<float>::const_iterator measurementChi2_begin() const;
153 std::vector<float>::const_iterator measurementChi2_end() const;
154 podio::RelationRange<float> getMeasurementChi2() const;
155 void addToOutlierChi2(const float&);
156 std::size_t outlierChi2_size() const;
157 float getOutlierChi2(std::size_t) const;
158 std::vector<float>::const_iterator outlierChi2_begin() const;
159 std::vector<float>::const_iterator outlierChi2_end() const;
160 podio::RelationRange<float> getOutlierChi2() const;
161
162
163
164 /// check whether the object is actually available
165 bool isAvailable() const;
166 /// disconnect from TrajectoryObj instance
167 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrajectoryObj>{nullptr}; }
168
169 constexpr bool operator==(const MutableTrajectory& other) const { return m_obj == other.m_obj; }
170 bool operator==(const Trajectory& other) const;
171
172 constexpr bool operator!=(const MutableTrajectory& other) const { return !(*this == other); }
173 bool operator!=(const Trajectory& other) const { return !(*this == other); }
174
175 // less comparison operator, so that objects can be e.g. stored in sets.
176 bool operator<(const MutableTrajectory& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
177
178 podio::ObjectID id() const { return getObjectID(); }
179
180 const podio::ObjectID getObjectID() const;
181
182 friend std::hash<MutableTrajectory>;
183
185 using std::swap;
186 swap(a.m_obj, b.m_obj); // swap out the internal pointers
187 }
188
189private:
190 /// constructor from existing TrajectoryObj
191 explicit MutableTrajectory(podio::utils::MaybeSharedPtr<TrajectoryObj> obj);
192
193 podio::utils::MaybeSharedPtr<TrajectoryObj> m_obj{new TrajectoryObj{}, podio::utils::MarkOwned};
194};
195
196#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
197void to_json(nlohmann::json& j, const MutableTrajectory& value);
198#endif
199
200
201} // namespace edm4eic
202
203
204
205template<>
206struct std::hash<edm4eic::MutableTrajectory> {
207 std::size_t operator()(const edm4eic::MutableTrajectory& obj) const {
208 return std::hash<edm4eic::TrajectoryObj*>{}(obj.m_obj.get());
209 }
210};
211
212
213#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:60
podio::RelationRange< edm4eic::Measurement2D > getOutliers_deprecated() const
Definition MutableTrajectory.cc:191
constexpr bool operator!=(const MutableTrajectory &other) const
Definition MutableTrajectory.h:172
std::vector< float >::const_iterator outlierChi2_begin() const
Definition MutableTrajectory.cc:240
MutableTrajectory(MutableTrajectory &&other) noexcept=default
move constructor
void setNOutliers(const std::uint32_t nOutliers)
Set the Number of hits not considered.
Definition MutableTrajectory.cc:79
podio::RelationRange< float > getMeasurementChi2() const
Definition MutableTrajectory.cc:227
std::size_t outliers_deprecated_size() const
Definition MutableTrajectory.cc:180
podio::RelationRange< edm4eic::TrackParameters > getTrackParameters() const
Definition MutableTrajectory.cc:119
bool operator<(const MutableTrajectory &other) const
Definition MutableTrajectory.h:176
std::uint32_t getNOutliers() const
Access the Number of hits not considered.
Definition MutableTrajectory.cc:61
void addToMeasurementChi2(const float &)
Definition MutableTrajectory.cc:199
std::vector< edm4eic::Measurement2D >::const_iterator outliers_deprecated_end() const
Definition MutableTrajectory.cc:174
void setNStates(const std::uint32_t nStates)
Set the Number of tracking steps.
Definition MutableTrajectory.cc:75
std::size_t measurements_deprecated_size() const
Definition MutableTrajectory.cc:144
void setType(const std::uint32_t type)
Set the 0 (does not have good track fit), 1 (has good track fit).
Definition MutableTrajectory.cc:73
void addToOutliers_deprecated(const edm4eic::Measurement2D &)
Definition MutableTrajectory.cc:163
podio::ObjectID id() const
Definition MutableTrajectory.h:178
void addToMeasurements_deprecated(const edm4eic::Measurement2D &)
Definition MutableTrajectory.cc:127
MutableTrajectory & operator=(MutableTrajectory other) &&=delete
void addToTrackParameters(const edm4eic::TrackParameters &)
Definition MutableTrajectory.cc:91
void setNHoles(const std::uint32_t nHoles)
Set the Number of missing hits.
Definition MutableTrajectory.cc:81
std::vector< edm4eic::Measurement2D >::const_iterator measurements_deprecated_end() const
Definition MutableTrajectory.cc:138
~MutableTrajectory()=default
destructor
const edm4eic::TrackSeed getSeed() const
Access the Corresponding track seed.
Definition MutableTrajectory.cc:65
std::vector< float >::const_iterator measurementChi2_end() const
Definition MutableTrajectory.cc:210
bool operator!=(const Trajectory &other) const
Definition MutableTrajectory.h:173
friend class TrajectoryCollection
Definition MutableTrajectory.h:41
MutableTrajectory clone(bool cloneRelations=true) const
Definition MutableTrajectory.cc:33
std::vector< float >::const_iterator outlierChi2_end() const
Definition MutableTrajectory.cc:246
void setNMeasurements(const std::uint32_t nMeasurements)
Set the Number of hits used.
Definition MutableTrajectory.cc:77
Trajectory object_type
Definition MutableTrajectory.h:46
MutableTrajectory()=default
default constructor
bool isAvailable() const
check whether the object is actually available
Definition MutableTrajectory.cc:276
MutableTrajectory(const MutableTrajectory &other) noexcept=default
copy constructor
podio::RelationRange< float > getOutlierChi2() const
Definition MutableTrajectory.cc:263
constexpr bool operator==(const MutableTrajectory &other) const
Definition MutableTrajectory.h:169
void setSeed(const edm4eic::TrackSeed &value)
Set the Corresponding track seed.
Definition MutableTrajectory.cc:86
std::uint32_t getType() const
Access the 0 (does not have good track fit), 1 (has good track fit).
Definition MutableTrajectory.cc:58
std::vector< float >::const_iterator measurementChi2_begin() const
Definition MutableTrajectory.cc:204
friend class TrajectoryMutableCollectionIterator
Definition MutableTrajectory.h:42
std::uint32_t getNStates() const
Access the Number of tracking steps.
Definition MutableTrajectory.cc:59
friend class Trajectory
Definition MutableTrajectory.h:43
const podio::ObjectID getObjectID() const
Definition MutableTrajectory.cc:280
std::uint32_t getNHoles() const
Access the Number of missing hits.
Definition MutableTrajectory.cc:62
std::size_t measurementChi2_size() const
Definition MutableTrajectory.cc:216
void unlink()
disconnect from TrajectoryObj instance
Definition MutableTrajectory.h:167
std::vector< edm4eic::Measurement2D >::const_iterator measurements_deprecated_begin() const
Definition MutableTrajectory.cc:132
podio::RelationRange< edm4eic::Measurement2D > getMeasurements_deprecated() const
Definition MutableTrajectory.cc:155
TrajectoryCollection collection_type
Definition MutableTrajectory.h:47
void addToOutlierChi2(const float &)
Definition MutableTrajectory.cc:235
void setNSharedHits(const std::uint32_t nSharedHits)
Set the Number of shared hits with other trajectories.
Definition MutableTrajectory.cc:83
MutableTrajectory & operator=(MutableTrajectory other) &
copy-assignment operator
Definition MutableTrajectory.cc:28
std::vector< edm4eic::Measurement2D >::const_iterator outliers_deprecated_begin() const
Definition MutableTrajectory.cc:168
friend void swap(MutableTrajectory &a, MutableTrajectory &b)
Definition MutableTrajectory.h:184
std::size_t outlierChi2_size() const
Definition MutableTrajectory.cc:252
std::vector< edm4eic::TrackParameters >::const_iterator trackParameters_end() const
Definition MutableTrajectory.cc:102
std::uint32_t getNSharedHits() const
Access the Number of shared hits with other trajectories.
Definition MutableTrajectory.cc:63
std::vector< edm4eic::TrackParameters >::const_iterator trackParameters_begin() const
Definition MutableTrajectory.cc:96
std::size_t trackParameters_size() const
Definition MutableTrajectory.cc:108
Definition TrackParameters.h:43
Definition TrackSeed.h:46
Definition TrajectoryCollection.h:139
Definition Trajectory.h:47
Definition TrajectoryObj.h:25
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrajectory &obj) const
Definition MutableTrajectory.h:207