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 phi, const float theta, const float qOverP, const float time, const std::int32_t pdg, const edm4eic::Cov6f& covariance);
50
51 /// copy constructor
52 MutableTrackParameters(const MutableTrackParameters& other) noexcept = default;
53
54 /// move constructor
56
57 /// copy-assignment operator
58 MutableTrackParameters& operator=(MutableTrackParameters other) &; // Rebind this to other's internal object
59 MutableTrackParameters& operator=(MutableTrackParameters other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
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 MutableTrackParameters clone(bool cloneRelations=true) const;
64
65 /// destructor
67
68
69public:
70
71 /// Access the Type of track parameters (-1/seed, 0/head, ...)
72 std::int32_t getType() const;
73
74 /// Access the Surface for bound parameters (geometryID)
75 std::uint64_t getSurface() const;
76
77 /// Access the 2D location on surface
78 const edm4hep::Vector2f& getLoc() const;
79
80 /// Access the Track azimuthal angle [rad]
81 float getPhi() const;
82
83 /// Access the Track polar angle [rad]
84 float getTheta() const;
85
86 /// Access the [e/GeV]
87 float getQOverP() const;
88
89 /// Access the Track time [ns]
90 float getTime() const;
91
92 /// Access the pdg pid for these parameters
93 std::int32_t getPdg() const;
94
95 /// Access the Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,t]
96 const edm4eic::Cov6f& getCovariance() const;
97
98
99
100 /// Set the Type of track parameters (-1/seed, 0/head, ...)
101 void setType(const std::int32_t type);
102 /// Get mutable reference to Type of track parameters (-1/seed, 0/head, ...)
103 std::int32_t& getType();
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
110 /// Set the 2D location on surface
111 void setLoc(const edm4hep::Vector2f& loc);
112 /// Get mutable reference to 2D location on surface
113 edm4hep::Vector2f& getLoc();
114
115 /// Set the Track azimuthal angle [rad]
116 void setPhi(const float phi);
117 /// Get mutable reference to Track azimuthal angle [rad]
118 float& getPhi();
119
120 /// Set the Track polar angle [rad]
121 void setTheta(const float theta);
122 /// Get mutable reference to Track polar angle [rad]
123 float& getTheta();
124
125 /// Set the [e/GeV]
126 void setQOverP(const float qOverP);
127 /// Get mutable reference to [e/GeV]
128 float& getQOverP();
129
130 /// Set the Track time [ns]
131 void setTime(const float time);
132 /// Get mutable reference to Track time [ns]
133 float& getTime();
134
135 /// Set the pdg pid for these parameters
136 void setPdg(const std::int32_t pdg);
137 /// Get mutable reference to pdg pid for these parameters
138 std::int32_t& getPdg();
139
140 /// Set the Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,t]
141 void setCovariance(const edm4eic::Cov6f& covariance);
142 /// Get mutable reference to Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,t]
144
145
146
147
148
149
150 /// check whether the object is actually available
151 bool isAvailable() const;
152 /// disconnect from TrackParametersObj instance
153 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
154
155 constexpr bool operator==(const MutableTrackParameters& other) const { return m_obj == other.m_obj; }
156 bool operator==(const TrackParameters& other) const;
157
158 constexpr bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
159 bool operator!=(const TrackParameters& other) const { return !(*this == other); }
160
161 // less comparison operator, so that objects can be e.g. stored in sets.
163
164 podio::ObjectID id() const { return getObjectID(); }
165
166 const podio::ObjectID getObjectID() const;
167
168 friend std::hash<MutableTrackParameters>;
169
171 using std::swap;
172 swap(a.m_obj, b.m_obj); // swap out the internal pointers
173 }
174
175private:
176 /// constructor from existing TrackParametersObj
177 explicit MutableTrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
178
179 podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{new TrackParametersObj{}, podio::utils::MarkOwned};
180};
181
182#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
183void to_json(nlohmann::json& j, const MutableTrackParameters& value);
184#endif
185
186
187} // namespace edm4eic
188
189
190
191template<>
192struct std::hash<edm4eic::MutableTrackParameters> {
193 std::size_t operator()(const edm4eic::MutableTrackParameters& obj) const {
194 return std::hash<edm4eic::TrackParametersObj*>{}(obj.m_obj.get());
195 }
196};
197
198
199#endif
Definition Cov6f.h:20
Definition MutableTrackParameters.h:35
constexpr bool operator!=(const MutableTrackParameters &other) const
Definition MutableTrackParameters.h:158
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackParameters.cc:81
void setTheta(const float theta)
Set the Track polar angle [rad].
Definition MutableTrackParameters.cc:64
float getQOverP() const
Access the [e/GeV].
Definition MutableTrackParameters.cc:50
MutableTrackParameters & operator=(MutableTrackParameters other) &
copy-assignment operator
Definition MutableTrackParameters.cc:30
void setType(const std::int32_t type)
Set the Type of track parameters (-1/seed, 0/head, ...).
Definition MutableTrackParameters.cc:56
void unlink()
disconnect from TrackParametersObj instance
Definition MutableTrackParameters.h:153
MutableTrackParameters(MutableTrackParameters &&other) noexcept=default
move constructor
void setTime(const float time)
Set the Track time [ns].
Definition MutableTrackParameters.cc:68
podio::ObjectID id() const
Definition MutableTrackParameters.h:164
void setSurface(const std::uint64_t surface)
Set the Surface for bound parameters (geometryID).
Definition MutableTrackParameters.cc:58
TrackParameters object_type
Definition MutableTrackParameters.h:42
void setPhi(const float phi)
Set the Track azimuthal angle [rad].
Definition MutableTrackParameters.cc:62
const podio::ObjectID getObjectID() const
Definition MutableTrackParameters.cc:85
bool operator!=(const TrackParameters &other) const
Definition MutableTrackParameters.h:159
void setQOverP(const float qOverP)
Set the [e/GeV].
Definition MutableTrackParameters.cc:66
bool operator<(const MutableTrackParameters &other) const
Definition MutableTrackParameters.h:162
MutableTrackParameters clone(bool cloneRelations=true) const
Definition MutableTrackParameters.cc:35
std::int32_t getPdg() const
Access the pdg pid for these parameters.
Definition MutableTrackParameters.cc:52
void setPdg(const std::int32_t pdg)
Set the pdg pid for these parameters.
Definition MutableTrackParameters.cc:70
void setCovariance(const edm4eic::Cov6f &covariance)
Set the Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,t].
Definition MutableTrackParameters.cc:72
std::uint64_t getSurface() const
Access the Surface for bound parameters (geometryID).
Definition MutableTrackParameters.cc:46
friend class TrackParameters
Definition MutableTrackParameters.h:39
MutableTrackParameters(const MutableTrackParameters &other) noexcept=default
copy constructor
const edm4hep::Vector2f & getLoc() const
Access the 2D location on surface.
Definition MutableTrackParameters.cc:47
const edm4eic::Cov6f & getCovariance() const
Access the Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,...
Definition MutableTrackParameters.cc:53
friend void swap(MutableTrackParameters &a, MutableTrackParameters &b)
Definition MutableTrackParameters.h:170
~MutableTrackParameters()=default
destructor
float getTheta() const
Access the Track polar angle [rad].
Definition MutableTrackParameters.cc:49
TrackParametersCollection collection_type
Definition MutableTrackParameters.h:43
float getPhi() const
Access the Track azimuthal angle [rad].
Definition MutableTrackParameters.cc:48
constexpr bool operator==(const MutableTrackParameters &other) const
Definition MutableTrackParameters.h:155
friend class TrackParametersMutableCollectionIterator
Definition MutableTrackParameters.h:38
void setLoc(const edm4hep::Vector2f &loc)
Set the 2D location on surface.
Definition MutableTrackParameters.cc:60
MutableTrackParameters()=default
default constructor
float getTime() const
Access the Track time [ns].
Definition MutableTrackParameters.cc:51
friend class TrackParametersCollection
Definition MutableTrackParameters.h:37
std::int32_t getType() const
Access the Type of track parameters (-1/seed, 0/head, ...).
Definition MutableTrackParameters.cc:45
MutableTrackParameters & operator=(MutableTrackParameters other) &&=delete
Definition TrackParametersCollection.h:139
Definition TrackParameters.h:43
Definition TrackParametersObj.h:17
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrackParameters &obj) const
Definition MutableTrackParameters.h:193