EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrack.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrack_H
4#define EDM4EIC_MutableTrack_H
5
6#include "edm4eic/TrackObj.h"
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/Track.h"
9
10#include "edm4eic/Cov6f.h"
12#include "edm4hep/Vector3f.h"
13#include "podio/RelationRange.h"
14#include <cstdint>
15#include <vector>
16
17#include "podio/utilities/MaybeSharedPtr.h"
18
19#include <cstdint>
20
21#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
22#include "nlohmann/json_fwd.hpp"
23#endif
24
25// forward declarations
26namespace edm4eic {
27class Trajectory;
28class MutableTrajectory;
29}
30
31
32namespace edm4eic {
33
34
35/** @class MutableTrack
36 * Track information at the vertex
37 * @author: S. Joosten, J. Osborn
38 */
40
41 friend class TrackCollection;
43 friend class Track;
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableTrack(std::int32_t type, edm4hep::Vector3f position, edm4hep::Vector3f momentum, edm4eic::Cov6f positionMomentumCovariance, float time, float timeError, float charge, float chi2, std::uint32_t ndf, std::int32_t pdg);
54
55 /// copy constructor
56 MutableTrack(const MutableTrack& other) = default;
57
58 /// copy-assignment operator
60
61 /// create a mutable deep-copy of the object with identical relations
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableTrack clone(bool cloneRelations=true) const;
64
65 /// destructor
66 ~MutableTrack() = default;
67
68
69public:
70
71 /// Access the Flag that defines the type of track
72 std::int32_t getType() const;
73
74 /// Access the Track 3-position at the vertex
75 const edm4hep::Vector3f& getPosition() const;
76
77 /// Access the Track 3-momentum at the vertex [GeV]
78 const edm4hep::Vector3f& getMomentum() const;
79
80 /// Access the Covariance matrix in basis [x,y,z,px,py,pz]
82
83 /// Access the Track time at the vertex [ns]
84 float getTime() const;
85
86 /// Access the Error on the track vertex time
87 float getTimeError() const;
88
89 /// Access the Particle charge
90 float getCharge() const;
91
92 /// Access the Total chi2
93 float getChi2() const;
94
95 /// Access the Number of degrees of freedom
96 std::uint32_t getNdf() const;
97
98 /// Access the PDG particle ID hypothesis
99 std::int32_t getPdg() const;
100
101
102 /// Access the Trajectory of this track
104
105 /// Set the Flag that defines the type of track
106 void setType(std::int32_t value);
107 /// Get mutable reference to Flag that defines the type of track
108 std::int32_t& getType();
109 /// Get reference to Flag that defines the type of track
110 [[deprecated("use getType instead")]]
111 std::int32_t& type();
112
113 /// Set the Track 3-position at the vertex
114 void setPosition(edm4hep::Vector3f value);
115 /// Get mutable reference to Track 3-position at the vertex
116 edm4hep::Vector3f& getPosition();
117 /// Get reference to Track 3-position at the vertex
118 [[deprecated("use getPosition instead")]]
119 edm4hep::Vector3f& position();
120
121 /// Set the Track 3-momentum at the vertex [GeV]
122 void setMomentum(edm4hep::Vector3f value);
123 /// Get mutable reference to Track 3-momentum at the vertex [GeV]
124 edm4hep::Vector3f& getMomentum();
125 /// Get reference to Track 3-momentum at the vertex [GeV]
126 [[deprecated("use getMomentum instead")]]
127 edm4hep::Vector3f& momentum();
128
129 /// Set the Covariance matrix in basis [x,y,z,px,py,pz]
131 /// Get mutable reference to Covariance matrix in basis [x,y,z,px,py,pz]
133 /// Get reference to Covariance matrix in basis [x,y,z,px,py,pz]
134 [[deprecated("use getPositionMomentumCovariance instead")]]
136
137 /// Set the Track time at the vertex [ns]
138 void setTime(float value);
139 /// Get mutable reference to Track time at the vertex [ns]
140 float& getTime();
141 /// Get reference to Track time at the vertex [ns]
142 [[deprecated("use getTime instead")]]
143 float& time();
144
145 /// Set the Error on the track vertex time
146 void setTimeError(float value);
147 /// Get mutable reference to Error on the track vertex time
148 float& getTimeError();
149 /// Get reference to Error on the track vertex time
150 [[deprecated("use getTimeError instead")]]
151 float& timeError();
152
153 /// Set the Particle charge
154 void setCharge(float value);
155 /// Get mutable reference to Particle charge
156 float& getCharge();
157 /// Get reference to Particle charge
158 [[deprecated("use getCharge instead")]]
159 float& charge();
160
161 /// Set the Total chi2
162 void setChi2(float value);
163 /// Get mutable reference to Total chi2
164 float& getChi2();
165 /// Get reference to Total chi2
166 [[deprecated("use getChi2 instead")]]
167 float& chi2();
168
169 /// Set the Number of degrees of freedom
170 void setNdf(std::uint32_t value);
171 /// Get mutable reference to Number of degrees of freedom
172 std::uint32_t& getNdf();
173 /// Get reference to Number of degrees of freedom
174 [[deprecated("use getNdf instead")]]
175 std::uint32_t& ndf();
176
177 /// Set the PDG particle ID hypothesis
178 void setPdg(std::int32_t value);
179 /// Get mutable reference to PDG particle ID hypothesis
180 std::int32_t& getPdg();
181 /// Get reference to PDG particle ID hypothesis
182 [[deprecated("use getPdg instead")]]
183 std::int32_t& pdg();
184
185
186 /// Set the Trajectory of this track
187 void setTrajectory(const edm4eic::Trajectory& value);
188
190 std::size_t measurements_size() const;
191 edm4eic::Measurement2D getMeasurements(std::size_t) const;
192 std::vector<edm4eic::Measurement2D>::const_iterator measurements_begin() const;
193 std::vector<edm4eic::Measurement2D>::const_iterator measurements_end() const;
194 podio::RelationRange<edm4eic::Measurement2D> getMeasurements() const;
195 void addToTracks(const edm4eic::Track&);
196 std::size_t tracks_size() const;
197 edm4eic::Track getTracks(std::size_t) const;
198 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
199 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
200 podio::RelationRange<edm4eic::Track> getTracks() const;
201
202
203
204 /// check whether the object is actually available
205 bool isAvailable() const;
206 /// disconnect from TrackObj instance
207 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
208
209 bool operator==(const MutableTrack& other) const { return m_obj == other.m_obj; }
210 bool operator==(const Track& other) const;
211
212 bool operator!=(const MutableTrack& other) const { return !(*this == other); }
213 bool operator!=(const Track& other) const { return !(*this == other); }
214
215 // less comparison operator, so that objects can be e.g. stored in sets.
216 bool operator<(const MutableTrack& other) const { return m_obj < other.m_obj; }
217
218 podio::ObjectID id() const { return getObjectID(); }
219
220 const podio::ObjectID getObjectID() const;
221
222 friend void swap(MutableTrack& a, MutableTrack& b) {
223 using std::swap;
224 swap(a.m_obj, b.m_obj); // swap out the internal pointers
225 }
226
227private:
228 /// constructor from existing TrackObj
229 explicit MutableTrack(podio::utils::MaybeSharedPtr<TrackObj> obj);
230
231 podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
232};
233
234#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
235void to_json(nlohmann::json& j, const MutableTrack& value);
236#endif
237
238
239} // namespace edm4eic
240
241
242#endif
Definition Cov6f.h:19
Definition Measurement2D.h:36
Definition MutableTrack.h:39
void setTrajectory(const edm4eic::Trajectory &value)
Set the Trajectory of this track.
Definition MutableTrack.cc:107
~MutableTrack()=default
destructor
podio::ObjectID id() const
Definition MutableTrack.h:218
std::int32_t & pdg()
Get reference to PDG particle ID hypothesis.
Definition MutableTrack.cc:105
void setPdg(std::int32_t value)
Set the PDG particle ID hypothesis.
Definition MutableTrack.cc:103
std::int32_t getPdg() const
Access the PDG particle ID hypothesis.
Definition MutableTrack.cc:66
float & charge()
Get reference to Particle charge.
Definition MutableTrack.cc:96
friend void swap(MutableTrack &a, MutableTrack &b)
Definition MutableTrack.h:222
void setTime(float value)
Set the Track time at the vertex [ns].
Definition MutableTrack.cc:88
const edm4eic::Trajectory getTrajectory() const
Access the Trajectory of this track.
Definition MutableTrack.cc:68
const podio::ObjectID getObjectID() const
Definition MutableTrack.cc:194
void setType(std::int32_t value)
Set the Flag that defines the type of track.
Definition MutableTrack.cc:76
std::int32_t & type()
Get reference to Flag that defines the type of track.
Definition MutableTrack.cc:78
float & chi2()
Get reference to Total chi2.
Definition MutableTrack.cc:99
bool operator<(const MutableTrack &other) const
Definition MutableTrack.h:216
void setTimeError(float value)
Set the Error on the track vertex time.
Definition MutableTrack.cc:91
bool operator!=(const Track &other) const
Definition MutableTrack.h:213
std::int32_t getType() const
Access the Flag that defines the type of track.
Definition MutableTrack.cc:57
float getChi2() const
Access the Total chi2.
Definition MutableTrack.cc:64
void setPosition(edm4hep::Vector3f value)
Set the Track 3-position at the vertex.
Definition MutableTrack.cc:79
std::size_t measurements_size() const
Definition MutableTrack.cc:130
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition MutableTrack.cc:160
podio::RelationRange< edm4eic::Measurement2D > getMeasurements() const
Definition MutableTrack.cc:141
MutableTrack()
default constructor
Definition MutableTrack.cc:19
MutableTrack clone(bool cloneRelations=true) const
Definition MutableTrack.cc:41
edm4hep::Vector3f & position()
Get reference to Track 3-position at the vertex.
Definition MutableTrack.cc:81
const edm4hep::Vector3f & getMomentum() const
Access the Track 3-momentum at the vertex [GeV].
Definition MutableTrack.cc:59
bool operator!=(const MutableTrack &other) const
Definition MutableTrack.h:212
void setMomentum(edm4hep::Vector3f value)
Set the Track 3-momentum at the vertex [GeV].
Definition MutableTrack.cc:82
podio::RelationRange< edm4eic::Track > getTracks() const
Definition MutableTrack.cc:177
float getTimeError() const
Access the Error on the track vertex time.
Definition MutableTrack.cc:62
void addToTracks(const edm4eic::Track &)
Definition MutableTrack.cc:149
MutableTrack & operator=(MutableTrack other)
copy-assignment operator
Definition MutableTrack.cc:36
void unlink()
disconnect from TrackObj instance
Definition MutableTrack.h:207
edm4eic::Cov6f & positionMomentumCovariance()
Get reference to Covariance matrix in basis [x,y,z,px,py,pz].
Definition MutableTrack.cc:87
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition MutableTrack.cc:154
edm4hep::Vector3f & momentum()
Get reference to Track 3-momentum at the vertex [GeV].
Definition MutableTrack.cc:84
std::size_t tracks_size() const
Definition MutableTrack.cc:166
MutableTrack(const MutableTrack &other)=default
copy constructor
float getCharge() const
Access the Particle charge.
Definition MutableTrack.cc:63
const edm4eic::Cov6f & getPositionMomentumCovariance() const
Access the Covariance matrix in basis [x,y,z,px,py,pz].
Definition MutableTrack.cc:60
std::uint32_t & ndf()
Get reference to Number of degrees of freedom.
Definition MutableTrack.cc:102
bool isAvailable() const
check whether the object is actually available
Definition MutableTrack.cc:190
void addToMeasurements(const edm4eic::Measurement2D &)
Definition MutableTrack.cc:113
friend class Track
Definition MutableTrack.h:43
float & timeError()
Get reference to Error on the track vertex time.
Definition MutableTrack.cc:93
void setNdf(std::uint32_t value)
Set the Number of degrees of freedom.
Definition MutableTrack.cc:100
void setPositionMomentumCovariance(edm4eic::Cov6f value)
Set the Covariance matrix in basis [x,y,z,px,py,pz].
Definition MutableTrack.cc:85
std::uint32_t getNdf() const
Access the Number of degrees of freedom.
Definition MutableTrack.cc:65
const edm4hep::Vector3f & getPosition() const
Access the Track 3-position at the vertex.
Definition MutableTrack.cc:58
bool operator==(const MutableTrack &other) const
Definition MutableTrack.h:209
void setChi2(float value)
Set the Total chi2.
Definition MutableTrack.cc:97
float & time()
Get reference to Track time at the vertex [ns].
Definition MutableTrack.cc:90
void setCharge(float value)
Set the Particle charge.
Definition MutableTrack.cc:94
float getTime() const
Access the Track time at the vertex [ns].
Definition MutableTrack.cc:61
friend class TrackCollection
Definition MutableTrack.h:41
std::vector< edm4eic::Measurement2D >::const_iterator measurements_end() const
Definition MutableTrack.cc:124
std::vector< edm4eic::Measurement2D >::const_iterator measurements_begin() const
Definition MutableTrack.cc:118
Definition TrackCollection.h:92
Definition Track.h:41
Definition TrackCollection.h:63
Definition Trajectory.h:40
Definition CalorimeterHit.cc:17