ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::PixelClusteringTool Class Reference

#include <PixelClusteringTool.h>

Inheritance diagram for ActsTrk::PixelClusteringTool:
Collaboration diagram for ActsTrk::PixelClusteringTool:

Public Member Functions

 PixelClusteringTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual std::pair< unsigned int, unsigned int > countCells (const RDOContainer &rdo_collection, const std::vector< IdentifierHash > &listOfIds, const InDetDD::SiDetectorElementCollection &detector_elements) const override
virtual StatusCode clusterize (const EventContext &ctx, const RawDataCollection &RDOs, const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::SiDetectorElement &element, IPixelClusteringTool::CellContainer &cellContainer) const override
virtual std::any createEventDataCache (xAOD::PixelClusterContainer &cont, std::size_t nClusterRDOs) const override
virtual StatusCode makeClusters (const EventContext &ctx, const RDOContainer &rdo_container, const IPixelClusteringTool::CellContainer &cellContainer, unsigned int module_i, const InDetDD::SiDetectorElement &element, unsigned int icluster, xAOD::PixelClusterContainer &cont, std::any &vars) const override

Private Types

using ClusterProxy = InPlaceClusterization::ClusterProxy<const IPixelClusteringTool::CellContainer>
using Cell = IPixelClusteringTool::CellContainer::Cell

Private Member Functions

template<bool GANGED>
std::pair< unsigned int, unsigned int > countCellsImpl (const RDOContainer &rdo_collection, const std::vector< IdentifierHash > &listOfIds, const InDetDD::SiDetectorElementCollection &detector_elements) const
std::span< IPixelClusteringTool::CellContainer::CellunpackRDOs (const RawDataCollection &RDOs, const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::SiDetectorElement &element, IPixelClusteringTool::CellContainer &cellContainer) const
StatusCode makeCluster (size_t icluster, const PixelClusteringTool::ClusterProxy &cluster, const InDetDD::SiDetectorElement &element, const InDetDD::PixelModuleDesign &design, const InDetRawDataCollection< PixelRDORawData > &rdos, const PixelChargeCalibCondData *calibData, const PixelChargeCalibCondData::CalibrationStrategy calibStrategy, const double lorentz_shift, xAOD::PixelCluster::ClusterVars &clusterVars) const

Private Attributes

ToolHandle< ISiLorentzAngleToolm_pixelLorentzAngleTool {this, "PixelLorentzAngleTool", "", "Tool to retreive Lorentz angle of Pixel"}
SG::ReadCondHandleKey< PixelChargeCalibCondDatam_chargeDataKey
Gaudi::Property< std::string > m_idHelperName
Gaudi::Property< bool > m_addCorners {this, "AddCorners", true}
Gaudi::Property< bool > m_useWeightedPos {this, "UseWeightedPosition", false}
Gaudi::Property< bool > m_broadErrors {this, "UseBroadErrors", false}
Gaudi::Property< bool > m_checkGanged {this, "CheckGanged", false}
Gaudi::Property< bool > m_isITk {this, "isITk", true, "True if running in ITk"}
const PixelIDm_pixelID {nullptr}

Detailed Description

Definition at line 25 of file PixelClusteringTool.h.

Member Typedef Documentation

◆ Cell

◆ ClusterProxy

Constructor & Destructor Documentation

◆ PixelClusteringTool()

ActsTrk::PixelClusteringTool::PixelClusteringTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 81 of file PixelClusteringTool.cxx.

83 : base_class(type,name,parent)
84{}

Member Function Documentation

◆ clusterize()

StatusCode ActsTrk::PixelClusteringTool::clusterize ( const EventContext & ctx,
const RawDataCollection & RDOs,
const InDet::SiDetectorElementStatus & pixelDetElStatus,
const InDetDD::SiDetectorElement & element,
IPixelClusteringTool::CellContainer & cellContainer ) const
overridevirtual

Definition at line 334 of file PixelClusteringTool.cxx.

339{
340 IdentifierHash idHash = RDOs.identifyHash();
341 IPixelClusteringTool::CellContainer::ModuleRangeGuard rangeGuard(cellContainer.startNewModule(idHash));
342 if ( pixelDetElStatus.isGood(idHash) ) {
343 // Retrieve the cells from the detector element
344 std::span<IPixelClusteringTool::CellContainer::Cell>
345 cellRange = unpackRDOs(RDOs, pixelDetElStatus, element, cellContainer);
346
347 static constexpr unsigned int SORT_BY_LOCAL_X=0u;
348 namespace CL=Acts::InPlaceClusterization;
349 CL::clusterize<SORT_BY_LOCAL_X, std::uint16_t>(cellRange,
350 CL::defaultConnectionHelper<CL::EConnectionType::CommonEdgeOrCorner>(cellRange));
351 // set the cell range per cluster
353 [&cellContainer](std::span<IPixelClusteringTool::CellContainer::Cell> &/*the_range*/,
354 unsigned int idx_begin,
355 unsigned int idx_end) {
356 cellContainer.registerNewCluster(idx_begin,idx_end);
357 });
358 }
359 // must add a range for every call otherwise the cell container and
360 // the list of processed modules get out of sync.
361 cellContainer.registerClustersForNewModule(rangeGuard.range());
362
363 return StatusCode::SUCCESS;
364}
std::span< IPixelClusteringTool::CellContainer::Cell > unpackRDOs(const RawDataCollection &RDOs, const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::SiDetectorElement &element, IPixelClusteringTool::CellContainer &cellContainer) const
bool isGood(IdentifierHash hash) const
void for_each_cluster(cell_collection_t &cells, func_t func)
call the given function for each cluster of a label sorted cell collection.
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ countCells()

std::pair< unsigned int, unsigned int > ActsTrk::PixelClusteringTool::countCells ( const RDOContainer & rdo_collection,
const std::vector< IdentifierHash > & listOfIds,
const InDetDD::SiDetectorElementCollection & detector_elements ) const
overridevirtual

Definition at line 133 of file PixelClusteringTool.cxx.

135 {
136 if (m_isITk || !m_checkGanged ) {
137 return countCellsImpl<false>(rdo_collection,listOfIds, detector_elements);
138 }
139 else {
140 return countCellsImpl<true>(rdo_collection,listOfIds, detector_elements);
141 }
142}
Gaudi::Property< bool > m_checkGanged
std::pair< unsigned int, unsigned int > countCellsImpl(const RDOContainer &rdo_collection, const std::vector< IdentifierHash > &listOfIds, const InDetDD::SiDetectorElementCollection &detector_elements) const
Gaudi::Property< bool > m_isITk

◆ countCellsImpl()

template<bool GANGED>
std::pair< unsigned int, unsigned int > ActsTrk::PixelClusteringTool::countCellsImpl ( const RDOContainer & rdo_collection,
const std::vector< IdentifierHash > & listOfIds,
const InDetDD::SiDetectorElementCollection & detector_elements ) const
private

Definition at line 88 of file PixelClusteringTool.cxx.

90 {
91 auto getNHits =[](const InDetRawDataCollection<PixelRDORawData> &RDOs,
92 const InDetDD::SiDetectorElementCollection &detector_elements )
93 -> unsigned int
94 {
95 unsigned int n_hits = RDOs.size();
96 if constexpr(GANGED) {
97 const InDetDD::SiDetectorElement *element = detector_elements.at(RDOs.identifyHash());
98 assert(element);
99 if (isFEI3(*element)) {
100 for(const PixelRDORawData* rdo : RDOs) {
101 if (isGanged(rdo->identify(), *element)) {
102 ++n_hits;
103 }
104 }
105 }
106 }
107 return n_hits;
108 };
109 unsigned int n_hits=0u;
110 if (listOfIds.empty()) {
111 for (const InDetRawDataCollection<PixelRDORawData> *RDOs : rdoContainer) {
112 assert( RDOs);
113 n_hits += getNHits(*RDOs, detector_elements);
114 }
115 }
116 else {
117 for (const IdentifierHash& id : listOfIds) {
118 if (not id.is_valid()) continue;
119 const InDetRawDataCollection<PixelRDORawData> *RDOs = rdoContainer.indexFindPtr(id);
120 if (RDOs) {
121 n_hits += getNHits(*RDOs, detector_elements);
122 }
123 }
124 }
125 // the total number of hits is the best estimate of the maximum number of clusters.
126 // @TODO could apply a factor for the number clusters or only if the number of hits
127 // are above a certain threshold to reduce memory consumption though impact
128 // is likely small.
129 return {n_hits,n_hits};
130}
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual IdentifierHash identifyHash() const override final

◆ createEventDataCache()

std::any ActsTrk::PixelClusteringTool::createEventDataCache ( xAOD::PixelClusterContainer & cont,
std::size_t nClusterRDOs ) const
overridevirtual

Definition at line 367 of file PixelClusteringTool.cxx.

369{
370 return std::any (xAOD::PixelCluster::ClusterVars (cont, nClusterRDOs));
371}

◆ initialize()

StatusCode ActsTrk::PixelClusteringTool::initialize ( )
overridevirtual

Definition at line 59 of file PixelClusteringTool.cxx.

60{
61 ATH_MSG_DEBUG("Initializing " << name() << " ...");
62
67
69
70 ATH_CHECK(m_chargeDataKey.initialize(not m_chargeDataKey.empty()));
71
72 ATH_MSG_INFO(" Charge Data Key:" << m_chargeDataKey);
73 ATH_MSG_INFO(" ID Helper Name:" << m_idHelperName);
74
75 ATH_CHECK( detStore()->retrieve(m_pixelID, m_idHelperName) );
76
77 ATH_MSG_DEBUG(name() << " successfully initialized");
78 return StatusCode::SUCCESS;
79}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Property< bool > m_broadErrors
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Gaudi::Property< std::string > m_idHelperName
Gaudi::Property< bool > m_addCorners
ToolHandle< ISiLorentzAngleTool > m_pixelLorentzAngleTool
Gaudi::Property< bool > m_useWeightedPos

◆ makeCluster()

StatusCode ActsTrk::PixelClusteringTool::makeCluster ( size_t icluster,
const PixelClusteringTool::ClusterProxy & cluster,
const InDetDD::SiDetectorElement & element,
const InDetDD::PixelModuleDesign & design,
const InDetRawDataCollection< PixelRDORawData > & rdos,
const PixelChargeCalibCondData * calibData,
const PixelChargeCalibCondData::CalibrationStrategy calibStrategy,
const double lorentz_shift,
xAOD::PixelCluster::ClusterVars & clusterVars ) const
private

Definition at line 146 of file PixelClusteringTool.cxx.

155{
156
157 Amg::Vector2D pos_acc(0,0);
158 float tot_acc = 0.f;
159
160 InDetDD::PixelDiodeTree::CellIndexType rowmax = std::numeric_limits<InDetDD::PixelDiodeTree::CellIndexType>::min();
161 InDetDD::PixelDiodeTree::CellIndexType colmax = std::numeric_limits<InDetDD::PixelDiodeTree::CellIndexType>::min();
162 InDetDD::PixelDiodeTree::CellIndexType rowmin = std::numeric_limits<InDetDD::PixelDiodeTree::CellIndexType>::max();
163 InDetDD::PixelDiodeTree::CellIndexType colmin = std::numeric_limits<InDetDD::PixelDiodeTree::CellIndexType>::max();
164 InDetDD::PixelDiodeTree::DiodeProxyWithPosition colmin_diode{};
165 InDetDD::PixelDiodeTree::DiodeProxyWithPosition colmax_diode{};
166 InDetDD::PixelDiodeTree::DiodeProxyWithPosition rowmin_diode{};
167 InDetDD::PixelDiodeTree::DiodeProxyWithPosition rowmax_diode{};
168
169 // We temporary comment this since it is not used
170 // bool hasGanged = false;
171 unsigned int n_rdos = clusterVars.rdoList.getBeginIndex(icluster);
172 assert( clusterVars.totList.getBeginIndex(icluster)==n_rdos );
173 assert( calibData==nullptr || clusterVars.chargeList.getBeginIndex(icluster)==n_rdos );
174
175 IdentifierHash idHash = element.identifyHash();
176 assert( idHash == cluster.identifyHash());
177 Identifier module_id = element.identify();
178 std::optional<Identifier::value_type> first_rdo_id;
179 int cluster_lvl1min = std::numeric_limits<int>::max();
180
181 using CellProxy = InPlaceClusterization::CellProxy<const IPixelClusteringTool::CellContainer>;
182 for (CellProxy cellProxy : cluster) {
183
184 //Construct the identifier class
185 Identifier rdo_id = m_pixelID->pixel_id(module_id, cellProxy.coordinates()[0], cellProxy.coordinates()[1]);
186 if (!first_rdo_id.has_value()) {
187 first_rdo_id=rdo_id.get_compact();
188 }
189
190 // We temporary comment this since it is not used
191 // TODO: Check how the ganged info is used in legacy
192 // if (multiChip) {
193 // hasGanged = hasGanged ||
194 // m_pixelRDOTool->isGanged(id, element).has_value();
195 // }
196 assert(cellProxy.srcIndex() < rdos.size());
197 const PixelRDORawData *rdo = rdos[cellProxy.srcIndex()];
198 cluster_lvl1min = std::min(cluster_lvl1min, rdo->getLVL1A());
199 const int tot = rdo->getToT();
200 float charge = tot;
201
202 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
203 = InDetDD::PixelDiodeTree::makeCellIndex(cellProxy.coordinates()[0],
204 cellProxy.coordinates()[1]);
205 InDetDD::PixelDiodeTree::DiodeProxyWithPosition si_param ( design.diodeProxyFromIdxCachePosition(diode_idx));
206
207 if (calibData) {
208 // Retrieving the calibration only depends on FE and not per cell (can be further optimized)
209 // Single FE modules could have an optimized getCharge function where the calib constants are cached
210 std::uint32_t feValue = design.getFE(si_param);
211 auto diode_type = design.getDiodeType(si_param);
212 if (m_isITk){
213 // @TODO only check in makeClusters or check at all ?
215 ATH_MSG_ERROR("Chip type is not recognized!");
216 return StatusCode::FAILURE;
217 }
218
219 charge = calibData->getCharge(diode_type,
220 calibStrategy,
221 idHash,
222 feValue,
223 tot);
224 } else {
225 charge = calibData->getCharge(diode_type,
226 idHash,
227 feValue,
228 tot);
229
230 // These numbers are taken from the Cluster Maker Tool
231 if (design.getReadoutTechnology() != InDetDD::PixelReadoutTechnology::RD53 && (idHash < 12 or idHash > 2035)) {
232 charge = tot/8.0*(8000.0-1200.0)+1200.0;
233 }
234 }
235 clusterVars.chargeList.setValue(n_rdos,charge);
236 }
237 clusterVars.rdoList.setValue(n_rdos,rdo_id.get_compact());
238 clusterVars.totList.setValue(n_rdos,tot);
239 ++n_rdos;
240
241 const InDetDD::PixelDiodeTree::CellIndexType &row = diode_idx[0];
242 const InDetDD::PixelDiodeTree::CellIndexType &col = diode_idx[1];
243 if (row>rowmax) {
244 rowmax=row;
245 rowmax_diode = si_param;
246 }
247 if (row<rowmin) {
248 rowmin=row;
249 rowmin_diode = si_param;
250 }
251 if (col>colmax) {
252 colmax=col;
253 colmax_diode = si_param;
254 }
255 if (col<colmin) {
256 colmin=col;
257 colmin_diode = si_param;
258 }
259
260 // We compute the digital position as a sum of all RDO positions
261 // all with the same weight of 1
262 // We do not compute a charge-weighted center of gravity here (by default) since
263 // we observe it to be worse than the digital position
264 // ToT-weighted center of gravity must not be used
265 if (m_useWeightedPos) {
266 pos_acc += charge * si_param.position();
267 tot_acc += charge;
268 } else {
269 pos_acc += si_param.position();
270 tot_acc += 1;
271 }
272
273 }
274 assert(n_rdos>0); // clusters must not be empty
275 if (tot_acc > 0)
276 pos_acc /= tot_acc;
277
278
279 const int colWidth = colmax - colmin + 1;
280 const int rowWidth = rowmax - rowmin + 1;
281
282 double etaWidth = colmax_diode.xEtaMax() - colmin_diode.xEtaMin(); // design.widthFromColumnRange(colmin, colmax);
283 double phiWidth = rowmax_diode.xPhiMax() - rowmin_diode.xPhiMin(); // design.widthFromColumnRange(colmin, colmax);
284
285 // ask for Lorentz correction, get global position
286 const Amg::Vector2D localPos = pos_acc;
287 Amg::Vector2D locpos(localPos[Trk::locX]+lorentzShift, localPos[Trk::locY]);
288 // find global position of element
289 const Amg::Transform3D& T = element.surface().transform();
290 double Ax[3] = {T(0,0),T(1,0),T(2,0)};
291 double Ay[3] = {T(0,1),T(1,1),T(2,1)};
292 double R [3] = {T(0,3),T(1,3),T(2,3)};
293
294 const Amg::Vector2D& M = locpos;
295 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]);
296
297 // Compute error matrix
298 float width0, width1;
299 if (m_broadErrors) {
300 // Use cluster width
301 width0 = phiWidth;
302 width1 = etaWidth;
303 } else {
304 // Use average pixel width
305 width0 = phiWidth / rowWidth;
306 width1 = etaWidth / colWidth;
307 }
308
309 // Actually create the cluster (i.e. fill the values)
310
311 Eigen::Matrix<float,2,1> localPosition(locpos.x(), locpos.y());
312 Eigen::Matrix<float,2,2> localCovariance = Eigen::Matrix<float,2,2>::Zero();
313 localCovariance(0, 0) = width0 * width0 / 12.0f;
314 localCovariance(1, 1) = width1 * width1 / 12.0f;
315
316 clusterVars.identifierHash[icluster] = idHash;
317 xAOD::VectorMap<2>(clusterVars.localPositionDim2[icluster].data()) = localPosition;
318 xAOD::MatrixMap<2>(clusterVars.localCovarianceDim2[icluster].data()) = localCovariance;
319 assert( first_rdo_id.has_value());
320 clusterVars.identifier[icluster] = *first_rdo_id;
321 clusterVars.rdoList.updateEndIndex(icluster,n_rdos);
322 xAOD::VectorMap<3>(clusterVars.globalPosition[icluster].data()) = globalPos.cast<float>();
323 clusterVars.totList.updateEndIndex(icluster,n_rdos);
324 clusterVars.chargeList.updateEndIndex(icluster, (calibData ? n_rdos : 0u));
325 clusterVars.lvl1a[icluster] = cluster_lvl1min;
326 clusterVars.channelsInPhi[icluster] = rowWidth;
327 clusterVars.channelsInEta[icluster] = colWidth;
328 clusterVars.widthInEta[icluster] = etaWidth;
329
330 return StatusCode::SUCCESS;
331}
#define ATH_MSG_ERROR(x)
double charge(const T &p)
Definition AtlasPID.h:997
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.
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
PixelReadoutTechnology getReadoutTechnology() const
static InDetDD::PixelDiodeType getDiodeType(const PixelDiodeTree::DiodeProxy &diode_proxy)
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
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.
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
virtual int getToT() const =0
virtual int getLVL1A() const =0
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
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
row
Appending html table to final .html summary file.
unsigned long long T
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
Eigen::Map< MeasVector< N > > VectorMap
Eigen::Map< MeasMatrix< N > > MatrixMap
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,...
double xEtaMax() const
for backward compatibility, return the position of the upper edge of the diode in local-y(eta,...
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< float > chargeList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< int > totList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< Identifier::value_type > rdoList

◆ makeClusters()

StatusCode ActsTrk::PixelClusteringTool::makeClusters ( const EventContext & ctx,
const RDOContainer & rdo_container,
const IPixelClusteringTool::CellContainer & cellContainer,
unsigned int module_i,
const InDetDD::SiDetectorElement & element,
unsigned int icluster,
xAOD::PixelClusterContainer & cont,
std::any & vars ) const
overridevirtual

Definition at line 375 of file PixelClusteringTool.cxx.

383{
384 // Retrieve the calibration data
385 const PixelChargeCalibCondData *calibData = nullptr;
386 if (not m_chargeDataKey.empty()) {
387 SG::ReadCondHandle<PixelChargeCalibCondData> calibDataHandle = SG::makeHandle( m_chargeDataKey, ctx );
388 calibData = calibDataHandle.cptr();
389
390 if (!calibData) {
391 ATH_MSG_ERROR("PixelChargeCalibCondData requested but couldn't be retrieved from " << m_chargeDataKey.key());
392 return StatusCode::FAILURE;
393 }
394 }
395
396 // Get the element design
397 const InDetDD::PixelModuleDesign& design =
398 static_cast<const InDetDD::PixelModuleDesign&>(element.design());
399
400 // Get the calibration strategy for this module.
401 // Default to RD53 if the calibData is not available. That is fine because it won't be used anyway
402 auto calibrationStrategy = calibData ? calibData->getCalibrationStrategy(element.identifyHash()) : PixelChargeCalibCondData::CalibrationStrategy::RD53;
403
404 IdentifierHash idHash = element.identifyHash();
405 double lorentzShift = m_pixelLorentzAngleTool->getLorentzShift(idHash, ctx);
406
407 auto* clusterVars = std::any_cast<xAOD::PixelCluster::ClusterVars> (&cache);
408 if (!clusterVars) throw std::bad_any_cast();
409
410 const InDetRawDataCollection<PixelRDORawData>* rdos = rdoContainer.indexFindPtr(idHash);
411 if (!rdos) return StatusCode::FAILURE;
412
413 using CellContainerProxy = InPlaceClusterization::CellContainerProxy<const IPixelClusteringTool::CellContainer>;
414 using ModuleProxy = InPlaceClusterization::ModuleProxy<const IPixelClusteringTool::CellContainer>;
415 using ClusterProxy = InPlaceClusterization::ClusterProxy<const IPixelClusteringTool::CellContainer>;
416 CellContainerProxy cellContainerProxy(&cellContainer);
417 ModuleProxy moduleProxy(cellContainerProxy[imodule]);
418
419 for (ClusterProxy clusterProxy: moduleProxy) {
420 ATH_CHECK(makeCluster(icluster++,
421 clusterProxy,
422 element,
423 design,
424 *rdos,
425 calibData,
426 calibrationStrategy,
427 lorentzShift,
428 *clusterVars));
429 }
430
431 return StatusCode::SUCCESS;
432}
StatusCode makeCluster(size_t icluster, const PixelClusteringTool::ClusterProxy &cluster, const InDetDD::SiDetectorElement &element, const InDetDD::PixelModuleDesign &design, const InDetRawDataCollection< PixelRDORawData > &rdos, const PixelChargeCalibCondData *calibData, const PixelChargeCalibCondData::CalibrationStrategy calibStrategy, const double lorentz_shift, xAOD::PixelCluster::ClusterVars &clusterVars) const
InPlaceClusterization::ClusterProxy< const IPixelClusteringTool::CellContainer > ClusterProxy
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
CalibrationStrategy getCalibrationStrategy(unsigned int moduleHash) const
const_pointer_type cptr()
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ unpackRDOs()

std::span< IPixelClusteringTool::CellContainer::Cell > ActsTrk::PixelClusteringTool::unpackRDOs ( const RawDataCollection & RDOs,
const InDet::SiDetectorElementStatus & pixelDetElStatus,
const InDetDD::SiDetectorElement & element,
IPixelClusteringTool::CellContainer & cellContainer ) const
private

Definition at line 435 of file PixelClusteringTool.cxx.

439{
440 // Get the element design
441 const InDetDD::PixelModuleDesign& design =
442 static_cast<const InDetDD::PixelModuleDesign&>(element.design());
443
444 bool check_ganged = !m_isITk && m_checkGanged && isFEI3(element);
445
446 IPixelClusteringTool::CellContainer::ModuleRangeGuard rangeGuard(cellContainer, RDOs.identifyHash() );
447 unsigned int rdo_i=0;
448 for (const auto *const rdo : RDOs) {
449 const Identifier& rdoID = rdo->identify();
450
451 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
453 m_pixelID->eta_index(rdoID));
454 InDetDD::PixelDiodeTree::DiodeProxy si_param ( design.diodeProxyFromIdx(diode_idx));
455 std::uint32_t fe = design.getFE(si_param);
456
457 // check if good RDO
458 // the pixel RDO tool here says always good if m_useModuleMap is false
459 if (pixelDetElStatus.isChipGood(rangeGuard.identifyHash(), fe)) {
460 std::array<std::int16_t,2> coordinates{check_integer_cast<int16_t>(diode_idx[0]),
461 check_integer_cast<int16_t>(diode_idx[1])};
462 cellContainer.emplace_back_cell(coordinates, rdo_i);
463
464 if ( check_ganged ) {
465 std::optional<std::array<std::int16_t,2> > gangedCoordinates = getGangedCoordinates(coordinates, element);
466 if (gangedCoordinates.has_value()) {
467 cellContainer.emplace_back_cell(*gangedCoordinates, rdo_i);
468 }
469 }
470 }
471 ++rdo_i;
472 }
473
474 return rangeGuard.moduleCellSpan();
475}
PixelDiodeTree::DiodeProxy diodeProxyFromIdx(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
bool isChipGood(IdentifierHash hash, unsigned int chip) const

Member Data Documentation

◆ m_addCorners

Gaudi::Property<bool> ActsTrk::PixelClusteringTool::m_addCorners {this, "AddCorners", true}
private

Definition at line 97 of file PixelClusteringTool.h.

97{this, "AddCorners", true};

◆ m_broadErrors

Gaudi::Property<bool> ActsTrk::PixelClusteringTool::m_broadErrors {this, "UseBroadErrors", false}
private

Definition at line 99 of file PixelClusteringTool.h.

99{this, "UseBroadErrors", false};

◆ m_chargeDataKey

SG::ReadCondHandleKey<PixelChargeCalibCondData> ActsTrk::PixelClusteringTool::m_chargeDataKey
private
Initial value:
{this, "PixelChargeCalibCondData", "",
"Pixel charge calibration data"}

Definition at line 92 of file PixelClusteringTool.h.

92 {this, "PixelChargeCalibCondData", "",
93 "Pixel charge calibration data"};

◆ m_checkGanged

Gaudi::Property<bool> ActsTrk::PixelClusteringTool::m_checkGanged {this, "CheckGanged", false}
private

Definition at line 100 of file PixelClusteringTool.h.

100{this, "CheckGanged", false};

◆ m_idHelperName

Gaudi::Property<std::string> ActsTrk::PixelClusteringTool::m_idHelperName
private
Initial value:
{this, "IDHelperName", "PixelID",
"Pixel-like ID helper name to retrieve from DetectorStore"}

Definition at line 94 of file PixelClusteringTool.h.

94 {this, "IDHelperName", "PixelID",
95 "Pixel-like ID helper name to retrieve from DetectorStore"};

◆ m_isITk

Gaudi::Property<bool> ActsTrk::PixelClusteringTool::m_isITk {this, "isITk", true, "True if running in ITk"}
private

Definition at line 101 of file PixelClusteringTool.h.

101{this, "isITk", true, "True if running in ITk"};

◆ m_pixelID

const PixelID* ActsTrk::PixelClusteringTool::m_pixelID {nullptr}
private

Definition at line 102 of file PixelClusteringTool.h.

102{nullptr};

◆ m_pixelLorentzAngleTool

ToolHandle< ISiLorentzAngleTool > ActsTrk::PixelClusteringTool::m_pixelLorentzAngleTool {this, "PixelLorentzAngleTool", "", "Tool to retreive Lorentz angle of Pixel"}
private

Definition at line 90 of file PixelClusteringTool.h.

90{this, "PixelLorentzAngleTool", "", "Tool to retreive Lorentz angle of Pixel"};

◆ m_useWeightedPos

Gaudi::Property<bool> ActsTrk::PixelClusteringTool::m_useWeightedPos {this, "UseWeightedPosition", false}
private

Definition at line 98 of file PixelClusteringTool.h.

98{this, "UseWeightedPosition", false};

The documentation for this class was generated from the following files: