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 }));
67 return StatusCode::SUCCESS;
74 bool checkBarrelOnly)
const
81 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
92 const EventContext& ctx,
94 int pixel_layer)
const
103 "Not a valid TrackParticle: no b-layer info will be provided");
113 "b-layer info will be provided");
124 const EventContext& ctx,
127 bool checkBarrelOnly)
const
129 bool expect_hit =
false;
131 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
138 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
140 if (!(
p->associatedSurface().associatedDetectorElement()))
143 p->associatedSurface().associatedDetectorElement()->identify();
149 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash()),
153 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
171 ATH_MSG_DEBUG(
"b-layer in dead region: fracGood = " << fracGood);
175 ATH_MSG_DEBUG(
"Condition Summary: not checking dead regions");
182 "Condition Summary: b-layer good but outside active area");
188 "Condition Summary: b-layer good, active areas not checked");
212 const EventContext& ctx = Gaudi::Hive::currentContext();
231 ATH_MSG_DEBUG(
"b-layer in dead region: fracGood = " << fracGood);
235 ATH_MSG_DEBUG(
"Condition Summary: not checking dead regions");
248 int pixel_layer)
const
253 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
254 "will be provided ");
265 int pixel_layer)
const
267 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
272 bool found_layer =
false;
273 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
274 if (!(
p->associatedSurface().associatedDetectorElement()))
277 p->associatedSurface().associatedDetectorElement()->identify();
290 const EventContext& ctx = Gaudi::Hive::currentContext();
293 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
295 if (!(
p->associatedSurface().associatedDetectorElement()))
298 p->associatedSurface().associatedDetectorElement()->identify();
308 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
318 "Condition Summary: b-layer good but outside active area");
341 if (siElement ==
nullptr) {
343 ATH_MSG_DEBUG(
"TrackParameters do not belong to a Si Element");
348 if (trackpar->covariance()) {
355 ATH_MSG_DEBUG(
"---> extrapolation on bond gap within " << etatol
357 }
else if (!siIn.
in()) {
358 ATH_MSG_DEBUG(
"---> extrapolation not inside (active?) detector within "
359 << phitol <<
" " << etatol <<
", return");
371 std::vector<TrackStateOnPixelLayerInfo>& infoList)
const
374 std::unique_ptr<const Trk::TrackParameters> startParameters =
nullptr;
376 if (
track->perigeeParameters()) {
377 startParameters =
track->perigeeParameters()->uniqueClone();
378 }
else if (
track->trackParameters()->front()) {
381 Gaudi::Hive::currentContext(),
382 *(
track->trackParameters()->front()),
388 if (!startParameters) {
389 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
401 std::vector<TrackStateOnPixelLayerInfo>& infoList)
const
406 if (!startParameters) {
408 "b-layer info will be provided");
418 std::vector<TrackStateOnPixelLayerInfo>& infoList,
420 bool checkBarrelOnly)
const
425 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
429 const EventContext& ctx = Gaudi::Hive::currentContext();
432 for (std::unique_ptr<const Trk::TrackParameters>& trkParam :
443 trkParam->associatedSurface().associatedDetectorElement()->identify();
449 const auto*
tmp = trkParam->associatedSurface().associatedDetectorElement();
456 ATH_MSG_WARNING(
"Failed to cast TrackParameters associated surface to "
457 "SiDetectorElement");
463 pixelLayerInfo.
pixelId(holeId_c);
465 double etaDist = -9999;
466 double phiDist = -9999;
477 <<
", returning false for getTrackStateOnPixelLayerInfo");
491 float error_locx = -9999;
492 float error_locy = -9999;
494 if (trkParam->covariance()) {
507 pixelDetElStatus->
isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash()),
511 pixelDetElStatus->
isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash())) ||
517 if (trkParam->covariance()) {
523 bool isIn = siIn.
in();
537 infoList.push_back(pixelLayerInfo);
545 const EventContext& ctx,
547 std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
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");
561 surfTrans.setIdentity();
565 std::vector<std::unique_ptr<Trk::TrackParameters>> paramList =
569 if (paramList.empty()) {
576 " Number of generated parameters by propagator: " << paramList.size());
579 for (std::unique_ptr<Trk::TrackParameters>&
p : paramList) {
583 if (!(
p->associatedSurface().associatedDetectorElement() !=
nullptr &&
584 p->associatedSurface().associatedDetectorElement()->identify() !=
589 id =
p->associatedSurface().associatedDetectorElement()->identify();
596 pixelLayerParam.push_back(std::move(
p));
605 double phiRegionSize,
606 double etaRegionSize,
614 const EventContext& ctx = Gaudi::Hive::currentContext();
616 bool is_good ( ( pixelDetElStatus && pixelDetElStatus->
isGood(id_hash))
624 double error_locx = -9999;
625 double error_locy = -9999;
627 if (trkParam->covariance()) {
636 if (trkParam->covariance()) {
637 phitol = phiRegionSize * error_locx;
638 etatol = etaRegionSize * error_locy;
651 "Failed to cast TrackParameters associated surface to SiDetectorElement");
662 "could not get pixel module design, returning 0 for getFracGood");
668 double startLocX = locx - phitol;
669 double startLocY = locy - etatol;
671 double endLocX = locx + phitol;
672 double endLocY = locy + etatol;
677 double etaDist = -9999;
678 double phiDist = -9999;
683 locx += (std::abs(phiDist) + 1
e-6);
685 locy += (std::abs(etaDist) + 1
e-6);
688 startLocX += (std::abs(phiDist) + 1
e-6);
690 startLocY += (std::abs(etaDist) + 1
e-6);
693 endLocX -= (std::abs(phiDist) + 1
e-6);
695 endLocY -= (std::abs(etaDist) + 1
e-6);
733 if (pixelDetElStatus) {