ATLAS Offline Software
Loading...
Searching...
No Matches
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
28namespace 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
40StatusCode
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
67bool
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
87bool
89 const EventContext& ctx,
90 const Trk::TrackParticleBase* track,
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
119bool
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
198bool
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
213 !m_pixelDetElStatus.empty(),
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
243double
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
259double
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
301 !m_pixelDetElStatus.empty(),
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
327bool
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 }
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
365bool
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
395bool
397 const Trk::TrackParticleBase* track,
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
412bool
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) {
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
503 !m_pixelDetElStatus.empty(),
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
540bool
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
599double
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
This is an Identifier helper class for the Pixel subdetector.
#define VALIDATE_STATUS_ARRAY(use_info, info_val, summary_val)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
This is a "hash" representation of an Identifier.
bool is_valid() const
Check if id is in a valid state.
Class used to describe the design of a module (diode segmentation and readout scheme)
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
virtual void distanceToDetectorEdge(const SiLocalPosition &localPosition, double &etaDist, double &phiDist) const
Returns distance to nearest detector active edge +ve = inside -ve = outside.
PixelDiodeTree::DiodeProxy diodeProxyFromPosition(const Amg::Vector2D &pos) const
virtual double etaPitch() const
Pitch in eta direction.
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
virtual double phiPitch() const
Pitch in phi direction.
Class to hold geometrical description of a silicon detector element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
bool nearBondGap(const Amg::Vector2D &localPosition, double etaTol) const
Test if near bond gap within tolerances.
class to run intersection tests
Definition SiIntersect.h:23
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
SiIntersect inDetector(const Amg::Vector2D &localPosition, double phiTol, double etaTol) const
Test that it is in the active region.
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
const PixelID * m_pixelId
ID pixel helper.
virtual bool expectHit(const Trk::TrackParameters *trackpar) const override final
bool isActive(const Trk::TrackParameters *trackpar) const
InDetTestPixelLayerTool(const std::string &name, const std::string &n, const IInterface *p)
virtual StatusCode initialize() override final
virtual double getFracGood(const Trk::TrackParticleBase *trackpar, int pixel_layer) const override final
ToolHandle< Trk::IExtrapolator > m_extrapolator
Pointer to Extrapolator AlgTool.
virtual bool expectHitInPixelLayer(const EventContext &ctx, const Trk::TrackParticleBase *, int pixel_layer) const override final
const AtlasDetectorID * m_idHelper
detector helper
SG::ReadHandleKey< InDet::SiDetectorElementStatus > m_pixelDetElStatus
Optional read handle to get status data to test whether a pixel detector element is good.
ToolHandle< IInDetConditionsTool > m_pixelCondSummaryTool
Handles to IConditionsSummaryServices for Pixels.
SG::ReadHandle< InDet::SiDetectorElementStatus > getPixelDetElStatus(const EventContext &ctx) const
virtual bool getTrackStateOnPixelLayerInfo(const Trk::TrackParticleBase *, std::vector< TrackStateOnPixelLayerInfo > &infoList) const override final
bool getPixelLayerParameters(const EventContext &ctx, const Trk::TrackParameters *trackpar, std::vector< std::unique_ptr< const Trk::TrackParameters > > &pixelLayerParam) const
bool isChipGood(IdentifierHash hash, unsigned int chip) const
bool isGood(IdentifierHash hash) const
TrackStateOnPixelLayerType type() const
const Amg::Vector3D & globalPosition() const
const_pointer_type cptr()
Dereference the pointer.
Class for a CylinderSurface in the ATLAS detector.
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Amg::Vector2D localPosition() const
Access method for the local coordinates, local parameter definitions differ for each surface type.
Class describing the Line to which the Perigee refers to.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
virtual IdentifierHash identifyHash() const =0
Identifier hash.
virtual Identifier identify() const =0
Identifier.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Primary Vertex Finder.
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.
@ alongMomentum
@ anyDirection
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
@ phi0
Definition ParamDefs.h:65
@ theta
Definition ParamDefs.h:66
ParametersBase< TrackParametersDim, Charged > TrackParameters
A diode proxy which caches the position of a diode.
Helper class to access parameters of a diode.
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.
bool isValid() const
return true if this proxy refers to a valide diode