ATLAS Offline Software
Loading...
Searching...
No Matches
TracccMeasurementConverterAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
8
13
14#include "TrkSurfaces/Surface.h"
15
16#include <stdexcept>
17
18namespace ActsTrk {
19
21{
22 ATH_MSG_DEBUG("Initializing.");
23
24 ATH_CHECK(m_hostMR.retrieve());
25 ATH_CHECK(m_copy.retrieve());
26
27 ATH_CHECK(m_inputMeasKey.initialize());
30
31 ATH_CHECK(m_outputPixelKey.initialize());
32 // pixel spacepoints are not needed when seeds are not converted on host
36 ATH_CHECK(m_outputStripKey.initialize());
37
39 ATH_CHECK(detStore()->retrieve(m_stripID, "SCT_ID"));
40 ATH_CHECK(detStore()->retrieve(m_pixelManager, "ITkPixel"));
41 ATH_CHECK(detStore()->retrieve(m_stripManager, "ITkStrip"));
42
44
45 ATH_MSG_DEBUG("Successfully initialized");
46 return StatusCode::SUCCESS;
47}
48
50std::pair<int, int> countPixelStrip(
51 const traccc::edm::measurement_collection::const_device& measurements) {
52 int n_pixels = 0;
53 int n_strips = 0;
54 for (std::size_t i = 0; i < measurements.size(); ++i) {
55 if (measurements.at(i).dimensions() == 2u) {
56 ++n_pixels;
57 } else {
58 ++n_strips;
59 }
60 }
61 return {n_pixels, n_strips};
62}
63
64// Allocate `n` clusters from the pool into a view container + aux store.
65template <typename ClusterT, typename AuxContainerT,
66 typename ContainerT = DataVector<ClusterT>>
67 std::pair<std::unique_ptr<ContainerT>, std::unique_ptr<AuxContainerT>>
68 makeOutputContainer(const EventContext& ctx, int n) {
69
71
72 auto cont = std::make_unique<ContainerT>(SG::VIEW_ELEMENTS,
74 auto aux = std::make_unique<AuxContainerT>();
75
76 pool.reserve(n);
77 cont->push_new(n, [&pool]() { return pool.nextElementPtr(); });
78 aux->resize(cont->size());
79 cont->setStore(aux.get());
80
81 return {std::move(cont), std::move(aux)};
82}
83
84template <typename MEAS>
85void fillStripCluster(const MEAS& meas, const Identifier& athenaId,
86 const SCT_ID* stripID,
87 const InDetDD::SCT_DetectorManager* stripManager,
88 xAOD::StripCluster& xaod_scl,
89 std::size_t combinedIndex) {
90 const IdentifierHash stripHash = stripID->wafer_hash(athenaId);
92 stripManager->getDetectorElement(stripHash);
93
94 Eigen::Matrix<float, 1, 1> localPosition = Eigen::Matrix<float, 1, 1>::Zero();
95 Eigen::Matrix<float, 1, 1> localCovariance =
96 Eigen::Matrix<float, 1, 1>::Zero();
97
98 if (pDE->isBarrel()) {
99 localPosition(0, 0) = meas.local_position()[0];
100 localCovariance(0, 0) = meas.local_variance()[0];
101 } else {
102 localPosition(0, 0) = meas.local_position()[1];
103 localCovariance(0, 0) = meas.local_variance()[1];
104 }
105
106 const Identifier hitId(athenaId.get_compact() + combinedIndex);
107
108 xaod_scl.setMeasurement<1>(stripHash, localPosition, localCovariance);
109 xaod_scl.setIdentifierHash(stripHash);
110 xaod_scl.setIdentifier(hitId.get_compact());
111}
112
113template <typename MEAS>
114void fillPixelCluster(const MEAS& meas, const Identifier& athenaId,
115 const PixelID* pixelID,
116 const InDetDD::PixelDetectorManager* pixelManager,
117 xAOD::PixelCluster& xaod_pcl,
118 std::size_t combinedIndex) {
119 const IdentifierHash pixHash = pixelID->wafer_hash(athenaId);
120 const InDetDD::SiDetectorElement* pDE =
121 pixelManager->getDetectorElement(pixHash);
122
123 const Amg::Vector2D localPos(meas.local_position()[0],
124 meas.local_position()[1]);
125 const Amg::Vector3D gp = pDE->globalPosition(localPos);
126
127 Eigen::Matrix<float, 2, 1> localPosition(localPos.x(), localPos.y());
128 Eigen::Matrix<float, 2, 2> localCovariance =
129 Eigen::Matrix<float, 2, 2>::Zero();
130 localCovariance(0, 0) = meas.local_variance()[0];
131 localCovariance(1, 1) = meas.local_variance()[1];
132
133 const Identifier hitId(athenaId.get_compact() + combinedIndex);
134
135 xaod_pcl.setIdentifierHash(pixHash);
136 xaod_pcl.setMeasurement<2>(pixHash, localPosition, localCovariance);
137 xaod_pcl.globalPosition() = Eigen::Matrix<float, 3, 1>(gp.x(), gp.y(), gp.z());
138 xaod_pcl.setIdentifier(hitId.get_compact());
139 xaod_pcl.setWidthInEta(meas.diameter());
140}
141
142StatusCode TracccMeasurementConverterAlg::execute(const EventContext& ctx) const
143{
144 // ---- Retrieve measurements (always needed) ----
145 auto measurements = SG::makeHandle(m_inputMeasKey, ctx);
146 ATH_CHECK(measurements.isValid());
147
148 auto copy = m_copy->copy(ctx);
149
150 traccc::edm::measurement_collection::buffer traccc_measurements_buffer{
151 copy->get_size(*measurements), m_hostMR->mr()};
152 copy->setup(traccc_measurements_buffer)->ignore();
153 (*copy)(*measurements, traccc_measurements_buffer)->wait();
154
155 traccc::edm::measurement_collection::const_device traccc_measurements(
156 traccc_measurements_buffer);
157
158 // ---- Optionally retrieve clusters and cells ----
159 std::optional<traccc::edm::silicon_cluster_collection::buffer> traccc_clusters_buffer;
160 std::optional<traccc::edm::silicon_cell_collection::buffer> traccc_cells_buffer;
161 std::optional<traccc::edm::silicon_cluster_collection::const_device> traccc_clusters;
162 std::optional<traccc::edm::silicon_cell_collection::const_device> traccc_cells;
163
164 // ---- Create mapping from traccc measurement index to pixel spacepoint index ----
165 // for pixel the index maps to cluster container or spacepoint containe
166 // because every pixel measurement makes one spacepoint
167 std::vector<unsigned int> measToPixelSP(traccc_measurements.size(),
168 std::numeric_limits<unsigned int>::max());
169
170 // ---- Create mapping from traccc measurement index to strip cluster index ----
171 // every strip measurement does not map to one strip spacepoint therefore this map
172 // is only valid between traccc measurements and strip clusters
173 // The reason why we have two maps is that during traccc track conversion
174 // we need to figure out if a track state is coming from pixel or strip
175 // since we don't want to copy/write to SG the measurements twice
176 // we can figure this out by creating two maps at conversion,
177 // then if the meas index is not in pixel map, has to be a strip meas
178 std::vector<unsigned int> measToStripCl(traccc_measurements.size(),
179 std::numeric_limits<unsigned int>::max());
181 ATH_MSG_DEBUG("Read " << traccc_measurements.size() << " traccc measurements from " << m_inputMeasKey.key());
182 ATH_MSG_DEBUG("Read traccc clusters from '"
183 << m_inputClusterKey.key()
184 << "' and will convert them with associated cells.");
185
187 m_inputClusterKey, ctx};
188 ATH_CHECK(clusters.isValid());
190 m_inputCellsKey, ctx};
191 ATH_CHECK(cells.isValid());
192
193 traccc_clusters_buffer.emplace(copy->get_sizes(*clusters), m_hostMR->mr());
194 copy->setup(*traccc_clusters_buffer)->wait();
195 (*copy)(*clusters, *traccc_clusters_buffer)->wait();
196
197 traccc_cells_buffer.emplace(copy->get_size(*cells), m_hostMR->mr());
198 copy->setup(*traccc_cells_buffer)->wait();
199 (*copy)(*cells, *traccc_cells_buffer)->wait();
200
201 traccc_clusters.emplace(*traccc_clusters_buffer);
202 ATH_MSG_DEBUG("Copied " << traccc_clusters->size() << " clusters.");
203
204 traccc_cells.emplace(*traccc_cells_buffer);
205 ATH_MSG_DEBUG("Copied " << traccc_cells->size() << " cells.");
206 } else {
207 ATH_MSG_DEBUG("Read traccc measurements from '"
208 << m_inputMeasKey.key()
209 << "' and will convert them without associated cells.");
210 }
211
212 // ---- Count pixel vs strip ----
213 const auto [n_pixels, n_strips] = countPixelStrip(traccc_measurements);
214
215 // ---- Create output containers ----
216 auto [pixel_cont, pixel_aux] =
218
219 const bool writeSpacePoints = !m_outputPixelSpacePointsKey.empty();
220
221 auto [pixel_spacepoint_cont, pixel_spacepoint_aux] =
223 auto [strip_cont, strip_aux] =
225
226 // ---- Convert ----
227 auto pixItr = pixel_cont->begin();
228 auto spItr = pixel_spacepoint_cont->begin();
229 auto stripItr = strip_cont->begin();
230
231 std::size_t pixel_idx = 0;
232 std::size_t strip_idx = 0;
233
234 for (std::size_t i = 0; i < traccc_measurements.size(); ++i) {
235 const auto& meas = traccc_measurements.at(i);
236 const uint64_t detrayId = meas.surface_link().value();
237 auto athenaIdOpt = m_idMapping->detrayToAthena(detrayId);
238 if (!athenaIdOpt.has_value()) {
239 ATH_MSG_FATAL("No Athena module found for detray id " << detrayId << " — skipping measurement.");
240 return StatusCode::FAILURE;
241 }
242 const Identifier athenaId = *athenaIdOpt;
243
244 // ---- Pixel ----
245 if (meas.dimensions() == 2u) {
246 xAOD::PixelCluster* xaod_pcl = *pixItr;
247 ++pixItr;
248
249 // once seeding will come into play, we will need to keep track of the
250 // mapping between traccc and xAOD clusters. The reason for this is:
251 // 1. the traccc measurements are all in one collection, and the
252 // xAOD clusters are in two separate collections (pixel and strip)
253 // 2. the traccc spacepoints are not not created in the same order as the traccc measurements
254 measToPixelSP[i] = pixel_idx;
255
256 const IdentifierHash Pixel_ModuleHash =
257 m_pixelID->wafer_hash(athenaId);
258 const InDetDD::SiDetectorElement* pDE =
259 m_pixelManager->getDetectorElement(Pixel_ModuleHash);
260 const InDetDD::PixelModuleDesign* design(
261 dynamic_cast<const InDetDD::PixelModuleDesign*>(
262 &pDE->design()));
263 if(design == nullptr){
264 ATH_MSG_FATAL("Could not retrieve module design for pixel module hash " << Pixel_ModuleHash);
265 return StatusCode::FAILURE;
266 }
267
268 fillPixelCluster(meas, athenaId, m_pixelID, m_pixelManager, *xaod_pcl,
269 pixel_idx + strip_idx);
270
272 const auto cluster = traccc_clusters->at(meas.cluster_index());
273
274 std::vector<Identifier> rdoList;
275 rdoList.reserve(cluster.cell_indices().size());
276 int phiIndicesMax = -1;
277 int etaIndicesMax = -1;
278 int phiIndicesMin = std::numeric_limits<int>::max();
279 int etaIndicesMin = std::numeric_limits<int>::max();
280
281 for (const unsigned int cell_idx : cluster.cell_indices()) {
282 const auto& cell = traccc_cells->at(cell_idx);
283
284 int const phiIndex = cell.channel0();
285 int const etaIndex = cell.channel1();
286
287 phiIndicesMax = std::max(phiIndicesMax, phiIndex);
288 etaIndicesMax = std::max(etaIndicesMax, etaIndex);
289 phiIndicesMin = std::min(phiIndicesMin, phiIndex);
290 etaIndicesMin = std::min(etaIndicesMin, etaIndex);
291
292 Identifier const hit_id =
293 m_pixelID->pixel_id(athenaId, phiIndex, etaIndex);
294 rdoList.push_back(hit_id);
295 }
296
297 double const colWidth = static_cast<double>((etaIndicesMax - etaIndicesMin) + 1);
298 double const rowWidth = static_cast<double>((phiIndicesMax - phiIndicesMin) + 1);
299 double const etaWidth =
300 design->widthFromColumnRange(etaIndicesMin, etaIndicesMax);
301 double const phiWidth = design->widthFromRowRange(phiIndicesMin, phiIndicesMax);
302
303 InDet::SiWidth siWidth(Amg::Vector2D(rowWidth, colWidth),
304 Amg::Vector2D(phiWidth, etaWidth));
305
306 float width0 = phiWidth / rowWidth;
307 float width1 = etaWidth / colWidth;
308 Eigen::Matrix<float, 2, 2> localCovariance =
309 Eigen::Matrix<float, 2, 2>::Zero();
310 localCovariance(0, 0) = width0 * width0 / 12.0f;
311 localCovariance(1, 1) = width1 * width1 / 12.0f;
312
313 Eigen::Matrix<float, 2, 1> localPosition(meas.local_position()[0], meas.local_position()[1]);
314 xaod_pcl->setMeasurement<2>(Pixel_ModuleHash, localPosition,
315 localCovariance);
316
317 std::sort(rdoList.begin(), rdoList.end());
318 xaod_pcl->setIdentifier(rdoList.front().get_compact());
319 xaod_pcl->setRDOlist(std::move(rdoList));
320 xaod_pcl->setChannelsInPhiEta(siWidth.colRow()[0],
321 siWidth.colRow()[1]);
322 float width_phiRZ = static_cast<float>(siWidth.widthPhiRZ()[1]);
323 xaod_pcl->setWidthInEta(width_phiRZ);
324
325 }
326
327 if(writeSpacePoints) {
328 xAOD::SpacePoint* xaod_sp = *spItr;
329 ++spItr;
330
331 // Using width to scale the cluster covariance for space points.
332 // Read width back from the cluster so that this works with and without cells
333 // only works if 'diameter' strategy is set to channel1 in traccc
334 const float width_phiRZ = xaod_pcl->widthInEta();
335 float covTerm = width_phiRZ * width_phiRZ * (1/12.0f);
336
337 const float localVarEta = xaod_pcl->localCovariance<2>()(1, 1);
338 if( covTerm < localVarEta )
339 covTerm = localVarEta;
340
341 const Amg::Transform3D& Tp = pDE->surface().transform();
342 float const cov_z =
343 6.f * covTerm *
344 static_cast<float>(Tp(0, 2) * Tp(0, 2) + Tp(1, 2) * Tp(1, 2));
345 float const cov_r = 6.f * covTerm *
346 static_cast<float>(Tp(2, 2) * Tp(2, 2));
347 xaod_sp->setSpacePoint(xaod_pcl->identifierHash(),
348 xaod_pcl->globalPosition(), cov_r, cov_z,
349 {xaod_pcl});
350 }
351
352 ++pixel_idx;
353
354 // ---- Strip ----
355 } else {
356 xAOD::StripCluster* xaod_scl = *stripItr;
357 ++stripItr;
358
359 // see comment above for pixel clusters, the same applies here
360 // when we eventually have strip spacepoints
361
362 const IdentifierHash Strip_ModuleHash =
363 m_stripID->wafer_hash(athenaId);
364 const InDetDD::SiDetectorElement* pDE =
365 m_stripManager->getDetectorElement(Strip_ModuleHash);
366
367 fillStripCluster(meas, athenaId, m_stripID, m_stripManager, *xaod_scl,
368 pixel_idx + strip_idx);
369
371 const auto cluster = traccc_clusters->at(meas.cluster_index());
372
373 std::vector<Identifier> rdoList;
374 rdoList.reserve(cluster.cell_indices().size());
375 int phiIndicesMax = -1;
376 int phiIndicesMin = std::numeric_limits<int>::max();
377
378 for (const unsigned int cell_idx : cluster.cell_indices()) {
379 const auto& cell = traccc_cells->at(cell_idx);
380
381 // (m_stripID->barrel_ec(athenaId) != 0) <=> endcap strip
382 // => we are working with polar coordinates (r,phi)
383 // and we have to swap the indices
384 int const phiIndex = (m_stripID->barrel_ec(athenaId) != 0)
385 ? cell.channel1()
386 : cell.channel0();
387
388 phiIndicesMax = std::max(phiIndicesMax, phiIndex);
389 phiIndicesMin = std::min(phiIndicesMin, phiIndex);
390 Identifier const hit_id =
391 m_stripID->strip_id(athenaId, int(phiIndex));
392 rdoList.push_back(hit_id);
393 }
394
395 std::sort(rdoList.begin(), rdoList.end());
396 const int firstStrip = m_stripID->strip(rdoList.front());
397 const int lastStrip = m_stripID->strip(rdoList.back());
398
399 const InDetDD::SCT_ModuleSideDesign* design;
400 if (pDE->isBarrel()) {
401 design = (static_cast<const InDetDD::SCT_ModuleSideDesign*>(
402 &pDE->design()));
403 } else {
404 design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(
405 &pDE->design()));
406 }
407
408 const int row = m_stripID->row(rdoList.front());
409 const int firstStrip1D = design->strip1Dim(firstStrip, row);
410 const int lastStrip1D = design->strip1Dim(lastStrip, row);
411 const InDetDD::SiCellId cell1(firstStrip1D);
412 const InDetDD::SiCellId cell2(lastStrip1D);
413 const InDetDD::SiLocalPosition firstStripPos(
414 pDE->rawLocalPositionOfCell(cell1));
415 const InDetDD::SiLocalPosition lastStripPos(
416 pDE->rawLocalPositionOfCell(cell2));
417 const InDetDD::SiLocalPosition centre(
418 (firstStripPos + lastStripPos) * 0.5);
419 const std::pair<InDetDD::SiLocalPosition, InDetDD::SiLocalPosition>
420 ends(design->endsOfStrip(centre));
421 const double stripLength(
422 std::abs(ends.first.xEta() - ends.second.xEta()));
423 const double width =
424 design->stripPitch() * (lastStrip - firstStrip + 1);
425
426 double const phiWidth = static_cast<double>((phiIndicesMax - phiIndicesMin) + 1);
427 InDet::SiWidth siWidth(Amg::Vector2D(phiWidth, 1),
428 Amg::Vector2D(width, stripLength));
429
430 xaod_scl->setIdentifier(rdoList.front().get_compact());
431 xaod_scl->setRDOlist(std::move(rdoList));
432 xaod_scl->setChannelsInPhi(siWidth.colRow()[0]);
433
434 }
435 measToStripCl[i] = strip_idx;
436 ++strip_idx;
437 }
438 }
439
440 ATH_MSG_DEBUG("Converted " << pixel_idx << " pixel clusters, " << strip_idx
441 << " strip clusters");
442
443 m_nMeas += traccc_measurements.size();
444 m_nPix += pixel_idx;
445 m_nStrip += strip_idx;
446
447 // ---- Write outputs ----
449 ctx};
450 ATH_CHECK(pixelHandle.record(std::move(pixel_cont), std::move(pixel_aux)));
451
452 if(writeSpacePoints) {
454 ctx};
455 ATH_CHECK(spacePointHandle.record(std::move(pixel_spacepoint_cont), std::move(pixel_spacepoint_aux)));
456 }
457
459 ATH_CHECK(measToPixelSPHandle.record(std::make_unique<std::vector<unsigned int>>(std::move(measToPixelSP))));
460
462 ATH_CHECK(measToStripClHandle.record(std::make_unique<std::vector<unsigned int>>(std::move(measToStripCl))));
463
465 ctx};
466 ATH_CHECK(stripHandle.record(std::move(strip_cont), std::move(strip_aux)));
467
468 ATH_MSG_DEBUG("Wrote clusters to " << m_outputPixelKey.key() << " and " << m_outputStripKey.key());
469
470 return StatusCode::SUCCESS;
471}
472
474{
475 ATH_MSG_DEBUG("Finalizing.");
476
477 ATH_MSG_INFO("Received total number of measurements = " << m_nMeas
478 << ", of which pixel clusters = " << m_nPix
479 << " and strip clusters = " << m_nStrip);
480
481 ATH_MSG_DEBUG("Successfully finalized");
482 return StatusCode::SUCCESS;
483}
484
485} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
static Double_t Tp(Double_t *t, Double_t *par)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
const double width
Gaudi::Property< std::string > m_geoIdMappingObjectName
SG::ReadHandleKey< traccc::edm::measurement_collection::buffer > m_inputMeasKey
SG::WriteHandleKey< xAOD::StripClusterContainer > m_outputStripKey
SG::WriteHandleKey< std::vector< unsigned int > > m_outputMeasToStripClKey
virtual StatusCode finalize() override
Function finalizing the algorthm.
SG::ReadHandleKey< traccc::edm::silicon_cell_collection::buffer > m_inputCellsKey
SG::ReadHandleKey< traccc::edm::silicon_cluster_collection::buffer > m_inputClusterKey
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
std::atomic< int > m_nPix
The object counters for debug prints in finalize method {.
const PixelID * m_pixelID
Conversion helpers (to retrieve module design, hash, etc.) {.
SG::WriteHandleKey< std::vector< unsigned int > > m_outputMeasToPixelSPKey
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_outputPixelKey
SG::WriteHandleKey< xAOD::SpacePointContainer > m_outputPixelSpacePointsKey
virtual StatusCode initialize() override
Function initializing the algorithm.
const InDetDD::SCT_DetectorManager * m_stripManager
const InDetDD::PixelDetectorManager * m_pixelManager
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
const ServiceHandle< StoreGateSvc > & detStore() const
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
Derived DataVector<T>.
Definition DataVector.h:818
This is a "hash" representation of an Identifier.
value_type get_compact() const
Get the compact id.
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Class used to describe the design of a module (diode segmentation and readout scheme).
double widthFromRowRange(const int rowMin, const int rowMax) const
Method to calculate phi width from a row range.
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Base class for the SCT module side design, extended by the Forward and Barrel module design.
virtual double stripPitch(const SiLocalPosition &chargePos) const =0
give the strip pitch (dependence on position needed for forward)
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
virtual std::pair< SiLocalPosition, SiLocalPosition > endsOfStrip(const SiLocalPosition &position) const override=0
give the ends of strips
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Trk::Surface & surface()
Element Surface.
const Amg::Vector2D & widthPhiRZ() const
Definition SiWidth.h:121
const Amg::Vector2D & colRow() const
Definition SiWidth.h:115
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition PixelID.h:378
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
IdentifierHash wafer_hash(const Identifier &wafer_id) const
wafer hash from id - optimized
Definition SCT_ID.h:487
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
void setChannelsInPhiEta(int channelsInPhi, int channelsInEta)
Sets the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
float widthInEta() const
Returns the width of the cluster in phi (x) and eta (y) directions, respectively.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setWidthInEta(float widthInEta)
Sets the width of the cluster in eta (y) direction.
void setSpacePoint(DetectorIDHashType idHash, const Eigen::Matrix< float, 3, 1 > &globPos, float cov_r, float cov_z, std::vector< const xAOD::UncalibratedMeasurement * > &&measurementIndexes)
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setChannelsInPhi(int channelsInPhi)
Sets the dimensions of the cluster in numbers of channels in phi (x).
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
void setIdentifierHash(const DetectorIDHashType idHash)
Sets the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
void fillPixelCluster(const MEAS &meas, const Identifier &athenaId, const PixelID *pixelID, const InDetDD::PixelDetectorManager *pixelManager, xAOD::PixelCluster &xaod_pcl, std::size_t combinedIndex)
void fillStripCluster(const MEAS &meas, const Identifier &athenaId, const SCT_ID *stripID, const InDetDD::SCT_DetectorManager *stripManager, xAOD::StripCluster &xaod_scl, std::size_t combinedIndex)
std::pair< std::unique_ptr< ContainerT >, std::unique_ptr< AuxContainerT > > makeOutputContainer(const EventContext &ctx, int n)
std::pair< int, int > countPixelStrip(const traccc::edm::measurement_collection::const_device &measurements)
Count the number of measurements 2D (pixel) vs 1D (strip).
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
@ ALWAYS_TRACK_INDICES
Always track indices, regardless of the setting of the ownership policy.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Framework include files.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.