ATLAS Offline Software
InDetTestPixelLayerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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  if (!m_pixelDetElStatus.empty()) {
64  ATH_CHECK(m_pixelReadout.retrieve());
65  }
66 
67  return StatusCode::SUCCESS;
68 }
69 
70 bool
72  const Trk::Track* track,
73  int pixel_layer,
74  bool checkBarrelOnly) const
75 {
76  ATH_MSG_DEBUG("computing expectHitInPixelLayer info");
77 
78  const Trk::Perigee* mp = track->perigeeParameters();
79 
80  if (!mp) {
81  ATH_MSG_WARNING("Found Track with no perigee parameters: no b-layer info "
82  "will be provided ");
83  return false;
84  } else {
85  ATH_MSG_DEBUG("Track perigee parameters");
86  return this->expectHitInPixelLayer(ctx, mp, pixel_layer, checkBarrelOnly);
87  }
88 }
89 
90 bool
92  const EventContext& ctx,
94  int pixel_layer) const
95 {
96 
97  // Need to compute if we do expect a B-layer hit. If the previous
98  // calculation already determined that we don't expect a hit, then we still
99  // won't expect one.
100 
101  if (!track) {
103  "Not a valid TrackParticle: no b-layer info will be provided");
104  return false;
105  }
106 
107  ATH_MSG_DEBUG("computing expectHitInPixelLayer info");
108 
109  const Trk::Perigee* mp = track->perigee();
110 
111  if (!mp) {
112  ATH_MSG_WARNING("Found TrackParticle with no perigee parameters: no "
113  "b-layer info will be provided");
114  return false;
115  } else {
116  ATH_MSG_DEBUG("TrackParticle perigee parameters");
117  // mp->dump(mLog);
118  return (this->expectHitInPixelLayer(ctx, mp, pixel_layer));
119  }
120 }
121 
122 bool
124  const EventContext& ctx,
125  const Trk::TrackParameters* trackpar,
126  int pixel_layer,
127  bool checkBarrelOnly) const
128 {
129  bool expect_hit = false;
130 
131  std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
132  if (!this->getPixelLayerParameters(ctx, trackpar, pixelLayerParam)) {
133  ATH_MSG_DEBUG("Failed to get pixel layer parameters!");
134  return false;
135  }
136 
138  for (std::unique_ptr<const Trk::TrackParameters>& p : pixelLayerParam) {
139 
140  if (!(p->associatedSurface().associatedDetectorElement()))
141  continue;
142  Identifier id =
143  p->associatedSurface().associatedDetectorElement()->identify();
144 
145  if (checkBarrelOnly && !m_pixelId->is_barrel(id)) continue;
146  if (m_pixelId->layer_disk(id) != pixel_layer) continue;
147 
149  pixelDetElStatus->isGood(p->associatedSurface().associatedDetectorElement()->identifyHash()),
151 
152  if ((!m_pixelDetElStatus.empty() &&
153  pixelDetElStatus->isGood(p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
155 
156  if (m_checkActiveAreas) {
157 
158  if (isActive(p.get())) {
159 
160  if (m_checkDeadRegions) {
161 
162  double fracGood = getFracGood(p.get(),
165  !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
166  if (fracGood > m_goodFracCut && fracGood >= 0) {
167  ATH_MSG_DEBUG("Condition Summary: b-layer good");
168  expect_hit =
169  true;
170  } else {
171  ATH_MSG_DEBUG("b-layer in dead region: fracGood = " << fracGood);
172  }
173 
174  } else {
175  ATH_MSG_DEBUG("Condition Summary: not checking dead regions");
176  expect_hit =
177  true;
178  }
179 
180  } else {
182  "Condition Summary: b-layer good but outside active area");
183  }
184 
185  }
186  else {
188  "Condition Summary: b-layer good, active areas not checked");
189  expect_hit = true;
190  }
191 
192  } else {
193  ATH_MSG_DEBUG(__LINE__ << "b-layer not good");
194  }
195 
196  }
197 
198  return expect_hit;
199 }
200 
201 bool
203  const Trk::TrackParameters* trackpar) const
204 {
205  bool expect_hit =
206  false;
207 
208  Identifier id =
210 
211 
212  const EventContext& ctx = Gaudi::Hive::currentContext();
214 
217  pixelDetElStatus->isGood(trackpar->associatedSurface().associatedDetectorElement()->identifyHash()),
219  if ((!m_pixelDetElStatus.empty() &&
220  pixelDetElStatus->isGood(trackpar->associatedSurface().associatedDetectorElement()->identifyHash())) ||
222 
223  if (m_checkDeadRegions) {
224 
225  double fracGood = getFracGood(
226  trackpar, m_phiRegionSize, m_etaRegionSize, !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
227  if (fracGood > m_goodFracCut && fracGood >= 0) {
228  ATH_MSG_DEBUG("Condition Summary: b-layer good");
229  expect_hit = true;
230  } else {
231  ATH_MSG_DEBUG("b-layer in dead region: fracGood = " << fracGood);
232  }
233 
234  } else {
235  ATH_MSG_DEBUG("Condition Summary: not checking dead regions");
236  expect_hit = true;
237  }
238 
239  } else {
240  ATH_MSG_DEBUG(__LINE__ << "b-layer not good");
241  }
242 
243  return expect_hit;
244 }
245 
246 double
248  int pixel_layer) const
249 {
250  const Trk::Perigee* mp = track->perigee();
251 
252  if (!mp) {
253  ATH_MSG_WARNING("Found Track with no perigee parameters: no b-layer info "
254  "will be provided ");
255  return -4.;
256  } else {
257  ATH_MSG_DEBUG("Track perigee parameters");
258  return this->getFracGood(mp, pixel_layer);
259  }
260 }
261 
262 double
264  const Trk::TrackParameters* trackpar,
265  int pixel_layer) const
266 {
267  std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
268  if (!this->getPixelLayerParameters(trackpar, pixelLayerParam))
269  return -5.;
270 
271  // now, figure out which layer we're supposed to be checking.
272  bool found_layer = false;
273  for (std::unique_ptr<const Trk::TrackParameters>& p : pixelLayerParam) {
274  if (!(p->associatedSurface().associatedDetectorElement()))
275  continue;
276  Identifier id =
277  p->associatedSurface().associatedDetectorElement()->identify();
278 
279  if (m_pixelId->layer_disk(id) == pixel_layer){
280  found_layer = true;
281  break;
282  }
283  }
284 
285  // if we're asking for a layer that doesn't exist in the extrapolation, then
286  // return.
287  if (!found_layer)
288  return -7.;
289 
290  const EventContext& ctx = Gaudi::Hive::currentContext();
292 
293  for (std::unique_ptr<const Trk::TrackParameters>& p : pixelLayerParam) {
294 
295  if (!(p->associatedSurface().associatedDetectorElement()))
296  continue;
297  Identifier id =
298  p->associatedSurface().associatedDetectorElement()->identify();
299 
300  if (m_pixelId->layer_disk(id) != pixel_layer)
301  continue;
302 
305  pixelDetElStatus->isGood(trackpar->associatedSurface().associatedDetectorElement()->identifyHash()),
307  if ((!m_pixelDetElStatus.empty() &&
308  pixelDetElStatus->isGood(p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
310 
311  if (isActive(p.get())) {
312 
313  return getFracGood(
314  p.get(), m_phiRegionSize, m_etaRegionSize, !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
315 
316  } else {
318  "Condition Summary: b-layer good but outside active area");
319  }
320 
321  } else {
322  ATH_MSG_DEBUG(__LINE__ << "b-layer not good");
323  }
324 
325  }
326 
327  return -3.;
328 }
329 
330 bool
332  const Trk::TrackParameters* trackpar) const
333 {
334 
335  const auto* tmp = trackpar->associatedSurface().associatedDetectorElement();
336  const InDetDD::SiDetectorElement* siElement =
337  (tmp != nullptr && tmp->detectorType() == Trk::DetectorElemType::Silicon)
338  ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
339  : nullptr;
340 
341  if (siElement == nullptr) {
342  // ------- in dubio pro reo --> return false (is assumed insensitive)
343  ATH_MSG_DEBUG("TrackParameters do not belong to a Si Element");
345  } else {
346  double phitol = 2.5;
347  double etatol = 5.;
348  if (trackpar->covariance()) {
349  phitol = 3. * sqrt((*trackpar->covariance())(Trk::locX, Trk::locX));
350  etatol = 3. * sqrt((*trackpar->covariance())(Trk::locY, Trk::locY));
351  }
352  InDetDD::SiIntersect siIn =
353  siElement->inDetector(trackpar->localPosition(), phitol, etatol);
354  if (siElement->nearBondGap(trackpar->localPosition(), etatol)) {
355  ATH_MSG_DEBUG("---> extrapolation on bond gap within " << etatol
356  << ", return");
357  } else if (!siIn.in()) {
358  ATH_MSG_DEBUG("---> extrapolation not inside (active?) detector within "
359  << phitol << " " << etatol << ", return");
360  } else {
361  return true;
362  }
363  }
364 
365  return false;
366 }
367 
368 bool
370  const Trk::Track* track,
371  std::vector<TrackStateOnPixelLayerInfo>& infoList) const
372 {
373 
374  std::unique_ptr<const Trk::TrackParameters> startParameters = nullptr;
375 
376  if (track->perigeeParameters()) {
377  startParameters = track->perigeeParameters()->uniqueClone();
378  } else if (track->trackParameters()->front()) {
379  startParameters =
380  m_extrapolator->extrapolate(
381  Gaudi::Hive::currentContext(),
382  *(track->trackParameters()->front()),
385  false);
386  }
387 
388  if (!startParameters) {
389  ATH_MSG_WARNING("Found Track with no perigee parameters: no b-layer info "
390  "will be provided");
391  return false;
392  }
393 
394  bool succeed = getTrackStateOnPixelLayerInfo(startParameters.get(), infoList);
395  return succeed;
396 }
397 
398 bool
401  std::vector<TrackStateOnPixelLayerInfo>& infoList) const
402 {
403 
404  const Trk::Perigee* startParameters = track->perigee();
405 
406  if (!startParameters) {
407  ATH_MSG_WARNING("Found TrackParticle with no perigee parameters: no "
408  "b-layer info will be provided");
409  return false;
410  }
411 
412  return getTrackStateOnPixelLayerInfo(startParameters, infoList);
413 }
414 
415 bool
417  const Trk::TrackParameters* trackpar,
418  std::vector<TrackStateOnPixelLayerInfo>& infoList,
419  int pixel_layer,
420  bool checkBarrelOnly) const
421 {
422 
423  infoList.clear();
424 
425  std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
426  if (!getPixelLayerParameters(trackpar, pixelLayerParam))
427  return false;
428 
429  const EventContext& ctx = Gaudi::Hive::currentContext();
431 
432  for (std::unique_ptr<const Trk::TrackParameters>& trkParam :
433  pixelLayerParam) {
434  TrackStateOnPixelLayerInfo pixelLayerInfo;
435 
436  double fracGood = getFracGood(trkParam.get(),
439  !m_pixelDetElStatus.empty() ? pixelDetElStatus.cptr() : nullptr);
440  pixelLayerInfo.goodFraction(fracGood);
441 
442  Identifier id =
443  trkParam->associatedSurface().associatedDetectorElement()->identify();
444  pixelLayerInfo.moduleId(id);
445 
446  if (checkBarrelOnly && !m_pixelId->is_barrel(id)) continue;
447  if (m_pixelId->layer_disk(id) != pixel_layer) continue;
448 
449  const auto* tmp = trkParam->associatedSurface().associatedDetectorElement();
450  const InDetDD::SiDetectorElement* sielem =
451  (tmp != nullptr && tmp->detectorType() == Trk::DetectorElemType::Silicon)
452  ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
453  : nullptr;
454 
455  if (!sielem) {
456  ATH_MSG_WARNING("Failed to cast TrackParameters associated surface to "
457  "SiDetectorElement");
458  return false;
459  }
460 
461  const Amg::Vector2D& locPos = trkParam->localPosition();
462  Identifier holeId_c = sielem->identifierOfPosition(locPos);
463  pixelLayerInfo.pixelId(holeId_c);
464 
465  double etaDist = -9999;
466  double phiDist = -9999;
467  const InDetDD::PixelModuleDesign* design =
468  dynamic_cast<const InDetDD::PixelModuleDesign*>(&sielem->design());
469  if (design) {
470  design->distanceToDetectorEdge(
471  locPos,
472  etaDist,
473  phiDist);
474  } else {
475  ATH_MSG_WARNING("could not get pixel module design for "
476  << m_idHelper->show_to_string(id)
477  << ", returning false for getTrackStateOnPixelLayerInfo");
478  return false;
479  }
480  pixelLayerInfo.distToModuleEdgePhi(phiDist);
481  pixelLayerInfo.distToModuleEdgeEta(etaDist);
482 
483  pixelLayerInfo.globalPosition(trkParam->position());
484 
485  pixelLayerInfo.localX(locPos[Trk::locX]);
486  pixelLayerInfo.localY(locPos[Trk::locY]);
487 
488  pixelLayerInfo.theta(trkParam->parameters()[Trk::theta]);
489  pixelLayerInfo.phi(trkParam->parameters()[Trk::phi0]);
490 
491  float error_locx = -9999;
492  float error_locy = -9999;
493 
494  if (trkParam->covariance()) {
495  error_locx = sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
496  error_locy = sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
497  } else {
498  ATH_MSG_DEBUG("could not TrackParameters for hole "
499  << m_idHelper->show_to_string(id));
500  }
501 
502  pixelLayerInfo.errLocalX(error_locx);
503  pixelLayerInfo.errLocalY(error_locy);
504 
507  pixelDetElStatus->isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash()),
509  bool isgood =
510  ((!m_pixelDetElStatus.empty() &&
511  pixelDetElStatus->isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash())) ||
513 
514  double phitol = 2.5;
515  double etatol = 5.;
516 
517  if (trkParam->covariance()) {
518  phitol = 3 * sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
519  etatol = 3 * sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
520  }
521 
522  InDetDD::SiIntersect siIn = sielem->inDetector(locPos, phitol, etatol);
523  bool isIn = siIn.in();
524 
525  if (isgood) {
526  if (isIn)
527  pixelLayerInfo.type(insideGoodModule);
528  else
529  pixelLayerInfo.type(nearGoodModuleEdge);
530  } else {
531  if (isIn)
532  pixelLayerInfo.type(insideBadModule);
533  else
534  pixelLayerInfo.type(nearBadModuleEdge);
535  }
536 
537  infoList.push_back(pixelLayerInfo);
538  }
539 
540  return true;
541 }
542 
543 bool
545  const EventContext& ctx,
546  const Trk::TrackParameters* trackpar,
547  std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
548  const
549 {
551  ATH_MSG_DEBUG("Trying to extrapolate to pixelLayer");
552 
553  if(std::abs(trackpar->position().z())>5000.){
554  ATH_MSG_DEBUG("Pathological track parameter well outside of tracking detector");
555  ATH_MSG_DEBUG("Propagator might have issue with this, discarding");
556  ATH_MSG_VERBOSE("dumping track parameters " << *trackpar);
557  return false;
558  }
559 
560  Amg::Transform3D surfTrans;
561  surfTrans.setIdentity();
562  Trk::CylinderSurface BiggerThanPixelLayerSurface(surfTrans, m_outerRadius, 10000.0);
563 
564  // extrapolate stepwise to this parameter (be careful, sorting might be wrong)
565  std::vector<std::unique_ptr<Trk::TrackParameters>> paramList =
566  m_extrapolator->extrapolateStepwise(
567  ctx, *trackpar, BiggerThanPixelLayerSurface, Trk::alongMomentum, false);
568 
569  if (paramList.empty()) {
570  ATH_MSG_DEBUG("No parameter returned by propagator ");
571  ATH_MSG_VERBOSE("dumping track parameters " << *trackpar);
572  return false;
573  }
574 
576  " Number of generated parameters by propagator: " << paramList.size());
577 
578  int s_int = 0;
579  for (std::unique_ptr<Trk::TrackParameters>& p : paramList) {
580  ATH_MSG_DEBUG(s_int++ << "th surface : ");
581 
582  Identifier id;
583  if (!(p->associatedSurface().associatedDetectorElement() != nullptr &&
584  p->associatedSurface().associatedDetectorElement()->identify() !=
585  0)) {
586  continue;
587  }
588 
589  id = p->associatedSurface().associatedDetectorElement()->identify();
590  if (!m_idHelper->is_pixel(id)) {
591  continue;
592  }
593 
594  ATH_MSG_DEBUG("Found pixel module : " << id.get_compact());
595 
596  pixelLayerParam.push_back(std::move(p));
597  }
598 
599  return true;
600 }
601 
602 double
604  const Trk::TrackParameters* trkParam,
605  double phiRegionSize,
606  double etaRegionSize,
607  const InDet::SiDetectorElementStatus *pixelDetElStatus) const
608 {
609 
610  Identifier moduleid =
612  IdentifierHash id_hash = m_pixelId->wafer_hash(moduleid);
613 
614  const EventContext& ctx = Gaudi::Hive::currentContext();
615  VALIDATE_STATUS_ARRAY(pixelDetElStatus,pixelDetElStatus->isGood(id_hash), m_pixelCondSummaryTool->isGood(id_hash, ctx));
616  bool is_good ( ( pixelDetElStatus && pixelDetElStatus->isGood(id_hash))
617  || (!pixelDetElStatus && m_pixelCondSummaryTool->isGood(id_hash, ctx)));
618  if (!is_good)
619  return 0.;
620 
621  const Amg::Vector2D& locPos = trkParam->localPosition();
622  double locx = locPos[Trk::locX];
623  double locy = locPos[Trk::locY];
624  double error_locx = -9999;
625  double error_locy = -9999;
626 
627  if (trkParam->covariance()) {
628  error_locx = sqrt((*trkParam->covariance())(Trk::locX, Trk::locX));
629  error_locy = sqrt((*trkParam->covariance())(Trk::locY, Trk::locY));
630  } else {
631  ATH_MSG_DEBUG("could not get MeasuredTrackParameters ");
632  }
633 
634  double phitol = 2.5;
635  double etatol = 5.;
636  if (trkParam->covariance()) {
637  phitol = phiRegionSize * error_locx;
638  etatol = etaRegionSize * error_locy;
639  }
640 
641  // now, check to see that phitol and etatol extend at least beyond the current
642  // pixel
643  const auto* tmp = trkParam->associatedSurface().associatedDetectorElement();
644  const InDetDD::SiDetectorElement* sielem =
645  (tmp != nullptr && tmp->detectorType() == Trk::DetectorElemType::Silicon)
646  ? static_cast<const InDetDD::SiDetectorElement*>(tmp)
647  : nullptr;
648 
649  if (!sielem) {
651  "Failed to cast TrackParameters associated surface to SiDetectorElement");
652  return false;
653  }
654 
655  const InDetDD::PixelModuleDesign* design =
656  dynamic_cast<const InDetDD::PixelModuleDesign*>(&sielem->design());
657  if (design) {
658  phitol = std::max(phitol, design->phiPitch() + 1e-6);
659  etatol = std::max(etatol, design->etaPitch() + 1e-6);
660  } else {
662  "could not get pixel module design, returning 0 for getFracGood");
663  return 0.;
664  }
665 
666  Amg::Vector2D LocPos(locx, locy);
667 
668  double startLocX = locx - phitol;
669  double startLocY = locy - etatol;
670 
671  double endLocX = locx + phitol;
672  double endLocY = locy + etatol;
673 
674  Amg::Vector2D startLocPostmp(startLocX, startLocY);
675  Amg::Vector2D endLocPostmp(endLocX, endLocY);
676 
677  double etaDist = -9999;
678  double phiDist = -9999;
679 
680  if (design) {
681  design->distanceToDetectorEdge(LocPos, etaDist, phiDist);
682  if (phiDist < 0)
683  locx += (std::abs(phiDist) + 1e-6);
684  if (etaDist < 0)
685  locy += (std::abs(etaDist) + 1e-6);
686  design->distanceToDetectorEdge(startLocPostmp, etaDist, phiDist);
687  if (phiDist < 0)
688  startLocX += (std::abs(phiDist) + 1e-6);
689  if (etaDist < 0)
690  startLocY += (std::abs(etaDist) + 1e-6);
691  design->distanceToDetectorEdge(endLocPostmp, etaDist, phiDist);
692  if (phiDist < 0)
693  endLocX -= (std::abs(phiDist) + 1e-6);
694  if (etaDist < 0)
695  endLocY -= (std::abs(etaDist) + 1e-6);
696  }
697 
698  LocPos = Amg::Vector2D(locx, locy);
699 
700  if (m_checkDisabledFEs) {
702  Identifier centreId = sielem->identifierOfPosition(LocPos);
703  if (centreId.is_valid()) {
704  Identifier moduleID = m_pixelId->wafer_id(centreId);
705  IdentifierHash id_hash = m_pixelId->wafer_hash(moduleID);
706 
708  pixelDetElStatus->isChipGood(id_hash, m_pixelReadout->getFE(centreId, moduleID)),
709  m_pixelCondSummaryTool->isGood(centreId, context));
710  bool is_chip_good((!m_pixelDetElStatus.empty() &&
711  pixelDetElStatus->isChipGood(id_hash, m_pixelReadout->getFE(centreId, moduleID))) ||
712  (m_pixelDetElStatus.empty() && m_pixelCondSummaryTool->isGood(centreId, context, ctx)));
713  if (!is_chip_good){
714  return 0.;
715  }
716  } else {
717  ATH_MSG_WARNING("Invalid Identifier, skipping check of FE...");
718  }
719  }
720 
721  Amg::Vector2D startLocPos(startLocX, startLocY);
722  Amg::Vector2D endLocPos(endLocX, endLocY);
723  Identifier startId = sielem->identifierOfPosition(startLocPos);
724  Identifier endId = sielem->identifierOfPosition(endLocPos);
725 
726  if (!startId.is_valid() || !endId.is_valid()) {
727  ATH_MSG_WARNING("unvalid identifier: locPos outside module! ");
728  return 0.;
729  }
730 
731  double frac =0.;
732 
733  if (pixelDetElStatus) {
734  frac = Pixel::getGoodFraction(*pixelDetElStatus, *m_pixelReadout, *m_pixelId, moduleid, id_hash, startId, endId);
736  !m_pixelDetElStatus.empty(), frac, m_pixelCondSummaryTool->goodFraction(id_hash, startId, endId, ctx));
737 
738  } else {
739  frac = m_pixelCondSummaryTool->goodFraction(id_hash, startId, endId, ctx);
740  }
741 
742  return frac;
743 }
744 
745 } // end namespace
746 
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:760
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:147
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:154
InDet::TrackStateOnPixelLayerInfo::type
TrackStateOnPixelLayerType type() const
Definition: TrackStateOnPixelLayerInfo.h:26
Trk::locX
@ locX
Definition: ParamDefs.h:37
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
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
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:70
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
InDet::TrackStateOnPixelLayerInfo::phi
double phi() const
Definition: TrackStateOnPixelLayerInfo.h:33
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
TrackParticleBase.h
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:544
InDet::InDetTestPixelLayerTool::m_checkDeadRegions
BooleanProperty m_checkDeadRegions
Definition: InDetTestPixelLayerTool.h:150
InDet::InDetTestPixelLayerTool::getPixelDetElStatus
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const EventContext &ctx) const
Definition: InDetTestPixelLayerTool.h:159
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
InDet::TrackStateOnPixelLayerInfo::distToModuleEdgeEta
double distToModuleEdgeEta() const
Definition: TrackStateOnPixelLayerInfo.h:37
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:127
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:364
InDet::InDetTestPixelLayerTool::m_etaRegionSize
DoubleProperty m_etaRegionSize
Definition: InDetTestPixelLayerTool.h:153
InDetDD::PixelModuleDesign::etaPitch
virtual double etaPitch() const
Pitch in eta direction.
Definition: PixelModuleDesign.cxx:196
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:399
Track.h
InDet::InDetTestPixelLayerTool::m_checkDisabledFEs
BooleanProperty m_checkDisabledFEs
Definition: InDetTestPixelLayerTool.h:151
InDetDD::SiIntersect::in
bool in() const
Definition: SiIntersect.h:50
InDetDD::PixelModuleDesign::phiPitch
virtual double phiPitch() const
Pitch in phi direction.
Definition: PixelModuleDesign.cxx:180
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:152
InDet::InDetTestPixelLayerTool::initialize
virtual StatusCode initialize() override final
Definition: InDetTestPixelLayerTool.cxx:41
GeoPrimitives.h
InDet::TrackStateOnPixelLayerInfo
Definition: TrackStateOnPixelLayerInfo.h:20
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
InDet::InDetTestPixelLayerTool::getFracGood
virtual double getFracGood(const Trk::TrackParticleBase *trackpar, int pixel_layer) const override final
Definition: InDetTestPixelLayerTool.cxx:247
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:605
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
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:731
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:84
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:91
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
InDet::InDetTestPixelLayerTool::expectHit
virtual bool expectHit(const Trk::TrackParameters *trackpar) const override final
Definition: InDetTestPixelLayerTool.cxx:202
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:138
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:626
InDet::SiDetectorElementStatus::isGood
bool isGood(IdentifierHash hash) const
Definition: SiDetectorElementStatus.h:97
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDet::InDetTestPixelLayerTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: InDetTestPixelLayerTool.h:141
InDet::InDetTestPixelLayerTool::m_idHelper
const AtlasDetectorID * m_idHelper
detector helper
Definition: InDetTestPixelLayerTool.h:144
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:119
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:574
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PixelModuleDesign.h
InDet::TrackStateOnPixelLayerInfo::distToModuleEdgePhi
double distToModuleEdgePhi() const
Definition: TrackStateOnPixelLayerInfo.h:36
InDet::InDetTestPixelLayerTool::m_checkActiveAreas
BooleanProperty m_checkActiveAreas
Definition: InDetTestPixelLayerTool.h:149
InDet::InDetTestPixelLayerTool::isActive
bool isActive(const Trk::TrackParameters *trackpar) const
Definition: InDetTestPixelLayerTool.cxx:331
AthService.h
InDet::InDetTestPixelLayerTool::m_outerRadius
DoubleProperty m_outerRadius
Definition: InDetTestPixelLayerTool.h:155
Trk::TrkDetElementBase::identifyHash
virtual IdentifierHash identifyHash() const =0
Identifier hash.
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
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
Pixel::getGoodFraction
double getGoodFraction(const InDet::SiDetectorElementStatus &pixelDetElStatus, const InDetDD::IPixelReadoutManager &pixelReadout, const PixelID &pixelID, const Identifier &moduleId, const IdentifierHash &moudlIdHash, const Identifier &startId, const Identifier &endId)
Get The fraction of good chips the pixel of a pixel array is connected to.
Definition: PixelFEUtils.h:33
Identifier
Definition: IdentifierFieldParser.cxx:14