4 from __future__
import print_function
6 from re
import split, sub
12 print(
"<MuonAlignment>")
16 line = sub(
"[ \t\n]+$",
"", line)
17 Alignable, struct1, struct2, struct3, struct4, struct5, \
18 relativeto, x, y, z, angletype, angle1, angle2, angle3, \
19 xx, xy, xz, yy, yz, zz =
split(
"[ \t]*,[ \t]", line)
22 if Alignable[0:2] ==
"DT":
23 print((
" <%s " % Alignable), end=
' ')
25 print((
"wheel=\"%s\" " % struct1), end=
' ')
27 print((
"station=\"%s\" " % struct2), end=
' ')
29 print((
"sector=\"%s\" " % struct3), end=
' ')
31 print((
"superlayer=\"%s\" " % struct4), end=
' ')
33 print((
"layer=\"%s\" " % struct5), end=
' ')
36 if Alignable[0:3] ==
"CSC":
37 print((
" <%s " % Alignable), end=
' ')
39 print((
"endcap=\"%s\" " % struct1), end=
' ')
41 print((
"station=\"%s\" " % struct2), end=
' ')
43 print((
"ring=\"%s\" " % struct3), end=
' ')
45 print((
"chamber=\"%s\" " % struct4), end=
' ')
47 print((
"layer=\"%s\" " % struct5), end=
' ')
50 if angletype ==
"phixyz":
51 print(
" <setposition relativeto=\"%s\" x=\"%s\" y=\"%s\" z=\"%s\" phix=\"%s\" phiy=\"%s\" phiz=\"%s\" />" \
52 % (relativeto, x, y, z, angle1, angle2, angle3))
54 print(
" <setposition relativeto=\"%s\" x=\"%s\" y=\"%s\" z=\"%s\" alpha=\"%s\" beta=\"%s\" gamma=\"%s\" />" \
55 % (relativeto, x, y, z, angle1, angle2, angle3))
57 print(
" <setape xx=\"%s\" xy=\"%s\" xz=\"%s\" yy=\"%s\" yz=\"%s\" zz=\"%s\" />" \
58 % (xx, xy, xz, yy, yz, zz))
63 print(
"</MuonAlignment>")