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) = 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
99 /// Set the Number of tracking steps
100 void setNStates(const std::uint32_t nStates);
101 /// Get mutable reference to Number of tracking steps
102 std::uint32_t& getNStates();
103
104 /// Set the Number of hits used
105 void setNMeasurements(const std::uint32_t nMeasurements);
106 /// Get mutable reference to Number of hits used
107 std::uint32_t& getNMeasurements();
108
109 /// Set the Number of hits not considered
110 void setNOutliers(const std::uint32_t nOutliers);
111 /// Get mutable reference to Number of hits not considered
112 std::uint32_t& getNOutliers();
113
114 /// Set the Number of missing hits
115 void setNHoles(const std::uint32_t nHoles);
116 /// Get mutable reference to Number of missing hits
117 std::uint32_t& getNHoles();
118
119 /// Set the Number of shared hits with other trajectories
120 void setNSharedHits(const std::uint32_t nSharedHits);
121 /// Get mutable reference to Number of shared hits with other trajectories
122 std::uint32_t& getNSharedHits();
123
124
125 /// Set the Corresponding track seed
126 void setSeed(const edm4eic::TrackSeed& value);
127
129 std::size_t trackParameters_size() const;
131 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_begin() const;
132 std::vector<edm4eic::TrackParameters>::const_iterator trackParameters_end() const;
133 podio::RelationRange<edm4eic::TrackParameters> getTrackParameters() const;
135 std::size_t measurements_deprecated_size() const;
137 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_begin() const;
138 std::vector<edm4eic::Measurement2D>::const_iterator measurements_deprecated_end() const;
139 podio::RelationRange<edm4eic::Measurement2D> getMeasurements_deprecated() const;
141 std::size_t outliers_deprecated_size() const;
143 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_begin() const;
144 std::vector<edm4eic::Measurement2D>::const_iterator outliers_deprecated_end() const;
145 podio::RelationRange<edm4eic::Measurement2D> getOutliers_deprecated() const;
146 void addToMeasurementChi2(const float&);
147 std::size_t measurementChi2_size() const;
148 float getMeasurementChi2(std::size_t) const;
149 std::vector<float>::const_iterator measurementChi2_begin() const;
150 std::vector<float>::const_iterator measurementChi2_end() const;
151 podio::RelationRange<float> getMeasurementChi2() const;
152 void addToOutlierChi2(const float&);
153 std::size_t outlierChi2_size() const;
154 float getOutlierChi2(std::size_t) const;
155 std::vector<float>::const_iterator outlierChi2_begin() const;
156 std::vector<float>::const_iterator outlierChi2_end() const;
157 podio::RelationRange<float> getOutlierChi2() const;
158
159
160
161 /// check whether the object is actually available
162 bool isAvailable() const;
163 /// disconnect from TrajectoryObj instance
164 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrajectoryObj>{nullptr}; }
165
166 constexpr bool operator==(const MutableTrajectory& other) const { return m_obj == other.m_obj; }
167 bool operator==(const Trajectory& other) const;
168
169 constexpr bool operator!=(const MutableTrajectory& other) const { return !(*this == other); }
170 bool operator!=(const Trajectory& other) const { return !(*this == other); }
171
172 // less comparison operator, so that objects can be e.g. stored in sets.
173 bool operator<(const MutableTrajectory& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
174
175 podio::ObjectID id() const { return getObjectID(); }
176
177 const podio::ObjectID getObjectID() const;
178
179 friend std::hash<MutableTrajectory>;
180
182 using std::swap;
183 swap(a.m_obj, b.m_obj); // swap out the internal pointers
184 }
185
186private:
187 /// constructor from existing TrajectoryObj
188 explicit MutableTrajectory(podio::utils::MaybeSharedPtr<TrajectoryObj> obj);
189
190 podio::utils::MaybeSharedPtr<TrajectoryObj> m_obj{new TrajectoryObj{}, podio::utils::MarkOwned};
191};
192
193#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
194void to_json(nlohmann::json& j, const MutableTrajectory& value);
195#endif
196
197
198} // namespace edm4eic
199
200
201
202template<>
203struct std::hash<edm4eic::MutableTrajectory> {
204 std::size_t operator()(const edm4eic::MutableTrajectory& obj) const {
205 return std::hash<edm4eic::TrajectoryObj*>{}(obj.m_obj.get());
206 }
207};
208
209
210#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:169
std::vector< float >::const_iterator outlierChi2_begin() const
Definition MutableTrajectory.cc:240
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:173
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:175
MutableTrajectory(const MutableTrajectory &other)=default
copy constructor
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:170
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
podio::RelationRange< float > getOutlierChi2() const
Definition MutableTrajectory.cc:263
constexpr bool operator==(const MutableTrajectory &other) const
Definition MutableTrajectory.h:166
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:164
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:181
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:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrajectory &obj) const
Definition MutableTrajectory.h:204