CMS 3D CMS Logo

Functions
gemGeometryCustoms Namespace Reference

Functions

def geomReplace (process, key, targetXML)
 change the current default GEM geometry More...
 

Function Documentation

def gemGeometryCustoms.geomReplace (   process,
  key,
  targetXML 
)

change the current default GEM geometry

Definition at line 4 of file gemGeometryCustoms.py.

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 
19 
def geomReplace(process, key, targetXML)
change the current default GEM geometry