HowTo 3. Reading tagged data from the ATLAS Geometry DB within ATHENA applications
This example demonstrates retrieval of TIFG structure corresponding to ATLAS tag
'ATLAS-00'. (You can find the code for this example in AtlasTest/DatabaseTest/RDBAccessTest)
- Step 1. Load RDBAccessSvc library. For that put the following line in your jobOptions file:
include( "RDBAccessSvc/RDBAccessSvcPdb_jobOptions.py" )
- Step 2. In application code, first retrieve a pointer to RDBAccessSvc and connect to the DB
IRDBAccessSvc* m_iAccessSvc;
pServiceLocator->service("RDBAccessSvc",m_iAccessSvc);
m_iAccessSvc->connect();
- Step 3. Get the pointer to recordset object
IRDBRecordset* pTifg = m_iAccessSvc->getRecordset("TIFG","ATLAS-00","ATLAS");
- Step 4. Access retrieved data (print it out)
for(unsigned int ind=0; indsize(); ind++)
{
const IRDBRecord* rec = (*pTifg)[ind];
std::cerr << rec->getInt("SECTION") << " "
<< rec->getInt("NELEM") << " "
<< rec->getDouble("DZ") << "\n";
}
Back