CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
cmsRelValCmd.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 #Parsing the $CMSSW_RELEASE_BASE/src/Configuration/PyReleaseValidation/data/cmsDriver_highstats_htl.txt file
3 #to look for necessary cmsdriver extra options
4 
5 import os, re
6 
7 #Assuming high statistics RelVal cmsDriver command file to be named:
8 cmsDriverCmd="cmsDriver_highstats_hlt.txt"
9 #And to be found at:
10 cmsDriverCmdPath=os.environ["CMSSW_RELEASE_BASE"]+"/src/Configuration/PyReleaseValidation/data"
11 
13  '''Function returns a string with the cmsDriver.py options relevant to the performance suite used in file cmsDriver_highstats_hlt.txt in package Configuration/PyReleaseValidation/data\n'''
14  filename=os.path.join(cmsDriverCmdPath,cmsDriverCmd)
15  cmsDriverOptions=""
16  if os.path.exists(filename):
17  file=open(filename,"r")
18  TTbar=re.compile("TTbar")
19  STARTUP=re.compile("STARTUP")
20  GENSIM=re.compile("GEN,SIM")
21  option=re.compile("^--")
22  for line in file.readlines():
23  #Always pick the TTbar with IDEAL geometry line to pick up the "standard" options:
24  if TTbar.search(line) and STARTUP.search(line) and GENSIM.search(line):
25  tokens=line.split()
26  #print line
27  #print tokens
28  for token in tokens:
29  found = option.search(token)
30  #Here we can filter out the options we don't care about:
31  #--relval
32  #--datatier
33  if found and not (found.string == "--relval" or found.string == "--datatier"):
34  cmsDriverOptions=cmsDriverOptions+found.string+" "+tokens[tokens.index(found.string)+1]+" "
35  return cmsDriverOptions
36  else:
37  print "Could not find file %s!\n"%filename
38  return NULL
def get_cmsDriverOptions
Definition: cmsRelValCmd.py:12