File indexing completed on 2024-11-25 02:29:03
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 xml.sax import handler, make_parser
0028 from sys import stdin
0029
0030
0031 print("Alignable, wheel, station, sector, superlayer, layer, relativeto, x, y, z, angletype, phix, phiy, phiz, xx, xy, xz, yy, yz, zz")
0032 print(", endcap, station, ring, chamber, layer, , , , , , alpha, beta, gamma, , , , , , ")
0033
0034
0035 class ContentHandler(handler.ContentHandler):
0036
0037 def startElement(self, tag, attrib):
0038 attrib = dict(attrib.items())
0039 if "rawId" in attrib: raise Exception("Please use \"rawIds = false\"")
0040 if "aa" in attrib: raise Exception("Please use \"survey = false\"")
0041
0042
0043 if tag[0:2] == "DT":
0044 print(tag, end=' ')
0045 for a in "wheel", "station", "sector", "superlayer", "layer":
0046 if a in attrib:
0047 print((", %s" % attrib[a]), end=' ')
0048 else:
0049 print(", ", end=' ')
0050
0051
0052 elif tag[0:3] == "CSC":
0053 print(tag, end=' ')
0054 for a in "endcap", "station", "ring", "chamber", "layer":
0055 if a in attrib:
0056 print((", %s" % attrib[a]), end=' ')
0057 else:
0058 print(", ", end=' ')
0059
0060
0061 elif tag == "setposition":
0062 print((", %(relativeto)s, %(x)s, %(y)s, %(z)s" % attrib), end=' ')
0063 if "phix" in attrib:
0064 print((", phixyz, %(phix)s, %(phiy)s, %(phiz)s" % attrib), end=' ')
0065 else:
0066 print((", Euler, %(alpha)s, %(beta)s, %(gamma)s" % attrib), end=' ')
0067
0068
0069 elif tag == "setape":
0070 print((", %(xx)s, %(xy)s, %(xz)s, %(yy)s, %(yz)s, %(zz)s" % attrib), end=' ')
0071
0072
0073 def endElement(self, tag):
0074 if tag == "operation":
0075 print("")
0076
0077
0078 parser = make_parser()
0079 parser.setContentHandler(ContentHandler())
0080 parser.parse(stdin)