Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TestCDBRead.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TestCDBRead.C
1 #ifndef TESTCDBREAD_C
2 #define TESTCDBREAD_C
3 
5 
6 #include <phool/recoConsts.h>
7 
8 R__LOAD_LIBRARY(libffamodules.so)
9 R__LOAD_LIBRARY(libphool.so)
10 
12 {
14 // please choose a unique name, if it is your username it's easier to see who created it
15  rc->set_StringFlag("CDB_GLOBALTAG","pinkenbu");
16  rc->set_uint64Flag("TIMESTAMP",6);
17 // 1000000 is the insert timestamp. Higher timestamps work, lower time stamps do not
19  cout << "using insert timestamp to retrieve no end time payload" << endl;
20  rc->set_uint64Flag("TIMESTAMP",10);
21  cout << cdb->getUrl("TestBeginValidity") << endl;
22  cout << "using larger timestamp to retrieve no end time payload" << endl;
23  rc->set_uint64Flag("TIMESTAMP",100);
24  cout << cdb->getUrl("TestBeginValidity") << endl;
25  cout << "using smaller timestamp to retrieve no end time payload" << endl;
26  rc->set_uint64Flag("TIMESTAMP",1);
27  cout << cdb->getUrl("TestBeginValidity") << endl;
28 
29  cout << "using timestamp in range to retrieve calibration with end time" << endl;
30  rc->set_uint64Flag("TIMESTAMP",15);
31  cout << cdb->getUrl("TestBeginEndValidity") << endl;
32  cout << "using timestamp outside range to retrieve calibration with end time" << endl;
33  rc->set_uint64Flag("TIMESTAMP",25);
34  cout << cdb->getUrl("TestBeginEndValidity") << endl;
35  gSystem->Exit(0);
36  return;
37 }
38 
39 #endif
40