26def getCurrentFolderTag(dbname,folderName,ES=False):
27 currentTag,nextTag=None,None
28
29
30 resolver=resolveAlias()
32 currentGlobal=resolver.getCurrentES().
replace(
"*",
"ST")
33 nextGlobal=resolver.getNextES().
replace(
"*",
"ST")
34 else:
35 currentGlobal=resolver.getCurrent().
replace(
"*",
"ST")
36 nextGlobal=resolver.getNext().
replace(
"*",
"ST")
37
38 print(
'currentGlobal: ',currentGlobal)
39
40 dbSvc = cool.DatabaseSvcFactory.databaseService()
41 db = dbSvc.openDatabase(dbname)
42 f=db.getFolder(folderName)
43 try:
44 currentTag=_resolveTagFaster(f,currentGlobal)
45 except Exception:
46 print(
'Warning: could not resolve ',currentGlobal,
' in db: ',dbname)
47 if "DBR2" in dbname:
48 print(
'resolving for the global CONDBR2-BLKPA-2022-10')
49 tmpGlobal='CONDBR2-BLKPA-2022-10'
50 else:
51 print(
'resolving for the global COMCOND-BLKPA-RUN1-06')
52 tmpGlobal='COMCOND-BLKPA-RUN1-06'
53
54 try:
55 currentTag=_resolveTagFaster(f,tmpGlobal)
56 except Exception:
57 print(
'Also not working, giving up')
58 pass
59 pass
60
61 if len(nextGlobal)>2:
62
63 try:
64 nextTag=_resolveTagFaster(f,nextGlobal)
65 except Exception:
66 pass
67 pass
68
69 db.closeDatabase()
70 return (currentTag,nextTag)
71
72
void print(char *figname, TCanvas *c1)
std::string replace(std::string s, const std::string &s2, const std::string &s3)