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