Analysis Software
Documentation for sPHENIX simulation software
 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>
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 
15 {
16  return uti;
17 }
18 
20 {
21  if (!uti) uti = new CDBUtils();
23  return;
24 }
25 
27 {
28  if (!uti) uti = new CDBUtils();
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 
76 {
77  if (!uti) uti = new CDBUtils();
78  int iret = uti->cloneGlobalTag(source, target);
79  return iret;
80 }
81 
82 
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 
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