EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrackParameters.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrackParameters_H
4#define EDM4EIC_MutableTrackParameters_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include "edm4eic/Cov6f.h"
11#include "edm4hep/Vector2f.h"
12#include <cstdint>
13
14#include "podio/utilities/MaybeSharedPtr.h"
15
16#include <cstdint>
17
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
20#endif
21
22// forward declarations
23namespace edm4eic {
25}
26
27
28namespace edm4eic {
29
30
31/** @class MutableTrackParameters
32 * ACTS Bound Track parameters
33 * @author: W. Armstrong, S. Joosten, J. Osborn
34 */
36
39 friend class TrackParameters;
40
41public:
44
45 /// default constructor
47
48 /// Constructor initializing all members
49 MutableTrackParameters(const std::int32_t type, const std::uint64_t surface, const edm4hep::Vector2f& loc, const float theta, const float phi, const float qOverP, const float time, const std::int32_t pdg, const edm4eic::Cov6f& covariance);
50
51 /// copy constructor
53
54 /// copy-assignment operator
55 MutableTrackParameters& operator=(MutableTrackParameters other) &; // Rebind this to other's internal object
56 MutableTrackParameters& operator=(MutableTrackParameters other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
57
58 /// create a mutable deep-copy of the object with identical relations
59 /// if cloneRelations=false, the relations are not cloned and will be empty
60 MutableTrackParameters clone(bool cloneRelations=true) const;
61
62 /// destructor
64
65
66public:
67
68 /// Access the Type of track parameters (-1/seed, 0/head, ...)
69 std::int32_t getType() const;
70
71 /// Access the Surface for bound parameters (geometryID)
72 std::uint64_t getSurface() const;
73
74 /// Access the 2D location on surface
75 const edm4hep::Vector2f& getLoc() const;
76
77 /// Access the Track polar angle [rad]
78 float getTheta() const;
79
80 /// Access the Track azimuthal angle [rad]
81 float getPhi() const;
82
83 /// Access the [e/GeV]
84 float getQOverP() const;
85
86 /// Access the Track time [ns]
87 float getTime() const;
88
89 /// Access the pdg pid for these parameters
90 std::int32_t getPdg() const;
91
92 /// Access the Full covariance in basis [l0,l1,theta,phi,q/p,t]
93 const edm4eic::Cov6f& getCovariance() const;
94
95
96
97 /// Set the Type of track parameters (-1/seed, 0/head, ...)
98 void setType(const std::int32_t type);
99 /// Get mutable reference to Type of track parameters (-1/seed, 0/head, ...)
100 std::int32_t& getType();
101 /// Get reference to Type of track parameters (-1/seed, 0/head, ...)
102 [[deprecated("use getType instead")]]
103 std::int32_t& type();
104
105 /// Set the Surface for bound parameters (geometryID)
106 void setSurface(const std::uint64_t surface);
107 /// Get mutable reference to Surface for bound parameters (geometryID)
108 std::uint64_t& getSurface();
109 /// Get reference to Surface for bound parameters (geometryID)
110 [[deprecated("use getSurface instead")]]
111 std::uint64_t& surface();
112
113 /// Set the 2D location on surface
114 void setLoc(const edm4hep::Vector2f& loc);
115 /// Get mutable reference to 2D location on surface
116 edm4hep::Vector2f& getLoc();
117 /// Get reference to 2D location on surface
118 [[deprecated("use getLoc instead")]]
119 edm4hep::Vector2f& loc();
120
121 /// Set the Track polar angle [rad]
122 void setTheta(const float theta);
123 /// Get mutable reference to Track polar angle [rad]
124 float& getTheta();
125 /// Get reference to Track polar angle [rad]
126 [[deprecated("use getTheta instead")]]
127 float& theta();
128
129 /// Set the Track azimuthal angle [rad]
130 void setPhi(const float phi);
131 /// Get mutable reference to Track azimuthal angle [rad]
132 float& getPhi();
133 /// Get reference to Track azimuthal angle [rad]
134 [[deprecated("use getPhi instead")]]
135 float& phi();
136
137 /// Set the [e/GeV]
138 void setQOverP(const float qOverP);
139 /// Get mutable reference to [e/GeV]
140 float& getQOverP();
141 /// Get reference to [e/GeV]
142 [[deprecated("use getQOverP instead")]]
143 float& qOverP();
144
145 /// Set the Track time [ns]
146 void setTime(const float time);
147 /// Get mutable reference to Track time [ns]
148 float& getTime();
149 /// Get reference to Track time [ns]
150 [[deprecated("use getTime instead")]]
151 float& time();
152
153 /// Set the pdg pid for these parameters
154 void setPdg(const std::int32_t pdg);
155 /// Get mutable reference to pdg pid for these parameters
156 std::int32_t& getPdg();
157 /// Get reference to pdg pid for these parameters
158 [[deprecated("use getPdg instead")]]
159 std::int32_t& pdg();
160
161 /// Set the Full covariance in basis [l0,l1,theta,phi,q/p,t]
163 /// Get mutable reference to Full covariance in basis [l0,l1,theta,phi,q/p,t]
165 /// Get reference to Full covariance in basis [l0,l1,theta,phi,q/p,t]
166 [[deprecated("use getCovariance instead")]]
168
169
170
171
172
173
174 /// check whether the object is actually available
175 bool isAvailable() const;
176 /// disconnect from TrackParametersObj instance
177 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
178
179 bool operator==(const MutableTrackParameters& other) const { return m_obj == other.m_obj; }
180 bool operator==(const TrackParameters& other) const;
181
182 bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
183 bool operator!=(const TrackParameters& other) const { return !(*this == other); }
184
185 // less comparison operator, so that objects can be e.g. stored in sets.
187
188 podio::ObjectID id() const { return getObjectID(); }
189
190 const podio::ObjectID getObjectID() const;
191
192 friend std::hash<MutableTrackParameters>;
193
195 using std::swap;
196 swap(a.m_obj, b.m_obj); // swap out the internal pointers
197 }
198
199private:
200 /// constructor from existing TrackParametersObj
201 explicit MutableTrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
202
203 podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{nullptr};
204};
205
206#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
207void to_json(nlohmann::json& j, const MutableTrackParameters& value);
208#endif
209
210
211} // namespace edm4eic
212
213
214
215template<>
216struct std::hash<edm4eic::MutableTrackParameters> {
217 std::size_t operator()(const edm4eic::MutableTrackParameters& obj) const {
218 return std::hash<edm4eic::TrackParametersObj*>{}(obj.m_obj.get());
219 }
220};
221
222
223#endif
Definition Cov6f.h:19
Definition MutableTrackParameters.h:35
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackParameters.cc:94
void setTheta(const float theta)
Set the Track polar angle [rad].
Definition MutableTrackParameters.cc:69
float getQOverP() const
Access the [e/GeV].
Definition MutableTrackParameters.cc:54
MutableTrackParameters & operator=(MutableTrackParameters other) &
copy-assignment operator
Definition MutableTrackParameters.cc:34
void setType(const std::int32_t type)
Set the Type of track parameters (-1/seed, 0/head, ...)
Definition MutableTrackParameters.cc:60
float & time()
Get reference to Track time [ns].
Definition MutableTrackParameters.cc:80
void unlink()
disconnect from TrackParametersObj instance
Definition MutableTrackParameters.h:177
void setTime(const float time)
Set the Track time [ns].
Definition MutableTrackParameters.cc:78
podio::ObjectID id() const
Definition MutableTrackParameters.h:188
void setSurface(const std::uint64_t surface)
Set the Surface for bound parameters (geometryID)
Definition MutableTrackParameters.cc:63
TrackParameters object_type
Definition MutableTrackParameters.h:42
void setPhi(const float phi)
Set the Track azimuthal angle [rad].
Definition MutableTrackParameters.cc:72
const podio::ObjectID getObjectID() const
Definition MutableTrackParameters.cc:98
edm4hep::Vector2f & loc()
Get reference to 2D location on surface.
Definition MutableTrackParameters.cc:68
bool operator!=(const TrackParameters &other) const
Definition MutableTrackParameters.h:183
void setQOverP(const float qOverP)
Set the [e/GeV].
Definition MutableTrackParameters.cc:75
MutableTrackParameters(const MutableTrackParameters &other)=default
copy constructor
bool operator<(const MutableTrackParameters &other) const
Definition MutableTrackParameters.h:186
MutableTrackParameters clone(bool cloneRelations=true) const
Definition MutableTrackParameters.cc:39
std::int32_t & pdg()
Get reference to pdg pid for these parameters.
Definition MutableTrackParameters.cc:83
bool operator!=(const MutableTrackParameters &other) const
Definition MutableTrackParameters.h:182
bool operator==(const MutableTrackParameters &other) const
Definition MutableTrackParameters.h:179
edm4eic::Cov6f & covariance()
Get reference to Full covariance in basis [l0,l1,theta,phi,q/p,t].
Definition MutableTrackParameters.cc:86
std::uint64_t & surface()
Get reference to Surface for bound parameters (geometryID)
Definition MutableTrackParameters.cc:65
std::int32_t getPdg() const
Access the pdg pid for these parameters.
Definition MutableTrackParameters.cc:56
void setPdg(const std::int32_t pdg)
Set the pdg pid for these parameters.
Definition MutableTrackParameters.cc:81
void setCovariance(const edm4eic::Cov6f &covariance)
Set the Full covariance in basis [l0,l1,theta,phi,q/p,t].
Definition MutableTrackParameters.cc:84
float & phi()
Get reference to Track azimuthal angle [rad].
Definition MutableTrackParameters.cc:74
std::uint64_t getSurface() const
Access the Surface for bound parameters (geometryID)
Definition MutableTrackParameters.cc:50
friend class TrackParameters
Definition MutableTrackParameters.h:39
const edm4hep::Vector2f & getLoc() const
Access the 2D location on surface.
Definition MutableTrackParameters.cc:51
std::int32_t & type()
Get reference to Type of track parameters (-1/seed, 0/head, ...)
Definition MutableTrackParameters.cc:62
float & qOverP()
Get reference to [e/GeV].
Definition MutableTrackParameters.cc:77
const edm4eic::Cov6f & getCovariance() const
Access the Full covariance in basis [l0,l1,theta,phi,q/p,t].
Definition MutableTrackParameters.cc:57
friend void swap(MutableTrackParameters &a, MutableTrackParameters &b)
Definition MutableTrackParameters.h:194
~MutableTrackParameters()=default
destructor
float getTheta() const
Access the Track polar angle [rad].
Definition MutableTrackParameters.cc:52
TrackParametersCollection collection_type
Definition MutableTrackParameters.h:43
float getPhi() const
Access the Track azimuthal angle [rad].
Definition MutableTrackParameters.cc:53
friend class TrackParametersMutableCollectionIterator
Definition MutableTrackParameters.h:38
void setLoc(const edm4hep::Vector2f &loc)
Set the 2D location on surface.
Definition MutableTrackParameters.cc:66
float getTime() const
Access the Track time [ns].
Definition MutableTrackParameters.cc:55
friend class TrackParametersCollection
Definition MutableTrackParameters.h:37
MutableTrackParameters()
default constructor
Definition MutableTrackParameters.cc:18
float & theta()
Get reference to Track polar angle [rad].
Definition MutableTrackParameters.cc:71
std::int32_t getType() const
Access the Type of track parameters (-1/seed, 0/head, ...)
Definition MutableTrackParameters.cc:49
MutableTrackParameters & operator=(MutableTrackParameters other) &&=delete
Definition TrackParametersCollection.h:137
Definition TrackParameters.h:43
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableTrackParameters &obj) const
Definition MutableTrackParameters.h:217