diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondAlg.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondAlg.cxx index 0edffc60e250783f4ae080facdc7380de94021b8..7630e83c5a04c62089d4beedf21dee2387cca80d 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondAlg.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RpcCablingCondAlg.cxx @@ -4,7 +4,6 @@ #include "RPC_CondCabling/RpcCablingCondAlg.h" - RpcCablingCondAlg::RpcCablingCondAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_ConfMapPString(nullptr), @@ -14,31 +13,24 @@ RpcCablingCondAlg::RpcCablingCondAlg(const std::string& name, ISvcLocator* pSvcL m_condSvc("CondSvc",name) { declareProperty( "CosmicConfiguration", m_cosmic_configuration=false ); - declareProperty("ApplyFeetPadThresholds", m_ApplyFeetPadThresholds=true, - "map 3 low pt thresholds from special feet pads on standard 6 (3low+3high)"); - // declareProperty( "RPCTriggerRoadsfromCool",m_RPCTriggerRoadsfromCool=false) + declareProperty("ApplyFeetPadThresholds", m_ApplyFeetPadThresholds=true, "map 3 low pt thresholds from special feet pads on standard 6 (3low+3high)"); declareProperty("ForceFeetPadThresholdsFromJO", m_ForceFeetPadThresholdsFromJO=false, "JO override db setting"); } StatusCode RpcCablingCondAlg::initialize() { ATH_MSG_DEBUG( "initializing" << name() ); - // CondSvc ATH_CHECK( m_condSvc.retrieve() ); - // Read CondHandles ATH_CHECK( m_readKey_map_schema.initialize() ); ATH_CHECK( m_readKey_map_schema_corr.initialize() ); ATH_CHECK( m_readKey_cm_thr_eta.initialize() ); ATH_CHECK( m_readKey_cm_thr_phi.initialize() ); - // Register write CondHandle ATH_CHECK( m_writeKey.initialize() ); if(m_condSvc->regHandle(this, m_writeKey).isFailure()) { ATH_MSG_ERROR("unable to register WriteCondHandle " << m_writeKey.fullKey() << " with CondSvc"); return StatusCode::FAILURE; } - ATH_CHECK(m_idHelperSvc.retrieve()); - return StatusCode::SUCCESS; } @@ -259,8 +251,10 @@ StatusCode RpcCablingCondAlg::ReadConf() ATH_MSG_DEBUG("--- ReadConf: map has size " << m_ConfMapPString->size() ); ATH_MSG_DEBUG("--- ReadConf: m_MaxType of types is " << m_MaxType ); - if(m_ConfMapPString==nullptr) + if(!m_ConfMapPString) { + ATH_MSG_ERROR("Pointer to cabling map not set"); return StatusCode::FAILURE; + } std::stringstream MAP; MAP.str(*m_ConfMapPString); @@ -500,7 +494,10 @@ StatusCode RpcCablingCondAlg::buildRDOmap(RpcCablingCondData* writeCdo) ++hashID; // get pointer to RDOindex class writeCdo->m_HashVec.push_back(pRDOindex); - if( writeCdo->m_HashVec.size() != pRDOindex->hash()+1 ) return StatusCode::FAILURE; + if( writeCdo->m_HashVec.size() != pRDOindex->hash()+1 ) { + ATH_MSG_ERROR("Size of hash vector and RDO hash does not match"); + return StatusCode::FAILURE; + } // calculate m_fullListOfRobIds const unsigned short int rob_id = pRDOindex->ROBid(); @@ -526,8 +523,10 @@ StatusCode RpcCablingCondAlg::buildRDOmap(RpcCablingCondData* writeCdo) std::pair < RpcCablingCondData::OfflineOnlineMap::iterator, bool> ins = writeCdo->m_RDOmap.insert( RpcCablingCondData::OfflineOnlineMap::value_type(id,pRDOindex)); ATH_MSG_DEBUG("OfflineOnlineMap new entry: value "<< m_idHelperSvc ->rpcIdHelper().show_to_string(id) << "hash of the RDOindex (key) = " << pRDOindex->hash()); - if(!ins.second) return StatusCode::FAILURE; - + if(!ins.second) { + ATH_MSG_ERROR("RpcCablingCondData::OfflineOnlineMap is false for value "<< m_idHelperSvc->rpcIdHelper().show_to_string(id) << " and hash of the RDOindex (key) = " << pRDOindex->hash()); + return StatusCode::FAILURE; + } //build the PRD->RDO and PRD->ROB maps ATH_MSG_VERBOSE("Looking for PRDs corresponding to this RDO"); @@ -682,28 +681,27 @@ StatusCode RpcCablingCondAlg::buildRDOmap(RpcCablingCondData* writeCdo) // record if (writeCdo->m_RDOs.empty()) { - ATH_MSG_DEBUG("Could not read any map configuration"); + ATH_MSG_ERROR("Could not read any map configuration"); return StatusCode::FAILURE; } if (writeCdo->m_HashVec.empty()) { - ATH_MSG_DEBUG("Could not read any HashID"); + ATH_MSG_ERROR("Could not read any HashID"); return StatusCode::FAILURE; } if (writeCdo->m_SectorType.empty()) { - ATH_MSG_DEBUG("Could not read any m_SectorMap"); + ATH_MSG_ERROR("Could not read any m_SectorMap"); return StatusCode::FAILURE; } if (writeCdo->m_int2id.empty()) { - ATH_MSG_DEBUG("Could not read any HashID"); + ATH_MSG_ERROR("Could not read any HashID"); return StatusCode::FAILURE; } if (writeCdo->m_lookup.empty()) { - ATH_MSG_DEBUG("Could not read any HashID"); + ATH_MSG_ERROR("Could not read any HashID"); return StatusCode::FAILURE; } - if (writeCdo->m_fullListOfRobIds.empty()) { - ATH_MSG_DEBUG("Could not read any HashID"); + ATH_MSG_ERROR("Could not read any HashID"); return StatusCode::FAILURE; } return StatusCode::SUCCESS; diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx index c4b89c774eea06d729ed3f579eaa5c36597bd518..edd6bf13164aac8596aca1ecd4d5d6c3b4006aaf 100755 --- a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/SectorLogicSetup.cxx @@ -1017,40 +1017,31 @@ std::ostream& operator<<(std::ostream& stream,const SectorLogicSetup& setup) bool -SectorLogicSetup::operator+=(RPCchamberdata& data) -{ - while(RPCchamber* cham = data.give_rpc()) - { +SectorLogicSetup::operator+=(RPCchamberdata& data) { + while(RPCchamber* cham = data.give_rpc()) { int key = data.station()*100; - std::pair < RPCmap::iterator, bool> ins = - m_RPCs.insert(RPCmap::value_type(key + cham->number(),*cham)); + std::pair < RPCmap::iterator, bool> ins = m_RPCs.insert(RPCmap::value_type(key + cham->number(),*cham)); - RPCmap::iterator lower = m_RPCs.lower_bound(key); - RPCmap::iterator upper = m_RPCs.upper_bound(key+99); + RPCmap::iterator lower = m_RPCs.lower_bound(key); + RPCmap::iterator upper = m_RPCs.upper_bound(key+99); RPCmap::iterator current = (ins.first); - if (ins.second) - { - if (current != lower ) --current; - while (current != upper ) - { - int div = ((*current).second.number())? 1 : 2; - int eta_st = (*current).second.eta_strips()/div; + if (ins.second) { + if (current != lower ) --current; + while (current != upper ) { + int div = ((*current).second.number())? 1 : 2; + int eta_st = (*current).second.eta_strips()/div; int eta_st_of = (*current).second.eta_strip_global()/div; int eta_co = (*current).second.eta_connectors()/div; int eta_co_of = (*current).second.eta_conn_global()/div; - - current++; - if (current != m_RPCs.end()) - { - (*current).second.set_eta_st_global(eta_st + eta_st_of); + current++; + if (current != m_RPCs.end()) { + (*current).second.set_eta_st_global(eta_st + eta_st_of); (*current).second.set_eta_co_global(eta_co + eta_co_of); - } - } - } - else - { - DISP <<"Error in inserting chamber:" << std::endl + } + } + } else { + DISP <<"Error in inserting chamber:" << std::endl << *cham << std::endl << "in "; PrintElement(m_message->message(),data.station(),"RPC",0,false); DISP_ERROR;