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)

  1. Step 1. Load RDBAccessSvc library. For that put the following line in your jobOptions file:
    include( "RDBAccessSvc/RDBAccessSvcPdb_jobOptions.py" )

  2. 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();


  3. Step 3. Get the pointer to recordset object
    IRDBRecordset* pTifg = m_iAccessSvc->getRecordset("TIFG","ATLAS-00","ATLAS");

  4. 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