47 if dettype !=
"RPC" and dettype !=
"TGC":
50 stats = {
'miocts' : 0,
'sectors' : 0,
'rois' : 0}
52 infile = geometry.getFileName()
53 outfile = infile.replace(
".",
"_%s." % dettype)
56 sectorFilter =
lambda s : s[
'name'].startswith(
'B')
58 sectorFilter =
lambda s : s[
'name'].startswith(
'E')
or s[
'name'].startswith(
'F')
60 f =
open(outfile,
"write")
62 print(
'<?xml version="1.0" ?>\n', file=f)
63 print(
'<!DOCTYPE MuCTPiGeometry SYSTEM "MUCTPIGeometry.dtd">\n', file=f)
64 print(geometry.MuCTPiGeometry, file=f)
65 for mioct
in geometry.getMIOCTs():
68 print(
"</%s>" % geometry.MuCTPiGeometry.tag, file=f)
69 stats[
'miocts'] = len(geometry.getMIOCTs())
70 print(
"Wrote %s" % outfile)
72 print(
"Numbers for %s" % dettype)
73 print(
"#MIOCTs : %i" % stats[
'miocts'])
74 print(
"#Sectors : %i" % stats[
'sectors'])
75 print(
"#ROIs : %i" % stats[
'rois'])