CMS 3D CMS Logo

Public Member Functions

geometryXMLtoCSV::ContentHandler Class Reference

List of all members.

Public Member Functions

def endElement
def startElement

Detailed Description

Definition at line 35 of file geometryXMLtoCSV.py.


Member Function Documentation

def geometryXMLtoCSV::ContentHandler::endElement (   self,
  tag 
)

Definition at line 73 of file geometryXMLtoCSV.py.

00074                              :
00075         if tag == "operation":
00076             print ""  # end current line (note: no comma)
00077 
# Actually make it and use it on "stdin" (a file object)
def geometryXMLtoCSV::ContentHandler::startElement (   self,
  tag,
  attrib 
)

Definition at line 37 of file geometryXMLtoCSV.py.

00038                                        :
00039         attrib = dict(attrib.items())
00040         if "rawId" in attrib: raise Exception, "Please use \"rawIds = false\""
00041         if "aa" in attrib: raise Exception, "Please use \"survey = false\""
00042 
00043         # <DT...>: print wheel/station/sector/superlayer/layer
00044         if tag[0:2] == "DT":
00045             print tag,  # ending with a comma means "don't print end-of-line character"
00046             for a in "wheel", "station", "sector", "superlayer", "layer":
00047                 if a in attrib:
00048                     print (", %s" % attrib[a]),
00049                 else:
00050                     print ", ",
00051 
00052         # <CSC...>: print endcap/station/ring/chamber/layer
00053         elif tag[0:3] == "CSC":
00054             print tag,
00055             for a in "endcap", "station", "ring", "chamber", "layer":
00056                 if a in attrib:
00057                     print (", %s" % attrib[a]),
00058                 else:
00059                     print ", ",
00060 
00061         # <setposition>: print x, y, z and phix, phiy, phiz or alpha, beta, gamma
00062         elif tag == "setposition":
00063             print (", %(relativeto)s, %(x)s, %(y)s, %(z)s" % attrib),
00064             if "phix" in attrib:
00065                 print (", phixyz, %(phix)s, %(phiy)s, %(phiz)s" % attrib),
00066             else:
00067                 print (", Euler, %(alpha)s, %(beta)s, %(gamma)s" % attrib),
00068 
00069         # <setape>: print xx, xy, xz, yy, yz, zz
00070         elif tag == "setape":
00071             print (", %(xx)s, %(xy)s, %(xz)s, %(yy)s, %(yz)s, %(zz)s" % attrib),