24 #include "Identifier/Identifier.h"
37 declareInterface<IInDetTestPixelLayerTool>(
this);
47 return StatusCode::FAILURE;
52 return StatusCode::FAILURE;
57 return StatusCode::FAILURE;
61 !m_pixelDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED }));
64 return StatusCode::SUCCESS;
71 bool checkBarrelOnly)
const
78 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
89 const EventContext& ctx,
91 int pixel_layer)
const
100 "Not a valid TrackParticle: no b-layer info will be provided");
110 "b-layer info will be provided");
121 const EventContext& ctx,
124 bool checkBarrelOnly)
const
126 bool expect_hit =
false;
128 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
135 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
137 if (!(
p->associatedSurface().associatedDetectorElement()))
140 p->associatedSurface().associatedDetectorElement()->identify();
146 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash()),
150 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
168 ATH_MSG_DEBUG(
"b-layer in dead region: fracGood = " << fracGood);
172 ATH_MSG_DEBUG(
"Condition Summary: not checking dead regions");
179 "Condition Summary: b-layer good but outside active area");
185 "Condition Summary: b-layer good, active areas not checked");
209 const EventContext& ctx = Gaudi::Hive::currentContext();
228 ATH_MSG_DEBUG(
"b-layer in dead region: fracGood = " << fracGood);
232 ATH_MSG_DEBUG(
"Condition Summary: not checking dead regions");
245 int pixel_layer)
const
250 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
251 "will be provided ");
262 int pixel_layer)
const
264 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
269 bool found_layer =
false;
270 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
271 if (!(
p->associatedSurface().associatedDetectorElement()))
274 p->associatedSurface().associatedDetectorElement()->identify();
287 const EventContext& ctx = Gaudi::Hive::currentContext();
290 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
292 if (!(
p->associatedSurface().associatedDetectorElement()))
295 p->associatedSurface().associatedDetectorElement()->identify();
305 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
315 "Condition Summary: b-layer good but outside active area");
338 if (siElement ==
nullptr) {
340 ATH_MSG_DEBUG(
"TrackParameters do not belong to a Si Element");
345 if (trackpar->covariance()) {
352 ATH_MSG_DEBUG(
"---> extrapolation on bond gap within " << etatol
354 }
else if (!siIn.
in()) {
355 ATH_MSG_DEBUG(
"---> extrapolation not inside (active?) detector within "
356 << phitol <<
" " << etatol <<
", return");
368 std::vector<TrackStateOnPixelLayerInfo>& infoList)
const
371 std::unique_ptr<const Trk::TrackParameters> startParameters =
nullptr;
373 if (
track->perigeeParameters()) {
374 startParameters =
track->perigeeParameters()->uniqueClone();
375 }
else if (
track->trackParameters()->front()) {
378 Gaudi::Hive::currentContext(),
379 *(
track->trackParameters()->front()),
385 if (!startParameters) {
386 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
398 std::vector<TrackStateOnPixelLayerInfo>& infoList)
const
403 if (!startParameters) {
405 "b-layer info will be provided");
415 std::vector<TrackStateOnPixelLayerInfo>& infoList,
417 bool checkBarrelOnly)
const
422 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
426 const EventContext& ctx = Gaudi::Hive::currentContext();
429 for (std::unique_ptr<const Trk::TrackParameters>& trkParam :
440 trkParam->associatedSurface().associatedDetectorElement()->identify();
446 const auto*
tmp = trkParam->associatedSurface().associatedDetectorElement();
453 ATH_MSG_WARNING(
"Failed to cast TrackParameters associated surface to "
454 "SiDetectorElement");
460 pixelLayerInfo.
pixelId(holeId_c);
462 double etaDist = -9999;
463 double phiDist = -9999;
474 <<
", returning false for getTrackStateOnPixelLayerInfo");
488 float error_locx = -9999;
489 float error_locy = -9999;
491 if (trkParam->covariance()) {
504 pixelDetElStatus->
isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash()),
508 pixelDetElStatus->
isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash())) ||
514 if (trkParam->covariance()) {
520 bool isIn = siIn.
in();
534 infoList.push_back(pixelLayerInfo);
542 const EventContext& ctx,
544 std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
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");
558 surfTrans.setIdentity();
562 std::vector<std::unique_ptr<Trk::TrackParameters>> paramList =
566 if (paramList.empty()) {
573 " Number of generated parameters by propagator: " << paramList.size());
576 for (std::unique_ptr<Trk::TrackParameters>&
p : paramList) {
580 if (!(
p->associatedSurface().associatedDetectorElement() !=
nullptr &&
581 p->associatedSurface().associatedDetectorElement()->identify() !=
586 id =
p->associatedSurface().associatedDetectorElement()->identify();
593 pixelLayerParam.push_back(std::move(
p));
602 double phiRegionSize,
603 double etaRegionSize,
611 const EventContext& ctx = Gaudi::Hive::currentContext();
613 bool is_good ( ( pixelDetElStatus && pixelDetElStatus->
isGood(id_hash))
621 double error_locx = -9999;
622 double error_locy = -9999;
624 if (trkParam->covariance()) {
633 if (trkParam->covariance()) {
634 phitol = phiRegionSize * error_locx;
635 etatol = etaRegionSize * error_locy;
648 "Failed to cast TrackParameters associated surface to SiDetectorElement");
659 "could not get pixel module design, returning 0 for getFracGood");
665 double startLocX = locx - phitol;
666 double startLocY = locy - etatol;
668 double endLocX = locx + phitol;
669 double endLocY = locy + etatol;
674 double etaDist = -9999;
675 double phiDist = -9999;
680 locx += (std::abs(phiDist) + 1
e-6);
682 locy += (std::abs(etaDist) + 1
e-6);
685 startLocX += (std::abs(phiDist) + 1
e-6);
687 startLocY += (std::abs(etaDist) + 1
e-6);
690 endLocX -= (std::abs(phiDist) + 1
e-6);
692 endLocY -= (std::abs(etaDist) + 1
e-6);
702 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx(si_param.
computeIndex(LocPos));
710 pixelDetElStatus->
isChipGood(id_hash, feValue),
713 pixelDetElStatus->
isChipGood(id_hash, feValue)) ||
735 if (pixelDetElStatus) {