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 <ostream>
20#include <cstddef>
21
22#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
23#include "nlohmann/json_fwd.hpp"
24#endif
25
26// forward declarations
27namespace edm4eic {
28class Trajectory;
29class MutableTrajectory;
30}
31
32
33namespace edm4eic {
34
35
36/** @class MutableTrack
37 * Track information at the vertex
38 * @author: S. Joosten, J. Osborn
39 */
41
42 friend class TrackCollection;
44 friend class Track;
45
46public:
49
50 /// default constructor
52
53 /// Constructor initializing all members
54 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);
55
56 /// copy constructor
57 MutableTrack(const MutableTrack& other) = default;
58
59 /// copy-assignment operator
61
62 /// create a mutable deep-copy of the object with identical relations
63 MutableTrack clone() const;
64
65 /// destructor
66 ~MutableTrack() = default;
67
68
69 /// conversion to const object
70 operator Track() const;
71
72public:
73
74 /// Access the Flag that defines the type of track
75 std::int32_t getType() const;
76
77 /// Access the Track 3-position at the vertex
78 const edm4hep::Vector3f& getPosition() const;
79
80 /// Access the Track 3-momentum at the vertex [GeV]
81 const edm4hep::Vector3f& getMomentum() const;
82
83 /// Access the Covariance matrix in basis [x,y,z,px,py,pz]
85
86 /// Access the Track time at the vertex [ns]
87 float getTime() const;
88
89 /// Access the Error on the track vertex time
90 float getTimeError() const;
91
92 /// Access the Particle charge
93 float getCharge() const;
94
95 /// Access the Total chi2
96 float getChi2() const;
97
98 /// Access the Number of degrees of freedom
99 std::uint32_t getNdf() const;
100
101 /// Access the PDG particle ID hypothesis
102 std::int32_t getPdg() const;
103
104
105 /// Access the Trajectory of this track
107
108 /// Set the Flag that defines the type of track
109 void setType(std::int32_t value);
110
111 /// Set the Track 3-position at the vertex
112 void setPosition(edm4hep::Vector3f value);
113 /// Get reference to Track 3-position at the vertex
114 edm4hep::Vector3f& position();
115
116 /// Set the Track 3-momentum at the vertex [GeV]
117 void setMomentum(edm4hep::Vector3f value);
118 /// Get reference to Track 3-momentum at the vertex [GeV]
119 edm4hep::Vector3f& momentum();
120
121 /// Set the Covariance matrix in basis [x,y,z,px,py,pz]
123 /// Get reference to Covariance matrix in basis [x,y,z,px,py,pz]
125
126 /// Set the Track time at the vertex [ns]
127 void setTime(float value);
128
129 /// Set the Error on the track vertex time
130 void setTimeError(float value);
131
132 /// Set the Particle charge
133 void setCharge(float value);
134
135 /// Set the Total chi2
136 void setChi2(float value);
137
138 /// Set the Number of degrees of freedom
139 void setNdf(std::uint32_t value);
140
141 /// Set the PDG particle ID hypothesis
142 void setPdg(std::int32_t value);
143
144
145 /// Set the Trajectory of this track
147
149 std::size_t measurements_size() const;
150 edm4eic::Measurement2D getMeasurements(std::size_t) const;
151 std::vector<edm4eic::Measurement2D>::const_iterator measurements_begin() const;
152 std::vector<edm4eic::Measurement2D>::const_iterator measurements_end() const;
153 podio::RelationRange<edm4eic::Measurement2D> getMeasurements() const;
155 std::size_t tracks_size() const;
156 edm4eic::Track getTracks(std::size_t) const;
157 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
158 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
159 podio::RelationRange<edm4eic::Track> getTracks() const;
160
161
162
163 /// check whether the object is actually available
164 bool isAvailable() const;
165 /// disconnect from TrackObj instance
166 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
167
168 bool operator==(const MutableTrack& other) const { return m_obj == other.m_obj; }
169 bool operator==(const Track& other) const;
170
171 // less comparison operator, so that objects can be e.g. stored in sets.
172 bool operator<(const MutableTrack& other) const { return m_obj < other.m_obj; }
173
174 podio::ObjectID id() const { return getObjectID(); }
175
176 const podio::ObjectID getObjectID() const;
177
178 friend void swap(MutableTrack& a, MutableTrack& b) {
179 using std::swap;
180 swap(a.m_obj, b.m_obj); // swap out the internal pointers
181 }
182
183private:
184 /// constructor from existing TrackObj
185 explicit MutableTrack(podio::utils::MaybeSharedPtr<TrackObj> obj);
186
187 podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
188};
189
190#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
191void to_json(nlohmann::json& j, const MutableTrack& value);
192#endif
193
194
195} // namespace edm4eic
196
197
198#endif
Definition Cov6f.h:19
Definition Measurement2D.h:36
Definition MutableTrack.h:40
~MutableTrack()=default
destructor
podio::ObjectID id() const
Definition MutableTrack.h:174
void setPdg(std::int32_t value)
Set the PDG particle ID hypothesis.
Definition MutableTrack.cc:82
std::int32_t getPdg() const
Access the PDG particle ID hypothesis.
Definition MutableTrack.cc:60
void setTrajectory(edm4eic::Trajectory value)
Set the Trajectory of this track.
Definition MutableTrack.cc:84
friend void swap(MutableTrack &a, MutableTrack &b)
Definition MutableTrack.h:178
void setTime(float value)
Set the Track time at the vertex [ns].
Definition MutableTrack.cc:77
const edm4eic::Trajectory getTrajectory() const
Access the Trajectory of this track.
Definition MutableTrack.cc:62
const podio::ObjectID getObjectID() const
Definition MutableTrack.cc:176
void setType(std::int32_t value)
Set the Flag that defines the type of track.
Definition MutableTrack.cc:70
bool operator<(const MutableTrack &other) const
Definition MutableTrack.h:172
void addToTracks(edm4eic::Track)
Definition MutableTrack.cc:128
void setTimeError(float value)
Set the Error on the track vertex time.
Definition MutableTrack.cc:78
std::int32_t getType() const
Access the Flag that defines the type of track.
Definition MutableTrack.cc:51
float getChi2() const
Access the Total chi2.
Definition MutableTrack.cc:58
void setPosition(edm4hep::Vector3f value)
Set the Track 3-position at the vertex.
Definition MutableTrack.cc:71
std::size_t measurements_size() const
Definition MutableTrack.cc:109
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition MutableTrack.cc:139
podio::RelationRange< edm4eic::Measurement2D > getMeasurements() const
Definition MutableTrack.cc:120
MutableTrack()
default constructor
Definition MutableTrack.cc:22
edm4hep::Vector3f & position()
Get reference to Track 3-position at the vertex.
Definition MutableTrack.cc:72
const edm4hep::Vector3f & getMomentum() const
Access the Track 3-momentum at the vertex [GeV].
Definition MutableTrack.cc:53
void setMomentum(edm4hep::Vector3f value)
Set the Track 3-momentum at the vertex [GeV].
Definition MutableTrack.cc:73
podio::RelationRange< edm4eic::Track > getTracks() const
Definition MutableTrack.cc:156
float getTimeError() const
Access the Error on the track vertex time.
Definition MutableTrack.cc:56
MutableTrack & operator=(MutableTrack other)
copy-assignment operator
Definition MutableTrack.cc:39
void unlink()
disconnect from TrackObj instance
Definition MutableTrack.h:166
edm4eic::Cov6f & positionMomentumCovariance()
Get reference to Covariance matrix in basis [x,y,z,px,py,pz].
Definition MutableTrack.cc:76
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition MutableTrack.cc:133
edm4hep::Vector3f & momentum()
Get reference to Track 3-momentum at the vertex [GeV].
Definition MutableTrack.cc:74
std::size_t tracks_size() const
Definition MutableTrack.cc:145
MutableTrack(const MutableTrack &other)=default
copy constructor
float getCharge() const
Access the Particle charge.
Definition MutableTrack.cc:57
const edm4eic::Cov6f & getPositionMomentumCovariance() const
Access the Covariance matrix in basis [x,y,z,px,py,pz].
Definition MutableTrack.cc:54
bool isAvailable() const
check whether the object is actually available
Definition MutableTrack.cc:169
friend class Track
Definition MutableTrack.h:44
void setNdf(std::uint32_t value)
Set the Number of degrees of freedom.
Definition MutableTrack.cc:81
void addToMeasurements(edm4eic::Measurement2D)
Definition MutableTrack.cc:92
void setPositionMomentumCovariance(edm4eic::Cov6f value)
Set the Covariance matrix in basis [x,y,z,px,py,pz].
Definition MutableTrack.cc:75
std::uint32_t getNdf() const
Access the Number of degrees of freedom.
Definition MutableTrack.cc:59
const edm4hep::Vector3f & getPosition() const
Access the Track 3-position at the vertex.
Definition MutableTrack.cc:52
bool operator==(const MutableTrack &other) const
Definition MutableTrack.h:168
void setChi2(float value)
Set the Total chi2.
Definition MutableTrack.cc:80
void setCharge(float value)
Set the Particle charge.
Definition MutableTrack.cc:79
float getTime() const
Access the Track time at the vertex [ns].
Definition MutableTrack.cc:55
friend class TrackCollection
Definition MutableTrack.h:42
std::vector< edm4eic::Measurement2D >::const_iterator measurements_end() const
Definition MutableTrack.cc:103
MutableTrack clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableTrack.cc:44
std::vector< edm4eic::Measurement2D >::const_iterator measurements_begin() const
Definition MutableTrack.cc:97
Definition TrackCollection.h:95
Definition Track.h:41
Definition TrackCollection.h:66
Definition Trajectory.h:40
Definition CalorimeterHit.cc:18