diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/cmt/requirements b/AtlasGeometryCommon/SubDetectorEnvelopes/cmt/requirements deleted file mode 100644 index c3a25edea120fa2cbacebb940f551cd4b9c5a520..0000000000000000000000000000000000000000 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/cmt/requirements +++ /dev/null @@ -1,29 +0,0 @@ -package SubDetectorEnvelopes -author <Elmar.Ritsch@cern.ch> -manager Elmar Ritsch <Elmar.Ritsch@cern.ch> - -################################################################# -# public use statements -use AtlasPolicy AtlasPolicy-* -use GaudiInterface GaudiInterface-* External -use AtlasDetDescr AtlasDetDescr-* DetectorDescription - -################################################################# -# private use statements -private -use AthenaBaseComps AthenaBaseComps-* Control -use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL -use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel -use AtlasCLHEP AtlasCLHEP-* External - -public -library SubDetectorEnvelopes *.cxx components/*.cxx -apply_pattern component_library - -apply_pattern declare_joboptions files="*.py" -apply_pattern declare_python_modules files="*.py" - -# use the following lines to compile this package with debug symbols -#private -#macro cppdebugflags '$(cppdebugflags_s)' -#macro_remove componentshr_linkopts "-Wl,-s" diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx b/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx index 41b7f1509a91226a9fed22d2fe0b3a8527ec400e..2acf8666c85b2cb58369af77eb52480fe763f36e 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/src/DetDescrDBEnvelopeSvc.cxx @@ -102,12 +102,6 @@ StatusCode DetDescrDBEnvelopeSvc::initialize() if ( !enableFallback()) return StatusCode::FAILURE; } - // connect to DDDB - if ( !m_doFallback && m_dbAccess->connect()==false) { - ATH_MSG_ERROR("Unable not connect to ATLASDD Database"); - if ( !enableFallback()) return StatusCode::FAILURE; - } - // retrieve the GeoModelSvc if ( !m_doFallback && svcLocator->service("GeoModelSvc", m_geoModel).isFailure()) { ATH_MSG_ERROR("Could not locate GeoModelSvc"); @@ -135,8 +129,6 @@ StatusCode DetDescrDBEnvelopeSvc::initialize() } } - // disconnect the DB access svc - m_dbAccess->disconnect(); } // (#) or use the fallback solution right away diff --git a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx index 2c590f234b429189a8f45107f850f5b93785d32a..bf72afb45c06d5f8a02a8483f162d8bcd5a4a6af 100755 --- a/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx +++ b/Calorimeter/CaloCnv/CaloDetMgrDetDescrCnv/src/CaloCellVolumes.cxx @@ -55,7 +55,6 @@ CaloCellVolumes::CaloCellVolumes(ISvcLocator* svcLocator): throw std::runtime_error("CaloCellVolumes error: cannot access RDBAccessSvc"); DecodeVersionKey detectorKey = DecodeVersionKey(geoModelSvc,"LAr"); - rdbAccessSvc->connect(); IRDBRecordset_ptr cellVolRec = rdbAccessSvc->getRecordsetPtr("LArCellVolumes",detectorKey.tag(),detectorKey.node()); if(cellVolRec->size()==0) @@ -63,7 +62,6 @@ CaloCellVolumes::CaloCellVolumes(ISvcLocator* svcLocator): cellVolRec = rdbAccessSvc->getRecordsetPtr("LArCellVolumes","LArCellVolumes-00"); if(cellVolRec->size()==0) { - rdbAccessSvc->disconnect(); throw std::runtime_error("CaloCellVolumes error: 0 size of LArCellVolumes recordset"); } } @@ -89,8 +87,6 @@ CaloCellVolumes::CaloCellVolumes(ISvcLocator* svcLocator): else if(LArTag.find("G3")!=std::string::npos) m_geometryLayout = "G3"; - rdbAccessSvc->disconnect(); - // Initialize m_cellVolumes vector for(unsigned int ind = 0; ind < cellVolRec->size(); ind++) { diff --git a/Database/AthenaPOOL/RDBAccessSvc/cmt/requirements b/Database/AthenaPOOL/RDBAccessSvc/cmt/requirements deleted file mode 100755 index 5a40aa9920bc1e11704b97c615b73e8898c9ffec..0000000000000000000000000000000000000000 --- a/Database/AthenaPOOL/RDBAccessSvc/cmt/requirements +++ /dev/null @@ -1,32 +0,0 @@ -package RDBAccessSvc - -public -use AtlasPolicy AtlasPolicy-* -use GaudiInterface GaudiInterface-* External -use AtlasCORAL AtlasCORAL-* External -use AtlasBoost AtlasBoost-* External - -private -apply_tag NEEDS_CORAL_BASE - -use AthenaBaseComps AthenaBaseComps-* Control -use PoolSvc PoolSvc-* Database/AthenaPOOL - -# Remove some libs from POOL -macro_remove POOL_linkopts "-llcg_Collection" -macro_remove POOL_linkopts "-llcg_MultiCollection" - -library RDBAccessSvc RDBAccessSvc.cxx RDBRecordset.cxx \ - RDBRecord.cxx RDBVersionAccessor.cxx \ - RDBQuery.cxx SourceCompAlg.cxx \ - components/RDBAccessSvc_entries.cxx \ - components/RDBAccessSvc_load.cxx - -apply_pattern component_library - -apply_pattern declare_joboptions files="*.py" - -macro_append DOXYGEN_INPUT " ../doc/MainPage.h " - -application geomdb2sqlite ../replicator/geomdb2sqlite.cpp -application geomdb2oracle ../replicator/geomdb2oracle.cpp diff --git a/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.cxx b/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.cxx index 2e674968382099feb09c2f483d7673999d5332d8..119c98ae88328e0eab17e72527b6501d0d8b35e1 100755 --- a/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.cxx +++ b/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.cxx @@ -166,89 +166,61 @@ IRDBRecordset_ptr RDBAccessSvc::getRecordsetPtr(const std::string& node, ATH_MSG_DEBUG("Getting RecordsetPtr with key " << key); - RecordsetPtrsByConn::const_iterator it_maps = m_recordsetptrs.find(connName); - if(it_maps==m_recordsetptrs.end()) { - ATH_MSG_DEBUG("Wrong name for connection " << connName << ". Unable to find recordset map. Returning empty recordset"); + if(!connect(connName)) { + ATH_MSG_ERROR("Unable to open connection " << connName << ". Returning empty recordset"); return IRDBRecordset_ptr(new RDBRecordset(this)); } - RecordsetPtrMap* recordsets = it_maps->second; + RecordsetPtrMap* recordsets = m_recordsetptrs[connName]; RecordsetPtrMap::const_iterator it = recordsets->find(key); if(it != recordsets->end()) { ATH_MSG_DEBUG("Reusing existing recordset"); + disconnect(connName); return it->second; } IRDBRecordset_ptr rec(new RDBRecordset(this)); - SessionMap::const_iterator it_sessions = m_sessions.find(connName); - - if(it_sessions != m_sessions.end()) { - coral::ISessionProxy* session = it_sessions->second; - if(session) { - try { - // Start new readonly transaction - session->transaction().start(true); - - // Check lookup table first - bool lookupFound = false; - std::string lookupMapKey = tag + "::" + connName; - GlobalTagLookupMap::const_iterator lookupmap = m_globalTagLookup.find(lookupMapKey); - if(lookupmap!=m_globalTagLookup.end()) { - lookupFound = true; - TagNameIdByNode::const_iterator childtagdet = lookupmap->second->find(node); - RDBRecordset* recConcrete = dynamic_cast<RDBRecordset*>(rec.get()); - if(recConcrete) { - if(childtagdet!=lookupmap->second->end()) { - recConcrete->getData(session,node,childtagdet->second.first,childtagdet->second.second); - } - else { - recConcrete->setNodeName(node); - ATH_MSG_DEBUG("Unable to find tag for the node " << node << " in the cache of global tag " << tag << ". Returning empty recordset"); - } - } - } - - if(!lookupFound) { - if(tag2node!="") { - RDBVersionAccessor versionAccessor(node,tag2node,tag,session,msg()); - versionAccessor.getChildTagData(); - RDBRecordset* recConcrete = dynamic_cast<RDBRecordset*>(rec.get()); - if(recConcrete) { - recConcrete->getData(session,versionAccessor.getNodeName(),versionAccessor.getTagName(),versionAccessor.getTagID()); - } - } - else { - RDBVersionAccessor versionAccessor(node,node,tag,session,msg()); - versionAccessor.getChildTagData(); - RDBRecordset* recConcrete = dynamic_cast<RDBRecordset*>(rec.get()); - if(recConcrete) { - recConcrete->getData(session,versionAccessor.getNodeName(),versionAccessor.getTagName(),versionAccessor.getTagID()); - } - } - } - - // Finish the transaction - session->transaction().commit(); - } - catch(coral::SchemaException& se) { - ATH_MSG_ERROR("Schema Exception : " << se.what()); - } - catch(std::exception& e) { - ATH_MSG_ERROR(e.what()); + RDBRecordset* recConcrete = dynamic_cast<RDBRecordset*>(rec.get()); + coral::ISessionProxy* session = m_sessions[connName]; + + try { + // Start new readonly transaction + session->transaction().start(true); + + // Check lookup table first + std::string lookupMapKey = tag + "::" + connName; + GlobalTagLookupMap::const_iterator lookupmap = m_globalTagLookup.find(lookupMapKey); + if(lookupmap!=m_globalTagLookup.end()) { + TagNameIdByNode::const_iterator childtagdet = lookupmap->second->find(node); + if(childtagdet!=lookupmap->second->end()) { + recConcrete->getData(session,node,childtagdet->second.first,childtagdet->second.second); } - catch(...) { - ATH_MSG_ERROR("Exception caught(...)"); + else { + recConcrete->setNodeName(node); + ATH_MSG_DEBUG("Unable to find tag for the node " << node << " in the cache of global tag " << tag << ". Returning empty recordset"); } } else { - ATH_MSG_ERROR("Connection " << connName << " is not open." << " Returning empty recordset"); + RDBVersionAccessor versionAccessor(node,(tag2node.empty()?node:tag2node),tag,session,msg()); + versionAccessor.getChildTagData(); + recConcrete->getData(session,versionAccessor.getNodeName(),versionAccessor.getTagName(),versionAccessor.getTagID()); } + + // Finish the transaction + session->transaction().commit(); } - else { - ATH_MSG_ERROR("Wrong name for connection " << connName << ". Unable to find session. Returning empty recordset"); + catch(coral::SchemaException& se) { + ATH_MSG_ERROR("Schema Exception : " << se.what()); + } + catch(std::exception& e) { + ATH_MSG_ERROR(e.what()); + } + catch(...) { + ATH_MSG_ERROR("Exception caught(...)"); } (*recordsets)[key] = rec; + disconnect(connName); return rec; } @@ -257,70 +229,56 @@ IRDBQuery* RDBAccessSvc::getQuery(const std::string& node, const std::string& tag2node, const std::string& connName) { - IRDBQuery* query(0); - - SessionMap::const_iterator it_sessions = m_sessions.find(connName); - if(it_sessions != m_sessions.end()) { - coral::ISessionProxy* session = it_sessions->second; - if(session) { - try { - // Check lookup table first - std::string childTagId(""); - bool lookupFound = false; - std::string lookupMapKey = tag + "::" + connName; - GlobalTagLookupMap::const_iterator lookupmap = m_globalTagLookup.find(lookupMapKey); - if(lookupmap!=m_globalTagLookup.end()) { - lookupFound = true; - TagNameIdByNode::const_iterator childtagdet = lookupmap->second->find(node); - if(childtagdet!=lookupmap->second->end()) { - childTagId = childtagdet->second.second; - } - } - - if(!lookupFound) { - // Start new readonly transaction - session->transaction().start(true); - - RDBVersionAccessor_ptr versionAccessor; - if(tag2node.empty()) { - versionAccessor = RDBVersionAccessor_ptr(new RDBVersionAccessor(node,node,tag,session,msg())); - } - else { - versionAccessor = RDBVersionAccessor_ptr(new RDBVersionAccessor(node,tag2node,tag,session,msg())); - } - - versionAccessor->getChildTagData(); - childTagId = versionAccessor->getTagID(); - - // Finish the transaction - session->transaction().commit(); - } - - if(childTagId.empty()) { - ATH_MSG_DEBUG("Could not get the tag for " << node << " node. Returning 0 pointer to IRDBQuery"); - } - else { - query = new RDBQuery(this,session,node,childTagId); - } - } - catch(coral::SchemaException& se) { - ATH_MSG_ERROR("Schema Exception : " << se.what()); - } - catch(std::exception& e) { - ATH_MSG_ERROR(e.what()); - } - catch(...) { - ATH_MSG_ERROR("Exception caught(...)"); + IRDBQuery* query{nullptr}; + + if(!connect(connName)) { + ATH_MSG_ERROR("Unable to open connection " << connName << ". Returning nullptr to IRDBQuery"); + return query; + } + + coral::ISessionProxy* session = m_sessions[connName]; + + try { + // Check lookup table first + std::string childTagId(""); + std::string lookupMapKey = tag + "::" + connName; + GlobalTagLookupMap::const_iterator lookupmap = m_globalTagLookup.find(lookupMapKey); + if(lookupmap!=m_globalTagLookup.end()) { + TagNameIdByNode::const_iterator childtagdet = lookupmap->second->find(node); + if(childtagdet!=lookupmap->second->end()) { + childTagId = childtagdet->second.second; } } else { - ATH_MSG_ERROR("Connection " << connName << " is not open."); + // Start new readonly transaction + session->transaction().start(true); + + RDBVersionAccessor versionAccessor{node,(tag2node.empty()?node:tag2node),tag,session,msg()}; + versionAccessor.getChildTagData(); + childTagId = versionAccessor.getTagID(); + + // Finish the transaction + session->transaction().commit(); + } + + if(childTagId.empty()) { + ATH_MSG_WARNING("Could not get the tag for " << node << " node. Returning 0 pointer to IRDBQuery"); } + else { + query = new RDBQuery(this,session,node,childTagId); + } + } + catch(coral::SchemaException& se) { + ATH_MSG_ERROR("Schema Exception : " << se.what()); } - else { - ATH_MSG_ERROR("Wrong name for connection " << connName << ". Unable to find session."); + catch(std::exception& e) { + ATH_MSG_ERROR(e.what()); + } + catch(...) { + ATH_MSG_ERROR("Exception caught(...)"); } + disconnect(connName); return query; } @@ -338,152 +296,135 @@ std::string RDBAccessSvc::getChildTag(const std::string& childNode, ATH_MSG_DEBUG("getChildTag for " << childNode << " " << parentTag << " " << parentNode << " " << (fetchData?"Fetch":"Nofetch")); - SessionMap::const_iterator it_sessions = m_sessions.find(connName); - - if(it_sessions != m_sessions.end()) { - coral::ISessionProxy* session = it_sessions->second; - - if(session) { - try { - // Check lookup table first - std::string lookupMapKey = parentTag + "::" + connName; - GlobalTagLookupMap::const_iterator lookupmap = m_globalTagLookup.find(lookupMapKey); - if(lookupmap!=m_globalTagLookup.end()) { - TagNameIdByNode::const_iterator childtagdet = lookupmap->second->find(childNode); - if(childtagdet!=lookupmap->second->end()) { - return childtagdet->second.first; - } - else { - return std::string(""); - } - } - - // We don't have lookup table for given parent tag. Go into slow mode through Version Accessor - // Start new readonly transaction - session->transaction().start(true); - - RDBVersionAccessor versionAccessor(childNode,parentNode,parentTag,session,msg()); - versionAccessor.getChildTagData(); - - // Finish the transaction - session->transaction().commit(); - - return versionAccessor.getTagName(); - } - catch(coral::SchemaException& se) { - ATH_MSG_ERROR("Schema Exception : " << se.what()); - } - catch(std::exception& e) { - ATH_MSG_ERROR(e.what()); - } - catch(...) { - ATH_MSG_ERROR("Exception caught(...)"); - } + // Check lookup table first + std::string lookupMapKey = parentTag + "::" + connName; + GlobalTagLookupMap::const_iterator lookupmap = m_globalTagLookup.find(lookupMapKey); + if(lookupmap!=m_globalTagLookup.end()) { + TagNameIdByNode::const_iterator childtagdet = lookupmap->second->find(childNode); + if(childtagdet!=lookupmap->second->end()) { + return childtagdet->second.first; } else { - ATH_MSG_ERROR("Connection " << connName << " is not open."); + return std::string(""); } } - else { - ATH_MSG_ERROR("Wrong name for connection " << connName); + + if(!connect(connName)) { + ATH_MSG_ERROR("Unable to open connection " << connName << ". Returning empty string"); + return std::string(""); } - return std::string(""); + std::string childTag(""); + try { + // We don't have lookup table for given parent tag. Go into slow mode through Version Accessor + // Start new readonly transaction + coral::ISessionProxy* session = m_sessions[connName]; + session->transaction().start(true); + + RDBVersionAccessor versionAccessor(childNode,parentNode,parentTag,session,msg()); + versionAccessor.getChildTagData(); + + // Finish the transaction + session->transaction().commit(); + + childTag = versionAccessor.getTagName(); + } + catch(coral::SchemaException& se) { + ATH_MSG_ERROR("Schema Exception : " << se.what()); + } + catch(std::exception& e) { + ATH_MSG_ERROR(e.what()); + } + catch(...) { + ATH_MSG_ERROR("Exception caught(...)"); + } + + disconnect(connName); + + return childTag; } RDBTagDetails RDBAccessSvc::getTagDetails(const std::string& tag, const std::string& connName) { RDBTagDetails tagDetails; - - SessionMap::const_iterator it_sessions = m_sessions.find(connName); - - if(it_sessions != m_sessions.end()) { - coral::ISessionProxy* session = it_sessions->second; - - if(session) { - try { - // Start new readonly transaction - session->transaction().start(true); + + if(!connect(connName)) { + ATH_MSG_ERROR("Failed to open connection " << connName); + return tagDetails; + } + + coral::ISessionProxy* session = m_sessions[connName]; + try { + // Start new readonly transaction + session->transaction().start(true); - coral::ITable& tableTag2Node = session->nominalSchema().tableHandle("HVS_TAG2NODE"); - coral::IQuery *queryTag2Node = tableTag2Node.newQuery(); - queryTag2Node->addToOutputList("LOCKED"); - queryTag2Node->addToOutputList("SUPPORTED"); - queryTag2Node->setMemoryCacheSize(1); - coral::AttributeList bindsTag2Node; - bindsTag2Node.extend<std::string>("tagN"); - queryTag2Node->setCondition("TAG_NAME=:tagN", bindsTag2Node); - bindsTag2Node[0].data<std::string>() = tag; - - coral::ICursor& cursorTag2Node = queryTag2Node->execute(); - if(cursorTag2Node.next()) { - tagDetails = cursorTag2Node.currentRow(); - } + coral::ITable& tableTag2Node = session->nominalSchema().tableHandle("HVS_TAG2NODE"); + coral::IQuery *queryTag2Node = tableTag2Node.newQuery(); + queryTag2Node->addToOutputList("LOCKED"); + queryTag2Node->addToOutputList("SUPPORTED"); + queryTag2Node->setMemoryCacheSize(1); + coral::AttributeList bindsTag2Node; + bindsTag2Node.extend<std::string>("tagN"); + queryTag2Node->setCondition("TAG_NAME=:tagN", bindsTag2Node); + bindsTag2Node[0].data<std::string>() = tag; + + coral::ICursor& cursorTag2Node = queryTag2Node->execute(); + if(cursorTag2Node.next()) { + tagDetails = cursorTag2Node.currentRow(); + } - delete queryTag2Node; + delete queryTag2Node; - // Build lookup table for the given global tag if has not been built yet - std::string lookupMapKey = tag + "::" + connName; - if(m_globalTagLookup.find(lookupMapKey)==m_globalTagLookup.end()) { - // Get tag contents from the database - TagNameIdByNode* lookup = new TagNameIdByNode(); + // Build lookup table for the given global tag if has not been built yet + std::string lookupMapKey = tag + "::" + connName; + if(m_globalTagLookup.find(lookupMapKey)==m_globalTagLookup.end()) { + // Get tag contents from the database + TagNameIdByNode* lookup = new TagNameIdByNode(); - coral::ITable& tableRootTag2Child = session->nominalSchema().tableHandle("HVS_TAGCACHE"); - coral::IQuery* queryRootTag2Child = tableRootTag2Child.newQuery(); - queryRootTag2Child->addToOutputList("CHILDNODE"); - queryRootTag2Child->addToOutputList("CHILDTAG"); - queryRootTag2Child->addToOutputList("CHILDTAGID"); - queryRootTag2Child->setMemoryCacheSize(1); - coral::AttributeList bindsRootTag2Child; - bindsRootTag2Child.extend<std::string>("tagN"); - queryRootTag2Child->setCondition("ROOTTAG=:tagN", bindsRootTag2Child); - bindsRootTag2Child[0].data<std::string>() = tag; - queryRootTag2Child->addToOrderList("CHILDNODE"); + coral::ITable& tableRootTag2Child = session->nominalSchema().tableHandle("HVS_TAGCACHE"); + coral::IQuery* queryRootTag2Child = tableRootTag2Child.newQuery(); + queryRootTag2Child->addToOutputList("CHILDNODE"); + queryRootTag2Child->addToOutputList("CHILDTAG"); + queryRootTag2Child->addToOutputList("CHILDTAGID"); + queryRootTag2Child->setMemoryCacheSize(1); + coral::AttributeList bindsRootTag2Child; + bindsRootTag2Child.extend<std::string>("tagN"); + queryRootTag2Child->setCondition("ROOTTAG=:tagN", bindsRootTag2Child); + bindsRootTag2Child[0].data<std::string>() = tag; + queryRootTag2Child->addToOrderList("CHILDNODE"); - coral::ICursor& cursorRootTag2Child = queryRootTag2Child->execute(); - while(cursorRootTag2Child.next()) { - const coral::AttributeList& row = cursorRootTag2Child.currentRow(); - - // turn TAG_ID into srting - std::stringstream tagIdStream; - tagIdStream << row["CHILDTAGID"].data<long long>(); - (*lookup)[row["CHILDNODE"].data<std::string>()]=std::make_pair(row["CHILDTAG"].data<std::string>(),tagIdStream.str()); - } - - delete queryRootTag2Child; - - if(lookup->size()>0) { - m_globalTagLookup[lookupMapKey]=lookup; - } - else { - delete lookup; - } - } - } - catch(coral::SchemaException& se) { - ATH_MSG_INFO("Schema Exception : " << se.what()); - } - catch(std::exception& e) { - ATH_MSG_ERROR(e.what()); + coral::ICursor& cursorRootTag2Child = queryRootTag2Child->execute(); + while(cursorRootTag2Child.next()) { + const coral::AttributeList& row = cursorRootTag2Child.currentRow(); + (*lookup)[row["CHILDNODE"].data<std::string>()]=std::make_pair(row["CHILDTAG"].data<std::string>(),std::to_string(row["CHILDTAGID"].data<long long>())); } - catch(...) { - ATH_MSG_ERROR("Exception caught(...)"); + + delete queryRootTag2Child; + + if(lookup->size()>0) { + m_globalTagLookup[lookupMapKey]=lookup; } - - // Finish the transaction - if(session->transaction().isActive()) { - session->transaction().commit(); + else { + delete lookup; } } - else { - ATH_MSG_ERROR("Connection " << connName << " is not open."); + // Finish the transaction + if(session->transaction().isActive()) { + session->transaction().commit(); } } - else { - ATH_MSG_ERROR("Wrong name for connection " << connName); + catch(coral::SchemaException& se) { + ATH_MSG_INFO("Schema Exception : " << se.what()); + } + catch(std::exception& e) { + ATH_MSG_ERROR(e.what()); + } + catch(...) { + ATH_MSG_ERROR("Exception caught(...)"); } + disconnect(connName); return tagDetails; } @@ -491,53 +432,46 @@ void RDBAccessSvc::getAllLeafNodes(std::vector<std::string>& list, const std::string& connName) { list.clear(); - SessionMap::const_iterator it_sessions = m_sessions.find(connName); - - if(it_sessions != m_sessions.end()) { - coral::ISessionProxy* session = it_sessions->second; - - if(session) { - try { - // Start new readonly transaction - session->transaction().start(true); - - coral::ITable& tableNode = session->nominalSchema().tableHandle("HVS_NODE"); - coral::IQuery *queryNode = tableNode.newQuery(); - queryNode->addToOutputList("NODE_NAME"); - queryNode->setMemoryCacheSize(1); - queryNode->setCondition("BRANCH_FLAG=0", coral::AttributeList()); - queryNode->addToOrderList("NODE_NAME"); - - coral::ICursor& cursorNode = queryNode->execute(); - while(cursorNode.next()) { - list.push_back(cursorNode.currentRow()["NODE_NAME"].data<std::string>()); - } - - delete queryNode; - } - catch(coral::SchemaException& se) { - ATH_MSG_INFO("Schema Exception : " << se.what()); - } - catch(std::exception& e) { - ATH_MSG_ERROR(e.what()); - } - catch(...) { - ATH_MSG_ERROR("Exception caught(...)"); - } + if(!connect(connName)) { + ATH_MSG_ERROR("Failed to open Connection " << connName); + return; + } - // Finish the transaction - if(session->transaction().isActive()) { - session->transaction().commit(); - } + coral::ISessionProxy* session = m_sessions[connName]; + try { + // Start new readonly transaction + session->transaction().start(true); + + coral::ITable& tableNode = session->nominalSchema().tableHandle("HVS_NODE"); + coral::IQuery *queryNode = tableNode.newQuery(); + queryNode->addToOutputList("NODE_NAME"); + queryNode->setMemoryCacheSize(1); + queryNode->setCondition("BRANCH_FLAG=0", coral::AttributeList()); + queryNode->addToOrderList("NODE_NAME"); + + coral::ICursor& cursorNode = queryNode->execute(); + while(cursorNode.next()) { + list.push_back(cursorNode.currentRow()["NODE_NAME"].data<std::string>()); } - else { - ATH_MSG_ERROR("Connection " << connName << " is not open."); + + delete queryNode; + + // Finish the transaction + if(session->transaction().isActive()) { + session->transaction().commit(); } } - else { - ATH_MSG_ERROR("Wrong name for connection " << connName); + catch(coral::SchemaException& se) { + ATH_MSG_INFO("Schema Exception : " << se.what()); + } + catch(std::exception& e) { + ATH_MSG_ERROR(e.what()); + } + catch(...) { + ATH_MSG_ERROR("Exception caught(...)"); } + disconnect(connName); } diff --git a/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.h b/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.h index 7569225b9ec01c8b7fa55ec95e9b14eae3d8ea84..955f392f08819591c782fd2860c3fc1270170024 100755 --- a/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.h +++ b/Database/AthenaPOOL/RDBAccessSvc/src/RDBAccessSvc.h @@ -57,7 +57,7 @@ typedef std::map<std::string, TagNameIdByNode*> GlobalTagLookupMap; // Key - <Gl * */ -class RDBAccessSvc : public AthService, virtual public IRDBAccessSvc +class RDBAccessSvc final : public AthService, virtual public IRDBAccessSvc { friend class RDBRecordset; @@ -70,16 +70,16 @@ class RDBAccessSvc : public AthService, virtual public IRDBAccessSvc /// If this method is called for already open connection the connection /// counter is incremented. /// @return success/failure - virtual bool connect(const std::string& connName); + bool connect(const std::string& connName) override; /// If the counnection counter==1 closes the connection. /// Decrements the connection counter value otherwise. /// @return success/failure - virtual bool disconnect(const std::string& connName); + bool disconnect(const std::string& connName) override; /// Closes the connection regardless of the counter value. /// @return success/failure - virtual bool shutdown(const std::string& connName); + bool shutdown(const std::string& connName) override; /// Provides access to the Recordset object containing HVS-tagged data. /// @param node [IN] name of the leaf HVS node @@ -87,10 +87,10 @@ class RDBAccessSvc : public AthService, virtual public IRDBAccessSvc /// tag of the HVS branch node specified by tag2node otherwise /// @param tag2node [IN] some parent of the HVS leaf node specified by node parameter /// @return pointer to the recordset object - virtual IRDBRecordset_ptr getRecordsetPtr(const std::string& node, + IRDBRecordset_ptr getRecordsetPtr(const std::string& node, const std::string& tag, const std::string& tag2node="", - const std::string& connName = "ATLASDD"); + const std::string& connName = "ATLASDD") override; /// Gets the tag name for the node by giving its parent node tag /// @param childNode [IN] name of the child node @@ -98,28 +98,28 @@ class RDBAccessSvc : public AthService, virtual public IRDBAccessSvc /// @param parentNode [IN] name of the parent node /// @param fetchData [IN] if true fetch the corresponding data /// this parameter has no sence if child is the branch node - virtual std::string getChildTag(const std::string& childNode, + std::string getChildTag(const std::string& childNode, const std::string& parentTag, const std::string& parentNode, bool fetchData, - const std::string& connName); + const std::string& connName) override; - virtual IRDBQuery* getQuery(const std::string& node, + IRDBQuery* getQuery(const std::string& node, const std::string& tag, const std::string& tag2node, - const std::string& connName); + const std::string& connName) override; - virtual RDBTagDetails getTagDetails(const std::string& tag, - const std::string& connName = "ATLASDD"); + RDBTagDetails getTagDetails(const std::string& tag, + const std::string& connName = "ATLASDD") override; void getAllLeafNodes(std::vector<std::string>& list, const std::string& connName = "ATLASDD"); inline MsgStream& msgStream() { return msg(); } - virtual StatusCode initialize(); - virtual StatusCode finalize(); - virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface ); + StatusCode initialize() override; + StatusCode finalize() override; + StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface ) override; protected: @@ -129,7 +129,7 @@ class RDBAccessSvc : public AthService, virtual public IRDBAccessSvc RDBAccessSvc(const std::string& name, ISvcLocator* svc); /// Standard Service Destructor - virtual ~RDBAccessSvc(); + ~RDBAccessSvc() override; private: SessionMap m_sessions; diff --git a/Database/AthenaPOOL/RDBAccessSvc/src/RDBQuery.h b/Database/AthenaPOOL/RDBAccessSvc/src/RDBQuery.h index fe48ad0d1941203d9efe5af25a3ec2bbef119750..689e438c6a8b47ac7b0f2be98cd9b97796002bb3 100755 --- a/Database/AthenaPOOL/RDBAccessSvc/src/RDBQuery.h +++ b/Database/AthenaPOOL/RDBAccessSvc/src/RDBQuery.h @@ -10,9 +10,6 @@ #include <vector> #include <string> -class RDBVersionAccessor; -typedef std::shared_ptr<RDBVersionAccessor> RDBVersionAccessor_ptr; - namespace coral { class IQuery; @@ -29,9 +26,7 @@ namespace coral class RDBAccessSvc; -#include "RDBVersionAccessor.h" - -class RDBQuery : public IRDBQuery +class RDBQuery final : public IRDBQuery { public: RDBQuery(RDBAccessSvc* _accessSvc, @@ -39,13 +34,13 @@ class RDBQuery : public IRDBQuery const std::string& nodeName, const std::string& tagId); - virtual ~RDBQuery(); + ~RDBQuery() override; - void execute(); - long size(); - void finalize(); - void setOrder(const std::string&); - void addToOutput(const std::string&); + void execute() override; + long size() override; + void finalize() override; + void setOrder(const std::string&) override; + void addToOutput(const std::string&) override; bool next(); diff --git a/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecord.h b/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecord.h index 0b78c3b8a69517ac532f3d15cf4d2b26954293b6..0ec88e63b3e20f7b1c7354e24f04bce641d7cc32 100755 --- a/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecord.h +++ b/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecord.h @@ -30,44 +30,44 @@ namespace coral * * @brief RDBRecord is one record in the RDBRecordset object */ -class RDBRecord : public IRDBRecord +class RDBRecord final : public IRDBRecord { friend class RDBRecordset; public: /// Destructor - virtual ~RDBRecord(); + ~RDBRecord() override; /// Check if the field value is NULL /// @param fieldName [IN] field name /// @retun TRUE if the field is NULL, FALSE otherwise - bool isFieldNull(const std::string& fieldName) const; + bool isFieldNull(const std::string& fieldName) const override; /// Get int field value /// @param fieldName [IN] field name /// @return field value - int getInt(const std::string& fieldName) const; + int getInt(const std::string& fieldName) const override; /// Get long field value /// @param fieldName [IN] field name /// @return field value - long getLong(const std::string& fieldName) const; + long getLong(const std::string& fieldName) const override; /// Get double field value /// @param fieldName [IN] field name /// @return field value - double getDouble(const std::string& fieldName) const; + double getDouble(const std::string& fieldName) const override; /// Get float field value /// @param fieldName [IN] field name /// @return field value - float getFloat(const std::string& fieldName) const; + float getFloat(const std::string& fieldName) const override; /// Get string field value /// @param fieldName [IN] field name /// @return field value - std::string getString(const std::string& fieldName) const; + std::string getString(const std::string& fieldName) const override; // Access array values by index // arrays are implemented using the field with names like NAME_0, NAME_1 etc. @@ -76,31 +76,31 @@ class RDBRecord : public IRDBRecord /// @param fieldName [IN] field name /// @param index [IN] index in the array /// @return field value - int getInt(const std::string& fieldName, unsigned int index) const; + int getInt(const std::string& fieldName, unsigned int index) const override; /// Get array long field value /// @param fieldName [IN] field name /// @param index [IN] index in the array /// @return field value - long getLong(const std::string& fieldName, unsigned int index) const; + long getLong(const std::string& fieldName, unsigned int index) const override; /// Get array double field value /// @param fieldName [IN] field name /// @param index [IN] index in the array /// @return field value - double getDouble(const std::string& fieldName, unsigned int index) const; + double getDouble(const std::string& fieldName, unsigned int index) const override; /// Get array float field value /// @param fieldName [IN] field name /// @param index [IN] index in the array /// @return field value - float getFloat(const std::string& fieldName, unsigned int index) const; + float getFloat(const std::string& fieldName, unsigned int index) const override; /// Get array string field value /// @param fieldName [IN] field name /// @param index [IN] index in the array /// @return field value - std::string getString(const std::string& fieldName, unsigned int index) const; + std::string getString(const std::string& fieldName, unsigned int index) const override; // Comparison operator bool operator!=(const RDBRecord& rhs) const; diff --git a/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecordset.h b/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecordset.h index 0ed5c540c3265607a26b564eae9640a8dcac0844..6aad45ae2dc695d484524829bb199773b358a8fd 100755 --- a/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecordset.h +++ b/Database/AthenaPOOL/RDBAccessSvc/src/RDBRecordset.h @@ -37,14 +37,14 @@ class RDBAccessSvc; #include "RDBVersionAccessor.h" -class RDBRecordset : public IRDBRecordset +class RDBRecordset final: public IRDBRecordset { public: /// Construct empty recordset RDBRecordset(RDBAccessSvc* accessSvc); /// Destructor, deletes all records - virtual ~RDBRecordset(); + ~RDBRecordset() override; /// Constructs SQL query and retrieves the data from DB /// @param session [IN] active relational session @@ -55,23 +55,23 @@ class RDBRecordset : public IRDBRecordset const std::string& tagId); /// @return number of records - unsigned int size() const; + unsigned int size() const override; /// @return node name - std::string nodeName() const; + std::string nodeName() const override; /// @return tag name - std::string tagName() const; + std::string tagName() const override; /// @param index [IN] index of the record /// @return RDBRecord by index - const IRDBRecord* operator[](unsigned int index) const; + const IRDBRecord* operator[](unsigned int index) const override; /// @return begin iterator - IRDBRecordset::const_iterator begin() const; + IRDBRecordset::const_iterator begin() const override; /// @return end iterator - IRDBRecordset::const_iterator end() const; + IRDBRecordset::const_iterator end() const override; // Comparison operator bool operator!=(const RDBRecordset& rhs) const; diff --git a/DetectorDescription/GeoModel/GeoModelSvc/cmt/requirements b/DetectorDescription/GeoModel/GeoModelSvc/cmt/requirements deleted file mode 100755 index 41130b4eaadd0539eb2469eeb95eabbb76d2d901..0000000000000000000000000000000000000000 --- a/DetectorDescription/GeoModel/GeoModelSvc/cmt/requirements +++ /dev/null @@ -1,28 +0,0 @@ -package GeoModelSvc - -author David Quarrie <David.Quarrie@cern.ch> - -use AtlasPolicy AtlasPolicy-* - -library GeoModelSvc GeoModelSvc.cxx RDBMaterialManager.cxx \ - components/GeoModelSvc_entries.cxx components/GeoModelSvc_load.cxx - -apply_pattern component_library -apply_pattern declare_joboptions files="*.py" - -private -use CxxUtils CxxUtils-* Control -use StoreGate StoreGate-* Control -use SGTools SGTools-* Control -use AthenaKernel AthenaKernel-* Control -use AthenaBaseComps AthenaBaseComps-* Control -use CLIDSvc CLIDSvc-* Control -use GaudiInterface GaudiInterface-* External -use EventInfo EventInfo-* Event -use EventInfoMgt EventInfoMgt-* Event -use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel -use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL -use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel -use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel - - diff --git a/DetectorDescription/GeoModel/GeoModelSvc/share/jobOptions.BuildGeometry.py b/DetectorDescription/GeoModel/GeoModelSvc/share/jobOptions.BuildGeometry.py index ed5f6e632018db240038040cbe695c4f05c52069..6e1f8e603c5e76885f9e9e8dfaba625c0940d13b 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/share/jobOptions.BuildGeometry.py +++ b/DetectorDescription/GeoModel/GeoModelSvc/share/jobOptions.BuildGeometry.py @@ -17,7 +17,7 @@ DetFlags.Lucid_setOn() DetFlags.Print() # GeoModel -globalflags.DetDescrVersion = "ATLAS-GEO-18-01-03" +globalflags.DetDescrVersion = "ATLAS-R2-2016-01-00-01" from AtlasGeoModel import SetGeometryVersion from AtlasGeoModel import GeoModelInit diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx index 8b8ca26153aecdcd0beea8b81aaaab9eaac80257..9958ab7fba3c2087124b64c226c38912c2ef7883 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoDbTagSvc.cxx @@ -65,10 +65,6 @@ StatusCode GeoDbTagSvc::setupTags() ATH_MSG_FATAL("Failed to retrieve RDBAccessSvc"); return StatusCode::FAILURE; } - if(!rdbAccessSvc->connect()) { - ATH_MSG_ERROR("Unable to connect to the Geometry DB"); - return StatusCode::FAILURE; - } // Get subsystem tags m_InDetVersion = (m_InDetVersionOverride.empty() @@ -140,6 +136,5 @@ StatusCode GeoDbTagSvc::setupTags() } } - rdbAccessSvc->disconnect(); return StatusCode::SUCCESS; } diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx index 7d53dc0abb75f77faf8dfe35de12fa333d3796d3..bc505860934814bf23829a5dbb36491cb126069b 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/GeoModelSvc.cxx @@ -274,7 +274,14 @@ StatusCode GeoModelSvc::geoInit() } // Create a material manager - StoredMaterialManager *theMaterialManager = new RDBMaterialManager(m_pSvcLocator); + StoredMaterialManager *theMaterialManager{nullptr}; + try{ + theMaterialManager = new RDBMaterialManager(m_pSvcLocator); + } + catch(std::runtime_error& e) { + ATH_MSG_FATAL(e.what()); + return StatusCode::FAILURE; + } ATH_CHECK( m_detStore->record(theMaterialManager,"MATERIALS") ); // Setup the GeoDbTagSvc diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx index 9658bd1f856bb609b90e9c04acc1807401a5f868..9082962a454e794cac27b794d15d2fe6ee82ee4c 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.cxx @@ -20,9 +20,11 @@ #include "GaudiKernel/IMessageSvc.h" #include "GaudiKernel/ISvcLocator.h" #include "GaudiKernel/MsgStream.h" +#include "AthenaBaseComps/AthCheckMacros.h" #include <algorithm> #include <iostream> +#include <stdexcept> bool RDBMaterialManager::s_specialMaterials = false; @@ -130,221 +132,188 @@ int printFullMaterial ( GeoMaterial* &p_material) -RDBMaterialManager::RDBMaterialManager(ISvcLocator* pSvcLocator ) +RDBMaterialManager::RDBMaterialManager(ISvcLocator* pSvcLocator) +{ + if(!readMaterialsFromDB(pSvcLocator).isSuccess()) { + throw std::runtime_error("RDBMaterialManager failed to read Geometry DB"); + } +} + +StatusCode RDBMaterialManager::readMaterialsFromDB(ISvcLocator* pSvcLocator) { IGeoModelSvc* iGeoModel; IRDBAccessSvc* iAccessSvc; MsgStream log(Athena::getMessageSvc(), "GeoModelSvc::RDBMaterialManager"); - StatusCode sc = pSvcLocator->service("GeoModelSvc",iGeoModel); - if(sc.isFailure()) - log << MSG::ERROR << "Unable to access GeoModelSvc" << endmsg; - else - { - sc = pSvcLocator->service("RDBAccessSvc",iAccessSvc); - - if(sc.isSuccess()) - { - if(iAccessSvc->connect()) - { - // --- Standard materials, elements - DecodeVersionKey keyAtlas(iGeoModel, "ATLAS"); - m_elements = iAccessSvc->getRecordsetPtr("Elements",keyAtlas.tag(),keyAtlas.node()); - if(m_elements->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting Elements with default tag" <<endmsg; - m_elements = iAccessSvc->getRecordsetPtr("Elements","Materials-00","Materials"); - } - m_stdmatcomponents = iAccessSvc->getRecordsetPtr("StdMatComponents",keyAtlas.tag(),keyAtlas.node()); - if(m_stdmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting StdMatComponents with default tag" <<endmsg; - m_stdmatcomponents = iAccessSvc->getRecordsetPtr("StdMatComponents","Materials-00","Materials"); - } - m_stdmaterials = iAccessSvc->getRecordsetPtr("StdMaterials",keyAtlas.tag(),keyAtlas.node()); - if(m_stdmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting StdMaterials with default tag" <<endmsg; - m_stdmaterials = iAccessSvc->getRecordsetPtr("StdMaterials","Materials-00","Materials"); - } - - // --- Pixel materials - DecodeVersionKey keyPixel(iGeoModel, "Pixel"); - m_pixmatcomponents = iAccessSvc->getRecordsetPtr("PixMatComponents",keyPixel.tag(),keyPixel.node()); - if(m_pixmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting PixMatComponents with default tag" <<endmsg; - m_pixmatcomponents = iAccessSvc->getRecordsetPtr("PixMatComponents","PixMatComponents-00"); - } - m_pixmaterials = iAccessSvc->getRecordsetPtr("PixMaterials",keyPixel.tag(),keyPixel.node()); - if(m_pixmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting PixMaterials with default tag" <<endmsg; - m_pixmaterials = iAccessSvc->getRecordsetPtr("PixMaterials","PixMaterials-00"); - } - - // --- Pixel materials for TB - m_pixtbmatcomponents = iAccessSvc->getRecordsetPtr("PixelTBMatComponents",keyPixel.tag(),keyPixel.node()); - if(m_pixtbmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting PixTBMatComponents with default tag" <<endmsg; - m_pixtbmatcomponents = iAccessSvc->getRecordsetPtr("PixMatComponents","PixMatComponents-00"); - } - m_pixtbmaterials = iAccessSvc->getRecordsetPtr("PixelTBMaterials",keyPixel.tag(),keyPixel.node()); - if(m_pixtbmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting PixTBMaterials with default tag" <<endmsg; - m_pixtbmaterials = iAccessSvc->getRecordsetPtr("PixMaterials","PixMaterials-00"); - } - - // --- SCT materials - DecodeVersionKey keySCT(iGeoModel, "SCT"); - m_sctmatcomponents = iAccessSvc->getRecordsetPtr("SCTMatComponents",keySCT.tag(),keySCT.node()); - if(m_sctmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting SCTMatComponents with default tag" <<endmsg; - m_sctmatcomponents = iAccessSvc->getRecordsetPtr("SCTMatComponents","SCTMatComponents-00"); - } + ATH_CHECK(pSvcLocator->service("GeoModelSvc",iGeoModel)); + ATH_CHECK(pSvcLocator->service("RDBAccessSvc",iAccessSvc)); - m_sctmaterials = iAccessSvc->getRecordsetPtr("SCTMaterials",keySCT.tag(),keySCT.node()); - if(m_sctmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting SCTMaterials with default tag" <<endmsg; - m_sctmaterials = iAccessSvc->getRecordsetPtr("SCTMaterials","SCTMaterials-00"); - } - - // --- TRT materials - DecodeVersionKey keyTRT(iGeoModel, "TRT"); - m_trtmatcomponents = iAccessSvc->getRecordsetPtr("TrtMatComponents",keyTRT.tag(),keyTRT.node()); - if(m_trtmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting TrtMatComponents with default tag" <<endmsg; - m_trtmatcomponents = iAccessSvc->getRecordsetPtr("TrtMatComponents","TrtMatComponents-00"); - } - m_trtmaterials = iAccessSvc->getRecordsetPtr("TrtMaterials",keyTRT.tag(),keyTRT.node()); - if(m_trtmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting TrtMaterials with default tag" <<endmsg; - m_trtmaterials = iAccessSvc->getRecordsetPtr("TrtMaterials","TrtMaterials-00"); - } - - // --- InDet common materials - DecodeVersionKey keyInDet(iGeoModel, "InnerDetector"); - m_indetmatcomponents = iAccessSvc->getRecordsetPtr("InDetMatComponents",keyInDet.tag(),keyInDet.node()); - if(m_indetmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting InDetMatComponents with default tag" <<endmsg; - m_indetmatcomponents = iAccessSvc->getRecordsetPtr("InDetMatComponents","InDetMatComponents-00"); - } - - m_indetmaterials = iAccessSvc->getRecordsetPtr("InDetMaterials",keyInDet.tag(),keyInDet.node()); - if(m_indetmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting InDetMaterials with default tag" <<endmsg; - m_indetmaterials = iAccessSvc->getRecordsetPtr("InDetMaterials","InDetMaterials-00"); - } - - // --- LAr materials - DecodeVersionKey keyLAr(iGeoModel, "LAr"); - m_larmatcomponents = iAccessSvc->getRecordsetPtr("LArMatComponents",keyLAr.tag(),keyLAr.node()); - if(m_larmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting LArMatComponents with default tag" <<endmsg; - m_larmatcomponents = iAccessSvc->getRecordsetPtr("LArMatComponents","LArMatComponents-00"); - } - m_larmaterials = iAccessSvc->getRecordsetPtr("LArMaterials",keyLAr.tag(),keyLAr.node()); - if(m_larmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting LArMaterials with default tag" <<endmsg; - m_larmaterials = iAccessSvc->getRecordsetPtr("LArMaterials","LArMaterials-00"); - } - - // --- Tile materials - DecodeVersionKey keyTile(iGeoModel, "TileCal"); - m_tilematcomponents = iAccessSvc->getRecordsetPtr("TileMatComponents",keyTile.tag(),keyTile.node()); - if(m_tilematcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting TileMatComponents with default tag" <<endmsg; - m_tilematcomponents = iAccessSvc->getRecordsetPtr("TileMatComponents","TileMatComponents-00"); - } - m_tilematerials = iAccessSvc->getRecordsetPtr("TileMaterials",keyTile.tag(),keyTile.node()); - if(m_tilematerials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting TileMaterials with default tag" <<endmsg; - m_tilematerials = iAccessSvc->getRecordsetPtr("TileMaterials","TileMaterials-00"); - } - - // --- Muon - DecodeVersionKey keyMuon(iGeoModel, "MuonSpectrometer"); - m_muomatcomponents = iAccessSvc->getRecordsetPtr("MUOMatComponents",keyMuon.tag(),keyMuon.node()); - if(m_muomatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting MUOMatComponents with default tag" <<endmsg; - m_muomatcomponents = iAccessSvc->getRecordsetPtr("MUOMatComponents","MUOMatComponents-00"); - } - m_muomaterials = iAccessSvc->getRecordsetPtr("MUOMaterials",keyMuon.tag(),keyMuon.node()); - if(m_muomaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting MUOMaterials with default tag" <<endmsg; - m_muomaterials = iAccessSvc->getRecordsetPtr("MUOMaterials","MUOMaterials-00"); - } - m_shieldmatcomponents = iAccessSvc->getRecordsetPtr("ShieldMatComponents",keyMuon.tag(),keyMuon.node()); - if(m_shieldmatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting ShieldMatComponents with default tag" <<endmsg; - m_shieldmatcomponents = iAccessSvc->getRecordsetPtr("ShieldMatComponents","ShieldMatComponents-00"); - } - m_shieldmaterials = iAccessSvc->getRecordsetPtr("ShieldMaterials",keyMuon.tag(),keyMuon.node()); - if(m_shieldmaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting ShieldMaterials with default tag" <<endmsg; - m_shieldmaterials = iAccessSvc->getRecordsetPtr("ShieldMaterials","ShieldMaterials-00"); - } - m_toromatcomponents = iAccessSvc->getRecordsetPtr("ToroMatComponents",keyMuon.tag(),keyMuon.node()); - if(m_toromatcomponents->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting ToroMatComponents with default tag" <<endmsg; - m_toromatcomponents = iAccessSvc->getRecordsetPtr("ToroMatComponents","ToroMatComponents-00"); - } - m_toromaterials = iAccessSvc->getRecordsetPtr("ToroMaterials",keyMuon.tag(),keyMuon.node()); - if(m_toromaterials->size()==0) - { - if(log.level()<=MSG::DEBUG) - log << MSG::DEBUG << " Getting ToroMaterials with default tag" <<endmsg; - m_toromaterials = iAccessSvc->getRecordsetPtr("ToroMaterials","ToroMaterials-00"); - } - - iAccessSvc->disconnect(); - } - else - log << MSG::ERROR << "Unable to fetch data from the Geometry DB" << endmsg; - } - else - log << MSG::ERROR << "Unable to get RDBAccessSvc" << endmsg; + // --- Standard materials, elements + DecodeVersionKey keyAtlas(iGeoModel, "ATLAS"); + m_elements = iAccessSvc->getRecordsetPtr("Elements",keyAtlas.tag(),keyAtlas.node()); + if(m_elements->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting Elements with default tag" <<endmsg; + m_elements = iAccessSvc->getRecordsetPtr("Elements","Materials-00","Materials"); } - + m_stdmatcomponents = iAccessSvc->getRecordsetPtr("StdMatComponents",keyAtlas.tag(),keyAtlas.node()); + if(m_stdmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting StdMatComponents with default tag" <<endmsg; + m_stdmatcomponents = iAccessSvc->getRecordsetPtr("StdMatComponents","Materials-00","Materials"); + } + m_stdmaterials = iAccessSvc->getRecordsetPtr("StdMaterials",keyAtlas.tag(),keyAtlas.node()); + if(m_stdmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting StdMaterials with default tag" <<endmsg; + m_stdmaterials = iAccessSvc->getRecordsetPtr("StdMaterials","Materials-00","Materials"); + } + + // --- Pixel materials + DecodeVersionKey keyPixel(iGeoModel, "Pixel"); + m_pixmatcomponents = iAccessSvc->getRecordsetPtr("PixMatComponents",keyPixel.tag(),keyPixel.node()); + if(m_pixmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting PixMatComponents with default tag" <<endmsg; + m_pixmatcomponents = iAccessSvc->getRecordsetPtr("PixMatComponents","PixMatComponents-00"); + } + m_pixmaterials = iAccessSvc->getRecordsetPtr("PixMaterials",keyPixel.tag(),keyPixel.node()); + if(m_pixmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting PixMaterials with default tag" <<endmsg; + m_pixmaterials = iAccessSvc->getRecordsetPtr("PixMaterials","PixMaterials-00"); + } + + // --- Pixel materials for TB + m_pixtbmatcomponents = iAccessSvc->getRecordsetPtr("PixelTBMatComponents",keyPixel.tag(),keyPixel.node()); + if(m_pixtbmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting PixTBMatComponents with default tag" <<endmsg; + m_pixtbmatcomponents = iAccessSvc->getRecordsetPtr("PixMatComponents","PixMatComponents-00"); + } + m_pixtbmaterials = iAccessSvc->getRecordsetPtr("PixelTBMaterials",keyPixel.tag(),keyPixel.node()); + if(m_pixtbmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting PixTBMaterials with default tag" <<endmsg; + m_pixtbmaterials = iAccessSvc->getRecordsetPtr("PixMaterials","PixMaterials-00"); + } + + // --- SCT materials + DecodeVersionKey keySCT(iGeoModel, "SCT"); + m_sctmatcomponents = iAccessSvc->getRecordsetPtr("SCTMatComponents",keySCT.tag(),keySCT.node()); + if(m_sctmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting SCTMatComponents with default tag" <<endmsg; + m_sctmatcomponents = iAccessSvc->getRecordsetPtr("SCTMatComponents","SCTMatComponents-00"); + } + + m_sctmaterials = iAccessSvc->getRecordsetPtr("SCTMaterials",keySCT.tag(),keySCT.node()); + if(m_sctmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting SCTMaterials with default tag" <<endmsg; + m_sctmaterials = iAccessSvc->getRecordsetPtr("SCTMaterials","SCTMaterials-00"); + } + + // --- TRT materials + DecodeVersionKey keyTRT(iGeoModel, "TRT"); + m_trtmatcomponents = iAccessSvc->getRecordsetPtr("TrtMatComponents",keyTRT.tag(),keyTRT.node()); + if(m_trtmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting TrtMatComponents with default tag" <<endmsg; + m_trtmatcomponents = iAccessSvc->getRecordsetPtr("TrtMatComponents","TrtMatComponents-00"); + } + m_trtmaterials = iAccessSvc->getRecordsetPtr("TrtMaterials",keyTRT.tag(),keyTRT.node()); + if(m_trtmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting TrtMaterials with default tag" <<endmsg; + m_trtmaterials = iAccessSvc->getRecordsetPtr("TrtMaterials","TrtMaterials-00"); + } + + // --- InDet common materials + DecodeVersionKey keyInDet(iGeoModel, "InnerDetector"); + m_indetmatcomponents = iAccessSvc->getRecordsetPtr("InDetMatComponents",keyInDet.tag(),keyInDet.node()); + if(m_indetmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting InDetMatComponents with default tag" <<endmsg; + m_indetmatcomponents = iAccessSvc->getRecordsetPtr("InDetMatComponents","InDetMatComponents-00"); + } + + m_indetmaterials = iAccessSvc->getRecordsetPtr("InDetMaterials",keyInDet.tag(),keyInDet.node()); + if(m_indetmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting InDetMaterials with default tag" <<endmsg; + m_indetmaterials = iAccessSvc->getRecordsetPtr("InDetMaterials","InDetMaterials-00"); + } + + // --- LAr materials + DecodeVersionKey keyLAr(iGeoModel, "LAr"); + m_larmatcomponents = iAccessSvc->getRecordsetPtr("LArMatComponents",keyLAr.tag(),keyLAr.node()); + if(m_larmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting LArMatComponents with default tag" <<endmsg; + m_larmatcomponents = iAccessSvc->getRecordsetPtr("LArMatComponents","LArMatComponents-00"); + } + m_larmaterials = iAccessSvc->getRecordsetPtr("LArMaterials",keyLAr.tag(),keyLAr.node()); + if(m_larmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting LArMaterials with default tag" <<endmsg; + m_larmaterials = iAccessSvc->getRecordsetPtr("LArMaterials","LArMaterials-00"); + } + + // --- Tile materials + DecodeVersionKey keyTile(iGeoModel, "TileCal"); + m_tilematcomponents = iAccessSvc->getRecordsetPtr("TileMatComponents",keyTile.tag(),keyTile.node()); + if(m_tilematcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting TileMatComponents with default tag" <<endmsg; + m_tilematcomponents = iAccessSvc->getRecordsetPtr("TileMatComponents","TileMatComponents-00"); + } + m_tilematerials = iAccessSvc->getRecordsetPtr("TileMaterials",keyTile.tag(),keyTile.node()); + if(m_tilematerials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting TileMaterials with default tag" <<endmsg; + m_tilematerials = iAccessSvc->getRecordsetPtr("TileMaterials","TileMaterials-00"); + } + + // --- Muon + DecodeVersionKey keyMuon(iGeoModel, "MuonSpectrometer"); + m_muomatcomponents = iAccessSvc->getRecordsetPtr("MUOMatComponents",keyMuon.tag(),keyMuon.node()); + if(m_muomatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting MUOMatComponents with default tag" <<endmsg; + m_muomatcomponents = iAccessSvc->getRecordsetPtr("MUOMatComponents","MUOMatComponents-00"); + } + m_muomaterials = iAccessSvc->getRecordsetPtr("MUOMaterials",keyMuon.tag(),keyMuon.node()); + if(m_muomaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting MUOMaterials with default tag" <<endmsg; + m_muomaterials = iAccessSvc->getRecordsetPtr("MUOMaterials","MUOMaterials-00"); + } + m_shieldmatcomponents = iAccessSvc->getRecordsetPtr("ShieldMatComponents",keyMuon.tag(),keyMuon.node()); + if(m_shieldmatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting ShieldMatComponents with default tag" <<endmsg; + m_shieldmatcomponents = iAccessSvc->getRecordsetPtr("ShieldMatComponents","ShieldMatComponents-00"); + } + m_shieldmaterials = iAccessSvc->getRecordsetPtr("ShieldMaterials",keyMuon.tag(),keyMuon.node()); + if(m_shieldmaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting ShieldMaterials with default tag" <<endmsg; + m_shieldmaterials = iAccessSvc->getRecordsetPtr("ShieldMaterials","ShieldMaterials-00"); + } + m_toromatcomponents = iAccessSvc->getRecordsetPtr("ToroMatComponents",keyMuon.tag(),keyMuon.node()); + if(m_toromatcomponents->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting ToroMatComponents with default tag" <<endmsg; + m_toromatcomponents = iAccessSvc->getRecordsetPtr("ToroMatComponents","ToroMatComponents-00"); + } + m_toromaterials = iAccessSvc->getRecordsetPtr("ToroMaterials",keyMuon.tag(),keyMuon.node()); + if(m_toromaterials->size()==0) { + if(log.level()<=MSG::WARNING) + log << MSG::WARNING << " Getting ToroMaterials with default tag" <<endmsg; + m_toromaterials = iAccessSvc->getRecordsetPtr("ToroMaterials","ToroMaterials-00"); + } + return StatusCode::SUCCESS; } // Destructor: diff --git a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.h b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.h index 9db41b4db66fedec1df764a31b55fac462d0b73b..1e0e4d72127c6362d8824e5e423ea24ed9cd7ef7 100755 --- a/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.h +++ b/DetectorDescription/GeoModel/GeoModelSvc/src/RDBMaterialManager.h @@ -61,6 +61,9 @@ class RDBMaterialManager: public StoredMaterialManager { private: static bool s_specialMaterials; + + StatusCode readMaterialsFromDB(ISvcLocator* pSvcLocator); + void buildSpecialMaterials(); void buildSpecialMaterials() const; diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.cxx index d693d20aff0c3beb96ae605649b0f4fbe584644d..009b8bde83a6aa1104223db4f2e003cb3d824baa 100644 --- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.cxx +++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.cxx @@ -15,12 +15,10 @@ RDBParamReader::RDBParamReader(IRDBAccessSvc* rdbAccess) : m_rdbAccess(rdbAccess) { - acquire(); } RDBParamReader::~RDBParamReader() { - release(); } RDBParamRecords RDBParamReader::data(const std::string& node, const std::string& tag, const std::string& tag2node) { @@ -32,12 +30,3 @@ IRDBRecordset_ptr RDBParamReader::_getRecordsetPtr(const std::string& node, con return m_rdbAccess->getRecordsetPtr(node, tag, tag2node); } -void RDBParamReader::acquire() { - if (!m_rdbAccess->connect()) - std::cout << "ERROR: RDBParamReader: cannot connect.\n"; -} - -void RDBParamReader::release() { - m_rdbAccess->disconnect(); -} - diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.h b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.h index b6ebf5833387a67f0b57397592d7d42c6e9e1f0e..a3ca69b46198ee7fd3a73c38f143328d90628875 100644 --- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.h +++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamReader.h @@ -24,9 +24,6 @@ class RDBParamReader { RDBParamRecords data(const std::string& node, const std::string& tag, const std::string& tag2node=""); // for internal use only IRDBRecordset_ptr _getRecordsetPtr(const std::string& node, const std::string& tag, const std::string& tag2node=""); - void acquire(); - void release(); - private: IRDBAccessSvc* m_rdbAccess; }; diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamRecords.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamRecords.cxx index c0b5230b3294c54ebd6be8f21d85681402a58439..e2595d05bee38a7574d3977cede04fad13072a2b 100644 --- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamRecords.cxx +++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/RDBParamRecords.cxx @@ -15,19 +15,16 @@ RDBParamRecords::RDBParamRecords(RDBParamReader* rdbParAcc, IRDBRecordset_ptr in m_rdbParAcc(rdbParAcc), m_RecSet(initRecSet) { - m_rdbParAcc->acquire(); } RDBParamRecords::RDBParamRecords(const RDBParamRecords& other) : m_rdbParAcc (other.m_rdbParAcc), m_RecSet (other.m_RecSet) { - m_rdbParAcc->acquire(); } RDBParamRecords::~RDBParamRecords() { - m_rdbParAcc->release(); } RDBParamRecords::self_t & RDBParamRecords::fallback_to(const std::string& node, const std::string& tag, const std::string& tag2node) { diff --git a/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx b/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx index 8c47b2b2c67c337a72f271cf08c0dd2c49532d54..d21483e337f6ce8e923784129bf52db7d629a186 100755 --- a/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx +++ b/DetectorDescription/IdDictDetDescrCnv/src/IdDictDetDescrCnv.cxx @@ -802,194 +802,183 @@ IdDictDetDescrCnv::getFileNamesFromTags() // inDetCustom = true; //} else { - // Must be sure a connection is open - if(rdbAccessSvc->connect()) { - // Get InDet - DecodeVersionKey detectorKey(geoModelSvc, "InnerDetector"); - log << MSG::DEBUG << "From Version Tag: " - << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; - IRDBRecordset_ptr idDictSet = rdbAccessSvc->getRecordsetPtr("InDetIdentifier", - detectorKey.tag(), - detectorKey.node()); - std::string dictName; - const IRDBRecord* idDictTable = 0; - // Size == 0 if not found - if (idDictSet->size()) { - idDictTable = (*idDictSet)[0]; - dictName = idDictTable->getString("DICT_NAME"); - m_inDetIDFileName = idDictTable->getString("DICT_FILENAME"); - // NOTE: the internal tag for IdDict is global, but is - // only used for InDet and thus is defined by InDet - if(!idDictTable->isFieldNull("DICT_TAG")) { - m_inDetIDTag = idDictTable->getString("DICT_TAG"); - } - m_inDetIdDictTag = idDictSet->tagName(); - log << MSG::DEBUG << " using dictionary: " << dictName - << ", file: " << m_inDetIDFileName - << ", with internal tag: " << m_inDetIDTag - << ", dictionary tag: " << m_inDetIdDictTag - << endmsg; - } - else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; - - // Get LAr - detectorKey = DecodeVersionKey(geoModelSvc, "LAr"); - log << MSG::DEBUG << "From Version Tag: " - << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; - idDictSet = rdbAccessSvc->getRecordsetPtr("LArIdentifier", - detectorKey.tag(), - detectorKey.node()); - // Size == 0 if not found - if (idDictSet->size()) { - idDictTable = (*idDictSet)[0]; - dictName = idDictTable->getString("DICT_NAME"); - m_larIDFileName = idDictTable->getString("DICT_FILENAME"); - m_larIdDictTag = idDictSet->tagName(); - log << MSG::DEBUG << " using Dictionary: " << dictName - << ", file: " << m_larIDFileName - << ", dictionary tag: " << m_larIdDictTag - << endmsg; - } - else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; - - - // Get Tile - detectorKey = DecodeVersionKey(geoModelSvc, "TileCal"); - log << MSG::DEBUG << "From Version Tag: " - << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; - idDictSet = rdbAccessSvc->getRecordsetPtr("TileIdentifier", - detectorKey.tag(), - detectorKey.node()); - // Size == 0 if not found - if (idDictSet->size()) { - idDictTable = (*idDictSet)[0]; - dictName = idDictTable->getString("DICT_NAME"); - m_tileIDFileName = idDictTable->getString("DICT_FILENAME"); - m_tileIdDictTag = idDictSet->tagName(); - log << MSG::DEBUG << " using Dictionary: " << dictName - << ", file: " << m_tileIDFileName - << ", dictionary tag: " << m_tileIdDictTag - << endmsg; - } - else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; - - // Get Calo - detectorKey = DecodeVersionKey(geoModelSvc, "Calorimeter"); - log << MSG::DEBUG << "From Version Tag: " << detectorKey.tag() - << " at Node: " << detectorKey.node() << endmsg; - idDictSet = rdbAccessSvc->getRecordsetPtr("CaloIdentifier", - detectorKey.tag(), - detectorKey.node()); - // Size == 0 if not found - if (idDictSet->size()) { - idDictTable = (*idDictSet)[0]; - dictName = idDictTable->getString("DICT_NAME"); - m_caloIDFileName = idDictTable->getString("DICT_FILENAME"); - m_caloIdDictTag = idDictSet->tagName(); - log << MSG::DEBUG << " using Dictionary: " << dictName - << ", file: " << m_caloIDFileName - << ", dictionary tag: " << m_caloIdDictTag - << endmsg; - } - else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; - - // Calo neighbor files: - IRDBRecordset_ptr caloNeighborTable = rdbAccessSvc->getRecordsetPtr("CaloNeighborTable", - detectorKey.tag(), - detectorKey.node()); - if (caloNeighborTable->size()==0) { - caloNeighborTable = rdbAccessSvc->getRecordsetPtr("CaloNeighborTable","CaloNeighborTable-00"); - } - // Size == 0 if not found - if (caloNeighborTable->size()) { - const IRDBRecord* neighborTable = (*caloNeighborTable)[0]; - m_fullAtlasNeighborsName = neighborTable->getString("FULLATLASNEIGHBORS"); - m_fcal2dNeighborsName = neighborTable->getString("FCAL2DNEIGHBORS"); - m_fcal3dNeighborsNextName = neighborTable->getString("FCAL3DNEIGHBORSNEXT"); - m_fcal3dNeighborsPrevName = neighborTable->getString("FCAL3DNEIGHBORSPREV"); - m_tileNeighborsName = neighborTable->getString("TILENEIGHBORS"); - log << MSG::DEBUG << " using neighbor files: " << endmsg; - log << MSG::DEBUG << " FullAtlasNeighborsFileName: " << m_fullAtlasNeighborsName - << endmsg; - log << MSG::DEBUG << " FCAL2DNeighborsFileName: " << m_fcal2dNeighborsName - << endmsg; - log << MSG::DEBUG << " FCAL3DNeighborsNextFileName: " << m_fcal3dNeighborsNextName - << endmsg; - log << MSG::DEBUG << " FCAL3DNeighborsPrevFileName: " << m_fcal3dNeighborsPrevName - << endmsg; - log << MSG::DEBUG << " TileNeighborsFileName: " << m_tileNeighborsName - << endmsg; - } - else log << MSG::ERROR << " no record set found neighbor file " << endmsg; - - - - // Get Muon - detectorKey = DecodeVersionKey(geoModelSvc, "MuonSpectrometer"); - log << MSG::DEBUG << "From Version Tag: " - << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; - idDictSet = rdbAccessSvc->getRecordsetPtr("MuonIdentifier", - detectorKey.tag(), - detectorKey.node()); - // Size == 0 if not found - if (idDictSet->size()) { - idDictTable = (*idDictSet)[0]; - dictName = idDictTable->getString("DICT_NAME"); - m_muonIDFileName = idDictTable->getString("DICT_FILENAME"); - m_muonIdDictTag = idDictSet->tagName(); - log << MSG::DEBUG << " using Dictionary: " << dictName - << ", file: " << m_muonIDFileName - << ", dictionary tag: " << m_muonIdDictTag - << endmsg; - if (m_muonIDFileName == "") { - log << MSG::ERROR << "MuonIDFileName CANNOT be empty " << endmsg; - return StatusCode::FAILURE; - } - else if (m_muonIDFileName == "IdDictMuonSpectrometer.xml") { - log << MSG::ERROR << "MuonIDFileName must NOT be IdDictMuonSpectrometer.xml " - << endmsg; - return StatusCode::FAILURE; - } - - } - else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; - - // Get Forward - detectorKey = DecodeVersionKey(geoModelSvc, "ForwardDetectors"); - log << MSG::DEBUG << "From Version Tag: " << detectorKey.tag() - << " at Node: " << detectorKey.node() << endmsg; - idDictSet = rdbAccessSvc->getRecordsetPtr("ForDetIdentifier", - detectorKey.tag(), - detectorKey.node()); - // For older datasets use ForDetIdentifier-00 as fallback - if (0 == idDictSet->size()) { - idDictSet = rdbAccessSvc->getRecordsetPtr("ForDetIdentifier", - "ForDetIdentifier-00"); - log << MSG::DEBUG << " explicitly requesting ForDetIdentifier-00 tag for pre-forward detector data " - << endmsg; - } - // Size == 0 if not found - if (idDictSet->size()) { - idDictTable = (*idDictSet)[0]; - dictName = idDictTable->getString("DICT_NAME"); - m_forwardIDFileName = idDictTable->getString("DICT_FILENAME"); - m_forwardIdDictTag = idDictSet->tagName(); - log << MSG::DEBUG << " using Dictionary: " << dictName - << ", file: " << m_forwardIDFileName - << ", dictionary tag: " << m_forwardIdDictTag - << endmsg; - } - else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; + // Get InDet + DecodeVersionKey detectorKey(geoModelSvc, "InnerDetector"); + log << MSG::DEBUG << "From Version Tag: " + << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; + IRDBRecordset_ptr idDictSet = rdbAccessSvc->getRecordsetPtr("InDetIdentifier", + detectorKey.tag(), + detectorKey.node()); + std::string dictName; + const IRDBRecord* idDictTable = 0; + // Size == 0 if not found + if (idDictSet->size()) { + idDictTable = (*idDictSet)[0]; + dictName = idDictTable->getString("DICT_NAME"); + m_inDetIDFileName = idDictTable->getString("DICT_FILENAME"); + // NOTE: the internal tag for IdDict is global, but is + // only used for InDet and thus is defined by InDet + if(!idDictTable->isFieldNull("DICT_TAG")) { + m_inDetIDTag = idDictTable->getString("DICT_TAG"); + } + m_inDetIdDictTag = idDictSet->tagName(); + log << MSG::DEBUG << " using dictionary: " << dictName + << ", file: " << m_inDetIDFileName + << ", with internal tag: " << m_inDetIDTag + << ", dictionary tag: " << m_inDetIdDictTag + << endmsg; + } + else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; + + // Get LAr + detectorKey = DecodeVersionKey(geoModelSvc, "LAr"); + log << MSG::DEBUG << "From Version Tag: " + << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; + idDictSet = rdbAccessSvc->getRecordsetPtr("LArIdentifier", + detectorKey.tag(), + detectorKey.node()); + // Size == 0 if not found + if (idDictSet->size()) { + idDictTable = (*idDictSet)[0]; + dictName = idDictTable->getString("DICT_NAME"); + m_larIDFileName = idDictTable->getString("DICT_FILENAME"); + m_larIdDictTag = idDictSet->tagName(); + log << MSG::DEBUG << " using Dictionary: " << dictName + << ", file: " << m_larIDFileName + << ", dictionary tag: " << m_larIdDictTag + << endmsg; + } + else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; + + + // Get Tile + detectorKey = DecodeVersionKey(geoModelSvc, "TileCal"); + log << MSG::DEBUG << "From Version Tag: " + << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; + idDictSet = rdbAccessSvc->getRecordsetPtr("TileIdentifier", + detectorKey.tag(), + detectorKey.node()); + // Size == 0 if not found + if (idDictSet->size()) { + idDictTable = (*idDictSet)[0]; + dictName = idDictTable->getString("DICT_NAME"); + m_tileIDFileName = idDictTable->getString("DICT_FILENAME"); + m_tileIdDictTag = idDictSet->tagName(); + log << MSG::DEBUG << " using Dictionary: " << dictName + << ", file: " << m_tileIDFileName + << ", dictionary tag: " << m_tileIdDictTag + << endmsg; + } + else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; + + // Get Calo + detectorKey = DecodeVersionKey(geoModelSvc, "Calorimeter"); + log << MSG::DEBUG << "From Version Tag: " << detectorKey.tag() + << " at Node: " << detectorKey.node() << endmsg; + idDictSet = rdbAccessSvc->getRecordsetPtr("CaloIdentifier", + detectorKey.tag(), + detectorKey.node()); + // Size == 0 if not found + if (idDictSet->size()) { + idDictTable = (*idDictSet)[0]; + dictName = idDictTable->getString("DICT_NAME"); + m_caloIDFileName = idDictTable->getString("DICT_FILENAME"); + m_caloIdDictTag = idDictSet->tagName(); + log << MSG::DEBUG << " using Dictionary: " << dictName + << ", file: " << m_caloIDFileName + << ", dictionary tag: " << m_caloIdDictTag + << endmsg; + } + else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; + + // Calo neighbor files: + IRDBRecordset_ptr caloNeighborTable = rdbAccessSvc->getRecordsetPtr("CaloNeighborTable", + detectorKey.tag(), + detectorKey.node()); + if (caloNeighborTable->size()==0) { + caloNeighborTable = rdbAccessSvc->getRecordsetPtr("CaloNeighborTable","CaloNeighborTable-00"); + } + // Size == 0 if not found + if (caloNeighborTable->size()) { + const IRDBRecord* neighborTable = (*caloNeighborTable)[0]; + m_fullAtlasNeighborsName = neighborTable->getString("FULLATLASNEIGHBORS"); + m_fcal2dNeighborsName = neighborTable->getString("FCAL2DNEIGHBORS"); + m_fcal3dNeighborsNextName = neighborTable->getString("FCAL3DNEIGHBORSNEXT"); + m_fcal3dNeighborsPrevName = neighborTable->getString("FCAL3DNEIGHBORSPREV"); + m_tileNeighborsName = neighborTable->getString("TILENEIGHBORS"); + log << MSG::DEBUG << " using neighbor files: " << endmsg; + log << MSG::DEBUG << " FullAtlasNeighborsFileName: " << m_fullAtlasNeighborsName + << endmsg; + log << MSG::DEBUG << " FCAL2DNeighborsFileName: " << m_fcal2dNeighborsName + << endmsg; + log << MSG::DEBUG << " FCAL3DNeighborsNextFileName: " << m_fcal3dNeighborsNextName + << endmsg; + log << MSG::DEBUG << " FCAL3DNeighborsPrevFileName: " << m_fcal3dNeighborsPrevName + << endmsg; + log << MSG::DEBUG << " TileNeighborsFileName: " << m_tileNeighborsName + << endmsg; + } + else log << MSG::ERROR << " no record set found neighbor file " << endmsg; + + + + // Get Muon + detectorKey = DecodeVersionKey(geoModelSvc, "MuonSpectrometer"); + log << MSG::DEBUG << "From Version Tag: " + << detectorKey.tag() << " at Node: " << detectorKey.node() << endmsg; + idDictSet = rdbAccessSvc->getRecordsetPtr("MuonIdentifier", + detectorKey.tag(), + detectorKey.node()); + // Size == 0 if not found + if (idDictSet->size()) { + idDictTable = (*idDictSet)[0]; + dictName = idDictTable->getString("DICT_NAME"); + m_muonIDFileName = idDictTable->getString("DICT_FILENAME"); + m_muonIdDictTag = idDictSet->tagName(); + log << MSG::DEBUG << " using Dictionary: " << dictName + << ", file: " << m_muonIDFileName + << ", dictionary tag: " << m_muonIdDictTag + << endmsg; + if (m_muonIDFileName == "") { + log << MSG::ERROR << "MuonIDFileName CANNOT be empty " << endmsg; + return StatusCode::FAILURE; + } + else if (m_muonIDFileName == "IdDictMuonSpectrometer.xml") { + log << MSG::ERROR << "MuonIDFileName must NOT be IdDictMuonSpectrometer.xml " + << endmsg; + return StatusCode::FAILURE; + } + + } + else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; + + // Get Forward + detectorKey = DecodeVersionKey(geoModelSvc, "ForwardDetectors"); + log << MSG::DEBUG << "From Version Tag: " << detectorKey.tag() + << " at Node: " << detectorKey.node() << endmsg; + idDictSet = rdbAccessSvc->getRecordsetPtr("ForDetIdentifier", + detectorKey.tag(), + detectorKey.node()); + // For older datasets use ForDetIdentifier-00 as fallback + if (0 == idDictSet->size()) { + idDictSet = rdbAccessSvc->getRecordsetPtr("ForDetIdentifier", + "ForDetIdentifier-00"); + log << MSG::DEBUG << " explicitly requesting ForDetIdentifier-00 tag for pre-forward detector data " + << endmsg; + } + // Size == 0 if not found + if (idDictSet->size()) { + idDictTable = (*idDictSet)[0]; + dictName = idDictTable->getString("DICT_NAME"); + m_forwardIDFileName = idDictTable->getString("DICT_FILENAME"); + m_forwardIdDictTag = idDictSet->tagName(); + log << MSG::DEBUG << " using Dictionary: " << dictName + << ", file: " << m_forwardIDFileName + << ", dictionary tag: " << m_forwardIdDictTag + << endmsg; + } + else log << MSG::WARNING << " no record set found - using default dictionary " << endmsg; - // Close request for this connection - rdbAccessSvc->disconnect(); - } - else { - log << MSG::ERROR - << "unable to get connect to database for to get Identifier records" - << endmsg; - return (StatusCode::FAILURE); - } log << MSG::DEBUG << "End access to RDB for id dictionary info " << endmsg; diff --git a/ForwardDetectors/ALFA/ALFA_Geometry/src/ALFA_RDBAccess.cxx b/ForwardDetectors/ALFA/ALFA_Geometry/src/ALFA_RDBAccess.cxx index 1ec607ace03a042161d21f5b43f67174844dc8a8..861a0eb0de9a323dcef7b9bd1342a14bf28f19ec 100644 --- a/ForwardDetectors/ALFA/ALFA_Geometry/src/ALFA_RDBAccess.cxx +++ b/ForwardDetectors/ALFA/ALFA_Geometry/src/ALFA_RDBAccess.cxx @@ -43,13 +43,9 @@ bool ALFA_RDBAccess::ReadGeometry(const eRPotName eRPName, eFiberType eFType, st throw GaudiException(" Could not initalize GeoModelSvc ", "ALFA_RDBAccess::ReadGeometry", StatusCode::FAILURE); }*/ - iAccessSvc->connect(); - bRes=ReadFiberGeometry(iAccessSvc, element, tag, node); // bRes|=ReadFiberGeometry("ALFAFibreUp","ALFA-00","ALFA"); - iAccessSvc->disconnect(); - return bRes; } diff --git a/ForwardDetectors/LUCID/LUCID_GeoModel/cmt/requirements b/ForwardDetectors/LUCID/LUCID_GeoModel/cmt/requirements deleted file mode 100755 index 575b7509c8b2c46a9eca557181bf66a7c91ddf93..0000000000000000000000000000000000000000 --- a/ForwardDetectors/LUCID/LUCID_GeoModel/cmt/requirements +++ /dev/null @@ -1,21 +0,0 @@ -package LUCID_GeoModel - -use AtlasPolicy AtlasPolicy-* -use GaudiInterface GaudiInterface-* External -use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel -use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel -use CLIDSvc CLIDSvc-* Control -use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel - -####include_dirs "$(LUCID_GeoModel_root)/LUCID_GeoModel" - -apply_pattern dual_use_library files=*.cxx - -private -use AthenaKernel AthenaKernel-* Control -use AtlasCLHEP AtlasCLHEP-* External -use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL -use StoreGate StoreGate-* Control -use CLIDSvc CLIDSvc-* Control -use SGTools SGTools-* Control -use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel \ No newline at end of file diff --git a/ForwardDetectors/LUCID/LUCID_GeoModel/src/LUCID_RDBAaccess.cxx b/ForwardDetectors/LUCID/LUCID_GeoModel/src/LUCID_RDBAaccess.cxx index 92916203a4380314beaddce139c5f98f48bd6d18..39e8269351228ace4a9ba8dfb0d0778d6156474d 100755 --- a/ForwardDetectors/LUCID/LUCID_GeoModel/src/LUCID_RDBAaccess.cxx +++ b/ForwardDetectors/LUCID/LUCID_GeoModel/src/LUCID_RDBAaccess.cxx @@ -51,13 +51,9 @@ void LUCID_RDBAccess::ReadDB() { DecodeVersionKey atlasVersion("ATLAS"); std::string AtlasVersion = atlasVersion.tag(); - iAccessSvc->connect(); - lucidParams = iAccessSvc->getRecordsetPtr("LucidParams", AtlasVersion, "ATLAS"); if (!lucidParams->size()) std::cerr << " ERROR: Unable to retrieve LucidParams data "<< std::endl; - - iAccessSvc->disconnect(); log << MSG::INFO << " LUCID data corresponding to " << AtlasVersion << " fetched " << endmsg; } diff --git a/InnerDetector/InDetAlignment/InDetAlignGeomTools/src/PixelGeometryManagerTool.cxx b/InnerDetector/InDetAlignment/InDetAlignGeomTools/src/PixelGeometryManagerTool.cxx index c654ca07ac8b0748ffc7f6a2c47b8259fa77fa2c..da8aeb0d1fd8fb4fbca9c629d69d81d2d94489ff 100644 --- a/InnerDetector/InDetAlignment/InDetAlignGeomTools/src/PixelGeometryManagerTool.cxx +++ b/InnerDetector/InDetAlignment/InDetAlignGeomTools/src/PixelGeometryManagerTool.cxx @@ -171,12 +171,6 @@ namespace InDet { } else ATH_MSG_INFO("retrieved RDBAccessSvc"); - if(!m_rdbAccessSvc->connect()) { - msg(MSG::FATAL) << "Unable to connect to the Geometry DB" << endmsg; - return StatusCode::FAILURE; - } - else ATH_MSG_INFO("connection to geometry DB successfull"); - // dump module selection if(m_doModuleSelection && msgLvl(MSG::INFO)) { msg(MSG::INFO)<<"Creating geometry for selected "<<m_moduleSelection.size()<<" modules:"<<endmsg; diff --git a/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelSiliconConditionsSvc.cxx b/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelSiliconConditionsSvc.cxx index 72e6d5bb995dac5b0d95a74e352a9a6f02292712..8b0e89b34523f781290b78659ccf5aaadfa45a7b 100644 --- a/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelSiliconConditionsSvc.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelSiliconConditionsSvc.cxx @@ -217,8 +217,6 @@ PixelSiliconConditionsSvc::setConditionsFromGeoModel() return false; } - m_rdbSvc->connect(); - DecodeVersionKey versionKey(&*m_geoModelSvc, "Pixel"); msg(MSG::DEBUG) << "Checking GeoModel Version Tag: "<< versionKey.tag() << " at Node: " << versionKey.node() << endmsg; @@ -251,8 +249,6 @@ PixelSiliconConditionsSvc::setConditionsFromGeoModel() msg(MSG::INFO) << "Default conditions not provided by GeoModel." << endmsg; } - m_rdbSvc->disconnect(); - return (!useCondDB && conditionsPresent); diff --git a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_SiliconConditionsSvc.cxx b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_SiliconConditionsSvc.cxx index 6fc91b0b6f13d3ed6ad46496301367fa8fe31ed1..8410ee16fddde969f0611f9cf4fe9e923d7a3838 100644 --- a/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_SiliconConditionsSvc.cxx +++ b/InnerDetector/InDetConditions/SCT_ConditionsServices/src/SCT_SiliconConditionsSvc.cxx @@ -188,7 +188,6 @@ SCT_SiliconConditionsSvc::setConditionsFromGeoModel() msg(MSG::ERROR) << "Could not locate GeoModelSvc" << endmsg; return false; } - m_rdbSvc->connect(); DecodeVersionKey versionKey(&*m_geoModelSvc, "SCT"); ATH_MSG_DEBUG( "Checking GeoModel Version Tag: "<< versionKey.tag() << " at Node: " << versionKey.node() ); @@ -214,8 +213,6 @@ SCT_SiliconConditionsSvc::setConditionsFromGeoModel() conditionsPresent = true; } - m_rdbSvc->disconnect(); - return (!useCondDB && conditionsPresent); } diff --git a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawNeighbourSvc.cxx b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawNeighbourSvc.cxx index 91695799943d8be51ed9553cdaec97f9e9adc9b2..13b3bfeb9e654be732c656b15392e3491961cff2 100755 --- a/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawNeighbourSvc.cxx +++ b/InnerDetector/InDetConditions/TRT_ConditionsServices/src/TRT_StrawNeighbourSvc.cxx @@ -110,8 +110,6 @@ StatusCode TRT_StrawNeighbourSvc::initialize() throw GaudiException("Could not initalize RDBAccessSvc","TRT_GeoModel",StatusCode::FAILURE); } - iAccessSvc->connect(); - IGeoModelSvc *geoModel; result = svcLocator->service ("GeoModelSvc",geoModel); if ( result.isFailure()) { @@ -276,7 +274,6 @@ StatusCode TRT_StrawNeighbourSvc::initialize() m_pad_to_straw.push_back(dummy3); m_chip_to_straw.push_back(dumdumdum3); - iAccessSvc->disconnect(); ATH_MSG_DEBUG("TRT_StrawNeighbourSvc initialized "); diff --git a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx index 2e10d7f0779344c336eeb0b9d4ab60876e1eace9..ccd6e14fa5e024f319c338e9b1c3c92c44945015 100755 --- a/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx +++ b/InnerDetector/InDetDetDescr/BCM_GeoModel/src/BCM_Builder.cxx @@ -146,10 +146,8 @@ StatusCode InDetDD::BCM_Builder::build(GeoVPhysVol* pv) return StatusCode::SUCCESS; } - accessSvc->connect(); IRDBRecordset_ptr DBmodul = accessSvc->getRecordsetPtr("BCMModule", versionKey.tag(), versionKey.node()); //DBmodul = accessSvc->getRecordset("BCMModule", "InnerDetector-DC3-Dev", "InnerDetector"); - accessSvc->disconnect(); ATH_MSG_DEBUG(" --> Number of records fetched = " << DBmodul->size()); diff --git a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx index 046ed50123bdd1e6b1a74238053392896693cfe1..d4367ff6edd3f4819bf08fd7dbc39162b04c0b5f 100644 --- a/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx +++ b/InnerDetector/InDetDetDescr/BLM_GeoModel/src/BLM_Builder.cxx @@ -154,10 +154,8 @@ StatusCode InDetDD::BLM_Builder::build(GeoVPhysVol* pv) return StatusCode::SUCCESS; } - accessSvc->connect(); IRDBRecordset_ptr DBmodul = accessSvc->getRecordsetPtr("BLMModule", versionKey.tag(), versionKey.node()); //DBmodul = accessSvc->getRecordset("BLMModule", "InnerDetector-DC3-Dev", "InnerDetector"); - accessSvc->disconnect(); ATH_MSG_DEBUG(" --> Number of records fetched = " << DBmodul->size()); diff --git a/InnerDetector/InDetDetDescr/PixelGeoModel/src/IBLParameterSvc.cxx b/InnerDetector/InDetDetDescr/PixelGeoModel/src/IBLParameterSvc.cxx index a70cc753051655c2a53e8ccfc82a9aab0ec8651d..52b83eb7919492561ef50e2b51467a46e14b1c0c 100644 --- a/InnerDetector/InDetDetDescr/PixelGeoModel/src/IBLParameterSvc.cxx +++ b/InnerDetector/InDetDetDescr/PixelGeoModel/src/IBLParameterSvc.cxx @@ -92,7 +92,6 @@ StatusCode IBLParameterSvc::setIblParameters() { msg(MSG::FATAL) << "Could not locate RDBAccessSvc" << endmsg; return (StatusCode::FAILURE); } - m_rdbAccessSvc->connect(); IRDBRecordset_ptr switchSet = m_rdbAccessSvc->getRecordsetPtr("PixelSwitches", versionKey.tag(), versionKey.node()); const IRDBRecord *switchTable = (*switchSet)[0]; std::string versionName(""); @@ -129,7 +128,6 @@ StatusCode IBLParameterSvc::setIblParameters() { for (int i =0; i < 4; i++) m_LayerFEsPerHalfModule.push_back(m_LayerFEsPerHalfModule_3d); } } - m_rdbAccessSvc->disconnect(); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArDetDescr/cmt/requirements b/LArCalorimeter/LArDetDescr/cmt/requirements deleted file mode 100755 index 26a18a75f86cb62d0cece556b79d0147b5c791da..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArDetDescr/cmt/requirements +++ /dev/null @@ -1,37 +0,0 @@ - - -package LArDetDescr - -author Claire Bourdarios <claire.bourdarios@cern.ch> - -use AtlasPolicy AtlasPolicy-* -use Identifier Identifier-* DetectorDescription - -use CaloDetDescr CaloDetDescr-* Calorimeter -use CaloGeoHelpers CaloGeoHelpers-* Calorimeter -use GaudiInterface GaudiInterface-* External - -use CLIDSvc CLIDSvc-* Control -use AthenaBaseComps AthenaBaseComps-* Control - -use LArReadoutGeometry LArReadoutGeometry-* LArCalorimeter/LArGeoModel -use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel - -public - -branches LArDetDescr src - -apply_pattern declare_joboptions files=" *.py" - -library LArDetDescr *.cxx -s=components *.cxx -apply_pattern component_library - -private -use StoreGate StoreGate-* Control -use AtlasCLHEP AtlasCLHEP-* External - -use CaloIdentifier CaloIdentifier-* Calorimeter -use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel -use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel -use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL -use GeoPrimitives GeoPrimitives-* DetectorDescription diff --git a/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx b/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx index 7985b37f321ca95833730747208e0520dc6b3d7d..62aea79b58c851c2eb1aa60d87f453368a35ef7e 100755 --- a/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx +++ b/LArCalorimeter/LArDetDescr/src/LArNumberHelper.cxx @@ -107,8 +107,6 @@ LArNumberHelper::LArNumberHelper(const std::string geometry) : { log <<MSG::INFO <<" did access RDBAccessSvc " <<endmsg; - m_iAccessSvc->connect(); - prepare_arrays(); db_nb_em(); @@ -131,8 +129,6 @@ LArNumberHelper::LArNumberHelper(const std::string geometry) : else log << MSG::ERROR << "Unable to get LArCellVolumes" << endmsg; - m_iAccessSvc->disconnect(); - } // now use all the info to finish up : @@ -1124,8 +1120,6 @@ LArNumberHelper::sagging_param( std::vector<double>& Rhocen, std::vector<double> Rhocen.clear(); Sag.clear(); - m_iAccessSvc->connect(); - m_lar = m_iAccessSvc->getRecordsetPtr("BarrelGeometry",m_tag,m_node); if (m_lar->size()) { @@ -1171,8 +1165,6 @@ LArNumberHelper::sagging_param( std::vector<double>& Rhocen, std::vector<double> } - m_iAccessSvc->disconnect(); - } Identifier diff --git a/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx b/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx index 9afa81be63b420563c2fa71053665082f75f35be..ce923217f655b86f7aff3a6086daabf3dcfdeba3 100755 --- a/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx +++ b/LArCalorimeter/LArDetDescr/src/LArRecoSimpleGeomTool.cxx @@ -90,8 +90,6 @@ LArRecoSimpleGeomTool::initialize() else ATH_MSG_INFO (" did access RDBAccessSvc "); - m_iAccessSvc->connect(); - m_recCryoCyl = m_iAccessSvc->getRecordsetPtr("CryoCylinders",m_tag,m_node); if (m_recCryoCyl->size()==0) m_recCryoCyl = m_iAccessSvc->getRecordsetPtr("CryoCylinders","CryoCylinders-00"); @@ -118,8 +116,6 @@ LArRecoSimpleGeomTool::initialize() if (m_HEC->size()==0) m_HEC = m_iAccessSvc->getRecordsetPtr("HadronicEndcap","HadronicEndcap-00"); - m_iAccessSvc->disconnect(); - ATH_MSG_INFO (" LArRecoSimpleGeomTool successfully initialized "); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationMixedCalculator.cc b/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationMixedCalculator.cc index f474b40d36e9410f839cd45728003a3258c5058f..3f5a3ef46c8cd8a06c3bedc367c604d18b943935 100644 --- a/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationMixedCalculator.cc +++ b/LArCalorimeter/LArG4/LArG4EC/src/CryostatCalibrationMixedCalculator.cc @@ -90,7 +90,6 @@ namespace LArG4 { std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - pAccessSvc->connect(); // getting HEC table IRDBRecordset_ptr hecNominals = pAccessSvc->getRecordsetPtr("HecNominals",detectorKey,detectorNode); if (hecNominals->size()==0) { @@ -124,24 +123,6 @@ namespace LArG4 { m_endZFCal3 = m_startZFCal3 + 2.0*m_hdepthFCal3; m_z1BeforeFCal = m_zEMECRefPoint + m_LArEMECLArThickness; m_z2BeforeFCal = m_endZHec0; - - // std::cout << "--- GGG CryostatCalibrationMixedCalculator.cc ---" << std::endl - // << " m_zShift: " << m_zShift << std::endl - // << " m_zEMECRefPoint: " << m_zEMECRefPoint << std::endl - // << " m_LArEMECLArThickness: " << m_LArEMECLArThickness << std::endl - // << " m_startZFCal1: " << m_startZFCal1 << std::endl - // << " m_startZFCal2: " << m_startZFCal2 << std::endl - // << " m_startZFCal3: " << m_startZFCal3 << std::endl - // << " m_hdepthFCal1: " << m_hdepthFCal1 << std::endl - // << " m_hdepthFCal2: " << m_hdepthFCal2 << std::endl - // << " m_hdepthFCal3: " << m_hdepthFCal3 << std::endl - // << " m_endZFCal3: " << m_endZFCal3 << std::endl - // << " m_endZHec0: " << m_endZHec0 << std::endl - // << " m_z1BeforeFCal: " << m_z1BeforeFCal << std::endl - // << " m_z2BeforeFCal: " << m_z2BeforeFCal << std::endl - // << std::endl; - - pAccessSvc->disconnect(); } CalibrationMixedCalculator::Parameters::~Parameters() diff --git a/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc b/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc index 6225e467ee774a7decb6bfdc20ebf1cbd1caa83a..aa8220f0418930bbc956343d9445c88c2ea4584d 100644 --- a/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc +++ b/LArCalorimeter/LArG4/LArG4EC/src/EMECSupportCalibrationCalculator.cc @@ -101,7 +101,6 @@ namespace LArG4 { const std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; const std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - pAccessSvc->connect(); // getting HEC table IRDBRecordset_ptr hecNominals = pAccessSvc->getRecordsetPtr("HecNominals",detectorKey,detectorNode); if (hecNominals->size()==0) { @@ -138,24 +137,6 @@ namespace LArG4 { m_z2BeforeFCal = (*hecNominals)[0]->getDouble("OUTDEPTH")*CLHEP::mm + m_zShift; m_HECzEnd = (*hecNominals)[7]->getDouble("OUTDEPTH")*CLHEP::mm + m_zShift; -// std::cout << "--- GGG EMECSupportCalibrationCalculator.cc variables ---" << std::endl -// << " m_zShift: " << m_zShift << std::endl -// << " m_zEMECRefPoint: " << m_zEMECRefPoint << std::endl -// << " m_HECzStart: " << m_HECzStart << std::endl -// << " m_zAlignmentSafety: " << m_zAlignmentSafety << std::endl -// << " m_zInFrontOfSpanishFan: " << m_zInFrontOfSpanishFan << std::endl -// << " m_zBehindOfSpanishFan: " << m_zBehindOfSpanishFan << std::endl -// << " m_zInFrontOfHEC: " << m_zInFrontOfHEC << std::endl -// << " m_zzInFrontOfPresampler: " << m_zzInFrontOfPresampler << std::endl -// << " m_zzInFrontOfStrips: " << m_zzInFrontOfStrips << std::endl -// << " m_zzInFrontOfMiddle: " << m_zzInFrontOfMiddle << std::endl -// << " m_zzInFrontOfBack: " << m_zzInFrontOfBack << std::endl -// << " m_z1BeforeFCal: " << m_z1BeforeFCal << std::endl -// << " m_z2BeforeFCal: " << m_z2BeforeFCal << std::endl -// << " m_HECzEnd: " << m_HECzEnd << std::endl -// << std::endl; - - pAccessSvc->disconnect(); } EMECSupportCalibrationCalculator::Parameters::~Parameters() diff --git a/LArCalorimeter/LArG4/LArG4EC/src/EnergyCalculator.cc b/LArCalorimeter/LArG4/LArG4EC/src/EnergyCalculator.cc index 99bbdf83d42b5438284e831fc321214b1a2a618b..dcdc53e9d6b10c95b0a24afd67501e4143cf725a 100644 --- a/LArCalorimeter/LArG4/LArG4EC/src/EnergyCalculator.cc +++ b/LArCalorimeter/LArG4/LArG4EC/src/EnergyCalculator.cc @@ -440,8 +440,6 @@ StatusCode EnergyCalculator::initialize() DecodeVersionKey larVersionKey(geoModel, "LAr"); - pAccessSvc->connect(); - IRDBRecordset_ptr emecSamplingSep = pAccessSvc->getRecordsetPtr("EmecSamplingSep", larVersionKey.tag(), larVersionKey.node()); if (emecSamplingSep->size()==0) { throw std::runtime_error("Cannot find the EmecSamplingSep Table"); @@ -452,8 +450,6 @@ StatusCode EnergyCalculator::initialize() throw std::runtime_error("Cannot find the EmecGeometry Table"); } - pAccessSvc->disconnect(); - for(int i = 0; i < 7; i ++){ std::ostringstream A0STR; A0STR << "_" << i; diff --git a/LArCalorimeter/LArG4/LArG4EC/src/PresamplerGeometry.cc b/LArCalorimeter/LArG4/LArG4EC/src/PresamplerGeometry.cc index 378e5d61b538057515a74a0935d1dfdabf6b9999..f4eab605209932a18d1f88aef48eb40fda1e699e 100644 --- a/LArCalorimeter/LArG4/LArG4EC/src/PresamplerGeometry.cc +++ b/LArCalorimeter/LArG4/LArG4EC/src/PresamplerGeometry.cc @@ -84,7 +84,6 @@ namespace LArG4 { const std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; const std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - pAccessSvc->connect(); // Note Presampler Lives In DB under "cryostats".. IRDBRecordset_ptr presamplerPosition = pAccessSvc->getRecordsetPtr("PresamplerPosition",AtlasVersion,"ATLAS"); if (presamplerPosition->size()==0) { @@ -93,8 +92,6 @@ namespace LArG4 { throw std::runtime_error("Cannot find the PresamplerPosition Table"); } } - pAccessSvc->disconnect(); - m_c->rMinEndcap=(*presamplerPosition)[0]->getDouble("RMIN")*CLHEP::cm; m_c->rMaxEndcap=(*presamplerPosition)[0]->getDouble("RMAX")*CLHEP::cm; diff --git a/LArCalorimeter/LArG4/LArG4FCAL/src/LArFCALCalibCalculatorBase.cc b/LArCalorimeter/LArG4/LArG4FCAL/src/LArFCALCalibCalculatorBase.cc index e2d70928cbacc4934dcbee6ea22a0b3937f01652..990b9e456267341283de1c681ce5460150731431 100644 --- a/LArCalorimeter/LArG4/LArG4FCAL/src/LArFCALCalibCalculatorBase.cc +++ b/LArCalorimeter/LArG4/LArG4FCAL/src/LArFCALCalibCalculatorBase.cc @@ -109,13 +109,11 @@ namespace LArG4 { std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - pAccessSvc->connect(); IRDBRecordset_ptr emecGeoPtr = pAccessSvc->getRecordsetPtr("EmecGeometry",detectorKey,detectorNode); if (emecGeoPtr->size()==0) throw std::runtime_error ("LArFCALCalibCalculatorBase ERROR: Cannot find the EmecGeometry Table"); m_zShift = (*emecGeoPtr)[0]->getDouble("ZSHIFT")*CLHEP::cm; - pAccessSvc->disconnect(); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc b/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc index cf5a7fd7f81440cef01a06162f6bdfa11fb6a744..4ad4a2a334e3f3b6d590eab0c1884924d87d4581 100644 --- a/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc +++ b/LArCalorimeter/LArG4/LArG4HEC/src/LocalGeometry.cc @@ -129,8 +129,6 @@ namespace LArG4 { ATH_CHECK(m_AccessSvc.retrieve()); // Obtain the geometry version information: - m_AccessSvc->connect(); - std::string AtlasVersion = m_geoModel->atlasVersion(); std::string LArVersion = m_geoModel->LAr_VersionOverride(); diff --git a/LArCalorimeter/LArG4/LArG4MiniFCAL/src/MiniFCALAssignIdentifier.cc b/LArCalorimeter/LArG4/LArG4MiniFCAL/src/MiniFCALAssignIdentifier.cc index 7d6642bbae530195cc309b44d814b9359a4ddd5e..99d30ada3babde4e1fd6ce0d6c1049cb6bfcc1ea 100644 --- a/LArCalorimeter/LArG4/LArG4MiniFCAL/src/MiniFCALAssignIdentifier.cc +++ b/LArCalorimeter/LArG4/LArG4MiniFCAL/src/MiniFCALAssignIdentifier.cc @@ -91,12 +91,9 @@ namespace LArG4 { std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - pAccessSvc->connect(); - std::string miniFcalVersion = pAccessSvc->getChildTag("MiniFcal",detectorKey,detectorNode); if(miniFcalVersion.empty()) { m_initialized = false; - pAccessSvc->disconnect(); return; } @@ -129,8 +126,6 @@ namespace LArG4 { m_nWafers[(*recRings)[i]->getInt("RINGNUM")] =(*recRings)[i]->getInt("NWAFERS") ; } - pAccessSvc->disconnect(); - m_initialized = true; } diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/cmt/requirements b/LArCalorimeter/LArGeoModel/LArGeoCode/cmt/requirements deleted file mode 100755 index e1e911024127cca0c1ae225137729ce8797efde2..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArGeoModel/LArGeoCode/cmt/requirements +++ /dev/null @@ -1,18 +0,0 @@ -package LArGeoCode - -author Joe Boudreau <boudreau@pitt.edu> -author Bill Seligman <seligman@nevis.columbia.edu> - -use AtlasPolicy AtlasPolicy-* - -# Build the library (and export the headers) -library LArGeoCode *.cxx -apply_pattern installed_library - -private -use AtlasCLHEP AtlasCLHEP-* External -use GaudiInterface GaudiInterface-* External -use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel -use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL -use StoreGate StoreGate-* Control -use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel \ No newline at end of file diff --git a/LArCalorimeter/LArGeoModel/LArGeoCode/src/DatabaseAccessTool.cxx b/LArCalorimeter/LArGeoModel/LArGeoCode/src/DatabaseAccessTool.cxx index 6230f94ef74cbbc5e9440599b7a2a3a7f5e75929..f07169f1b68ec7bdcd4e0423bac054e3aecfe799 100755 --- a/LArCalorimeter/LArGeoModel/LArGeoCode/src/DatabaseAccessTool.cxx +++ b/LArCalorimeter/LArGeoModel/LArGeoCode/src/DatabaseAccessTool.cxx @@ -43,13 +43,10 @@ DatabaseAccessTool::DatabaseAccessTool () m_cw->detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; m_cw->detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - m_cw->pAccessSvc->connect(); - } DatabaseAccessTool::~DatabaseAccessTool () { - m_cw->pAccessSvc->disconnect(); delete m_cw; } diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/cmt/requirements b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/cmt/requirements deleted file mode 100755 index d5c9b6a91e71ce933308e86f6149432bf654afb3..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/cmt/requirements +++ /dev/null @@ -1,31 +0,0 @@ - - -package LArReadoutGeometry - -author Joe Boudreau <boudreau@pitt.edu> - -use AtlasPolicy AtlasPolicy-* -use CLIDSvc CLIDSvc-* Control -use GeoModelKernel GeoModelKernel-* DetectorDescription/GeoModel -use Identifier Identifier-* DetectorDescription -use LArHV LArHV-* LArCalorimeter/LArGeoModel -use GeoPrimitives GeoPrimitives-* DetectorDescription -public - -apply_pattern installed_library -library LArReadoutGeometry *.cxx - -macro DOXYGEN_EXAMPLE_PATH "../doc ../cmt ../share" -macro DOXYGEN_EXAMPLE_PATTERNS "*.cxx *.html requirements *.py" - -private -use AtlasCLHEP AtlasCLHEP-* External -use AtlasBoost AtlasBoost-* External -use GaudiInterface GaudiInterface-* External -use GeoModelInterfaces GeoModelInterfaces-* DetectorDescription/GeoModel -use GeoModelUtilities GeoModelUtilities-* DetectorDescription/GeoModel -use RDBAccessSvc RDBAccessSvc-* Database/AthenaPOOL -use StoreGate StoreGate-* Control - -#macro LArReadoutGeometry_cppflags "-g -O0" - diff --git a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMBAccordionDetails.cxx b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMBAccordionDetails.cxx index 2f043344f6509f4d2618dcb3367471a2b184fd10..85098c19b38760d703cdf9b23fc0f162bbfde8ae 100644 --- a/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMBAccordionDetails.cxx +++ b/LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/EMBAccordionDetails.cxx @@ -227,21 +227,16 @@ EMBAccordionDetails::EMBAccordionDetails():m_c(new Clockwork()) { std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion; std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr"; - pAccessSvc->connect(); - IRDBRecordset_ptr barrelGeometry = pAccessSvc->getRecordsetPtr("BarrelGeometry",detectorKey,detectorNode); if (barrelGeometry->size()==0) { throw std::runtime_error("Cannot find the BarrelGeometry Table"); } - IRDBRecordset_ptr barrelLongDiv = pAccessSvc->getRecordsetPtr("BarrelLongDiv",detectorKey,detectorNode); if (barrelLongDiv->size()==0) { throw std::runtime_error("Cannot find the BarrelLongDiv Table"); } - pAccessSvc->disconnect(); - // number of straight sections (should be 14) m_c->Nbrt = (*barrelGeometry)[0]->getInt("NBRT"); // Number of ZIGs + 1 i.e. 15 = number of folds diff --git a/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx b/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx index c074918e1ad95fa14da8807cbb5a945a9708c2d6..fea0daa0d61d1a961276f61008ee627f8926b16d 100755 --- a/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx +++ b/MuonSpectrometer/Amdcsimrec/AmdcAth/src/AmdcsimrecAthenaSvc.cxx @@ -537,8 +537,6 @@ StatusCode AmdcsimrecAthenaSvc::initializeFromOracle() return StatusCode::FAILURE; } - pIRDBAccessSvc->connect(); - ATH_MSG_DEBUG( " Keys are (key) " << m_detectorKey << " (node) " << m_detectorNode ) ; diff --git a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx index 797e3df7afc2bb173e107abe296ee8545f2cca9a..09ab3193c6a871158fa1caf75300e0aef94b66a2 100755 --- a/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx +++ b/MuonSpectrometer/Amdcsimrec/AmdcDb/src/AmdcDbSvcMakerFromRDB.cxx @@ -1912,8 +1912,6 @@ void AmdcDbSvcMakerFromRDB::Set( m_detectorKey = detectorKey ; m_detectorNode = detectorNode ; - pIRDBAccessSvc->connect(); - AMDC(pIRDBAccessSvc,pAmdcDbSvc); AGDD(pIRDBAccessSvc,pAmdcDbSvc); diff --git a/MuonSpectrometer/MuonCablings/CSCcabling/src/CSCcablingSvc.cxx b/MuonSpectrometer/MuonCablings/CSCcabling/src/CSCcablingSvc.cxx index 6858c9f444992acffe543dbfd1a41c153846ef44..eb1d26251801506da6033a87fdae6b29c2cd5b0f 100755 --- a/MuonSpectrometer/MuonCablings/CSCcabling/src/CSCcablingSvc.cxx +++ b/MuonSpectrometer/MuonCablings/CSCcabling/src/CSCcablingSvc.cxx @@ -44,11 +44,6 @@ StatusCode CSCcablingSvc::initialize() { IRDBAccessSvc* rdbAccess = 0; ATH_CHECK( service("RDBAccessSvc",rdbAccess) ); - if(!rdbAccess->connect()) { - ATH_MSG_ERROR("Unable to connect to the Geometry DB"); - return StatusCode::FAILURE; - } - const IGeoModelSvc* geoModel = 0; StatusCode sc = service("GeoModelSvc", geoModel); if (sc.isFailure()) { @@ -75,11 +70,6 @@ StatusCode CSCcablingSvc::initialize() { m_rod = (m_run1 ? 8 : 16); m_max = m_side * m_rod; - if(!rdbAccess->disconnect()) { - ATH_MSG_ERROR("Unable to disconnectfrom the Geometry DB"); - return StatusCode::FAILURE; - } - return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx index b2bdd1ac5ebe1f6a90dae562dea7af8298b5f8ae..384ca7c30b21b0d0cad053edba778e79b397eccf 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondTool/src/MDT_MapConversion.cxx @@ -104,7 +104,6 @@ StatusCode MDT_MapConversion::initialize() IRDBAccessSvc *accessSvc; service("RDBAccessSvc",accessSvc); - accessSvc->connect(); @@ -145,7 +144,6 @@ StatusCode MDT_MapConversion::initialize() } - accessSvc->disconnect(); log << MSG::INFO << "#### Chamber Map SIZE" << m_Chamber_Map.size()<< endmsg; return StatusCode::SUCCESS; diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx index 50c81ca87534a2912f4a78ff113dd5df21b0d948..7492933b015bf9dbe9ba204434f5207ae59324fb 100644 --- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx +++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx @@ -59,8 +59,6 @@ MuonAGDDToolHelper::MuonAGDDToolHelper() { std::cout<<"unable to access RBDAccessSvc "<<std::endl; } - else - p_RDBAccessSvc->connect(); tagInfoKey=""; result=Gaudi::svcLocator()->service("TagInfoMgr",m_tagInfoMgr); if (result.isFailure()) diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index 9924e43a8304e2e7aa8e6a27fd1264fe39246642..bce7780a53c3c5bde7517f818059b1a3a73bfeb4 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -229,11 +229,6 @@ StatusCode RpcDigitizationTool::initialize() { return result; } - if(!rdbAccess->connect()) { - ATH_MSG_ERROR("Unable to connect to the Geometry DB"); - return StatusCode::FAILURE; - } - bool m_run1 = true; std::string configVal = ""; const IGeoModelSvc* geoModel = 0; diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx index 277d2de36ccbea6ee5675aee271eabbb2806c077..f50f063389cda315935dba989743b050deb2e783 100644 --- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/src/TgcDigitizationTool.cxx @@ -103,10 +103,6 @@ StatusCode TgcDigitizationTool::initialize() IRDBAccessSvc* rdbAccess = nullptr; CHECK( service("RDBAccessSvc",rdbAccess) ); - if(!rdbAccess->connect()) { - ATH_MSG_ERROR("Unable to connect to the Geometry DB"); - return StatusCode::FAILURE; - } IRDBRecordset_ptr atlasCommonRec = rdbAccess->getRecordsetPtr("AtlasCommon",atlasVersion,"ATLAS"); unsigned int runperiod = 1; diff --git a/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileCalibDddbManager.cc b/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileCalibDddbManager.cc index 56f6be41de1959dcd0e7d34b52f309b23249d7e9..c9b23ca8128fd26175859ad947415be64dc571bf 100644 --- a/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileCalibDddbManager.cc +++ b/TileCalorimeter/TileG4/TileGeoG4Calib/src/TileCalibDddbManager.cc @@ -36,8 +36,6 @@ TileCalibDddbManager::TileCalibDddbManager(ServiceHandle<IRDBAccessSvc> &access, m_verboseLevel(verboseLevel) { - access->connect(); - m_tile = access->getRecordsetPtr("TILE", m_tag, m_node); m_nTile = m_tile->size(); @@ -55,8 +53,6 @@ TileCalibDddbManager::TileCalibDddbManager(ServiceHandle<IRDBAccessSvc> &access, m_switches = access->getRecordsetPtr("TileSwitches", m_tag, m_node); - access->disconnect(); - } // --------------------------- T I L E -------------------------