CMS 3D CMS Logo

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

Functions

def run
 

Function Documentation

def cmsDriver.run ( )

Definition at line 6 of file cmsDriver.py.

References cmsDriverOptions.OptionsFromCommandLine(), print(), SiPixelLorentzAngle_cfi.read, and submitPVValidationJobs.split().

6 
7 def run():
8  import sys
9  import os
10  import Configuration.Applications
11  from Configuration.Applications.ConfigBuilder import ConfigBuilder
12  from Configuration.Applications.cmsDriverOptions import OptionsFromCommandLine
13  options = OptionsFromCommandLine()
14 
15  # after cleanup of all config parameters pass it to the ConfigBuilder
16  configBuilder = ConfigBuilder(options, with_output = True, with_input = True)
17 
18  # Switch on any eras that have been specified. This is not required to create
19  # the file, it is only relevant if dump_python is set. It does have to be done
20  # before the prepare() call though. If not, then the config files will be loaded
21  # without applying the era changes. This doesn't affect the config file written,
22  # but when the dump_python branch uses execfile to read it back in it doesn't
23  # reload the modules - it picks up a reference to the already loaded ones.
24  if hasattr( options, "era" ) and options.era is not None :
25  from Configuration.StandardSequences.Eras import eras
26  for eraName in options.era.split(',') :
27  getattr( eras, eraName )._setChosen()
28 
29  configBuilder.prepare()
30  # fetch the results and write it to file
31  config = open(options.python_filename,"w")
32  config.write(configBuilder.pythonCfgCode)
33  config.close()
34 
35  # handle different dump options
36  if options.dump_python:
37  result = {}
38  exec(open(options.python_filename).read(), result)
39  process = result["process"]
40  expanded = process.dumpPython()
41  expandedFile = open(options.python_filename,"w")
42  expandedFile.write(expanded)
43  expandedFile.close()
44  print("Expanded config file", options.python_filename, "created")
45  sys.exit(0)
46 
47  if options.no_exec_flag:
48  print("Config file "+options.python_filename+ " created")
49  sys.exit(0)
50  else:
51  commandString = options.prefix+" cmsRun "+options.suffix
52  print("Starting "+commandString+' '+options.python_filename)
53  commands = commandString.lstrip().split()
54  os.execvpe(commands[0],commands+[options.python_filename],os.environ)
55  sys.exit()
56 
57 run()
58 
59 
60 
def run
Definition: cmsDriver.py:6
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47