ATLAS Offline Software
Loading...
Searching...
No Matches
PixelClusteringTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Tell clang not to allow spurious FPEs.
8
10
12
17#include <TrkSurfaces/Surface.h>
19
21
22#include <algorithm>
23#include <array>
24#include <cassert>
25#include <cstdint>
26#include <limits>
27#include <optional>
28#include <stdexcept>
29
30using CLHEP::micrometer;
32namespace {
33
34 template <typename T1, typename T2>
35 T1 check_integer_cast(T2 a) {
36 assert( std::in_range<T1>(a) );
37 return static_cast<T1>(a);
38 }
39
40 inline bool isFEI3(const InDetDD::PixelModuleDesign& design) {
42 }
44 template <typename IndexType>
45 inline std::optional<std::array<std::int16_t,2> >
46 getGangedCoordinates(const std::array<IndexType,2> &coordinates,
47 const InDetDD::PixelModuleDesign& design)
48 {
49 // If the pixel is ganged, returns a new identifier for it
50 InDetDD::SiCellId cellId(check_integer_cast<int>(coordinates[0]),check_integer_cast<int>(coordinates[1]));
51 InDetDD::SiReadoutCellId readoutId = design.readoutIdOfCell(cellId);
52 if ( design.numberOfConnectedCells( readoutId ) > 1 ) {
53 InDetDD::SiCellId gangedCellId = design.connectedCell( readoutId, 1 );
54 return std::array<std::int16_t,2>{ static_cast<std::int16_t>(gangedCellId.phiIndex()),
55 static_cast<std::int16_t>(gangedCellId.etaIndex())};
56 }
57 return std::nullopt;
58 }
59
60 // PixelRDO_Container
61 std::array<std::int16_t,2>
62 makeCellCoordinates(const std::array<InDetDD::PixelDiodeTree::CellIndexType,2> &diode_idx) {
63 return std::array<std::int16_t,2>{
64 check_integer_cast<std::int16_t>(diode_idx[0]),
65 check_integer_cast<std::int16_t>(diode_idx[1])};
66 }
67 // PixelRDO_Container
68 const std::array<InDetDD::PixelDiodeTree::CellIndexType,2> &
69 makeDiodeIdx(const std::array<InDetDD::PixelDiodeTree::CellIndexType,2> &diode_idx) {
70 return diode_idx;
71 }
72
73 // PhaseIIPixelRawDataContainer
74 std::array<std::int16_t,2>
75 makeCellCoordinates(const std::array<std::int16_t,2> &diode_idx) {
76 return diode_idx;
77 }
78 // PhaseIIPixelRawDataContainer
79 std::array<InDetDD::PixelDiodeTree::CellIndexType,2>
80 makeDiodeIdx(const std::array<std::int16_t,2> &diode_idx) {
81 return std::array<InDetDD::PixelDiodeTree::CellIndexType,2>{
82 check_integer_cast<InDetDD::PixelDiodeTree::CellIndexType>(diode_idx[0]),
83 check_integer_cast<InDetDD::PixelDiodeTree::CellIndexType>(diode_idx[1])};
84 }
85
86}
87
88namespace ActsTrk {
89
90template <typename T_RDOContainer>
92{
93 ATH_MSG_DEBUG("Initializing " << this->name() << " ...");
94
99
100 ATH_CHECK(this->m_pixelLorentzAngleTool.retrieve());
101
102 ATH_CHECK(this->m_chargeDataKey.initialize(not m_chargeDataKey.empty()));
103
104 ATH_MSG_INFO(" Charge Data Key:" << m_chargeDataKey);
105 ATH_MSG_INFO(" ID Helper Name:" << m_idHelperName);
106
107 ATH_CHECK( this->detStore()->retrieve(m_pixelID, m_idHelperName) );
108
109 ATH_MSG_DEBUG(this->name() << " successfully initialized");
110 return StatusCode::SUCCESS;
111}
112
113template <typename T_RDOContainer>
115 const std::string& type, const std::string& name, const IInterface* parent)
116 : base_class(type,name,parent)
117{}
118
119
120template <typename T_RDOContainer>
121template <bool GANGED>
122std::pair<unsigned int, unsigned int>
124 const std::vector<IdentifierHash> &listOfIds,
125 const InDetDD::SiDetectorElementCollection &detector_elements) const {
128 const PixelID* pixelID)
129 -> unsigned int
130 {
131 unsigned int n_hits = RDOs.size();
132 if constexpr(GANGED) {
133 assert(elements.at(RDOs.identifyHash()));
134 assert(dynamic_cast<const InDetDD::PixelModuleDesign *>(&elements.at(RDOs.identifyHash())->design()) != nullptr);
135 const InDetDD::PixelModuleDesign &design = static_cast<const InDetDD::PixelModuleDesign &>(elements.at(RDOs.identifyHash())->design());
136 if (isFEI3(design)) {
137 for(RDOAdapter<T_RDOContainer> rdo : RDOs) {
138 if (rdo.isGanged(design, *pixelID)) {
139 ++n_hits;
140 }
141 }
142 }
143 }
144 return n_hits;
145 };
146 unsigned int n_hits=0u;
147 if (listOfIds.empty()) {
149 assert( RDOs.isValid());
150 n_hits += getNHits(*RDOs, detector_elements, m_pixelID);
151 }
152 }
153 else {
154 for (const IdentifierHash& id : listOfIds) {
155 if (not id.is_valid()) continue;
156 std::optional<RDOCollectionAdapter<T_RDOContainer> > RDOs = RDOCollectionAdapter<T_RDOContainer>::make(rdo_collection,id);
157 if (RDOs.has_value()) {
158 n_hits += getNHits(*(RDOs.value()), detector_elements, m_pixelID);
159 }
160 }
161 }
162 // the total number of hits is the best estimate of the maximum number of clusters.
163 // @TODO could apply a factor for the number clusters or only if the number of hits
164 // are above a certain threshold to reduce memory consumption though impact
165 // is likely small.
166 return {n_hits,n_hits};
167}
168
169template <typename T_RDOContainer>
170std::pair<unsigned int, unsigned int>
171PixelClusteringToolImpl<T_RDOContainer>::countCells(const T_RDOContainer& rdo_collection,
172 const std::vector<IdentifierHash> &listOfIds,
173 const InDetDD::SiDetectorElementCollection &detector_elements) const {
174 if (m_isITk || !m_checkGanged ) {
175 return countCellsImpl<false>(rdo_collection,listOfIds, detector_elements);
176 }
177 else {
178 return countCellsImpl<true>(rdo_collection,listOfIds, detector_elements);
179 }
180}
181
182template <typename T_RDOContainer>
183StatusCode
186 const InDetDD::SiDetectorElement& element,
187 const InDetDD::PixelModuleDesign& design,
189 const PixelChargeCalibCondData *calibData,
191 const double lorentzShift,
192 xAOD::PixelCluster::ClusterVars& clusterVars) const
193{
194 Amg::Vector2D pos_acc(0,0);
195 float tot_acc = 0.f;
196 //to start, set max to the min possible int and min to the max possible int
197 static constexpr InDetDD::PixelDiodeTree::CellIndexType defaultMax = std::numeric_limits<InDetDD::PixelDiodeTree::CellIndexType>::min();
198 static constexpr InDetDD::PixelDiodeTree::CellIndexType defaultMin = std::numeric_limits<InDetDD::PixelDiodeTree::CellIndexType>::max();
199 //
200 InDetDD::PixelDiodeTree::CellIndexType rowmax = defaultMax;
201 InDetDD::PixelDiodeTree::CellIndexType colmax = defaultMax;
202 InDetDD::PixelDiodeTree::CellIndexType rowmin = defaultMin;
203 InDetDD::PixelDiodeTree::CellIndexType colmin = defaultMin;
208
209 // We temporary comment this since it is not used
210 // bool hasGanged = false;
211 unsigned int n_rdos = clusterVars.rdoList.getBeginIndex(icluster);
212 assert( clusterVars.totList.getBeginIndex(icluster)==n_rdos );
213 assert( calibData==nullptr || clusterVars.chargeList.getBeginIndex(icluster)==n_rdos );
214
215 IdentifierHash idHash = element.identifyHash();
216 assert( idHash == cluster.identifyHash());
217 Identifier module_id = element.identify();
218 std::optional<Identifier::value_type> first_rdo_id;
219 int cluster_lvl1min = std::numeric_limits<int>::max();
220 float totalCharge = 0.f;
221
223 for (CellProxy cellProxy : cluster) {
224
225 //Construct the identifier class
226
227 // We temporary comment this since it is not used
228 // TODO: Check how the ganged info is used in legacy
229 // if (multiChip) {
230 // hasGanged = hasGanged ||
231 // m_pixelRDOTool->isGanged(id, element).has_value();
232 // }
233 assert(cellProxy.srcIndex() < rdos.size());
234
235 RDOAdapter<T_RDOContainer> rdo(rdos[cellProxy.srcIndex()]);
236 if constexpr(std::is_same_v<T_RDOContainer, PhaseIIPixelRawDataContainer>) {
237 assert( rdo.index() >= rdos.beginIndex() && rdo.index() < rdos.endIndex() );
238 }
239
240 Identifier rdo_id = rdo.computeIdentifier(*m_pixelID,module_id, cellProxy);
241 if (!first_rdo_id.has_value()) {
242 first_rdo_id=rdo_id.get_compact();
243 }
244
245 assert(rdo.getLVL1A()>=0 && rdo.getLVL1A() < std::numeric_limits<uint8_t>::max());
246 cluster_lvl1min = std::min(cluster_lvl1min, static_cast<int>(rdo.getLVL1A()) );
247
248 const int tot = rdo.getToT();
249 float charge = tot;
250
251 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
252 = InDetDD::PixelDiodeTree::makeCellIndex(cellProxy.coordinates()[0],
253 cellProxy.coordinates()[1]);
255
256 if (calibData) {
257 // Retrieving the calibration only depends on FE and not per cell (can be further optimized)
258 // Single FE modules could have an optimized getCharge function where the calib constants are cached
259 std::uint32_t feValue = design.getFE(si_param);
260 auto diode_type = design.getDiodeType(si_param);
261 if (m_isITk){
262 // @TODO only check in makeClusters or check at all ?
264 ATH_MSG_ERROR("Chip type is not recognized!");
265 return StatusCode::FAILURE;
266 }
267
268 charge = calibData->getCharge(diode_type,
269 calibStrategy,
270 idHash,
271 feValue,
272 tot);
273 } else {
274 charge = calibData->getCharge(diode_type,
275 idHash,
276 feValue,
277 tot);
278
279 // These numbers are taken from the Cluster Maker Tool
280 if (design.getReadoutTechnology() != InDetDD::PixelReadoutTechnology::RD53 && (idHash < 12 or idHash > 2035)) {
281 charge = tot/8.0*(8000.0-1200.0)+1200.0;
282 }
283 }
284 clusterVars.chargeList.setValue(n_rdos,charge);
285 }
286 clusterVars.rdoList.setValue(n_rdos,rdo_id.get_compact());
287 clusterVars.totList.setValue(n_rdos,tot);
288 totalCharge += charge;
289 ++n_rdos;
290
291 const InDetDD::PixelDiodeTree::CellIndexType &row = diode_idx[0];
292 const InDetDD::PixelDiodeTree::CellIndexType &col = diode_idx[1];
293 if (row>rowmax) {
294 rowmax=row;
295 rowmax_diode = si_param;
296 }
297 if (row<rowmin) {
298 rowmin=row;
299 rowmin_diode = si_param;
300 }
301 if (col>colmax) {
302 colmax=col;
303 colmax_diode = si_param;
304 }
305 if (col<colmin) {
306 colmin=col;
307 colmin_diode = si_param;
308 }
309
310 // We compute the digital position as a sum of all RDO positions
311 // all with the same weight of 1
312 // We do not compute a charge-weighted center of gravity here (by default) since
313 // we observe it to be worse than the digital position
314 // ToT-weighted center of gravity must not be used
315 if (m_useWeightedPos) {
316 pos_acc += charge * si_param.position();
317 tot_acc += charge;
318 } else {
319 pos_acc += si_param.position();
320 tot_acc += 1;
321 }
322
323 } // loop on cluster's cells
324 assert(n_rdos>0); // clusters must not be empty
325 if (tot_acc > 0)
326 pos_acc /= tot_acc;
327
328 const long long diffCol = static_cast<long long>(colmax) - static_cast<long long>(colmin) + 1LL;
329 const long long diffRow = static_cast<long long>(rowmax) - static_cast<long long>(rowmin) + 1LL;
330 assert(std::in_range<int>(diffCol));
331 assert(std::in_range<int>(diffRow));
332 const int colWidth = static_cast<int>(diffCol);
333 const int rowWidth = static_cast<int>(diffRow);
334
335 double etaWidth = colmax_diode.xEtaMax() - colmin_diode.xEtaMin(); // design.widthFromColumnRange(colmin, colmax);
336 double phiWidth = rowmax_diode.xPhiMax() - rowmin_diode.xPhiMin(); // design.widthFromColumnRange(colmin, colmax);
337
338 // ask for Lorentz correction, get global position
339 const Amg::Vector2D localPos = pos_acc;
340 Amg::Vector2D locpos(localPos[Trk::locX]+lorentzShift, localPos[Trk::locY]);
341 // find global position of element
342 const Amg::Transform3D& T = element.surface().transform();
343 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
344 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
345 double R [3] = {T(0,3),T(1,3),T(2,3)};
346
347 const Amg::Vector2D& M = locpos;
348 Amg::Vector3D globalPos(M[0]*Ax[0]+M[1]*Ay[0]+R[0],M[0]*Ax[1]+M[1]*Ay[1]+R[1],M[0]*Ax[2]+M[1]*Ay[2]+R[2]);
349
350 // Compute error matrix
351 float width0, width1;
352 if (m_broadErrors) {
353 // Use cluster width
354 width0 = phiWidth;
355 width1 = etaWidth;
356 } else {
357 // Use average pixel width
358 width0 = phiWidth / rowWidth;
359 width1 = etaWidth / colWidth;
360 }
361
362 // Actually create the cluster (i.e. fill the values)
363
364 Eigen::Matrix<float,2,1> localPosition(locpos.x(), locpos.y());
365 Eigen::Matrix<float,2,2> localCovariance = Eigen::Matrix<float,2,2>::Zero();
366 localCovariance(0, 0) = width0 * width0 / 12.0f;
367 localCovariance(1, 1) = width1 * width1 / 12.0f;
368
369 clusterVars.identifierHash[icluster] = idHash;
370 xAOD::VectorMap<2>(clusterVars.localPositionDim2[icluster].data()) = localPosition;
371 xAOD::MatrixMap<2>(clusterVars.localCovarianceDim2[icluster].data()) = localCovariance;
372 assert( first_rdo_id.has_value());
373 clusterVars.identifier[icluster] = *first_rdo_id;
374 clusterVars.rdoList.updateEndIndex(icluster,n_rdos);
375 xAOD::VectorMap<3>(clusterVars.globalPosition[icluster].data()) = globalPos.cast<float>();
376 clusterVars.totList.updateEndIndex(icluster,n_rdos);
377 clusterVars.chargeList.updateEndIndex(icluster, (calibData ? n_rdos : 0u));
378 clusterVars.totalCharge[icluster] = totalCharge;
379 clusterVars.lvl1a[icluster] = cluster_lvl1min;
380 clusterVars.channelsInPhi[icluster] = rowWidth;
381 clusterVars.channelsInEta[icluster] = colWidth;
382 clusterVars.widthInEta[icluster] = etaWidth;
383
384 return StatusCode::SUCCESS;
385}
386
387template <typename T_RDOContainer>
388StatusCode
389PixelClusteringToolImpl<T_RDOContainer>::clusterize([[maybe_unused]] const EventContext& ctx,
391 const InDet::SiDetectorElementStatus& pixelDetElStatus,
392 const InDetDD::SiDetectorElement& element,
394{
395 IdentifierHash idHash = RDOs.identifyHash();
396 typename IClusteringToolType::CellContainer::ModuleRangeGuard rangeGuard(cellContainer.startNewModule(idHash));
397 if ( pixelDetElStatus.isGood(idHash) ) {
398 // Retrieve the cells from the detector element
399 std::span<typename IClusteringToolType::CellContainer::Cell>
400 cellRange = unpackRDOs(RDOs, pixelDetElStatus, element, cellContainer);
401
402 static constexpr unsigned int SORT_BY_LOCAL_X=0u;
403 namespace CL=Acts::InPlaceClusterization;
404 CL::clusterize<SORT_BY_LOCAL_X, std::uint16_t>(cellRange,
405 CL::defaultConnectionHelper<CL::EConnectionType::CommonEdgeOrCorner>(cellRange));
406 // set the cell range per cluster
408 [&cellContainer](std::span<typename IClusteringToolType::CellContainer::Cell> &/*the_range*/,
409 unsigned int idx_begin,
410 unsigned int idx_end) {
411 cellContainer.registerNewCluster(idx_begin,idx_end);
412 });
413 }
414 // must add a range for every call otherwise the cell container and
415 // the list of processed modules get out of sync.
416 cellContainer.registerClustersForNewModule(rangeGuard.range());
417
418 return StatusCode::SUCCESS;
419}
420
421
422template <typename T_RDOContainer>
424 [[maybe_unused]] std::size_t nClusterRDOs) const
425{
426 return std::any (xAOD::PixelCluster::ClusterVars (cont, nClusterRDOs));
427}
428
429
430template <typename T_RDOContainer>
431StatusCode
433 const EventContext& ctx,
434 const T_RDOContainer &rdoContainer,
436 unsigned int imodule,
437 const InDetDD::SiDetectorElement& element,
438 unsigned int icluster,
439 [[maybe_unused]] xAOD::PixelClusterContainer& cont,
440 std::any& cache) const
441{
442 // Retrieve the calibration data
443 const PixelChargeCalibCondData *calibData = nullptr;
444 if (not m_chargeDataKey.empty()) {
446 calibData = calibDataHandle.cptr();
447
448 if (!calibData) {
449 ATH_MSG_ERROR("PixelChargeCalibCondData requested but couldn't be retrieved from " << m_chargeDataKey.key());
450 return StatusCode::FAILURE;
451 }
452 }
453
454 // Get the element design
455 const InDetDD::PixelModuleDesign& design =
456 static_cast<const InDetDD::PixelModuleDesign&>(element.design());
457
458 // Get the calibration strategy for this module.
459 // Default to RD53 if the calibData is not available. That is fine because it won't be used anyway
460 auto calibrationStrategy = calibData ? calibData->getCalibrationStrategy(element.identifyHash()) : PixelChargeCalibCondData::CalibrationStrategy::RD53;
461
462 IdentifierHash idHash = element.identifyHash();
463 double lorentzShift = m_pixelLorentzAngleTool->getLorentzShift(idHash, ctx);
464
465 auto* clusterVars = std::any_cast<xAOD::PixelCluster::ClusterVars> (&cache);
466 if (!clusterVars) throw std::bad_any_cast();
467
468 std::optional<RDOCollectionAdapter<T_RDOContainer> > rdos_optional(RDOCollectionAdapter<T_RDOContainer>::make(rdoContainer,idHash));
469 if (!rdos_optional.has_value()) return StatusCode::FAILURE;
470 const RDOCollectionAdapter<T_RDOContainer> &rdos(*rdos_optional);
471
475 CellContainerProxy cellContainerProxy(&cellContainer);
476 ModuleProxy moduleProxy(cellContainerProxy[imodule]);
477
478 for (ClusterProxy clusterProxy: moduleProxy) {
479 ATH_CHECK(makeCluster(icluster++,
480 clusterProxy,
481 element,
482 design,
483 *rdos,
484 calibData,
485 calibrationStrategy,
486 lorentzShift,
487 *clusterVars));
488 }
489
490 return StatusCode::SUCCESS;
491}
492
493template <typename T_RDOContainer>
494std::span<typename ActsTrk::RDOContainerTraits<T_RDOContainer>::IClusteringToolType::CellContainer::Cell>
497 const InDet::SiDetectorElementStatus& pixelDetElStatus,
498 const InDetDD::SiDetectorElement& element,
500{
501 // Get the element design
502 const InDetDD::PixelModuleDesign& design =
503 static_cast<const InDetDD::PixelModuleDesign&>(element.design());
504
505 bool check_ganged = !m_isITk && m_checkGanged && isFEI3(design);
506
507 typename IClusteringToolType::CellContainer::ModuleRangeGuard rangeGuard(cellContainer, RDOs.identifyHash() );
508 unsigned int rdo_i=0;
509 for (RDOAdapter<T_RDOContainer> rdo : RDOs) {
510 auto coordinates=rdo.coordinates(*m_pixelID);
511 InDetDD::PixelDiodeTree::DiodeProxy si_param ( design.diodeProxyFromIdx(makeDiodeIdx(coordinates)));
512 std::uint32_t fe = design.getFE(si_param);
513
514 // check if good RDO
515 // the pixel RDO tool here says always good if m_useModuleMap is false
516 if (pixelDetElStatus.isChipGood(rangeGuard.identifyHash(), fe)) {
517 cellContainer.emplace_back_cell(makeCellCoordinates(coordinates), rdo_i);
518
519 if ( check_ganged ) {
520 std::optional<std::array<std::int16_t,2> > gangedCoordinates = getGangedCoordinates(coordinates, design);
521 if (gangedCoordinates.has_value()) {
522 cellContainer.emplace_back_cell(*gangedCoordinates, rdo_i);
523 }
524 }
525 }
526 ++rdo_i;
527 }
528
529 return rangeGuard.moduleCellSpan();
530}
531
534} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
double charge(const T &p)
Definition AtlasPID.h:1003
static Double_t a
virtual std::pair< unsigned int, unsigned int > countCells(const T_RDOContainer &rdo_collection, const std::vector< IdentifierHash > &listOfIds, const InDetDD::SiDetectorElementCollection &detector_elements) const override
std::pair< unsigned int, unsigned int > countCellsImpl(const T_RDOContainer &rdo_collection, const std::vector< IdentifierHash > &listOfIds, const InDetDD::SiDetectorElementCollection &detector_elements) const
InPlaceClusterization::ClusterProxy< const typename IClusteringToolType::CellContainer > ClusterProxy
virtual StatusCode initialize() override
Gaudi::Property< bool > m_broadErrors
extends< AthAlgTool, typename ActsTrk::RDOContainerTraits< T_RDOContainer >::IClusteringToolType >::base_class base_class
Gaudi::Property< bool > m_useWeightedPos
StatusCode makeCluster(size_t icluster, const PixelClusteringToolImpl::ClusterProxy &cluster, const InDetDD::SiDetectorElement &element, const InDetDD::PixelModuleDesign &design, const ActsTrk::RDOContainerTraits< T_RDOContainer >::PerModuleRDOs &RDOs, const PixelChargeCalibCondData *calibData, const PixelChargeCalibCondData::CalibrationStrategy calibStrategy, const double lorentz_shift, xAOD::PixelCluster::ClusterVars &clusterVars) const
ToolHandle< ISiLorentzAngleTool > m_pixelLorentzAngleTool
virtual StatusCode clusterize(const EventContext &ctx, const ActsTrk::RDOContainerTraits< T_RDOContainer >::PerModuleRDOs &RDOs, const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::SiDetectorElement &element, typename IClusteringToolType::CellContainer &cellContainer) const override
Gaudi::Property< bool > m_checkGanged
Gaudi::Property< std::string > m_idHelperName
virtual StatusCode makeClusters(const EventContext &ctx, const T_RDOContainer &rdo_container, const typename IClusteringToolType::CellContainer &cellContainer, unsigned int module_i, const InDetDD::SiDetectorElement &element, unsigned int icluster, xAOD::PixelClusterContainer &cont, std::any &vars) const override
PixelClusteringToolImpl(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
std::span< typename IClusteringToolType::CellContainer::Cell > unpackRDOs(const ActsTrk::RDOContainerTraits< T_RDOContainer >::PerModuleRDOs &RDOs, const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::SiDetectorElement &element, typename IClusteringToolType::CellContainer &cellContainer) const
virtual std::any createEventDataCache(xAOD::PixelClusterContainer &cont, std::size_t nClusterRDOs) const override
static const T_RDOContainer & range(const T_RDOContainer &rdo_container)
static std::optional< RDOCollectionAdapter > make(const T_RDOContainer &rdo_container, const IdentifierHash &id_hash)
This is a "hash" representation of an Identifier.
value_type get_compact() const
Get the compact id.
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
Class used to describe the design of a module (diode segmentation and readout scheme).
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
virtual int numberOfConnectedCells(const SiReadoutCellId &readoutId) const
readout id -> id of connected diodes
PixelReadoutTechnology getReadoutTechnology() const
PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
virtual SiReadoutCellId readoutIdOfCell(const SiCellId &cellId) const
diode id -> readout id
static InDetDD::PixelDiodeType getDiodeType(const PixelDiodeTree::DiodeProxy &diode_proxy)
virtual SiCellId connectedCell(const SiReadoutCellId &readoutId, int number) const
readout id -> id of connected diodes.
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
Identifier for the strip or pixel cell.
Definition SiCellId.h:29
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
Identifier for the strip or pixel readout cell.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::Surface & surface()
Element Surface.
bool isChipGood(IdentifierHash hash, unsigned int chip) const
bool isGood(IdentifierHash hash) const
CalibrationStrategy getCalibrationStrategy(unsigned int moduleHash) const
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
const_pointer_type cptr()
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
void updateEndIndex(unsigned int obj_i, unsigned int elm_i)
unsigned int getBeginIndex(unsigned int obj_i) const
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
void for_each_cluster(cell_collection_t &cells, func_t func)
call the given function for each cluster of a label sorted cell collection.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
Eigen::Map< MeasVector< N > > VectorMap
Eigen::Map< MeasMatrix< N > > MatrixMap
typename T_RDO_Container::base_value_type PerModuleRDOs
A diode proxy which caches the position of a diode.
double xPhiMax() const
for backward compatibility, return the position of the lower edge of the diode in local-y(phi,...
double xEtaMin() const
for backward compatibility, return the position of the lower edge of the diode in local-y(eta,...
double xPhiMin() const
for backward compatibility, return the position of the lower edge of the diode in local-x(phi,...
const Vector2D & position() const
get the cached position of this diode
double xEtaMax() const
for backward compatibility, return the position of the upper edge of the diode in local-y(eta,...
Helper class to access parameters of a diode.
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< float > chargeList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< int > totList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< Identifier::value_type > rdoList
Tell the compiler to optimize assuming that FP may trap.
#define CXXUTILS_TRAPPING_FP
Definition trapping_fp.h:24