EICd
EIC data model
MutableTrajectory.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_MutableTrajectory_H
4#define EICD_MutableTrajectory_H
5
7// Make the immutable class available from its mutable version but not vice versa
8#include "eicd/Trajectory.h"
9
10#include "eicd/TrackerHit.h"
11#include "podio/RelationRange.h"
12#include <cstdint>
13#include <vector>
14#include "podio/ObjectID.h"
15#include <ostream>
16
17#ifdef PODIO_JSON_OUTPUT
18#include "nlohmann/json.hpp"
19#endif
20
21// forward declarations
22namespace eicd {
23class TrackParameters;
24class MutableTrackParameters;
25}
26
27
28namespace eicd {
29
30
31/** @class MutableTrajectory
32 * Raw trajectory from the tracking algorithm
33 * @author: S. Joosten, S. Li
34 */
36
39 friend class Trajectory;
40
41public:
42
43 /// default constructor
45 MutableTrajectory(std::uint32_t type, std::uint32_t nStates, std::uint32_t nMeasurements, std::uint32_t nOutliers, std::uint32_t nHoles, float chi2, std::uint32_t ndf, std::uint32_t nSharedHits);
46
47 /// constructor from existing TrajectoryObj
49
50 /// copy constructor
52
53 /// copy-assignment operator
55
56 /// create a mutable deep-copy of the object with identical relations
58
59 /// destructor
61
62 /// conversion to const object
63 operator Trajectory() const;
64
65public:
66
67 /// Access the 0 (does not have good track fit), 1 (has good track fit)
68 const std::uint32_t& getType() const;
69
70 /// Access the Number of tracking steps
71 const std::uint32_t& getNStates() const;
72
73 /// Access the Number of hits used
74 const std::uint32_t& getNMeasurements() const;
75
76 /// Access the Number of hits not considered
77 const std::uint32_t& getNOutliers() const;
78
79 /// Access the Number of missing hits
80 const std::uint32_t& getNHoles() const;
81
82 /// Access the Total chi2
83 const float& getChi2() const;
84
85 /// Access the Number of degrees of freedom
86 const std::uint32_t& getNdf() const;
87
88 /// Access the Number of shared hits with other trajectories
89 const std::uint32_t& getNSharedHits() const;
90
91
92 /// Access the Associated track parameters, if any
94
95 /// Set the 0 (does not have good track fit), 1 (has good track fit)
96 void setType(std::uint32_t value);
97
98 /// Set the Number of tracking steps
99 void setNStates(std::uint32_t value);
100
101 /// Set the Number of hits used
102 void setNMeasurements(std::uint32_t value);
103
104 /// Set the Number of hits not considered
105 void setNOutliers(std::uint32_t value);
106
107 /// Set the Number of missing hits
108 void setNHoles(std::uint32_t value);
109
110 /// Set the Total chi2
111 void setChi2(float value);
112
113 /// Set the Number of degrees of freedom
114 void setNdf(std::uint32_t value);
115
116 /// Set the Number of shared hits with other trajectories
117 void setNSharedHits(std::uint32_t value);
118
119
120 /// Set the Associated track parameters, if any
122
124 unsigned int measurementHits_size() const;
125 eicd::TrackerHit getMeasurementHits(unsigned int) const;
126 std::vector<eicd::TrackerHit>::const_iterator measurementHits_begin() const;
127 std::vector<eicd::TrackerHit>::const_iterator measurementHits_end() const;
128 podio::RelationRange<eicd::TrackerHit> getMeasurementHits() const;
130 unsigned int outlierHits_size() const;
131 eicd::TrackerHit getOutlierHits(unsigned int) const;
132 std::vector<eicd::TrackerHit>::const_iterator outlierHits_begin() const;
133 std::vector<eicd::TrackerHit>::const_iterator outlierHits_end() const;
134 podio::RelationRange<eicd::TrackerHit> getOutlierHits() const;
135 void addToMeasurementChi2(float);
136 unsigned int measurementChi2_size() const;
137 float getMeasurementChi2(unsigned int) const;
138 std::vector<float>::const_iterator measurementChi2_begin() const;
139 std::vector<float>::const_iterator measurementChi2_end() const;
140 podio::RelationRange<float> getMeasurementChi2() const;
141 void addToOutlierChi2(float);
142 unsigned int outlierChi2_size() const;
143 float getOutlierChi2(unsigned int) const;
144 std::vector<float>::const_iterator outlierChi2_begin() const;
145 std::vector<float>::const_iterator outlierChi2_end() const;
146 podio::RelationRange<float> getOutlierChi2() const;
147
148
149
150 /// check whether the object is actually available
151 bool isAvailable() const;
152 /// disconnect from TrajectoryObj instance
153 void unlink() { m_obj = nullptr; }
154
155 bool operator==(const MutableTrajectory& other) const { return m_obj == other.m_obj; }
156 bool operator==(const Trajectory& other) const;
157
158 // less comparison operator, so that objects can be e.g. stored in sets.
159 bool operator<(const MutableTrajectory& other) const { return m_obj < other.m_obj; }
160
161 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
162
163 const podio::ObjectID getObjectID() const;
164
166 using std::swap;
167 swap(a.m_obj, b.m_obj); // swap out the internal pointers
168 }
169
170private:
171 TrajectoryObj* m_obj;
172};
173
174#ifdef PODIO_JSON_OUTPUT
175void to_json(nlohmann::json& j, const MutableTrajectory& value);
176#endif
177
178
179} // namespace eicd
180
181
182#endif
Definition: MutableTrajectory.h:35
const std::uint32_t & getType() const
Access the 0 (does not have good track fit), 1 (has good track fit)
Definition: MutableTrajectory.cc:59
const std::uint32_t & getNdf() const
Access the Number of degrees of freedom.
Definition: MutableTrajectory.cc:65
unsigned int measurementHits_size() const
Definition: MutableTrajectory.cc:110
void addToMeasurementChi2(float)
Definition: MutableTrajectory.cc:165
unsigned int outlierChi2_size() const
Definition: MutableTrajectory.cc:218
const std::uint32_t & getNMeasurements() const
Access the Number of hits used.
Definition: MutableTrajectory.cc:61
std::vector< eicd::TrackerHit >::const_iterator measurementHits_begin() const
Definition: MutableTrajectory.cc:98
void setNMeasurements(std::uint32_t value)
Set the Number of hits used.
Definition: MutableTrajectory.cc:78
void addToOutlierChi2(float)
Definition: MutableTrajectory.cc:201
unsigned int measurementChi2_size() const
Definition: MutableTrajectory.cc:182
bool operator==(const MutableTrajectory &other) const
Definition: MutableTrajectory.h:155
MutableTrajectory()
default constructor
Definition: MutableTrajectory.cc:17
bool operator<(const MutableTrajectory &other) const
Definition: MutableTrajectory.h:159
std::vector< float >::const_iterator outlierChi2_begin() const
Definition: MutableTrajectory.cc:206
std::vector< float >::const_iterator measurementChi2_begin() const
Definition: MutableTrajectory.cc:170
const eicd::TrackParameters getTrackParameters() const
Access the Associated track parameters, if any.
Definition: MutableTrajectory.cc:68
void setTrackParameters(eicd::TrackParameters value)
Set the Associated track parameters, if any.
Definition: MutableTrajectory.cc:85
const std::uint32_t & getNStates() const
Access the Number of tracking steps.
Definition: MutableTrajectory.cc:60
const float & getChi2() const
Access the Total chi2.
Definition: MutableTrajectory.cc:64
const std::uint32_t & getNHoles() const
Access the Number of missing hits.
Definition: MutableTrajectory.cc:63
void setChi2(float value)
Set the Total chi2.
Definition: MutableTrajectory.cc:81
void unlink()
disconnect from TrajectoryObj instance
Definition: MutableTrajectory.h:153
podio::RelationRange< eicd::TrackerHit > getOutlierHits() const
Definition: MutableTrajectory.cc:157
const podio::ObjectID getObjectID() const
Definition: MutableTrajectory.cc:249
std::vector< eicd::TrackerHit >::const_iterator outlierHits_end() const
Definition: MutableTrajectory.cc:140
~MutableTrajectory()
destructor
Definition: MutableTrajectory.cc:52
MutableTrajectory clone() const
create a mutable deep-copy of the object with identical relations
Definition: MutableTrajectory.cc:48
void setNdf(std::uint32_t value)
Set the Number of degrees of freedom.
Definition: MutableTrajectory.cc:82
podio::RelationRange< float > getMeasurementChi2() const
Definition: MutableTrajectory.cc:193
bool isAvailable() const
check whether the object is actually available
Definition: MutableTrajectory.cc:242
void setNSharedHits(std::uint32_t value)
Set the Number of shared hits with other trajectories.
Definition: MutableTrajectory.cc:83
void setNOutliers(std::uint32_t value)
Set the Number of hits not considered.
Definition: MutableTrajectory.cc:79
void addToOutlierHits(eicd::TrackerHit)
Definition: MutableTrajectory.cc:129
podio::RelationRange< float > getOutlierChi2() const
Definition: MutableTrajectory.cc:229
std::vector< float >::const_iterator outlierChi2_end() const
Definition: MutableTrajectory.cc:212
friend class Trajectory
Definition: MutableTrajectory.h:39
unsigned int id() const
Definition: MutableTrajectory.h:161
const std::uint32_t & getNSharedHits() const
Access the Number of shared hits with other trajectories.
Definition: MutableTrajectory.cc:66
podio::RelationRange< eicd::TrackerHit > getMeasurementHits() const
Definition: MutableTrajectory.cc:121
std::vector< eicd::TrackerHit >::const_iterator outlierHits_begin() const
Definition: MutableTrajectory.cc:134
const std::uint32_t & getNOutliers() const
Access the Number of hits not considered.
Definition: MutableTrajectory.cc:62
MutableTrajectory & operator=(MutableTrajectory other)
copy-assignment operator
Definition: MutableTrajectory.cc:37
void setType(std::uint32_t value)
Set the 0 (does not have good track fit), 1 (has good track fit)
Definition: MutableTrajectory.cc:76
unsigned int outlierHits_size() const
Definition: MutableTrajectory.cc:146
friend void swap(MutableTrajectory &a, MutableTrajectory &b)
Definition: MutableTrajectory.h:165
void setNHoles(std::uint32_t value)
Set the Number of missing hits.
Definition: MutableTrajectory.cc:80
std::vector< eicd::TrackerHit >::const_iterator measurementHits_end() const
Definition: MutableTrajectory.cc:104
void addToMeasurementHits(eicd::TrackerHit)
Definition: MutableTrajectory.cc:93
std::vector< float >::const_iterator measurementChi2_end() const
Definition: MutableTrajectory.cc:176
void setNStates(std::uint32_t value)
Set the Number of tracking steps.
Definition: MutableTrajectory.cc:77
Definition: TrackParameters.h:34
Definition: TrackerHit.h:28
Definition: TrajectoryCollection.h:82
Definition: Trajectory.h:34
Definition: TrajectoryCollection.h:57
Definition: TrajectoryObj.h:23
Definition: CalorimeterHit.cc:13