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