File indexing completed on 2023-03-17 13:03:00
0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003
0004
0005 def geomReplace(process, key, targetXML) :
0006 mynum=-1
0007 originalXML=''
0008 for i, xml in enumerate( process.XMLIdealGeometryESSource.geomXMLFiles) :
0009 if ( xml.find(key) != -1 ) :
0010 mynum, originalXML = i, xml
0011 break
0012 if ( mynum != -1 and originalXML != targetXML ) :
0013 print("Changing Geometry from %s to %s"%(originalXML, targetXML))
0014 process.XMLIdealGeometryESSource.geomXMLFiles.remove(originalXML)
0015 process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,targetXML)
0016 if ( mynum == -1) :
0017 print("Alert! key is not found on XMLIdealGeometryESSource")
0018 return process
0019