Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:24

0001 #ifndef TESTCDBREAD_C
0002 #define TESTCDBREAD_C
0003 
0004 #include <ffamodules/CDBInterface.h>
0005 
0006 #include <phool/recoConsts.h>
0007 
0008 R__LOAD_LIBRARY(libffamodules.so)
0009 R__LOAD_LIBRARY(libphool.so)
0010 
0011 void TestCDBRead()
0012 {
0013   recoConsts *rc = recoConsts::instance();
0014 // please choose a unique name, if it is your username it's easier to see who created it
0015   rc->set_StringFlag("CDB_GLOBALTAG","pinkenbu"); 
0016   rc->set_uint64Flag("TIMESTAMP",6);
0017 // 1000000 is the insert timestamp. Higher timestamps work, lower time stamps do not
0018   CDBInterface *cdb = CDBInterface::instance();
0019   cout << "using insert timestamp to retrieve no end time payload" << endl;
0020   rc->set_uint64Flag("TIMESTAMP",10);
0021   cout << cdb->getUrl("TestBeginValidity") << endl;
0022   cout << "using larger timestamp to retrieve no end time payload" << endl;
0023   rc->set_uint64Flag("TIMESTAMP",100);
0024   cout << cdb->getUrl("TestBeginValidity") << endl;
0025   cout << "using smaller timestamp to retrieve no end time payload" << endl;
0026   rc->set_uint64Flag("TIMESTAMP",1);
0027   cout << cdb->getUrl("TestBeginValidity") << endl;
0028 
0029   cout << "using timestamp in range to retrieve calibration with end time" << endl;
0030   rc->set_uint64Flag("TIMESTAMP",15);
0031   cout << cdb->getUrl("TestBeginEndValidity") << endl;
0032   cout << "using timestamp outside range to retrieve calibration with end time" << endl;
0033   rc->set_uint64Flag("TIMESTAMP",25);
0034   cout << cdb->getUrl("TestBeginEndValidity") << endl;
0035   gSystem->Exit(0);
0036   return;
0037 }
0038 
0039 #endif
0040