From f874de6beaf9895082ff1600b97628d97c5cfb1c Mon Sep 17 00:00:00 2001 From: Susumu Oda <susumu.oda@cern.ch> Date: Thu, 21 Mar 2019 21:28:13 +0000 Subject: [PATCH] Consider bad SCT strips in InDetTrackHoleSearchTool (ATLASRECTS-4902) --- .../src/SCT_ReadCalibDataTool.cxx | 42 ++++++++----------- .../InDetTrackHoleSearchTool.h | 4 +- .../src/InDetTrackHoleSearchTool.cxx | 30 +++++++------ 3 files changed, 37 insertions(+), 39 deletions(-) diff --git a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadCalibDataTool.cxx b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadCalibDataTool.cxx index 2d96d716189..acdbeada758 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadCalibDataTool.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsTools/src/SCT_ReadCalibDataTool.cxx @@ -54,9 +54,25 @@ bool SCT_ReadCalibDataTool::canReportAbout(InDetConditions::Hierarchy h) const { bool SCT_ReadCalibDataTool::isGood(const Identifier& elementId, const EventContext& ctx, InDetConditions::Hierarchy h) const { // Status of the compId bool status{true}; - // Extract the moduleId from the comp identifier - Identifier moduleId{m_id_sct->module_id(elementId)}; switch (h) { + case InDetConditions::SCT_STRIP: + { + // Retrieve isGood Wafer data + const SCT_AllGoodStripInfo* condDataInfo{getCondDataInfo(ctx)}; + if (condDataInfo==nullptr) { + ATH_MSG_ERROR("In isGood, SCT_AllGoodStripInfo cannot be retrieved"); + return false; + } + // Extract the wafer identifier from the strip identifier + Identifier waferId{m_id_sct->wafer_id(elementId)}; + // Get hashId + IdentifierHash waferHash{m_id_sct->wafer_hash(waferId)}; + // Get strip on wafer to check + int strip{m_id_sct->strip(elementId)}; + // Set value + status = (*condDataInfo)[waferHash.value()][strip]; + break; + } case InDetConditions::SCT_MODULE: { // Not applicable for Calibration data @@ -75,30 +91,8 @@ bool SCT_ReadCalibDataTool::isGood(const Identifier& elementId, const EventConte ATH_MSG_WARNING("summary(): Chip good/bad is not applicable for Calibration data"); break; } - case InDetConditions::SCT_STRIP: - { - // Get hashId - IdentifierHash hashIdx{m_id_sct->wafer_hash(moduleId)}; - int side{m_id_sct->side(elementId)}; - if (side==1) m_id_sct->get_other_side(hashIdx, hashIdx); - unsigned int waferIdx{hashIdx}; - //unsigned int waferIdx=hashIdx+side; //uhm - // Get strip on wafer to check - int strip{m_id_sct->strip(elementId)}; - // Retrieve isGood Wafer data - - const SCT_AllGoodStripInfo* condDataInfo{getCondDataInfo(ctx)}; - if (condDataInfo==nullptr) { - ATH_MSG_ERROR("In isGood, SCT_AllGoodStripInfo cannot be retrieved"); - return false; - } - // Set value - status = (*condDataInfo)[waferIdx][strip]; - break; - } default: { - status = true ; ATH_MSG_INFO("Unknown component has been asked for, should be Module/Wafer/Chip or Strip; returning 'good' and continuing"); } } //end of switch structure diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h index 0c5705d7b3a..11a0d9e691e 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h @@ -180,8 +180,8 @@ namespace InDet const Trk::Track* addHolesToTrack(const Trk::Track& oldTrack, std::vector<const Trk::TrackStateOnSurface*>* listOfHoles) const; - /** This method checks the SCT ABCD chip where the track passes through is bad or not */ - bool isBadSCTChip(const Identifier& waferId, const Trk::TrackParameters& parameters, const InDetDD::SiDetectorElement& siElement) const; + /** This method checks the SCT ABCD chip and SCT strip where the track passes through is bad or not */ + bool isBadSCTChipStrip(const Identifier& waferId, const Trk::TrackParameters& parameters, const InDetDD::SiDetectorElement& siElement) const; }; } // end of namespace diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx index 294d9d5772d..20fb0e6b5ea 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -93,7 +93,7 @@ StatusCode InDet::InDetTrackHoleSearchTool::initialize() { } if (m_checkBadSCTChip) { - // Check if ITk Strip is used because isBadSCTChip method is valid only for SCT. + // Check if ITk Strip is used because isBadSCTChipStrip method is valid only for SCT. ATH_CHECK(m_geoModelSvc.retrieve()); if (m_geoModelSvc->geoConfig()==GeoModel::GEO_RUN4 or m_geoModelSvc->geoConfig()==GeoModel::GEO_ITk) { @@ -845,7 +845,7 @@ bool InDet::InDetTrackHoleSearchTool::isSensitive(const Trk::TrackParameters* pa // the track plus its error hits the active material if (isActiveElement) { - if (m_checkBadSCTChip and isBadSCTChip(id, *parameters, *siElement)) { + if (m_checkBadSCTChip and isBadSCTChipStrip(id, *parameters, *siElement)) { ATH_MSG_VERBOSE("Track is hiting a bad SCT chip, this is not a hole candidate!"); isgood = false; return false; @@ -938,27 +938,31 @@ const Trk::Track* InDet::InDetTrackHoleSearchTool::addHolesToTrack(const Trk::T } // ==================================================================================================================== -bool InDet::InDetTrackHoleSearchTool::isBadSCTChip(const Identifier& waferId, - const Trk::TrackParameters& parameters, - const InDetDD::SiDetectorElement& siElement) const { - // Check if the track passes through a bad SCT ABCD chip - // A chip is determined by the extrapolated position. +bool InDet::InDetTrackHoleSearchTool::isBadSCTChipStrip(const Identifier& waferId, + const Trk::TrackParameters& parameters, + const InDetDD::SiDetectorElement& siElement) const { + // Check if the track passes through a bad SCT ABCD chip or a bad SCT strip. + // A chip and a strip are determined by the extrapolated position. // Algorithm is based on InnerDetector/InDetMonitoring/SCT_Monitoring/src/SCTHitEffMonTool.cxx - // Check the input + // Check the input. if (not m_atlasId->is_sct(waferId)) { ATH_MSG_WARNING(waferId << " is not an SCT Identifier"); return true; } - // There is at least one bad chip on the side. - // Get strip id from local position + // Get strip id from local position. + // Due to the limited position resolution, we may pick up a neighboring strip... const Amg::Vector2D localPos(parameters.localPosition()); const Identifier stripIdentifier(siElement.identifierOfPosition(localPos)); if (not m_atlasId->is_sct(stripIdentifier)) { ATH_MSG_WARNING(stripIdentifier << " is not an SCT Identifier"); return true; } - - return (not m_sctCondSummaryTool->isGood(stripIdentifier, InDetConditions::SCT_CHIP)); + + // The extrapolated position is on a bad chip. + if (not m_sctCondSummaryTool->isGood(stripIdentifier, InDetConditions::SCT_CHIP)) return true; + // The extrapolated position is on a bad strip. (We may need to check neighboring strips.) + if (not m_sctCondSummaryTool->isGood(stripIdentifier, InDetConditions::SCT_STRIP)) return true; + return false; } -- GitLab