CMS 3D CMS Logo

Functions
getGTfromDQMFile_V2 Namespace Reference

Functions

def getGTfromDQMFile (DQMfile, RunNumber, globalTagVar)
 

Function Documentation

def getGTfromDQMFile_V2.getGTfromDQMFile (   DQMfile,
  RunNumber,
  globalTagVar 
)

Definition at line 10 of file getGTfromDQMFile_V2.py.

References edm.print().

10 def getGTfromDQMFile(DQMfile, RunNumber, globalTagVar):
11  if not os.path.isfile(DQMfile):# print "Error: file", DQMfile, "not found, exit"
12  sys.exit(0)
13  thefile = TFile( DQMfile )
14  globalTagDir = 'DQMData/Run ' + RunNumber + '/Info/Run summary/CMSSWInfo'
15  if not gDirectory.GetDirectory( globalTagDir ):
16  # print "Warning: globalTag not found in DQM file"
17  sys.exit(0)
18  keys = gDirectory.GetDirectory( globalTagDir ).GetListOfKeys()
19  key = keys[0]
20  globalTag = ''
21  while key:
22  obj = key.ReadObj()
23  if globalTagVar in obj.GetName():
24  globalTag = obj.GetName()[len("<"+globalTagVar+">s="):-len("</"+globalTagVar+">")]
25  break
26  key = keys.After(key)
27  if len(globalTag) > 1:
28  if globalTag.find('::') >= 0:
29  print(globalTag[0:globalTag.find('::')])
30  else:
31  print(globalTag)
32  return globalTag
33 
34 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def getGTfromDQMFile(DQMfile, RunNumber, globalTagVar)