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
TestCDBInsert.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TestCDBInsert.C
1
#ifndef TESTCDBINSERT_C
2
#define TESTCDBINSERT_C
3
4
#include <
sphenixnpc/CDBUtils.h
>
5
6
#include <
phool/recoConsts.h
>
7
8
R__LOAD_LIBRARY(libsphenixnpc.so)
9
R__LOAD_LIBRARY(libphool.so)
10
11
// if you get errors like
12
// Error inserting payload test.root, msg: "DataBaseException: Global Tag is locked."
13
// use CDBUtils to unlock your global tag (unlockGlobalTag("<global tag>")
14
15
void
TestCDBInsert
()
16
{
17
recoConsts
*rc =
recoConsts::instance
();
18
// please choose a unique name, if it is your username it's easier to see who created it
19
rc->
set_StringFlag
(
"CDB_GLOBALTAG"
,
"pinkenbu"
);
20
CDBUtils
*cdb =
new
CDBUtils
(rc->
get_StringFlag
(
"CDB_GLOBALTAG"
));
21
cdb->
createPayloadType
(
"TestBeginValidity"
);
22
cdb->
insertPayload
(
"TestBeginValidity"
,
"test.root"
,10);
23
cdb->
createPayloadType
(
"TestBeginEndValidity"
);
24
cdb->
insertPayload
(
"TestBeginEndValidity"
,
"test.root"
,10,20);
25
return
;
26
}
27
28
#endif
macros
blob
master
CDBTest
TestCDBInsert.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:26
using
1.8.2 with
sPHENIX GitHub integration