CMS 3D CMS Logo

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 from __future__ import print_function
6 import os, re
7 
8 #Assuming high statistics RelVal cmsDriver command file to be named:
9 cmsDriverCmd="cmsDriver_highstats_hlt.txt"
10 #And to be found at:
11 cmsDriverCmdPath=os.environ["CMSSW_RELEASE_BASE"]+"/src/Configuration/PyReleaseValidation/data"
12 
14  '''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'''
15  filename=os.path.join(cmsDriverCmdPath,cmsDriverCmd)
16  cmsDriverOptions=""
17  if os.path.exists(filename):
18  file=open(filename,"r")
19  TTbar=re.compile("TTbar")
20  STARTUP=re.compile("STARTUP")
21  GENSIM=re.compile("GEN,SIM")
22  option=re.compile("^--")
23  for line in file.readlines():
24  #Always pick the TTbar with IDEAL geometry line to pick up the "standard" options:
25  if TTbar.search(line) and STARTUP.search(line) and GENSIM.search(line):
26  tokens=line.split()
27  #print line
28  #print tokens
29  for token in tokens:
30  found = option.search(token)
31  #Here we can filter out the options we don't care about:
32  #--relval
33  #--datatier
34  if found and not (found.string == "--relval" or found.string == "--datatier"):
35  cmsDriverOptions=cmsDriverOptions+found.string+" "+tokens[tokens.index(found.string)+1]+" "
36  return cmsDriverOptions
37  else:
38  print("Could not find file %s!\n"%filename)
39  return NULL
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
def get_cmsDriverOptions()
Definition: cmsRelValCmd.py:13