ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceMeasurementContainers.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef ACTSGPUEVENT_DEVICEMEASUREMENTCOLLECTION_H
5#define ACTSGPUEVENT_DEVICEMEASUREMENTCOLLECTION_H
6
7
8#include "traccc/definitions/qualifiers.hpp"
9#include <vecmem/edm/container.hpp>
10
11#include <array>
12#include <compare>
13#include <ostream>
14
15namespace ActsTrk {
16
23template <typename BASE>
24class DevicePixelMeasurement : public BASE {
25
26 public:
29
31 using BASE::BASE;
33 using BASE::operator=;
34
36
39
41 TRACCC_HOST_DEVICE
42 auto& identifier() { return BASE::template get<0>(); }
44 TRACCC_HOST_DEVICE
45 const auto& identifier() const { return BASE::template get<0>(); }
46
48 TRACCC_HOST_DEVICE
49 auto& local_position() { return BASE::template get<1>(); }
51 TRACCC_HOST_DEVICE
52 const auto& local_position() const { return BASE::template get<1>(); }
53
55 TRACCC_HOST_DEVICE
56 auto& local_variance() { return BASE::template get<2>(); }
58 TRACCC_HOST_DEVICE
59 const auto& local_variance() const { return BASE::template get<2>(); }
60
62 TRACCC_HOST_DEVICE
63 auto& global_position() { return BASE::template get<3>(); }
65 TRACCC_HOST_DEVICE
66 const auto& global_position() const { return BASE::template get<3>(); }
67
70 TRACCC_HOST_DEVICE
71 auto& module_id_hash() { return BASE::template get<4>(); }
74 TRACCC_HOST_DEVICE
75 const auto& module_id_hash() const { return BASE::template get<4>(); }
76
78
81
90 template <typename T>
91 TRACCC_HOST_DEVICE bool operator==(const DevicePixelMeasurement<T>& other) const;
92
102 template <typename T>
103 TRACCC_HOST_DEVICE std::partial_ordering operator<=>(
104 const DevicePixelMeasurement<T>& other) const;
105
107
108 private:
110 TRACCC_HOST
111 friend std::ostream& operator<<(std::ostream& os, const DevicePixelMeasurement& m) {
112 os << "id = " << m.identifier()
113 << ", ";
114 os << "module_hash = " << m.module_id_hash()
115 << ", ";
116 os << "local_pos = [" << m.local_position()[0]
117 << ", " << m.local_position()[1]
118 << "], ";
119 os << "local_var = [" << m.local_variance()[0]
120 << ", " << m.local_variance()[1]
121 << "], ";
122 os << "global_pos = [" << m.global_position()[0]
123 << ", " << m.global_position()[1]
124 << ", " << m.global_position()[2]
125 << "]";
126 return os;
127 }
128}; // class DevicePixelmeasurement
129
136template <typename BASE>
137class DeviceStripMeasurement : public BASE {
138
139 public:
142
144 using BASE::BASE;
146 using BASE::operator=;
147
149
152
154 TRACCC_HOST_DEVICE
155 auto& identifier() { return BASE::template get<0>(); }
157 TRACCC_HOST_DEVICE
158 const auto& identifier() const { return BASE::template get<0>(); }
159
161 TRACCC_HOST_DEVICE
162 auto& local_position() { return BASE::template get<1>(); }
164 TRACCC_HOST_DEVICE
165 const auto& local_position() const { return BASE::template get<1>(); }
166
168 TRACCC_HOST_DEVICE
169 auto& local_variance() { return BASE::template get<2>(); }
171 TRACCC_HOST_DEVICE
172 const auto& local_variance() const { return BASE::template get<2>(); }
173
176 TRACCC_HOST_DEVICE
177 auto& module_id_hash() { return BASE::template get<3>(); }
180 TRACCC_HOST_DEVICE
181 const auto& module_id_hash() const { return BASE::template get<3>(); }
182
184
187
196 template <typename T>
197 TRACCC_HOST_DEVICE bool operator==(const DeviceStripMeasurement<T>& other) const;
198
208 template <typename T>
209 TRACCC_HOST_DEVICE std::partial_ordering operator<=>(
210 const DeviceStripMeasurement<T>& other) const;
211
213
214 private:
216 TRACCC_HOST
217 friend std::ostream& operator<<(std::ostream& os, const DeviceStripMeasurement& m) {
218 os << "id = " << m.identifier()
219 << ", ";
220 os << "module_hash = " << m.module_id_hash()
221 << ", ";
222 os << "local_pos = " << m.local_position()[0]
223 << ", ";
224 os << "local_var = " << m.local_variance()[0]
225 << ", ";
226 return os;
227 }
228
229}; // class DeviceStripmeasurement
230
232using DevicePixelMeasurementContainer = vecmem::edm::container<
234 // identifier
235 , vecmem::edm::type::vector<long unsigned int>
236 // local_position
237 , vecmem::edm::type::vector<std::array<float, 2u>>
238 // local_variance
239 , vecmem::edm::type::vector<std::array<float, 4u>>
240 // global_position
241 , vecmem::edm::type::vector<std::array<float, 3u>>
242 // module hash
243 , vecmem::edm::type::vector<unsigned int>
244 >;
245
247using DeviceStripMeasurementContainer = vecmem::edm::container<
249 // identifier
250 , vecmem::edm::type::vector<long unsigned int>
251 // local_position
252 , vecmem::edm::type::vector<float>
253 // local_variance
254 , vecmem::edm::type::vector<float>
255 // module hash
256 , vecmem::edm::type::vector<unsigned int>
257 >;
258
259} // namespace ActsTrk
260
261#endif // ACTSGPUEVENT_DEVICEMEASUREMENTCOLLECTION_H
Interface for the DeviceMeasurementContainer type.
TRACCC_HOST_DEVICE bool operator==(const DevicePixelMeasurement< T > &other) const
Equality operator.
TRACCC_HOST_DEVICE auto & module_id_hash()
Athena module identifier hash where the measurement belongs (non-const).
TRACCC_HOST_DEVICE const auto & global_position() const
TRACCC_HOST friend std::ostream & operator<<(std::ostream &os, const DevicePixelMeasurement &m)
TRACCC_HOST_DEVICE const auto & identifier() const
TRACCC_HOST_DEVICE auto & local_position()
TRACCC_HOST_DEVICE auto & local_variance()
TRACCC_HOST_DEVICE auto & global_position()
TRACCC_HOST_DEVICE const auto & local_variance() const
TRACCC_HOST_DEVICE const auto & module_id_hash() const
Athena module identifier hash where the measurement belongs (const).
TRACCC_HOST_DEVICE std::partial_ordering operator<=>(const DevicePixelMeasurement< T > &other) const
Comparison operator.
TRACCC_HOST_DEVICE const auto & local_position() const
Interface for the DeviceMeasurementContainer type.
TRACCC_HOST_DEVICE const auto & local_position() const
TRACCC_HOST_DEVICE bool operator==(const DeviceStripMeasurement< T > &other) const
Equality operator.
TRACCC_HOST_DEVICE auto & module_id_hash()
Athena module identifier hash where the measurement belongs (non-const).
TRACCC_HOST_DEVICE const auto & local_variance() const
TRACCC_HOST_DEVICE std::partial_ordering operator<=>(const DeviceStripMeasurement< T > &other) const
Comparison operator.
TRACCC_HOST friend std::ostream & operator<<(std::ostream &os, const DeviceStripMeasurement &m)
TRACCC_HOST_DEVICE const auto & module_id_hash() const
Athena module identifier hash where the measurement belongs (const).
TRACCC_HOST_DEVICE const auto & identifier() const
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
vecmem::edm::container< DevicePixelMeasurement, vecmem::edm::type::vector< long unsigned int >, vecmem::edm::type::vector< std::array< float, 2u > >, vecmem::edm::type::vector< std::array< float, 4u > >, vecmem::edm::type::vector< std::array< float, 3u > >, vecmem::edm::type::vector< unsigned int > > DevicePixelMeasurementContainer
SoA container of Pixel measurements.
vecmem::edm::container< DeviceStripMeasurement, vecmem::edm::type::vector< long unsigned int >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< float >, vecmem::edm::type::vector< unsigned int > > DeviceStripMeasurementContainer
SoA container of Strip measurements.