Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-12-01 23:40:23

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