diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h index cd78fef0deeb4e9d731cada1bfb4a52ac8f0bb45..42e96ced97718f02c2581c397849e81f4ea13b2e 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/MdtCalibSvc/MdtCalibrationTool.h @@ -126,6 +126,7 @@ private: SG::ReadCondHandleKey<AtlasFieldCacheCondObj> m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}; ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; + bool m_hasBISsMDT; }; #endif diff --git a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx index acbedbb0f77b2bd1fc45ffc7c2d6641887ff1ac3..d17af02ea2df6cd653b18f3b905c0b11d00dcba1 100644 --- a/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx +++ b/MuonSpectrometer/MuonCalib/MdtCalib/MdtCalibSvc/src/MdtCalibrationTool.cxx @@ -92,8 +92,8 @@ MdtCalibrationTool::Imp::Imp(std::string name) : {} -MdtCalibrationTool::MdtCalibrationTool(const std::string& type, const std::string &name, const IInterface* parent) - : base_class(type, name, parent) +MdtCalibrationTool::MdtCalibrationTool(const std::string& type, const std::string &name, const IInterface* parent) : base_class(type, name, parent), + m_hasBISsMDT(false) { m_imp.reset(new MdtCalibrationTool::Imp(name)); // settable properties @@ -134,6 +134,11 @@ StatusCode MdtCalibrationTool::initialize() { ATH_MSG_INFO("Processing configuration for layouts with BMG chambers."); m_imp->m_BMGid = m_idHelperSvc->mdtIdHelper().stationNameIndex("BMG"); } + + int bisIndex=m_idHelperSvc->mdtIdHelper().stationNameIndex("BIS"); + Identifier bis7Id = m_idHelperSvc->mdtIdHelper().elementID(bisIndex, 7, 1); + if (m_idHelperSvc->issMdt(bis7Id)) m_hasBISsMDT=true; + // initialise MuonGeoModel access ATH_CHECK(detStore()->retrieve( m_imp->m_muonGeoManager )); @@ -258,9 +263,15 @@ bool MdtCalibrationTool::driftRadiusFromTime( MdtCalibHit &hit, // get t0 shift from tool (default: no shift, value is zero) if (m_imp->m_doT0Shift) t0 += m_imp->m_t0ShiftSvc->getValue(id); } else { - ATH_MSG_WARNING("MdtTubeCalibContainer not found for " - << m_idHelperSvc->mdtIdHelper().print_to_string( id )); - ATH_MSG_WARNING( "Tube cannot be calibrated!!!" ); + if (m_hasBISsMDT) { + static std::atomic<bool> bisWarningPrinted = false; + if (!bisWarningPrinted) { + ATH_MSG_WARNING("MdtTubeCalibContainer not found for " << m_idHelperSvc->mdtIdHelper().print_to_string( id ) << " - Tube cannot be calibrated, cf. ATLASRECTS-5819"); + bisWarningPrinted.store(true, std::memory_order_relaxed); + } + } else { + ATH_MSG_WARNING("MdtTubeCalibContainer not found for " << m_idHelperSvc->mdtIdHelper().print_to_string( id ) << " - Tube cannot be calibrated!"); + } return false; } @@ -480,7 +491,7 @@ bool MdtCalibrationTool::twinPositionFromTwinHits( MdtCalibHit &hit, } else { ATH_MSG_WARNING( "MdtTubeCalibContainer not found for " << m_idHelperSvc->mdtIdHelper().print_to_string( id ) ); - ATH_MSG_WARNING( "Tube cannot be calibrated!!!" ); + ATH_MSG_WARNING( "Tube cannot be calibrated!!" ); return false; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCalibDbAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCalibDbAlg.cxx index 7f9b8e53613f5f7fe6908d45e10d88e4735ecfba..e0f7fd4ef7c6709a5eed23f82df63e370538640f 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCalibDbAlg.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondAlg/src/MdtCalibDbAlg.cxx @@ -464,7 +464,11 @@ StatusCode MdtCalibDbAlg::loadRt(const MuonGM::MuonDetectorManager* muDetMgr){ double innerTubeRadius = -9999.; const MuonGM::MdtReadoutElement *detEl = muDetMgr->getMdtReadoutElement( m_idHelperSvc->mdtIdHelper().channelID(athenaId,1,1,1) ); if( !detEl ){ - ATH_MSG_INFO( "Ignoring nonexistant station in calibration DB: " << m_idHelperSvc->mdtIdHelper().print_to_string(athenaId) ); + static std::atomic<bool> rtWarningPrinted = false; + if (!rtWarningPrinted) { + ATH_MSG_WARNING("loadRt() - Ignoring nonexistant station in calibration DB: "<<m_idHelperSvc->mdtIdHelper().print_to_string(athenaId)<<", cf. ATLASRECTS-5826"); + rtWarningPrinted.store(true, std::memory_order_relaxed); + } } else { innerTubeRadius = detEl->innerTubeRadius(); } @@ -830,7 +834,11 @@ StatusCode MdtCalibDbAlg::loadTube(const MuonGM::MuonDetectorManager* muDetMgr){ bool isValid = true; // the elementID takes a bool pointer to check the validity of the Identifier Identifier chId = m_idHelperSvc->mdtIdHelper().elementID(name,ieta,iphi,true,&isValid); if (!isValid) { - ATH_MSG_WARNING("Element Identifier " << chId.get_compact() << " retrieved for station name " << name << " is not valid, skipping..."); + static std::atomic<bool> idWarningPrinted = false; + if (!idWarningPrinted) { + ATH_MSG_WARNING("Element Identifier " << chId.get_compact() << " retrieved for station name " << name << " is not valid, skipping, cf. ATLASRECTS-5826"); + idWarningPrinted.store(true, std::memory_order_relaxed); + } continue; } @@ -981,7 +989,11 @@ MuonCalib::MdtTubeCalibContainer* MdtCalibDbAlg::buildMdtTubeCalibContainer(cons ATH_MSG_VERBOSE( " new det el " << detEl ); if( !detEl ){ - ATH_MSG_INFO( "Ignoring nonexistant station in calibration DB: " << m_idHelperSvc->mdtIdHelper().print_to_string(id) ); + static std::atomic<bool> warningPrinted = false; + if (!warningPrinted) { + ATH_MSG_WARNING("buildMdtTubeCalibContainer() - Ignoring nonexistant station in calibration DB: "<<m_idHelperSvc->mdtIdHelper().print_to_string(id)<<", cf. ATLASRECTS-5826"); + warningPrinted.store(true, std::memory_order_relaxed); + } } else { int nml = 2; if( !detEl2 ) nml = 1;