Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
8
#include <
ffamodules/CDBInterface.h
>
9
10
#include <
fun4all/Fun4AllServer.h
>
11
#include <
fun4all/Fun4AllDummyInputManager.h
>
12
13
#include <
phool/recoConsts.h
>
14
15
R__LOAD_LIBRARY(libffamodules.so)
16
R__LOAD_LIBRARY(libphool.so)
17
18
void
TestCDBSubsysReco
()
19
{
20
recoConsts
*rc =
recoConsts::instance
();
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);
24
Fun4AllServer
*se =
Fun4AllServer::instance
();
25
se->
Verbosity
(1);
26
27
CDBInterface
*cdb =
CDBInterface::instance
();
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
45
Fun4AllInputManager
*
in
=
new
Fun4AllDummyInputManager
(
"JADE"
);
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
macros
blob
master
CDBTest
TestCDBSubsysReco.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:26
using
1.8.2 with
sPHENIX GitHub integration