EDM4eic
EIC data model
Loading...
Searching...
No Matches
TrackParameters.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_TrackParameters_H
4#define EDM4EIC_TrackParameters_H
5
7
8#include "edm4eic/Cov6f.h"
9#include "edm4hep/Vector2f.h"
10#include <cstdint>
11
12#include "podio/utilities/MaybeSharedPtr.h"
13#include "podio/detail/OrderKey.h"
14
15#include <ostream>
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 podio::detail {
29// Internal function used in less comparison operators of the datatypes and interface types
30OrderKey getOrderKey(const edm4eic::TrackParameters& obj);
31};
32
33namespace edm4eic {
34
38
39/** @class TrackParameters
40 * ACTS Bound Track parameters
41 * @author: W. Armstrong, S. Joosten, J. Osborn
42 */
44
49 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackParameters & obj);
50
51public:
54
55 /// default constructor
56 TrackParameters() = default;
57
58 /// Constructor initializing all members
59 TrackParameters(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);
60
61 /// copy constructor
62 TrackParameters(const TrackParameters& other) noexcept = default;
63
64 /// move constructor
65 TrackParameters(TrackParameters&& other) noexcept = default;
66
67 /// copy-assignment operator
68 TrackParameters& operator=(TrackParameters other) &; // Rebind this to other's internal object
69 TrackParameters& operator=(TrackParameters other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
70
71 /// create a mutable deep-copy of the object with identical relations
72 /// if cloneRelations=false, the relations are not cloned and will be empty
73 MutableTrackParameters clone(bool cloneRelations=true) const;
74
75 /// destructor
76 ~TrackParameters() = default;
77
78 /// converting constructor from mutable object
80
82
83public:
84
85 static constexpr std::string_view typeName = "edm4eic::TrackParameters";
86
87 /// Access the Type of track parameters (-1/seed, 0/head, ...)
88 std::int32_t getType() const;
89
90 /// Access the Surface for bound parameters (geometryID)
91 std::uint64_t getSurface() const;
92
93 /// Access the 2D location on surface
94 const edm4hep::Vector2f& getLoc() const;
95
96 /// Access the Track azimuthal angle [rad]
97 float getPhi() const;
98
99 /// Access the Track polar angle [rad]
100 float getTheta() const;
101
102 /// Access the [e/GeV]
103 float getQOverP() const;
104
105 /// Access the Track time [ns]
106 float getTime() const;
107
108 /// Access the pdg pid for these parameters
109 std::int32_t getPdg() const;
110
111 /// Access the Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,t]
112 const edm4eic::Cov6f& getCovariance() const;
113
114
115
116
117
118 /// check whether the object is actually available
119 bool isAvailable() const;
120 /// disconnect from TrackParametersObj instance
121 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackParametersObj>{nullptr}; }
122
123 constexpr bool operator==(const TrackParameters& other) const { return m_obj == other.m_obj; }
124 bool operator==(const MutableTrackParameters& other) const;
125
126 constexpr bool operator!=(const TrackParameters& other) const { return !(*this == other); }
127 bool operator!=(const MutableTrackParameters& other) const { return !(*this == other); }
128
129 // less comparison operator, so that objects can be e.g. stored in sets.
130 bool operator<(const TrackParameters& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
131
132 podio::ObjectID id() const { return getObjectID(); }
133
134 const podio::ObjectID getObjectID() const;
135
136 friend std::hash<TrackParameters>;
137
139 using std::swap;
140 swap(a.m_obj, b.m_obj); // swap out the internal pointers
141 }
142
143private:
144 /// constructor from existing TrackParametersObj
145 explicit TrackParameters(podio::utils::MaybeSharedPtr<TrackParametersObj> obj);
147
148 podio::utils::MaybeSharedPtr<TrackParametersObj> m_obj{new TrackParametersObj{}, podio::utils::MarkOwned};
149};
150
151std::ostream& operator<<(std::ostream& o, const TrackParameters& value);
152
153#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
154void to_json(nlohmann::json& j, const TrackParameters& value);
155#endif
156
157
158} // namespace edm4eic
159
160
161
162template<>
163struct std::hash<edm4eic::TrackParameters> {
164 std::size_t operator()(const edm4eic::TrackParameters& obj) const {
165 return std::hash<edm4eic::TrackParametersObj*>{}(obj.m_obj.get());
166 }
167};
168
169
170// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
171// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
172// and https://github.com/AIDASoft/podio/issues/770
173#if defined(__clang__)
174 #pragma clang diagnostic push
175 #pragma clang diagnostic ignored "-Wunknown-warning-option"
176 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
177 #pragma clang diagnostic ignored "-Wdeprecated"
178constexpr std::string_view edm4eic::TrackParameters::typeName;
179 #pragma clang diagnostic pop
180#elif defined(__GNUC__)
181 #pragma GCC diagnostic push
182 #pragma GCC diagnostic ignored "-Wdeprecated"
183constexpr std::string_view edm4eic::TrackParameters::typeName;
184 #pragma GCC diagnostic pop
185#endif
186
187
188#endif
Definition Cov6f.h:20
Definition MutableTrackParameters.h:35
Definition TrackParametersCollectionData.h:31
Definition TrackParametersCollection.h:139
Definition TrackParameters.h:43
friend void swap(TrackParameters &a, TrackParameters &b)
Definition TrackParameters.h:138
float getPhi() const
Access the Track azimuthal angle [rad].
Definition TrackParameters.cc:59
constexpr bool operator!=(const TrackParameters &other) const
Definition TrackParameters.h:126
std::int32_t getPdg() const
Access the pdg pid for these parameters.
Definition TrackParameters.cc:63
static constexpr std::string_view typeName
Definition TrackParameters.h:85
bool operator<(const TrackParameters &other) const
Definition TrackParameters.h:130
TrackParameters & operator=(TrackParameters other) &
copy-assignment operator
Definition TrackParameters.cc:32
static TrackParameters makeEmpty()
Definition TrackParameters.cc:52
TrackParameters & operator=(TrackParameters other) &&=delete
float getQOverP() const
Access the [e/GeV].
Definition TrackParameters.cc:61
const edm4hep::Vector2f & getLoc() const
Access the 2D location on surface.
Definition TrackParameters.cc:58
TrackParameters()=default
default constructor
bool operator!=(const MutableTrackParameters &other) const
Definition TrackParameters.h:127
constexpr bool operator==(const TrackParameters &other) const
Definition TrackParameters.h:123
const podio::ObjectID getObjectID() const
Definition TrackParameters.cc:75
const edm4eic::Cov6f & getCovariance() const
Access the Full covariance in basis following ACTS convention [l0,l1,phi,theta,q/p,...
Definition TrackParameters.cc:64
TrackParametersCollection collection_type
Definition TrackParameters.h:53
~TrackParameters()=default
destructor
std::uint64_t getSurface() const
Access the Surface for bound parameters (geometryID).
Definition TrackParameters.cc:57
TrackParameters(const TrackParameters &other) noexcept=default
copy constructor
bool isAvailable() const
check whether the object is actually available
Definition TrackParameters.cc:71
float getTime() const
Access the Track time [ns].
Definition TrackParameters.cc:62
friend class TrackParametersCollectionIterator
Definition TrackParameters.h:48
TrackParameters(TrackParameters &&other) noexcept=default
move constructor
void unlink()
disconnect from TrackParametersObj instance
Definition TrackParameters.h:121
float getTheta() const
Access the Track polar angle [rad].
Definition TrackParameters.cc:60
podio::ObjectID id() const
Definition TrackParameters.h:132
MutableTrackParameters mutable_type
Definition TrackParameters.h:52
MutableTrackParameters clone(bool cloneRelations=true) const
Definition TrackParameters.cc:37
std::int32_t getType() const
Access the Type of track parameters (-1/seed, 0/head, ...).
Definition TrackParameters.cc:56
friend class TrackParametersCollection
Definition TrackParameters.h:46
friend class MutableTrackParameters
Definition TrackParameters.h:45
Definition TrackParametersObj.h:17
Definition ArrowMapper.cc:63
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::TrackParameters &obj) const
Definition TrackParameters.h:164