Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TestCDBSubsysReco.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TestCDBSubsysReco.C
1 // This example runs the CDBInterface like in the real reconstruction
2 // once the CDBInterface instance is created it registers itself with the
3 // Fun4AllServer and creates (or adds to) the CdbUrl Node which contains a
4 // record of the files and timestamps which were used
5 #ifndef TESTCDBREAD_C
6 #define TESTCDBREAD_C
7 
9 
10 #include <fun4all/Fun4AllServer.h>
12 
13 #include <phool/recoConsts.h>
14 
15 R__LOAD_LIBRARY(libffamodules.so)
16 R__LOAD_LIBRARY(libphool.so)
17 
19 {
21 // please choose a unique name, if it is your username it's easier to see who created it
22  rc->set_StringFlag("CDB_GLOBALTAG","pinkenbu");
23  rc->set_uint64Flag("TIMESTAMP",6);
25  se->Verbosity(1);
26 
28  cout << "using insert timestamp to retrieve" << endl;
29  rc->set_uint64Flag("TIMESTAMP",10);
30  cout << cdb->getUrl("TestBeginValidity") << endl;
31  cout << "using larger timestamp to retrieve" << endl;
32  rc->set_uint64Flag("TIMESTAMP",100);
33  cout << cdb->getUrl("TestBeginValidity") << endl;
34  cout << "using smaller timestamp to retrieve" << endl;
35  rc->set_uint64Flag("TIMESTAMP",1);
36  cout << cdb->getUrl("TestBeginValidity") << endl;
37 
38  cout << "using timestamp in range to retrieve calibration" << endl;
39  rc->set_uint64Flag("TIMESTAMP",15);
40  cout << cdb->getUrl("TestBeginEndValidity") << endl;
41  cout << "using timestamp outside range to retrieve calibration" << endl;
42  rc->set_uint64Flag("TIMESTAMP",25);
43  cout << cdb->getUrl("TestBeginEndValidity") << endl;
44 
46  in->Verbosity(1);
47  se->registerInputManager(in);
48  se->run(1);
49  CDBInterface::instance()->Print(); // print used DB files
50  se->End();
51  se->Print("NODETREE");
52  std::cout << "All done" << std::endl;
53  delete se;
54 
55  gSystem->Exit(0);
56  return;
57 }
58 
59 #endif
60