CMS 3D CMS Logo

BuildIsoConfigs.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 """
4 BuildIsoMvacs.py
5 
6 Author: Evan K. Friis, UC Davis friis@physics.ucdavis.edu
7 
8 Usage: Prepare copies of all MVA configuration files (*.mvac) with the isolation inputs removed.
9  New copies will be titled *Iso.xml
10 """
11 from __future__ import print_function
12 import os
13 import glob
14 import string
15 
16 filesToConvert = glob.glob("./*.mvac")
17 
18 for aFile in filesToConvert:
19  xmlFileName = string.replace(aFile, ".mvac", "Iso.xml")
20  if os.path.exists(xmlFileName):
21  os.system("cp %s %s.bak" % (xmlFileName, xmlFileName))
22  os.remove(xmlFileName)
23 
24  print("Building %s..." % xmlFileName)
25  os.system("cat Preamble.xml.fragment > %s" % xmlFileName)
26  os.system("cat Inputs.xml.fragment >> %s" % xmlFileName)
27  os.system("cat Helpers.xml.fragment >> %s" % xmlFileName)
28  os.system("cat %s | grep -v Outlier >> %s" % (aFile, xmlFileName))
29  os.system("cat Finale.xml.fragment >> %s" % xmlFileName)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66