CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
gemGeometryCustoms Namespace Reference

Functions

def geomReplace
 change the current default GEM geometry More...
 

Function Documentation

def gemGeometryCustoms.geomReplace (   process,
  key,
  targetXML 
)

change the current default GEM geometry

Definition at line 5 of file gemGeometryCustoms.py.

References print().

5 
6 def geomReplace(process, key, targetXML) :
7  mynum=-1
8  originalXML=''
9  for i, xml in enumerate( process.XMLIdealGeometryESSource.geomXMLFiles) :
10  if ( xml.find(key) != -1 ) :
11  mynum, originalXML = i, xml
12  break ## For now, to change multiple keys is not supported.
13  if ( mynum != -1 and originalXML != targetXML ) :
14  print("Changing Geometry from %s to %s"%(originalXML, targetXML))
15  process.XMLIdealGeometryESSource.geomXMLFiles.remove(originalXML)
16  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,targetXML)
17  if ( mynum == -1) :
18  print("Alert! key is not found on XMLIdealGeometryESSource")
19  return process
20 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def geomReplace
change the current default GEM geometry