35{
36
44
51
52
53 const int nBound = content.getNumberNodes("MomVol/ZBound");
54 for (int iBound = 0; iBound < nBound; iBound++) {
55 const double rmin = content.getLength((format(
"MomVol/ZBound[%1%]/Rmin") % (iBound + 1)).str()) /
Unit::mm;
56 const double rmax = content.getLength((format(
"MomVol/ZBound[%1%]/Rmax") % (iBound + 1)).str()) /
Unit::mm;
57 const double z = content.getLength((format(
"MomVol/ZBound[%1%]/Z") % (iBound + 1)).str()) /
Unit::mm;
59 }
60
61
62
63 const int nSLayer = content.getNumberNodes("SLayers/SLayer");
64
65 for (int iSLayer = 0; iSLayer < nSLayer; ++iSLayer) {
67 layerContent.append((format("/SLayers/SLayer[%1%]/") % (iSLayer + 1)).str());
68 const double r = layerContent.getLength("Radius");
69 const double zfwd = layerContent.getLength("ForwardZ");
70 const double zbwd = layerContent.getLength("BackwardZ");
71 const double dzfwd = layerContent.getLength("FwdDeltaZ");
72 const double dzbwd = layerContent.getLength("BwdDeltaZ");
73 const double offset = atof((layerContent.getString("Offset")).c_str());
74 const int nWires = atoi((layerContent.getString("NHoles")).c_str()) / 2;
75 const double nShifts = atof((layerContent.getString("NShift")).c_str());
76
78 dzfwd, dzbwd, offset, nWires, nShifts);
79
81 }
82
83
84 const int nFLayer = content.getNumberNodes("FLayers/FLayer");
85
86 for (int iFLayer = 0; iFLayer < nFLayer; ++iFLayer) {
88 layerContent.append((format("/FLayers/FLayer[%1%]/") % (iFLayer + 1)).str());
89 const double r = layerContent.getLength("Radius");
90 const double zfwd = layerContent.getLength("ForwardZ");
91 const double zbwd = layerContent.getLength("BackwardZ");
94 }
95
96
97 const int nEndplates = content.getNumberNodes("Endplates/Endplate");
98 for (int i = 0; i < nEndplates; ++i) {
99
100 EndPlate ep(i);
101
103 epContent.append((format("/Endplates/Endplate[%1%]/") % (i + 1)).str());
104 const int nEPLayer = epContent.getNumberNodes("EndplateLayer");
105
106 for (int iEPLayer = 0; iEPLayer < nEPLayer; ++iEPLayer) {
107 GearDir epLayerContent(epContent);
108 epLayerContent.append((format("/EndplateLayer[%1%]/") % (iEPLayer + 1)).str());
109 string epName = epLayerContent.getString("Name");
110 double rmin = epLayerContent.getLength("InnerR");
111 double rmax = epLayerContent.getLength("OuterR");
112 double zfwd = epLayerContent.getLength("ForwardZ");
113 double zbwd = epLayerContent.getLength("BackwardZ");
114 std::string name =
"Layer" + to_string(i +
m_firstLayerOffset) + epName + to_string(iEPLayer);
115
116 ep.appendNew(name, iEPLayer, rmin, rmax, zfwd, zbwd);
117 }
119 }
120
121
122 const int nInnerWall = content.getNumberNodes("InnerWalls/InnerWall");
123 for (int i = 0; i < nInnerWall; ++i) {
124 GearDir innerWallContent(content);
125 innerWallContent.append((format("/InnerWalls/InnerWall[%1%]/") % (i + 1)).str());
126
127 string sInnerWallID = innerWallContent.getString("@id");
128 const string name = "InnerWall_" + sInnerWallID + "_" + innerWallContent.getString("Name");
129 const double rmin = innerWallContent.getLength("InnerR");
130 const double rmax = innerWallContent.getLength("OuterR");
131 const double zfwd = innerWallContent.getLength("ForwardZ");
132 const double zbwd = innerWallContent.getLength("BackwardZ");
133 const InnerWall wall(name, i, rmin, rmax, zfwd, zbwd);
135 if (innerWallContent.getString("Name") == "Shield") {
137 }
138 }
139
140
141
142 const int nOuterWall = content.getNumberNodes("OuterWalls/OuterWall");
143 for (int i = 0; i < nOuterWall; ++i) {
144 GearDir outerWallContent(content);
145 outerWallContent.append((format("/OuterWalls/OuterWall[%1%]/") % (i + 1)).str());
146
147 string sOuterWallID = outerWallContent.getString("@id");
148 const string name = "OuterWall_" + sOuterWallID + "_" + outerWallContent.getString("Name");
149 const double rmin = outerWallContent.getLength("InnerR");
150 const double rmax = outerWallContent.getLength("OuterR");
151 const double zfwd = outerWallContent.getLength("ForwardZ");
152 const double zbwd = outerWallContent.getLength("BackwardZ");
153 const OuterWall wall(name, i, rmin, rmax, zfwd, zbwd);
155 if (outerWallContent.getString("Name") == "Shield") {
157 }
158 }
159
160
161
162 const int nEB = content.getNumberNodes("ElectronicsBoards/ElectronicsBoard");
163 for (int iEB = 0; iEB < nEB; ++iEB) {
165 ebContent.append((format("/ElectronicsBoards/ElectronicsBoard[%1%]/") % (iEB + 1)).str());
166
167 const double rmin = ebContent.getLength("EBInnerR");
168 const double rmax = ebContent.getLength("EBOuterR");
169 const double zfwd = ebContent.getLength("EBForwardZ");
170 const double zbwd = ebContent.getLength("EBBackwardZ");
171 Frontend frontend(iEB, rmin, rmax, zfwd, zbwd);
173 }
174
175
176 const int nShields = content.getNumberNodes("Shields/Shield");
177 for (int i = 0; i < nShields; ++i) {
179 neuContent.append((format("/Shields/Shield[%1%]/") % (i + 1)).str());
180
181 const double rmin1 = neuContent.getLength("InnerR1");
182 const double rmin2 = neuContent.getLength("InnerR2");
183 const double rmax1 = neuContent.getLength("OuterR1");
184 const double rmax2 = neuContent.getLength("OuterR2");
185 const double thick = neuContent.getLength("Thickness");
186 const double z = neuContent.getLength("PosZ");
187 NeutronShield shield(i, rmin1, rmin2, rmax1, rmax2, thick, z);
189 }
190
191
192 const int nCovers = content.getNumberNodes("Covers/Cover");
193 for (int i = 0; i < nCovers; ++i) {
195 coverContent.append((format("/Covers/Cover[%1%]/") % (i + 1)).str());
196
197 const int coverID = atoi((coverContent.getString("@id")).c_str());
198 const double rmin1 = coverContent.getLength("InnerR1");
199 const double rmin2 = coverContent.getLength("InnerR2");
200 const double rmax1 = coverContent.getLength("OuterR1");
201 const double rmax2 = coverContent.getLength("OuterR2");
202 const double thick = coverContent.getLength("Thickness");
203 const double z = coverContent.getLength("PosZ");
204 Cover cover(coverID, rmin1, rmin2, rmax1, rmax2, thick, z);
206 }
207
208 const int nCover2s = content.getNumberNodes("Covers/Cover2");
209 for (int i = 0; i < nCover2s; ++i) {
210 GearDir cover2Content(content);
211 cover2Content.append((format("/Covers/Cover2[%1%]/") % (i + 1)).str());
212
213 const int cover2ID = atoi((cover2Content.getString("@id")).c_str());
214 const double rmin = cover2Content.getLength("InnerR");
215 const double rmax = cover2Content.getLength("OuterR");
216 const double phis = cover2Content.getLength("StartPhi");
217 const double dphi = cover2Content.getLength("DeltaPhi");
218 const double thick = cover2Content.getLength("Thickness");
219 const double z = cover2Content.getLength("PosZ");
220 Cover2 cover2(cover2ID, rmin, rmax, phis, dphi, thick, z);
222 }
223
224 const int nRibs = content.getNumberNodes("Covers/Rib");
225 for (int i = 0; i < nRibs; ++i) {
227 ribContent.append((format("/Covers/Rib[%1%]/") % (i + 1)).str());
228
229 const int ribID = atoi((ribContent.getString("@id")).c_str());
230 const double length = ribContent.getLength("Length");
231 const double width = ribContent.getLength("Width");
232 const double thick = ribContent.getLength("Thickness");
233 const double rotx = ribContent.getLength("RotX");
234 const double roty = ribContent.getLength("RotY");
235 const double rotz = ribContent.getLength("RotZ");
236 const double x = ribContent.getLength("PosX");
237 const double y = ribContent.getLength("PosY");
238 const double z = ribContent.getLength("PosZ");
239 const int offset = atoi((ribContent.getString("Offset")).c_str());
240 const int ndiv = atoi((ribContent.getString("NDiv")).c_str());
241 Rib rib(ribID, length, width, thick, rotx, roty, rotz, x, y, z, offset, ndiv);
243 }
244
245 const int nRib2s = content.getNumberNodes("Covers/Rib2");
246 for (int i = 0; i < nRib2s; ++i) {
248 rib2Content.append((format("/Covers/Rib2[%1%]/") % (i + 1)).str());
249
250 const int rib2ID = atoi((rib2Content.getString("@id")).c_str());
251 const double length = rib2Content.getLength("Length");
252 const double width = rib2Content.getLength("Width");
253 const double thick = rib2Content.getLength("Thickness");
254 const double width2 = rib2Content.getLength("Width2");
255 const double thick2 = rib2Content.getLength("Thickness2");
256 const double rotx = rib2Content.getLength("RotX");
257 const double roty = rib2Content.getLength("RotY");
258 const double rotz = rib2Content.getLength("RotZ");
259 const double x = rib2Content.getLength("PosX");
260 const double y = rib2Content.getLength("PosY");
261 const double z = rib2Content.getLength("PosZ");
262 const int ndiv = atoi((rib2Content.getString("NDiv")).c_str());
263 Rib2 rib2(rib2ID, length, width, thick, width2, thick2, rotx, roty, rotz,
264 x, y, z, ndiv);
266 }
267
268 const int nRib3s = content.getNumberNodes("Covers/Rib3");
269 for (int i = 0; i < nRib3s; ++i) {
271 rib3Content.append((format("/Covers/Rib3[%1%]/") % (i + 1)).str());
272
273 const int rib3ID = atoi((rib3Content.getString("@id")).c_str());
274 const double length = rib3Content.getLength("Length");
275 const double width = rib3Content.getLength("Width");
276 const double thick = rib3Content.getLength("Thickness");
277 const double r = rib3Content.getLength("HoleR");
278 const double x = rib3Content.getLength("PosX");
279 const double y = rib3Content.getLength("PosY");
280 const double z = rib3Content.getLength("PosZ");
281 const double rx = rib3Content.getLength("HoleX");
282 const double ry = rib3Content.getLength("HoleY");
283 const double rz = rib3Content.getLength("HoleZ");
284 const int offset = atoi((rib3Content.getString("Offset")).c_str());
285 const int ndiv = atoi((rib3Content.getString("NDiv")).c_str());
286 Rib3 rib3(rib3ID, length, width, thick, r, x, y, z, rx, ry, rz, offset, ndiv);
288 }
289
290 const int nRib4s = content.getNumberNodes("Covers/Rib4");
291 for (int i = 0; i < nRib4s; ++i) {
293 rib4Content.append((format("/Covers/Rib4[%1%]/") % (i + 1)).str());
294
295 const int rib4ID = atoi((rib4Content.getString("@id")).c_str());
296 const double length = rib4Content.getLength("Length");
297 const double width = rib4Content.getLength("Width");
298 const double thick = rib4Content.getLength("Thickness");
299 const double length2 = rib4Content.getLength("Length2");
300 const double width2 = rib4Content.getLength("Width2");
301 const double thick2 = rib4Content.getLength("Thickness2");
302 const double x = rib4Content.getLength("PosX");
303 const double y = rib4Content.getLength("PosY");
304 const double z = rib4Content.getLength("PosZ");
305 const double x2 = rib4Content.getLength("HoleX");
306 const double y2 = rib4Content.getLength("HoleY");
307 const double z2 = rib4Content.getLength("HoleZ");
308 const int offset = atoi((rib4Content.getString("Offset")).c_str());
309 const int ndiv = atoi((rib4Content.getString("NDiv")).c_str());
310 Rib4 rib4(rib4ID, length, width, thick, length2, width2, thick2, x, y, z, x2, y2, z2, offset, ndiv);
312 }
313
314 const int nRib5s = content.getNumberNodes("Covers/Rib5");
315 for (int i = 0; i < nRib5s; ++i) {
317 rib5Content.append((format("/Covers/Rib5[%1%]/") % (i + 1)).str());
318
319 const int rib5ID = atoi((rib5Content.getString("@id")).c_str());
320 const double dr = rib5Content.getLength("DR");
321 const double dz = rib5Content.getLength("DZ");
322 const double width = rib5Content.getLength("Width");
323 const double thick = rib5Content.getLength("Thickness");
324 const double rin = rib5Content.getLength("Rin");
325 const double x = rib5Content.getLength("PosX");
326 const double y = rib5Content.getLength("PosY");
327 const double z = rib5Content.getLength("PosZ");
328 const double rotx = rib5Content.getLength("RotX");
329 const double roty = rib5Content.getLength("RotY");
330 const double rotz = rib5Content.getLength("RotZ");
331 const int offset = atoi((rib5Content.getString("Offset")).c_str());
332 const int ndiv = atoi((rib5Content.getString("NDiv")).c_str());
333 Rib5 rib5(rib5ID, dr, dz, width, thick, rin, x, y, z,
334 rotx, roty, rotz, offset, ndiv);
336 }
337
338
339
341 senseWire.append("/SenseWire/");
343
345
346
348 fieldWire.append("/FieldWire/");
350
352
353
354
356
357
358
361
362}
void appendNode(double rmin, double rmax, double z)
Append a new node.
GearDir is the basic class used for accessing the parameter store.
static const double mm
[millimeters]