ATLAS Offline Software
InDetTestPixelLayerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
16 #include "TrkTrack/Track.h"
17 
19 
20 #include "TrkGeometry/Layer.h"
21 
24 #include "Identifier/Identifier.h"
27 
28 namespace InDet {
29 
31  const std::string& n,
32  const IInterface* p)
33  : AthAlgTool(name, n, p)
34  , m_idHelper(nullptr)
35  , m_pixelId(nullptr)
36 {
37  declareInterface<IInDetTestPixelLayerTool>(this);
38 }
39 
42 {
43 
44  // retrieve ID helpers:
45  if (detStore()->retrieve(m_idHelper, "AtlasID").isFailure()) {
46  ATH_MSG_FATAL("Could not get AtlasDetectorID helper");
47  return StatusCode::FAILURE;
48  }
49 
50  if (detStore()->retrieve(m_pixelId, "PixelID").isFailure()) {
51  ATH_MSG_FATAL("Could not get PixelID helper !");
52  return StatusCode::FAILURE;
53  }
54 
55  if (m_extrapolator.retrieve().isFailure()) {
56  ATH_MSG_FATAL("Failed to retrieve tool " << m_extrapolator);
57  return StatusCode::FAILURE;
58  }
59 
60  ATH_CHECK(m_pixelCondSummaryTool.retrieve(DisableTool{
61  !m_pixelDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED }));
63 
64  return StatusCode::SUCCESS;
65 }
66 
67 bool
69  const Trk::Track* track,
70  int pixel_layer,
71  bool checkBarrelOnly) const
72 {
73  ATH_MSG_DEBUG("computing expectHitInPixelLayer info");
74 
75  const Trk::Perigee* mp = track->perigeeParameters();
76 
77  if (!mp) {
78  ATH_MSG_WARNING("Found Track with no perigee parameters: no b-layer info "
79  "will be provided ");
80  return false;
81  } else {
82  ATH_MSG_DEBUG("Track perigee parameters");
83  return this->expectHitInPixelLayer(ctx, mp, pixel_layer, checkBarrelOnly);
84  }
85 }
86 
87 bool
89  const EventContext& ctx,
91  int pixel_layer) const
92 {
93 
94  // Need to compute if we do expect a B-layer hit. If the previous
95  // calculation already determined that we don't expect a hit, then we still
96  // won't expect one.
97 
98  if (!track) {
100  "Not a valid TrackParticle: no b-layer info will be provided");
101  return false;
102  }
103 
104  ATH_MSG_DEBUG("computing expectHitInPixelLayer info");
105 
106  const Trk::Perigee* mp = track->perigee();
107 
108  if (!mp) {
109  ATH_MSG_WARNING("Found TrackParticle with no perigee parameters: no "
110  "b-layer info will be provided");
111  return false;
112  } else {
113  ATH_MSG_DEBUG("TrackParticle perigee parameters");
114  // mp->dump(mLog);
115  return (this->expectHitInPixelLayer(ctx, mp, pixel_layer));
116  }
117 }
118 
119 bool
121  const EventContext& ctx,
122  const Trk::TrackParameters* trackpar,
123  int pixel_layer,
124  bool checkBarrelOnly) const
125 {
126  bool expect_hit = false;
127 
128  std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
129  if (!this->getPixelLayerParameters(ctx, trackpar, pixelLayerParam)) {
130  ATH_MSG_DEBUG("Failed to get pixel layer parameters!");
131  return false;
132  }
133 
135  for (std::unique_ptr<const Trk::TrackParameters>& p : pixelLayerParam) {
136 
137  if (!(p->associatedSurface().associatedDetectorElement()))
138  continue;
139  Identifier id =
140  p->associatedSurface().associatedDetectorElement()->identify();
141 
142  if (checkBarrelOnly && !m_pixelId->is_barrel(id)) continue;
143  if (m_pixelId->layer_disk(id) != pixel_layer) continue;
144 
146  pixelDetElStatus->isGood(p->associatedSurface().associatedDetectorElement()->identifyHash()),
148 
149  if ((!m_pixelDetElStatus.empty() &&
150  pixelDetElStatus->isGood(p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
152 
153  if (m_checkActiveAreas) {
154 
155  if (isActive(p.get())) {
156 
157  if (m_checkDeadRegions) {
158 
159  double fracGood = getFracGood(p.get(),
162  !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
163  if (fracGood > m_goodFracCut && fracGood >= 0) {
164  ATH_MSG_DEBUG("Condition Summary: b-layer good");
165  expect_hit =
166  true;
167  } else {
168  ATH_MSG_DEBUG("b-layer in dead region: fracGood = " << fracGood);
169  }
170 
171  } else {
172  ATH_MSG_DEBUG("Condition Summary: not checking dead regions");
173  expect_hit =
174  true;
175  }
176 
177  } else {
179  "Condition Summary: b-layer good but outside active area");
180  }
181 
182  }
183  else {
185  "Condition Summary: b-layer good, active areas not checked");
186  expect_hit = true;
187  }
188 
189  } else {
190  ATH_MSG_DEBUG(__LINE__ << "b-layer not good");
191  }
192 
193  }
194 
195  return expect_hit;
196 }
197 
198 bool
200  const Trk::TrackParameters* trackpar) const
201 {
202  bool expect_hit =
203  false;
204 
205  Identifier id =
207 
208 
209  const EventContext& ctx = Gaudi::Hive::currentContext();
211 
214  pixelDetElStatus->isGood(trackpar->associatedSurface().associatedDetectorElement()->identifyHash()),
216  if ((!m_pixelDetElStatus.empty() &&
217  pixelDetElStatus->isGood(trackpar->associatedSurface().associatedDetectorElement()->identifyHash())) ||
219 
220  if (m_checkDeadRegions) {
221 
222  double fracGood = getFracGood(
223  trackpar, m_phiRegionSize, m_etaRegionSize, !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
224  if (fracGood > m_goodFracCut && fracGood >= 0) {
225  ATH_MSG_DEBUG("Condition Summary: b-layer good");
226  expect_hit = true;
227  } else {
228  ATH_MSG_DEBUG("b-layer in dead region: fracGood = " << fracGood);
229  }
230 
231  } else {
232  ATH_MSG_DEBUG("Condition Summary: not checking dead regions");
233  expect_hit = true;
234  }
235 
236  } else {
237  ATH_MSG_DEBUG(__LINE__ << "b-layer not good");
238  }
239 
240  return expect_hit;
241 }
242 
243 double
245  int pixel_layer) const
246 {
247  const Trk::Perigee* mp = track->perigee();
248 
249  if (!mp) {
250  ATH_MSG_WARNING("Found Track with no perigee parameters: no b-layer info "
251  "will be provided ");
252  return -4.;
253  } else {
254  ATH_MSG_DEBUG("Track perigee parameters");
255  return this->getFracGood(mp, pixel_layer);
256  }
257 }
258 
259 double
261  const Trk::TrackParameters* trackpar,
262  int pixel_layer) const
263 {
264  std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
265  if (!this->getPixelLayerParameters(trackpar, pixelLayerParam))
266  return -5.;
267 
268  // now, figure out which layer we're supposed to be checking.
269  bool found_layer = false;
270  for (std::unique_ptr<const Trk::TrackParameters>& p : pixelLayerParam) {
271  if (!(p->associatedSurface().associatedDetectorElement()))
272  continue;
273  Identifier id =
274  p->associatedSurface().associatedDetectorElement()->identify();
275 
276  if (m_pixelId->layer_disk(id) == pixel_layer){
277  found_layer = true;
278  break;
279  }
280  }
281 
282  // if we're asking for a layer that doesn't exist in the extrapolation, then
283  // return.
284  if (!found_layer)
285  return -7.;
286 
287  const EventContext& ctx = Gaudi::Hive::currentContext();
289 
290  for (std::unique_ptr<const Trk::TrackParameters>& p : pixelLayerParam) {
291 
292  if (!(p->associatedSurface().associatedDetectorElement()))
293  continue;
294  Identifier id =
295  p->associatedSurface().associatedDetectorElement()->identify();
296 
297  if (m_pixelId->layer_disk(id) != pixel_layer)
298  continue;
299 
302  pixelDetElStatus->isGood(trackpar->associatedSurface().associatedDetectorElement()->identifyHash()),
304  if ((!m_pixelDetElStatus.empty() &&
305  pixelDetElStatus->isGood(p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
307 
308  if (isActive(p.get())) {
309 
310  return getFracGood(
311  p.get(), m_phiRegionSize, m_etaRegionSize, !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
312 
313  } else {
315  "Condition Summary: b-layer good but outside active area");
316  }
317 
318  } else {
319  ATH_MSG_DEBUG(__LINE__ << "b-layer not good");
320  }
321 
322  }
323 
324  return -3.;
325 }
326 
327 bool
329  const Trk::TrackParameters* trackpar) const
330 {
331 
332  const auto* tmp = trackpar->associatedSurface().associatedDetectorElement();
333  const InDetDD::SiDetectorElement* siElement =
334  (tmp != nullptr && tmp->detectorType() == Trk::DetectorElemType::Silicon)
335  ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
336  : nullptr;
337 
338  if (siElement == nullptr) {
339  // ------- in dubio pro reo --> return false (is assumed insensitive)
340  ATH_MSG_DEBUG("TrackParameters do not belong to a Si Element");
342  } else {
343  double phitol = 2.5;
344  double etatol = 5.;
345  if (trackpar->covariance()) {
346  phitol = 3. * sqrt((*trackpar->covariance())(Trk::locX, Trk::locX));
347  etatol = 3. * sqrt((*trackpar->covariance())(Trk::locY, Trk::locY));
348  }
349  InDetDD::SiIntersect siIn =
350  siElement->inDetector(trackpar->localPosition(), phitol, etatol);
351  if (siElement->nearBondGap(trackpar->localPosition(), etatol)) {
352  ATH_MSG_DEBUG("---> extrapolation on bond gap within " << etatol
353  << ", return");
354  } else if (!siIn.in()) {
355  ATH_MSG_DEBUG("---> extrapolation not inside (active?) detector within "
356  << phitol << " " << etatol << ", return");
357  } else {
358  return true;
359  }
360  }
361 
362  return false;
363 }
364 
365 bool
367  const Trk::Track* track,
368  std::vector<TrackStateOnPixelLayerInfo>& infoList) const
369 {
370 
371  std::unique_ptr<const Trk::TrackParameters> startParameters = nullptr;
372 
373  if (track->perigeeParameters()) {
374  startParameters = track->perigeeParameters()->uniqueClone();
375  } else if (track->trackParameters()->front()) {
376  startParameters =
377  m_extrapolator->extrapolate(
378  Gaudi::Hive::currentContext(),
379  *(track->trackParameters()->front()),
382  false);
383  }
384 
385  if (!startParameters) {
386  ATH_MSG_WARNING("Found Track with no perigee parameters: no b-layer info "
387  "will be provided");
388  return false;
389  }
390 
391  bool succeed = getTrackStateOnPixelLayerInfo(startParameters.get(), infoList);
392  return succeed;
393 }
394 
395 bool
398  std::vector<TrackStateOnPixelLayerInfo>& infoList) const
399 {
400 
401  const Trk::Perigee* startParameters = track->perigee();
402 
403  if (!startParameters) {
404  ATH_MSG_WARNING("Found TrackParticle with no perigee parameters: no "
405  "b-layer info will be provided");
406  return false;
407  }
408 
409  return getTrackStateOnPixelLayerInfo(startParameters, infoList);
410 }
411 
412 bool
414  const Trk::TrackParameters* trackpar,
415  std::vector<TrackStateOnPixelLayerInfo>& infoList,
416  int pixel_layer,
417  bool checkBarrelOnly) const
418 {
419 
420  infoList.clear();
421 
422  std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
423  if (!getPixelLayerParameters(trackpar, pixelLayerParam))
424  return false;
425 
426  const EventContext& ctx = Gaudi::Hive::currentContext();
428 
429  for (std::unique_ptr<const Trk::TrackParameters>& trkParam :
430  pixelLayerParam) {
431  TrackStateOnPixelLayerInfo pixelLayerInfo;
432 
433  double fracGood = getFracGood(trkParam.get(),
436  !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
437  pixelLayerInfo.goodFraction(fracGood);
438 
439  Identifier id =
440  trkParam->associatedSurface().associatedDetectorElement()->identify();
441  pixelLayerInfo.moduleId(id);
442 
443  if (checkBarrelOnly && !m_pixelId->is_barrel(id)) continue;
444  if (m_pixelId->layer_disk(id) != pixel_layer) continue;
445 
446  const auto* tmp = trkParam->associatedSurface().associatedDetectorElement();
447  const InDetDD::SiDetectorElement* sielem =
448  (tmp != nullptr && tmp->detectorType() == Trk::DetectorElemType::Silicon)
449  ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
450  : nullptr;
451 
452  if (!sielem) {
453  ATH_MSG_WARNING("Failed to cast TrackParameters associated surface to "
454  "SiDetectorElement");
455  return false;
456  }
457 
458  const Amg::Vector2D& locPos = trkParam->localPosition();
459  Identifier holeId_c = sielem->identifierOfPosition(locPos);
460  pixelLayerInfo.pixelId(holeId_c);
461 
462  double etaDist = -9999;
463  double phiDist = -9999;
464  const InDetDD::PixelModuleDesign* design =
465  dynamic_cast<const InDetDD::PixelModuleDesign*>(&sielem->design());
466  if (design) {
467  design->distanceToDetectorEdge(
468  locPos,
469  etaDist,
470  phiDist);
471  } else {
472  ATH_MSG_WARNING("could not get pixel module design for "
473  << m_idHelper->show_to_string(id)
474  << ", returning false for getTrackStateOnPixelLayerInfo");
475  return false;
476  }
477  pixelLayerInfo.distToModuleEdgePhi(phiDist);
478  pixelLayerInfo.distToModuleEdgeEta(etaDist);
479 
480  pixelLayerInfo.globalPosition(trkParam->position());
481 
482  pixelLayerInfo.localX(locPos[Trk::locX]);
483  pixelLayerInfo.localY(locPos[Trk::locY]);
484 
485  pixelLayerInfo.theta(trkParam->parameters()[Trk::theta]);
486  pixelLayerInfo.phi(trkParam->parameters()[Trk::phi0]);
487 
488  float error_locx = -9999;
489  float error_locy = -9999;
490 
491  if (trkParam->covariance()) {
492  error_locx = sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
493  error_locy = sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
494  } else {
495  ATH_MSG_DEBUG("could not TrackParameters for hole "
496  << m_idHelper->show_to_string(id));
497  }
498 
499  pixelLayerInfo.errLocalX(error_locx);
500  pixelLayerInfo.errLocalY(error_locy);
501 
504  pixelDetElStatus->isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash()),
506  bool isgood =
507  ((!m_pixelDetElStatus.empty() &&
508  pixelDetElStatus->isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash())) ||
510 
511  double phitol = 2.5;
512  double etatol = 5.;
513 
514  if (trkParam->covariance()) {
515  phitol = 3 * sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
516  etatol = 3 * sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
517  }
518 
519  InDetDD::SiIntersect siIn = sielem->inDetector(locPos, phitol, etatol);
520  bool isIn = siIn.in();
521 
522  if (isgood) {
523  if (isIn)
524  pixelLayerInfo.type(insideGoodModule);
525  else
526  pixelLayerInfo.type(nearGoodModuleEdge);
527  } else {
528  if (isIn)
529  pixelLayerInfo.type(insideBadModule);
530  else
531  pixelLayerInfo.type(nearBadModuleEdge);
532  }
533 
534  infoList.push_back(pixelLayerInfo);
535  }
536 
537  return true;
538 }
539 
540 bool
542  const EventContext& ctx,
543  const Trk::TrackParameters* trackpar,
544  std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
545  const
546 {
548  ATH_MSG_DEBUG("Trying to extrapolate to pixelLayer");
549 
550  if(std::abs(trackpar->position().z())>5000.){
551  ATH_MSG_DEBUG("Pathological track parameter well outside of tracking detector");
552  ATH_MSG_DEBUG("Propagator might have issue with this, discarding");
553  ATH_MSG_VERBOSE("dumping track parameters " << *trackpar);
554  return false;
555  }
556 
557  Amg::Transform3D surfTrans;
558  surfTrans.setIdentity();
559  Trk::CylinderSurface BiggerThanPixelLayerSurface(surfTrans, m_outerRadius, 10000.0);
560 
561  // extrapolate stepwise to this parameter (be careful, sorting might be wrong)
562  std::vector<std::unique_ptr<Trk::TrackParameters>> paramList =
563  m_extrapolator->extrapolateStepwise(
564  ctx, *trackpar, BiggerThanPixelLayerSurface, Trk::alongMomentum, false);
565 
566  if (paramList.empty()) {
567  ATH_MSG_DEBUG("No parameter returned by propagator ");
568  ATH_MSG_VERBOSE("dumping track parameters " << *trackpar);
569  return false;
570  }
571 
573  " Number of generated parameters by propagator: " << paramList.size());
574 
575  int s_int = 0;
576  for (std::unique_ptr<Trk::TrackParameters>& p : paramList) {
577  ATH_MSG_DEBUG(s_int++ << "th surface : ");
578 
579  Identifier id;
580  if (!(p->associatedSurface().associatedDetectorElement() != nullptr &&
581  p->associatedSurface().associatedDetectorElement()->identify() !=
582  0)) {
583  continue;
584  }
585 
586  id = p->associatedSurface().associatedDetectorElement()->identify();
587  if (!m_idHelper->is_pixel(id)) {
588  continue;
589  }
590 
591  ATH_MSG_DEBUG("Found pixel module : " << id.get_compact());
592 
593  pixelLayerParam.push_back(std::move(p));
594  }
595 
596  return true;
597 }
598 
599 double
601  const Trk::TrackParameters* trkParam,
602  double phiRegionSize,
603  double etaRegionSize,
604  const InDet::SiDetectorElementStatus *pixelDetElStatus) const
605 {
606 
607  Identifier moduleid =
609  IdentifierHash id_hash = m_pixelId->wafer_hash(moduleid);
610 
611  const EventContext& ctx = Gaudi::Hive::currentContext();
612  VALIDATE_STATUS_ARRAY(pixelDetElStatus,pixelDetElStatus->isGood(id_hash), m_pixelCondSummaryTool->isGood(id_hash, ctx));
613  bool is_good ( ( pixelDetElStatus && pixelDetElStatus->isGood(id_hash))
614  || (!pixelDetElStatus && m_pixelCondSummaryTool->isGood(id_hash, ctx)));
615  if (!is_good)
616  return 0.;
617 
618  const Amg::Vector2D& locPos = trkParam->localPosition();
619  double locx = locPos[Trk::locX];
620  double locy = locPos[Trk::locY];
621  double error_locx = -9999;
622  double error_locy = -9999;
623 
624  if (trkParam->covariance()) {
625  error_locx = sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
626  error_locy = sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
627  } else {
628  ATH_MSG_DEBUG("could not get MeasuredTrackParameters ");
629  }
630 
631  double phitol = 2.5;
632  double etatol = 5.;
633  if (trkParam->covariance()) {
634  phitol = phiRegionSize * error_locx;
635  etatol = etaRegionSize * error_locy;
636  }
637 
638  // now, check to see that phitol and etatol extend at least beyond the current
639  // pixel
640  const auto* tmp = trkParam->associatedSurface().associatedDetectorElement();
641  const InDetDD::SiDetectorElement* sielem =
642  (tmp != nullptr && tmp->detectorType() == Trk::DetectorElemType::Silicon)
643  ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
644  : nullptr;
645 
646  if (!sielem) {
648  "Failed to cast TrackParameters associated surface to SiDetectorElement");
649  return false;
650  }
651 
652  const InDetDD::PixelModuleDesign* design =
653  dynamic_cast<const InDetDD::PixelModuleDesign*>(&sielem->design());
654  if (design) {
655  phitol = std::max(phitol, design->phiPitch() + 1e-6);
656  etatol = std::max(etatol, design->etaPitch() + 1e-6);
657  } else {
659  "could not get pixel module design, returning 0 for getFracGood");
660  return 0.;
661  }
662 
663  Amg::Vector2D LocPos(locx, locy);
664 
665  double startLocX = locx - phitol;
666  double startLocY = locy - etatol;
667 
668  double endLocX = locx + phitol;
669  double endLocY = locy + etatol;
670 
671  Amg::Vector2D startLocPostmp(startLocX, startLocY);
672  Amg::Vector2D endLocPostmp(endLocX, endLocY);
673 
674  double etaDist = -9999;
675  double phiDist = -9999;
676 
677  if (design) {
678  design->distanceToDetectorEdge(LocPos, etaDist, phiDist);
679  if (phiDist < 0)
680  locx += (std::abs(phiDist) + 1e-6);
681  if (etaDist < 0)
682  locy += (std::abs(etaDist) + 1e-6);
683  design->distanceToDetectorEdge(startLocPostmp, etaDist, phiDist);
684  if (phiDist < 0)
685  startLocX += (std::abs(phiDist) + 1e-6);
686  if (etaDist < 0)
687  startLocY += (std::abs(etaDist) + 1e-6);
688  design->distanceToDetectorEdge(endLocPostmp, etaDist, phiDist);
689  if (phiDist < 0)
690  endLocX -= (std::abs(phiDist) + 1e-6);
691  if (etaDist < 0)
692  endLocY -= (std::abs(etaDist) + 1e-6);
693  }
694 
695  LocPos = Amg::Vector2D(locx, locy);
696 
697  if (m_checkDisabledFEs) {
700 
701  if (si_param.isValid()) {
702  std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx(si_param.computeIndex(LocPos));
703  Identifier centreId = m_pixelId->pixel_id(moduleid, diode_idx[0],diode_idx[1]);
704  assert( centreId == sielem->identifierOfPosition(LocPos) );
705 
706  assert( sielem->identifyHash() == m_pixelId->wafer_hash(m_pixelId->wafer_id(centreId)));
708  std::uint32_t feValue = design->getFE(si_param);
710  pixelDetElStatus->isChipGood(id_hash, feValue),
711  m_pixelCondSummaryTool->isGood(centreId, context));
712  bool is_chip_good((!m_pixelDetElStatus.empty() &&
713  pixelDetElStatus->isChipGood(id_hash, feValue)) ||
714  (m_pixelDetElStatus.empty() && m_pixelCondSummaryTool->isGood(centreId, context, ctx)));
715  if (!is_chip_good){
716  return 0.;
717  }
718  } else {
719  ATH_MSG_WARNING("Invalid Identifier, skipping check of FE...");
720  }
721  }
722 
723  Amg::Vector2D startLocPos(startLocX, startLocY);
724  Amg::Vector2D endLocPos(endLocX, endLocY);
725  Identifier startId = sielem->identifierOfPosition(startLocPos);
726  Identifier endId = sielem->identifierOfPosition(endLocPos);
727 
728  if (!startId.is_valid() || !endId.is_valid()) {
729  ATH_MSG_WARNING("unvalid identifier: locPos outside module! ");
730  return 0.;
731  }
732 
733  double frac =0.;
734 
735  if (pixelDetElStatus) {
736  frac = Pixel::getGoodFraction(*pixelDetElStatus, *design, *m_pixelId, id_hash, startId, endId);
738  !m_pixelDetElStatus.empty(), frac, m_pixelCondSummaryTool->goodFraction(id_hash, startId, endId, ctx));
739 
740  } else {
741  frac = m_pixelCondSummaryTool->goodFraction(id_hash, startId, endId, ctx);
742  }
743 
744  return frac;
745 }
746 
747 } // end namespace
748 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:629
PixelFEUtils.h
InDetDD::SolidStateDetectorElementBase::identifierOfPosition
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
Definition: SolidStateDetectorElementBase.cxx:217
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
InDet::InDetTestPixelLayerTool::m_pixelId
const PixelID * m_pixelId
ID pixel helper.
Definition: InDetTestPixelLayerTool.h:143
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::TrackStateOnPixelLayerInfo::errLocalX
double errLocalX() const
Definition: TrackStateOnPixelLayerInfo.h:34
InDet::TrackStateOnPixelLayerInfo::pixelId
Identifier pixelId() const
Definition: TrackStateOnPixelLayerInfo.h:28
Trk::Surface::associatedDetectorElement
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
TrackParameters.h
MeasurementBase.h
InDet::InDetTestPixelLayerTool::m_goodFracCut
DoubleProperty m_goodFracCut
Definition: InDetTestPixelLayerTool.h:150
InDet::TrackStateOnPixelLayerInfo::type
TrackStateOnPixelLayerType type() const
Definition: TrackStateOnPixelLayerInfo.h:26
Trk::locX
@ locX
Definition: ParamDefs.h:37
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:45
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
InDetDD::PixelDiodeTree::DiodeProxy::isValid
bool isValid() const
return true if this proxy refers to a valide diode
Definition: PixelDiodeTree.h:224
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
InDetDD::SolidStateDetectorElementBase::inDetector
SiIntersect inDetector(const Amg::Vector2D &localPosition, double phiTol, double etaTol) const
Test that it is in the active region.
Definition: SolidStateDetectorElementBase.cxx:204
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
InDet::SiDetectorElementStatus::isChipGood
bool isChipGood(IdentifierHash hash, unsigned int chip) const
Definition: SiDetectorElementStatus.h:100
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
InDet::TrackStateOnPixelLayerInfo::theta
double theta() const
Definition: TrackStateOnPixelLayerInfo.h:32
Trk::ParametersBase::associatedSurface
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Pixel::getGoodFraction
double getGoodFraction(const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::PixelModuleDesign &design, const PixelID &pixelID, const IdentifierHash &modulIdHash, const Identifier &startId, const Identifier &endId)
Get The fraction of good chips the pixel of a pixel array is connected to.
Definition: PixelFEUtils.h:32
InDet::TrackStateOnPixelLayerInfo::phi
double phi() const
Definition: TrackStateOnPixelLayerInfo.h:33
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TrackParticleBase.h
InDetDD::PixelModuleDesign::diodeProxyFromPosition
PixelDiodeTree::DiodeProxy diodeProxyFromPosition(const Amg::Vector2D &pos) const
Definition: PixelModuleDesign.h:254
InDet::InDetTestPixelLayerTool::getPixelLayerParameters
bool getPixelLayerParameters(const EventContext &ctx, const Trk::TrackParameters *trackpar, std::vector< std::unique_ptr< const Trk::TrackParameters >> &pixelLayerParam) const
Definition: InDetTestPixelLayerTool.cxx:541
InDet::InDetTestPixelLayerTool::m_checkDeadRegions
BooleanProperty m_checkDeadRegions
Definition: InDetTestPixelLayerTool.h:146
InDet::InDetTestPixelLayerTool::getPixelDetElStatus
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const EventContext &ctx) const
Definition: InDetTestPixelLayerTool.h:155
InDetConditions::PIXEL_CHIP
@ PIXEL_CHIP
Definition: InDetHierarchy.h:15
Layer.h
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
InDetConditions::Hierarchy
Hierarchy
Definition: InDetHierarchy.h:14
IdDictManager.h
Trk::TrkDetElementBase::identify
virtual Identifier identify() const =0
Identifier.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
InDetDD::PixelModuleDesign::getFE
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
Definition: PixelModuleDesign.h:258
InDet::TrackStateOnPixelLayerInfo::distToModuleEdgeEta
double distToModuleEdgeEta() const
Definition: TrackStateOnPixelLayerInfo.h:37
InDetDD::PixelModuleDesign::diodeProxyFromIdxCachePosition
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
Definition: PixelModuleDesign.h:251
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
InDet::InDetTestPixelLayerTool::m_pixelCondSummaryTool
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Handles to IConditionsSummaryServices for Pixels.
Definition: InDetTestPixelLayerTool.h:126
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:360
InDet::InDetTestPixelLayerTool::m_etaRegionSize
DoubleProperty m_etaRegionSize
Definition: InDetTestPixelLayerTool.h:149
InDetDD::PixelModuleDesign::etaPitch
virtual double etaPitch() const
Pitch in eta direction.
Definition: PixelModuleDesign.cxx:208
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
InDet::InDetTestPixelLayerTool::getTrackStateOnPixelLayerInfo
virtual bool getTrackStateOnPixelLayerInfo(const Trk::TrackParticleBase *, std::vector< TrackStateOnPixelLayerInfo > &infoList) const override final
Definition: InDetTestPixelLayerTool.cxx:396
Track.h
InDet::InDetTestPixelLayerTool::m_checkDisabledFEs
BooleanProperty m_checkDisabledFEs
Definition: InDetTestPixelLayerTool.h:147
InDetDD::SiIntersect::in
bool in() const
Definition: SiIntersect.h:50
InDetDD::PixelModuleDesign::phiPitch
virtual double phiPitch() const
Pitch in phi direction.
Definition: PixelModuleDesign.cxx:192
Trk::TrackParticleBase
Definition: TrackParticleBase.h:41
Trk::DetectorElemType::Silicon
@ Silicon
InDet::TrackStateOnPixelLayerInfo::localX
double localX() const
Definition: TrackStateOnPixelLayerInfo.h:30
InDet::InDetTestPixelLayerTool::m_phiRegionSize
DoubleProperty m_phiRegionSize
Definition: InDetTestPixelLayerTool.h:148
InDet::InDetTestPixelLayerTool::initialize
virtual StatusCode initialize() override final
Definition: InDetTestPixelLayerTool.cxx:41
GeoPrimitives.h
InDet::TrackStateOnPixelLayerInfo
Definition: TrackStateOnPixelLayerInfo.h:20
InDetDD::PixelDiodeTree::DiodeProxy::computeIndex
std::array< PixelDiodeTree::CellIndexType, 2 > computeIndex(const Vector2D &pos) const
Compute the full 2D index (row, column) of the diode in the full diode matrix.
Definition: PixelDiodeTree.h:220
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
InDetDD::PixelDiodeTree::DiodeProxyWithPosition
A diode proxy which caches the position of a diode.
Definition: PixelDiodeTree.h:230
InDet::InDetTestPixelLayerTool::getFracGood
virtual double getFracGood(const Trk::TrackParticleBase *trackpar, int pixel_layer) const override final
Definition: InDetTestPixelLayerTool.cxx:244
PixelID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
Definition: PixelID.h:586
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:383
InDet::TrackStateOnPixelLayerInfo::globalPosition
const Amg::Vector3D & globalPosition() const
Definition: TrackStateOnPixelLayerInfo.h:29
InDet::insideBadModule
@ insideBadModule
Definition: TrackStateOnPixelLayerInfo.h:15
VALIDATE_STATUS_ARRAY
#define VALIDATE_STATUS_ARRAY(use_info, info_val, summary_val)
Definition: SiDetectorElementStatus.h:51
InDet::SiDetectorElementStatus
Definition: SiDetectorElementStatus.h:62
beamspotman.n
n
Definition: beamspotman.py:727
Trk::theta
@ theta
Definition: ParamDefs.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
checkxAOD.frac
frac
Definition: Tools/PyUtils/bin/checkxAOD.py:259
Trk::CylinderSurface
Definition: CylinderSurface.h:55
InDet::TrackStateOnPixelLayerInfo::localY
double localY() const
Definition: TrackStateOnPixelLayerInfo.h:31
InDetDD::PixelModuleDesign::distanceToDetectorEdge
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
Returns distance to nearest detector active edge +ve = inside -ve = outside.
Definition: PixelModuleDesign.cxx:88
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthAlgTool.h
CylinderSurface.h
InDet::TrackStateOnPixelLayerInfo::errLocalY
double errLocalY() const
Definition: TrackStateOnPixelLayerInfo.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDetConditions::PIXEL_MODULE
@ PIXEL_MODULE
Definition: InDetHierarchy.h:15
TrackSummary.h
Trk::ParametersBase
Definition: ParametersBase.h:55
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
InDet::InDetTestPixelLayerTool::expectHitInPixelLayer
virtual bool expectHitInPixelLayer(const EventContext &ctx, const Trk::TrackParticleBase *, int pixel_layer) const override final
Definition: InDetTestPixelLayerTool.cxx:88
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
InDet::InDetTestPixelLayerTool::expectHit
virtual bool expectHit(const Trk::TrackParameters *trackpar) const override final
Definition: InDetTestPixelLayerTool.cxx:199
InDet::InDetTestPixelLayerTool::m_pixelDetElStatus
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
Definition: InDetTestPixelLayerTool.h:137
Trk::ParametersCommon::localPosition
Amg::Vector2D localPosition() const
Access method for the local coordinates, local parameter definitions differ for each surface type.
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:607
InDet::SiDetectorElementStatus::isGood
bool isGood(IdentifierHash hash) const
Definition: SiDetectorElementStatus.h:97
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDet::InDetTestPixelLayerTool::m_idHelper
const AtlasDetectorID * m_idHelper
detector helper
Definition: InDetTestPixelLayerTool.h:140
SiDetectorElement.h
InDet::nearBadModuleEdge
@ nearBadModuleEdge
Definition: TrackStateOnPixelLayerInfo.h:16
InDetDD::SiIntersect
Definition: SiIntersect.h:23
InDet::TrackStateOnPixelLayerInfo::goodFraction
double goodFraction() const
Definition: TrackStateOnPixelLayerInfo.h:38
InDet::InDetTestPixelLayerTool::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Pointer to Extrapolator AlgTool.
Definition: InDetTestPixelLayerTool.h:118
AtlasDetectorID::show_to_string
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:367
InDetDD::PixelDiodeTree::DiodeProxy
Helper class to access parameters of a diode.
Definition: PixelDiodeTree.h:183
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PixelModuleDesign.h
PixelID::pixel_id
Identifier pixel_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int phi_index, int eta_index) const
For an individual pixel.
Definition: PixelID.h:428
InDet::TrackStateOnPixelLayerInfo::distToModuleEdgePhi
double distToModuleEdgePhi() const
Definition: TrackStateOnPixelLayerInfo.h:36
InDet::InDetTestPixelLayerTool::m_checkActiveAreas
BooleanProperty m_checkActiveAreas
Definition: InDetTestPixelLayerTool.h:145
InDet::InDetTestPixelLayerTool::isActive
bool isActive(const Trk::TrackParameters *trackpar) const
Definition: InDetTestPixelLayerTool.cxx:328
AthService.h
InDet::InDetTestPixelLayerTool::m_outerRadius
DoubleProperty m_outerRadius
Definition: InDetTestPixelLayerTool.h:151
Trk::TrkDetElementBase::identifyHash
virtual IdentifierHash identifyHash() const =0
Identifier hash.
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
InDetDD::SiDetectorElement::nearBondGap
bool nearBondGap(const Amg::Vector2D &localPosition, double etaTol) const
Test if near bond gap within tolerances.
Definition: SiDetectorElement.cxx:323
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
InDet::insideGoodModule
@ insideGoodModule
Definition: TrackStateOnPixelLayerInfo.h:13
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDet::InDetTestPixelLayerTool::InDetTestPixelLayerTool
InDetTestPixelLayerTool(const std::string &name, const std::string &n, const IInterface *p)
Definition: InDetTestPixelLayerTool.cxx:30
InDetTestPixelLayerTool.h
Trk::phi0
@ phi0
Definition: ParamDefs.h:65
InDet::nearGoodModuleEdge
@ nearGoodModuleEdge
Definition: TrackStateOnPixelLayerInfo.h:14
InDet::TrackStateOnPixelLayerInfo::moduleId
Identifier moduleId() const
Definition: TrackStateOnPixelLayerInfo.h:27
Identifier
Definition: IdentifierFieldParser.cxx:14