Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-15 22:42:35

0001 #! /usr/bin/env python3
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 import sys
0005 import os
0006 
0007 # get the list of XML files from the cfi file
0008 process = cms.Process("TEST")
0009 cfiFile = 'Geometry/CMSCommonData/cmsIdealGeometryXML_cfi'
0010 if len(sys.argv) > 1:
0011     cfiFile = sys.argv[1]
0012 process.load(cfiFile)
0013 xmlFiles = process.es_sources['XMLIdealGeometryESSource'].geomXMLFiles.value()
0014 
0015 # create an XML configuration file that contains the same list of XML files as the python cfi file
0016 configXMLFile = open('dddreportconfig.xml', 'w')
0017 configXMLFile.write('<?xml version="1.0"?>\n')
0018 configXMLFile.write('<Configuration xmlns="." xmlns:xsi="." xsi:schemaLocation= "." name="CMSConfiguration" version="0">\n')
0019 configXMLFile.write('  <Include>\n')
0020 for name in xmlFiles:
0021     configXMLFile.write("    <File name=\"" + name + "\" url=\".\"/>\n")
0022 configXMLFile.write('  </Include>\n')
0023 configXMLFile.write('<Root fileName="cms.xml" logicalPartName="OCMS"/>\n')
0024 configXMLFile.write('</Configuration>\n')
0025 configXMLFile.close()
0026 
0027 # DDErrorReport is in $PATH
0028 command = "DDErrorReport dddreportconfig.xml -p"
0029 status = os.system( command )
0030 if (status != 0):
0031     sys.exit(1)