CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
getGTfromDQMFile_V2 Namespace Reference

Functions

def getGTfromDQMFile
 

Function Documentation

def getGTfromDQMFile_V2.getGTfromDQMFile (   DQMfile,
  RunNumber,
  globalTagVar 
)

Definition at line 10 of file getGTfromDQMFile_V2.py.

References print().

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