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
CDBUtils.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file CDBUtils.C
1
#ifndef CDBUTILS_C
2
#define CDBUTILS_C
3
4
#include <
sphenixnpc/CDBUtils.h
>
5
#include <
sphenixnpc/SphenixClient.h
>
6
7
#include <
phool/recoConsts.h
>
8
9
R__LOAD_LIBRARY(libsphenixnpc.so)
10
R__LOAD_LIBRARY(libphool.so)
11
12
CDBUtils
*
uti
=
nullptr
;
13
14
CDBUtils
*
getCDBUtils
()
15
{
16
return
uti
;
17
}
18
19
void
listGlobalTags
()
20
{
21
if
(!
uti
)
uti
=
new
CDBUtils
();
22
uti
->
listGlobalTags
();
23
return
;
24
}
25
26
void
listPayloadTypes
()
27
{
28
if
(!
uti
)
uti
=
new
CDBUtils
();
29
uti
->
listPayloadTypes
();
30
return
;
31
}
32
33
void
listPayloadIOVs
(uint64_t iov)
34
{
35
if
(!
uti
)
uti
=
new
CDBUtils
();
36
uti
->
listPayloadIOVs
(iov);
37
return
;
38
}
39
40
void
createGlobalTag
(
const
std::string
&tagname)
41
{
42
if
(!
uti
)
uti
=
new
CDBUtils
();
43
uti
->
createGlobalTag
(tagname);
44
return
;
45
}
46
47
void
deleteGlobalTag
(
const
std::string
&tagname)
48
{
49
if
(!
uti
)
uti
=
new
CDBUtils
();
50
uti
->
deleteGlobalTag
(tagname);
51
return
;
52
}
53
54
void
lockGlobalTag
(
const
std::string
&tagname)
55
{
56
if
(!
uti
)
uti
=
new
CDBUtils
();
57
uti
->
lockGlobalTag
(tagname);
58
return
;
59
}
60
61
void
unlockGlobalTag
(
const
std::string
&tagname)
62
{
63
if
(!
uti
)
uti
=
new
CDBUtils
();
64
uti
->
unlockGlobalTag
(tagname);
65
return
;
66
}
67
68
int
setGlobalTag
(
const
std::string
&tagname)
69
{
70
if
(!
uti
)
uti
=
new
CDBUtils
();
71
int
iret =
uti
->
setGlobalTag
(tagname);
72
return
iret;
73
}
74
75
int
cloneGlobalTag
(
const
std::string
&
source
,
const
std::string
&
target
)
76
{
77
if
(!
uti
)
uti
=
new
CDBUtils
();
78
int
iret =
uti
->
cloneGlobalTag
(source, target);
79
return
iret;
80
}
81
82
83
int
createPayloadType
(
const
std::string
&
pt
)
84
{
85
if
(!
uti
)
uti
=
new
CDBUtils
();
86
int
iret =
uti
->
createPayloadType
(pt);
87
return
iret;
88
}
89
90
int
insertPayload
(
const
std::string
&pl_type,
const
std::string
&file_url, uint64_t iov_start)
91
{
92
if
(!
uti
)
uti
=
new
CDBUtils
();
93
if
(
uti
->
isGlobalTagSet
())
94
{
95
uti
->
insertPayload
(pl_type,file_url,iov_start);
96
}
97
return
0;
98
}
99
100
int
insertPayload
(
const
std::string
&pl_type,
const
std::string
&file_url, uint64_t iov_start, uint64_t iov_end)
101
{
102
if
(!
uti
)
uti
=
new
CDBUtils
();
103
if
(
uti
->
isGlobalTagSet
())
104
{
105
uti
->
insertPayload
(pl_type,file_url,iov_start,iov_end);
106
}
107
return
0;
108
}
109
110
std::string
getCalibration
(
const
std::string
&pl_type, uint64_t iov)
111
{
112
if
(!
uti
)
uti
=
new
CDBUtils
();
113
return
uti
->
getUrl
(pl_type,iov);
114
}
115
116
void
clearCache
()
117
{
118
if
(!
uti
)
uti
=
new
CDBUtils
();
119
return
uti
->
clearCache
();
120
}
121
122
void
Verbosity
(
int
verb)
123
{
124
if
(!
uti
)
uti
=
new
CDBUtils
();
125
return
uti
->
Verbosity
(verb);
126
}
127
128
int
deletePayloadIOV
(
const
std::string
& pl_type, uint64_t iov_start)
129
{
130
if
(!
uti
)
uti
=
new
CDBUtils
();
131
return
uti
->
deletePayloadIOV
(pl_type,iov_start);
132
}
133
134
int
deletePayloadIOV
(
const
std::string
& pl_type, uint64_t iov_start, uint64_t iov_end)
135
{
136
if
(!
uti
)
uti
=
new
CDBUtils
();
137
return
uti
->
deletePayloadIOV
(pl_type,iov_start, iov_end);
138
}
139
140
#endif
macros
blob
master
common
CDBUtils.C
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:26
using
1.8.2 with
sPHENIX GitHub integration