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