File indexing completed on 2024-04-06 11:56:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 from __future__ import print_function
0028 from xml.sax import handler, make_parser
0029 from sys import stdin
0030
0031
0032 print("Alignable, wheel, station, sector, superlayer, layer, relativeto, x, y, z, angletype, phix, phiy, phiz, xx, xy, xz, yy, yz, zz")
0033 print(", endcap, station, ring, chamber, layer, , , , , , alpha, beta, gamma, , , , , , ")
0034
0035
0036 class ContentHandler(handler.ContentHandler):
0037
0038 def startElement(self, tag, attrib):
0039 attrib = dict(attrib.items())
0040 if "rawId" in attrib: raise Exception("Please use \"rawIds = false\"")
0041 if "aa" in attrib: raise Exception("Please use \"survey = false\"")
0042
0043
0044 if tag[0:2] == "DT":
0045 print(tag, end=' ')
0046 for a in "wheel", "station", "sector", "superlayer", "layer":
0047 if a in attrib:
0048 print((", %s" % attrib[a]), end=' ')
0049 else:
0050 print(", ", end=' ')
0051
0052
0053 elif tag[0:3] == "CSC":
0054 print(tag, end=' ')
0055 for a in "endcap", "station", "ring", "chamber", "layer":
0056 if a in attrib:
0057 print((", %s" % attrib[a]), end=' ')
0058 else:
0059 print(", ", end=' ')
0060
0061
0062 elif tag == "setposition":
0063 print((", %(relativeto)s, %(x)s, %(y)s, %(z)s" % attrib), end=' ')
0064 if "phix" in attrib:
0065 print((", phixyz, %(phix)s, %(phiy)s, %(phiz)s" % attrib), end=' ')
0066 else:
0067 print((", Euler, %(alpha)s, %(beta)s, %(gamma)s" % attrib), end=' ')
0068
0069
0070 elif tag == "setape":
0071 print((", %(xx)s, %(xy)s, %(xz)s, %(yy)s, %(yz)s, %(zz)s" % attrib), end=' ')
0072
0073
0074 def endElement(self, tag):
0075 if tag == "operation":
0076 print("")
0077
0078
0079 parser = make_parser()
0080 parser.setContentHandler(ContentHandler())
0081 parser.parse(stdin)