6 Author: Evan K. Friis, UC Davis friis@physics.ucdavis.edu 8 Usage: Any objects with file type [name].mvac will be turned into [name].xml with the correct format 10 A configuration script to automate changes in available MVA input variables (for the PhysicsTools/MVAComputer framework) 11 across numerous MVA configurations. 13 This is total kludge and will be deprecated when 14 a. I figure out how you use <xi:include... success full (xml sucks) 15 b. Proposed changes to the MVA objects allow classification steering in a single xml file 17 from __future__
import print_function
23 filesToConvert = glob.glob(
"./*.mvac")
25 RemoveNumEventsSpecifiers =
True 27 for aFile
in filesToConvert:
28 xmlFileName = string.replace(aFile,
"mvac",
"xml")
29 if os.path.exists(xmlFileName):
30 os.system(
"cp %s %s.bak" % (xmlFileName, xmlFileName))
31 os.remove(xmlFileName)
33 print(
"Building %s..." % xmlFileName)
34 os.system(
"cat Preamble.xml.fragment > %s" % xmlFileName)
35 os.system(
"cat Inputs.xml.fragment >> %s" % xmlFileName)
36 os.system(
"cat Helpers.xml.fragment >> %s" % xmlFileName)
37 if RemoveNumEventsSpecifiers:
38 os.system(
"cat %s | sed 's|NSigTest=[0-9]*|NSigTest=0|' | sed 's|NBkgTest=[0-9]*|NBkgTest=0|' | sed 's|NSigTrain=[0-9]*|NSigTrain=0|' | sed 's|NBkgTrain=[0-9]*|NBkgTrain=0|' >> %s" % (aFile, xmlFileName))
40 os.system(
"cat %s >> %s" % (aFile, xmlFileName))
41 os.system(
"cat Finale.xml.fragment >> %s" % xmlFileName)
S & print(S &os, JobReport::InputFile const &f)