CMS 3D CMS Logo

gemGeometryCustoms.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 ## change the current default GEM geometry
4 def geomReplace(process, key, targetXML) :
5  mynum=-1
6  originalXML=''
7  for i, xml in enumerate( process.XMLIdealGeometryESSource.geomXMLFiles) :
8  if ( xml.find(key) != -1 ) :
9  mynum, originalXML = i, xml
10  break ## For now, to change multiple keys is not supported.
11  if ( mynum != -1 and originalXML != targetXML ) :
12  print "Changing Geometry from %s to %s"%(originalXML, targetXML)
13  process.XMLIdealGeometryESSource.geomXMLFiles.remove(originalXML)
14  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,targetXML)
15  if ( mynum == -1) :
16  print "Alert! key is not found on XMLIdealGeometryESSource"
17  return process
18 
def geomReplace(process, key, targetXML)
change the current default GEM geometry