6 Creating the xml file for tickness and density of each cell volume
7 for the service matirial.
9 Two kinds of material can be selected:
12 The thickness and density calculated from the photo of actual
13 cable arrangement and density of each cable.
16 No service matirial in the gap.
19 dom1 = xml.dom.getDOMImplementation()
20 doc = dom1.createDocument(
None,
"TicknessDensity",
None)
21 top_element = doc.documentElement
28 thickness_CDCback = (np.ones((16, 144)) * 1.0e-5).ravel()
31 thickness_CDCfor = (np.ones((16, 144)) * 1.0e-5).ravel()
34 thickness_ARICH = (np.ones((3, 144)) * 1.0e-5).ravel()
37 thickness_TOPback = (np.ones(144) * 1.0e-5).ravel()
40 thickness_TOPfor = (np.ones(144) * 1.0e-5).ravel()
43 thickness_ECLCOIL = (np.ones((92, 144)) * 1.0e-5).ravel()
46 thickness_ECLback = (np.ones((3, 5, 144)) * 1.0e-5).ravel()
49 thickness_ECLfor = (np.ones((3, 5, 144)) * 1.0e-5).ravel()
53 thickness_CDCback = (np.loadtxt(open(
"thickness_CDCback.csv",
"rb"), delimiter=
",")).ravel()
54 thickness_CDCback[thickness_CDCback < 1.0e-5] = 1.0e-5
60 thickness_CDCfor = (np.loadtxt(open(
"thickness_CDCfor.csv",
"rb"), delimiter=
",")).ravel()
61 thickness_CDCfor[thickness_CDCfor < 1.0e-5] = 1.0e-5
64 thickness_ARICH = (np.loadtxt(open(
"thickness_ARICH.csv",
"rb"), delimiter=
",")).ravel()
65 thickness_ARICH[thickness_ARICH < 1.0e-5] = 1.0e-5
68 thickness_TOPback = (np.loadtxt(open(
"thickness_TOP_back.csv",
"rb"), delimiter=
",")).ravel()
69 thickness_TOPback[thickness_TOPback < 1.0e-5] = 1.0e-5
72 thickness_TOPfor = (np.loadtxt(open(
"thickness_TOP_for.csv",
"rb"), delimiter=
",")).ravel()
73 thickness_TOPfor[thickness_TOPfor < 1.0e-5] = 1.0e-5
76 thickness_ECLCOIL = (np.loadtxt(open(
"thickness_ECLCOIL.csv",
"rb"), delimiter=
",")).ravel()
77 thickness_ECLCOIL[thickness_ECLCOIL < 1.0e-5] = 1.0e-5
80 thickness_ECLback = (np.loadtxt(open(
"thickness_ECLback.csv",
"rb"), delimiter=
",")).ravel()
81 thickness_ECLback[thickness_ECLback < 1.0e-5] = 1.0e-5
84 thickness_ECLfor = (np.loadtxt(open(
"thickness_ECLfor.csv",
"rb"), delimiter=
",")).ravel()
85 thickness_ECLfor[thickness_ECLfor < 1.0e-5] = 1.0e-5
87 thickness_list = list(map(str, thickness_CDCback.tolist() +
88 thickness_CDCfor.tolist() +
89 thickness_ARICH.tolist() +
90 thickness_TOPback.tolist() +
91 thickness_TOPfor.tolist() +
92 thickness_ECLCOIL.tolist() +
93 thickness_ECLback.tolist() +
94 thickness_ECLfor.tolist()))
99 density_ARICH = (np.ones(3) * 1.29e-10).ravel()
100 density_TOPback = (np.ones(1) * 1.29e-10).ravel()
101 density_TOPfor = (np.ones(1) * 1.29e-10).ravel()
102 density_ECLCOIL = (np.ones(1) * 1.29e-10).ravel()
103 density_ECLback = (np.ones(5) * 1.29e-10).ravel()
104 density_ECLfor = (np.ones(5) * 1.29e-10).ravel()
106 density_ARICH = (np.ones(3) * 8.96).ravel()
107 density_TOPback = (np.ones(1) * 8.96).ravel()
108 density_TOPfor = (np.ones(1) * 8.96).ravel()
109 density_ECLCOIL = (np.ones(1) * 8.96).ravel()
110 density_ECLback = (np.ones(5) * 8.96).ravel()
111 density_ECLfor = (np.ones(5) * 8.96).ravel()
114 density_list = list(map(str, density_ARICH.tolist() + density_TOPback.tolist() +
115 density_TOPfor.tolist() + density_ECLCOIL.tolist() +
116 density_ECLback.tolist() + density_ECLfor.tolist()))
119 'IRCDCBack':
u'segmentation in R of backward',
120 'IPhiCDCBack':
u'segmentation in Phi of backward',
121 'IRCDCFor':
u'segmentation in R of forward',
122 'IPhiCDCFor':
u'segmentation in Phi of forward',
123 'thicknesses':
u'thicknesses',
124 'IZARICHFor':
u'segmentation in Z of forward',
125 'IPhiARICHFor':
u'segmentation in Phi of forward',
126 'IPhiTOPBack':
u'segmentation in Phi of backward',
127 'IPhiTOPFor':
u'segmentation in Phi of forward',
128 'IZECLCOILBar':
u'segmentation in Z of barrel',
129 'IPhiECLCOILBar':
u'segmentation in Phi of barrel',
130 'IRECLBack':
u'segmentation in R of backward',
131 'IZECLBack':
u'segmentation in Z of backward',
132 'IPhiECLBack':
u'segmentation in Phi of backward',
133 'IRECLFor':
u'segmentation in R of forward',
134 'IZECLFor':
u'segmentation in Z of forward',
135 'IPhiECLFor':
u'segmentation in Phi of forward'}
143 'thicknesses': thickness_list,
149 'IPhiECLCOILBar': 144,
176 unit = {
'thicknesses':
'mm'}
178 for element
in elements:
179 sNode = doc.createElement(element)
180 sNode.setAttribute(
'desc', desc[element])
181 if element
in unit.keys():
182 sNode.setAttribute(
'unit', unit[element])
183 if isinstance(value[element], list):
184 textNode = doc.createTextNode(
" ".join(value[element]))
186 textNode = doc.createTextNode(str(value[element]))
187 sNode.appendChild(textNode)
188 top_element.appendChild(sNode)
190 xmlfile = open(
'GAPS-thickness-density.xml',
'w')
191 doc.writexml(xmlfile, addindent=
' ' * 4, newl=
'\n', encoding=
'utf-8')