Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:10

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 ## change the current default GEM geometry
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  ## For now, to change multiple keys is not supported.
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