5 from re
import split, sub
11 print "<MuonAlignment>"
15 line = sub(
"[ \t\n]+$",
"", line)
16 Alignable, struct1, struct2, struct3, struct4, struct5, \
17 relativeto, x, y, z, angletype, angle1, angle2, angle3, \
18 xx, xy, xz, yy, yz, zz =
split(
"[ \t]*,[ \t]", line)
21 if Alignable[0:2] ==
"DT":
22 print (
" <%s " % Alignable),
24 print (
"wheel=\"%s\" " % struct1),
26 print (
"station=\"%s\" " % struct2),
28 print (
"sector=\"%s\" " % struct3),
30 print (
"superlayer=\"%s\" " % struct4),
32 print (
"layer=\"%s\" " % struct5),
35 if Alignable[0:3] ==
"CSC":
36 print (
" <%s " % Alignable),
38 print (
"endcap=\"%s\" " % struct1),
40 print (
"station=\"%s\" " % struct2),
42 print (
"ring=\"%s\" " % struct3),
44 print (
"chamber=\"%s\" " % struct4),
46 print (
"layer=\"%s\" " % struct5),
49 if angletype ==
"phixyz":
50 print " <setposition relativeto=\"%s\" x=\"%s\" y=\"%s\" z=\"%s\" phix=\"%s\" phiy=\"%s\" phiz=\"%s\" />" \
51 % (relativeto, x, y, z, angle1, angle2, angle3)
53 print " <setposition relativeto=\"%s\" x=\"%s\" y=\"%s\" z=\"%s\" alpha=\"%s\" beta=\"%s\" gamma=\"%s\" />" \
54 % (relativeto, x, y, z, angle1, angle2, angle3)
56 print " <setape xx=\"%s\" xy=\"%s\" xz=\"%s\" yy=\"%s\" yz=\"%s\" zz=\"%s\" />" \
57 % (xx, xy, xz, yy, yz, zz)
62 print "</MuonAlignment>"