24 #include "Identifier/Identifier.h"
37 declareInterface<IInDetTestPixelLayerTool>(
this);
54 return StatusCode::FAILURE;
59 return StatusCode::FAILURE;
64 return StatusCode::FAILURE;
69 !m_pixelDetElStatus.empty() && !VALIDATE_STATUS_ARRAY_ACTIVATED }));
75 return StatusCode::SUCCESS;
82 bool checkBarrelOnly)
const
89 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
100 const EventContext& ctx,
102 int pixel_layer)
const
111 "Not a valid TrackParticle: no b-layer info will be provided");
121 "b-layer info will be provided");
132 const EventContext& ctx,
135 bool checkBarrelOnly)
const
137 bool expect_hit =
false;
139 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
146 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
148 if (!(
p->associatedSurface().associatedDetectorElement()))
151 p->associatedSurface().associatedDetectorElement()->identify();
157 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash()),
161 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
179 ATH_MSG_DEBUG(
"b-layer in dead region: fracGood = " << fracGood);
183 ATH_MSG_DEBUG(
"Condition Summary: not checking dead regions");
190 "Condition Summary: b-layer good but outside active area");
196 "Condition Summary: b-layer good, active areas not checked");
220 const EventContext& ctx = Gaudi::Hive::currentContext();
239 ATH_MSG_DEBUG(
"b-layer in dead region: fracGood = " << fracGood);
243 ATH_MSG_DEBUG(
"Condition Summary: not checking dead regions");
256 int pixel_layer)
const
261 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
262 "will be provided ");
273 int pixel_layer)
const
275 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
280 bool found_layer =
false;
281 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
282 if (!(
p->associatedSurface().associatedDetectorElement()))
285 p->associatedSurface().associatedDetectorElement()->identify();
298 const EventContext& ctx = Gaudi::Hive::currentContext();
301 for (std::unique_ptr<const Trk::TrackParameters>&
p : pixelLayerParam) {
303 if (!(
p->associatedSurface().associatedDetectorElement()))
306 p->associatedSurface().associatedDetectorElement()->identify();
316 pixelDetElStatus->
isGood(
p->associatedSurface().associatedDetectorElement()->identifyHash())) ||
326 "Condition Summary: b-layer good but outside active area");
346 if (siElement ==
nullptr) {
348 ATH_MSG_DEBUG(
"TrackParameters do not belong to a Si Element");
353 if (trackpar->covariance()) {
361 msg(
MSG::DEBUG) <<
"---> extrapolation on bond gap within " << etatol
364 }
else if (!siIn.
in()) {
367 <<
"---> extrapolation not inside (active?) detector within "
368 << phitol <<
" " << etatol <<
", return" <<
endmsg;
381 std::vector<TrackStateOnPixelLayerInfo>& infoList)
const
384 std::unique_ptr<const Trk::TrackParameters> startParameters =
nullptr;
386 if (
track->perigeeParameters()) {
387 startParameters =
track->perigeeParameters()->uniqueClone();
388 }
else if (
track->trackParameters()->front()) {
391 Gaudi::Hive::currentContext(),
392 *(
track->trackParameters()->front()),
398 if (!startParameters) {
399 ATH_MSG_WARNING(
"Found Track with no perigee parameters: no b-layer info "
411 std::vector<TrackStateOnPixelLayerInfo>& infoList)
const
416 if (!startParameters) {
418 "b-layer info will be provided");
428 std::vector<TrackStateOnPixelLayerInfo>& infoList,
430 bool checkBarrelOnly)
const
435 std::vector<std::unique_ptr<const Trk::TrackParameters>> pixelLayerParam;
439 const EventContext& ctx = Gaudi::Hive::currentContext();
442 for (std::unique_ptr<const Trk::TrackParameters>& trkParam :
453 trkParam->associatedSurface().associatedDetectorElement()->identify();
461 trkParam->associatedSurface().associatedDetectorElement());
464 ATH_MSG_WARNING(
"Failed to cast TrackParameters associated surface to "
465 "SiDetectorElement");
471 pixelLayerInfo.
pixelId(holeId_c);
473 double etaDist = -9999;
474 double phiDist = -9999;
485 <<
", returning false for getTrackStateOnPixelLayerInfo");
499 float error_locx = -9999;
500 float error_locy = -9999;
502 if (trkParam->covariance()) {
515 pixelDetElStatus->
isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash()),
519 pixelDetElStatus->
isGood(trkParam->associatedSurface().associatedDetectorElement()->identifyHash())) ||
525 if (trkParam->covariance()) {
531 bool isIn = siIn.
in();
545 infoList.push_back(pixelLayerInfo);
553 const EventContext& ctx,
555 std::vector<std::unique_ptr<const Trk::TrackParameters>>& pixelLayerParam)
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");
569 surfTrans.setIdentity();
573 std::vector<std::unique_ptr<Trk::TrackParameters>> paramList =
577 if (paramList.empty()) {
584 " Number of generated parameters by propagator: " << paramList.size());
587 for (std::unique_ptr<Trk::TrackParameters>&
p : paramList) {
591 if (!(
p->associatedSurface().associatedDetectorElement() !=
nullptr &&
592 p->associatedSurface().associatedDetectorElement()->identify() !=
597 id =
p->associatedSurface().associatedDetectorElement()->identify();
604 pixelLayerParam.push_back(std::move(
p));
613 double phiRegionSize,
614 double etaRegionSize,
622 const EventContext& ctx = Gaudi::Hive::currentContext();
624 bool is_good ( ( pixelDetElStatus && pixelDetElStatus->
isGood(id_hash))
632 double error_locx = -9999;
633 double error_locy = -9999;
635 if (trkParam->covariance()) {
644 if (trkParam->covariance()) {
645 phitol = phiRegionSize * error_locx;
646 etatol = etaRegionSize * error_locy;
657 "Failed to cast TrackParameters associated surface to SiDetectorElement");
668 "could not get pixel module design, returning 0 for getFracGood");
674 double startLocX = locx - phitol;
675 double startLocY = locy - etatol;
677 double endLocX = locx + phitol;
678 double endLocY = locy + etatol;
683 double etaDist = -9999;
684 double phiDist = -9999;
689 locx += (std::abs(phiDist) + 1
e-6);
691 locy += (std::abs(etaDist) + 1
e-6);
694 startLocX += (std::abs(phiDist) + 1
e-6);
696 startLocY += (std::abs(etaDist) + 1
e-6);
699 endLocX -= (std::abs(phiDist) + 1
e-6);
701 endLocY -= (std::abs(etaDist) + 1
e-6);
739 if (pixelDetElStatus) {