ATLAS Offline Software
Functions | Variables
python.getCurrentFolderTag Namespace Reference

Functions

def getCurrentFolderTag (dbname, folderName, ES=False)
 

Variables

 dn = sys.argv[1]
 
 fn = sys.argv[2]
 
 estag = sys.argv[3]
 
def currTag = getCurrentFolderTag(dn,fn,estag)[0]
 

Function Documentation

◆ getCurrentFolderTag()

def python.getCurrentFolderTag.getCurrentFolderTag (   dbname,
  folderName,
  ES = False 
)

Definition at line 11 of file getCurrentFolderTag.py.

11 def getCurrentFolderTag(dbname,folderName,ES=False):
12  current=None
13  next=None
14 
15  #1. Get current and next global tags using resolver class in ~atlcond
16  resolver=resolveAlias()
17  if(ES):
18  currentGlobal=resolver.getCurrentES().replace("*","ST")
19  nextGlobal=resolver.getNextES().replace("*","ST")
20  else:
21  currentGlobal=resolver.getCurrent().replace("*","ST")
22  nextGlobal=resolver.getNext().replace("*","ST")
23 
24  print('currentGlobal: ',currentGlobal)
25  #2. Open the DB to resolve this gobal tag for the given folder
26  dbSvc = cool.DatabaseSvcFactory.databaseService()
27  db = dbSvc.openDatabase(dbname)
28  f=db.getFolder(folderName)
29  try:
30  current=f.resolveTag(currentGlobal)
31  except Exception:
32  print('Warning: could not resolve ',currentGlobal,' in db: ',dbname)
33  if "DBR2" in dbname:
34  print('resolving for the global CONDBR2-BLKPA-2022-10')
35  tmpGlobal='CONDBR2-BLKPA-2022-10'
36  else:
37  print('resolving for the global COMCOND-BLKPA-RUN1-06')
38  tmpGlobal='COMCOND-BLKPA-RUN1-06'
39 
40  try:
41  current=f.resolveTag(tmpGlobal)
42  except Exception:
43  print('Also not working, giving up')
44  pass
45  pass
46 
47  if len(nextGlobal)>2:
48  # NEXT exists, try to resolve it
49  try:
50  next=f.resolveTag(nextGlobal)
51  except Exception:
52  pass
53  pass
54 
55  db.closeDatabase()
56  return (current,next)
57 
58 

Variable Documentation

◆ currTag

def python.getCurrentFolderTag.currTag = getCurrentFolderTag(dn,fn,estag)[0]

Definition at line 71 of file getCurrentFolderTag.py.

◆ dn

python.getCurrentFolderTag.dn = sys.argv[1]

Definition at line 64 of file getCurrentFolderTag.py.

◆ estag

bool python.getCurrentFolderTag.estag = sys.argv[3]

Definition at line 67 of file getCurrentFolderTag.py.

◆ fn

python.getCurrentFolderTag.fn = sys.argv[2]

Definition at line 65 of file getCurrentFolderTag.py.

replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.getCurrentFolderTag.getCurrentFolderTag
def getCurrentFolderTag(dbname, folderName, ES=False)
Definition: getCurrentFolderTag.py:11
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567