52 const int nBound = content.getNumberNodes(
"MomVol/ZBound");
53 for (
int iBound = 0; iBound < nBound; iBound++) {
54 const double rmin = content.getLength((boost::format(
"MomVol/ZBound[%1%]/Rmin") % (iBound + 1)).str()) /
Unit::mm;
55 const double rmax = content.getLength((boost::format(
"MomVol/ZBound[%1%]/Rmax") % (iBound + 1)).str()) /
Unit::mm;
56 const double z = content.getLength((boost::format(
"MomVol/ZBound[%1%]/Z") % (iBound + 1)).str()) /
Unit::mm;
62 const int nSLayer = content.getNumberNodes(
"SLayers/SLayer");
64 for (
int iSLayer = 0; iSLayer < nSLayer; ++iSLayer) {
66 layerContent.
append((boost::format(
"/SLayers/SLayer[%1%]/") % (iSLayer + 1)).str());
67 const double r = layerContent.
getLength(
"Radius");
68 const double zfwd = layerContent.
getLength(
"ForwardZ");
69 const double zbwd = layerContent.
getLength(
"BackwardZ");
70 const double dzfwd = layerContent.
getLength(
"FwdDeltaZ");
71 const double dzbwd = layerContent.
getLength(
"BwdDeltaZ");
72 const double offset = atof((layerContent.
getString(
"Offset")).c_str());
73 const int nWires = atoi((layerContent.
getString(
"NHoles")).c_str()) / 2;
74 const double nShifts = atof((layerContent.
getString(
"NShift")).c_str());
77 dzfwd, dzbwd, offset, nWires, nShifts);
83 const int nFLayer = content.getNumberNodes(
"FLayers/FLayer");
85 for (
int iFLayer = 0; iFLayer < nFLayer; ++iFLayer) {
87 layerContent.
append((boost::format(
"/FLayers/FLayer[%1%]/") % (iFLayer + 1)).str());
88 const double r = layerContent.
getLength(
"Radius");
89 const double zfwd = layerContent.
getLength(
"ForwardZ");
90 const double zbwd = layerContent.
getLength(
"BackwardZ");
96 const int nEndplates = content.getNumberNodes(
"Endplates/Endplate");
97 for (
int i = 0; i < nEndplates; ++i) {
102 epContent.
append((boost::format(
"/Endplates/Endplate[%1%]/") % (i + 1)).str());
105 for (
int iEPLayer = 0; iEPLayer < nEPLayer; ++iEPLayer) {
106 GearDir epLayerContent(epContent);
107 epLayerContent.
append((boost::format(
"/EndplateLayer[%1%]/") % (iEPLayer + 1)).str());
108 string epName = epLayerContent.
getString(
"Name");
109 double rmin = epLayerContent.
getLength(
"InnerR");
110 double rmax = epLayerContent.
getLength(
"OuterR");
111 double zfwd = epLayerContent.
getLength(
"ForwardZ");
112 double zbwd = epLayerContent.
getLength(
"BackwardZ");
113 std::string name =
"Layer" + to_string(i +
m_firstLayerOffset) + epName + to_string(iEPLayer);
115 ep.
appendNew(name, iEPLayer, rmin, rmax, zfwd, zbwd);
121 const int nInnerWall = content.getNumberNodes(
"InnerWalls/InnerWall");
122 for (
int i = 0; i < nInnerWall; ++i) {
123 GearDir innerWallContent(content);
124 innerWallContent.
append((boost::format(
"/InnerWalls/InnerWall[%1%]/") % (i + 1)).str());
126 string sInnerWallID = innerWallContent.
getString(
"@id");
127 const string name =
"InnerWall_" + sInnerWallID +
"_" + innerWallContent.
getString(
"Name");
128 const double rmin = innerWallContent.
getLength(
"InnerR");
129 const double rmax = innerWallContent.
getLength(
"OuterR");
130 const double zfwd = innerWallContent.
getLength(
"ForwardZ");
131 const double zbwd = innerWallContent.
getLength(
"BackwardZ");
132 const InnerWall wall(name, i, rmin, rmax, zfwd, zbwd);
134 if (innerWallContent.
getString(
"Name") ==
"Shield") {
141 const int nOuterWall = content.getNumberNodes(
"OuterWalls/OuterWall");
142 for (
int i = 0; i < nOuterWall; ++i) {
143 GearDir outerWallContent(content);
144 outerWallContent.
append((boost::format(
"/OuterWalls/OuterWall[%1%]/") % (i + 1)).str());
146 string sOuterWallID = outerWallContent.
getString(
"@id");
147 const string name =
"OuterWall_" + sOuterWallID +
"_" + outerWallContent.
getString(
"Name");
148 const double rmin = outerWallContent.
getLength(
"InnerR");
149 const double rmax = outerWallContent.
getLength(
"OuterR");
150 const double zfwd = outerWallContent.
getLength(
"ForwardZ");
151 const double zbwd = outerWallContent.
getLength(
"BackwardZ");
152 const OuterWall wall(name, i, rmin, rmax, zfwd, zbwd);
154 if (outerWallContent.
getString(
"Name") ==
"Shield") {
161 const int nEB = content.getNumberNodes(
"ElectronicsBoards/ElectronicsBoard");
162 for (
int iEB = 0; iEB < nEB; ++iEB) {
164 ebContent.
append((boost::format(
"/ElectronicsBoards/ElectronicsBoard[%1%]/") % (iEB + 1)).str());
166 const double rmin = ebContent.
getLength(
"EBInnerR");
167 const double rmax = ebContent.
getLength(
"EBOuterR");
168 const double zfwd = ebContent.
getLength(
"EBForwardZ");
169 const double zbwd = ebContent.
getLength(
"EBBackwardZ");
170 Frontend frontend(iEB, rmin, rmax, zfwd, zbwd);
175 const int nShields = content.getNumberNodes(
"Shields/Shield");
176 for (
int i = 0; i < nShields; ++i) {
178 neuContent.
append((boost::format(
"/Shields/Shield[%1%]/") % (i + 1)).str());
180 const double rmin1 = neuContent.
getLength(
"InnerR1");
181 const double rmin2 = neuContent.
getLength(
"InnerR2");
182 const double rmax1 = neuContent.
getLength(
"OuterR1");
183 const double rmax2 = neuContent.
getLength(
"OuterR2");
184 const double thick = neuContent.
getLength(
"Thickness");
185 const double z = neuContent.
getLength(
"PosZ");
186 const int ena = neuContent.
getInt(
"Enable");
188 NeutronShield shield(i, rmin1, rmin2, rmax1, rmax2, thick, z, ena);
193 const int nCovers = content.getNumberNodes(
"Covers/Cover");
194 for (
int i = 0; i < nCovers; ++i) {
196 coverContent.
append((boost::format(
"/Covers/Cover[%1%]/") % (i + 1)).str());
198 const int coverID = atoi((coverContent.
getString(
"@id")).c_str());
199 const double rmin1 = coverContent.
getLength(
"InnerR1");
200 const double rmin2 = coverContent.
getLength(
"InnerR2");
201 const double rmax1 = coverContent.
getLength(
"OuterR1");
202 const double rmax2 = coverContent.
getLength(
"OuterR2");
203 const double thick = coverContent.
getLength(
"Thickness");
204 const double z = coverContent.
getLength(
"PosZ");
205 Cover cover(coverID, rmin1, rmin2, rmax1, rmax2, thick, z);
209 const int nCover2s = content.getNumberNodes(
"Covers/Cover2");
210 for (
int i = 0; i < nCover2s; ++i) {
211 GearDir cover2Content(content);
212 cover2Content.
append((boost::format(
"/Covers/Cover2[%1%]/") % (i + 1)).str());
214 const int cover2ID = atoi((cover2Content.
getString(
"@id")).c_str());
215 const double rmin = cover2Content.
getLength(
"InnerR");
216 const double rmax = cover2Content.
getLength(
"OuterR");
217 const double phis = cover2Content.
getLength(
"StartPhi");
218 const double dphi = cover2Content.
getLength(
"DeltaPhi");
219 const double thick = cover2Content.
getLength(
"Thickness");
220 const double z = cover2Content.
getLength(
"PosZ");
221 Cover2 cover2(cover2ID, rmin, rmax, phis, dphi, thick, z);
225 const int nRibs = content.getNumberNodes(
"Covers/Rib");
226 for (
int i = 0; i < nRibs; ++i) {
228 ribContent.
append((boost::format(
"/Covers/Rib[%1%]/") % (i + 1)).str());
230 const int ribID = atoi((ribContent.
getString(
"@id")).c_str());
231 const double length = ribContent.
getLength(
"Length");
232 const double width = ribContent.
getLength(
"Width");
233 const double thick = ribContent.
getLength(
"Thickness");
234 const double rotx = ribContent.
getLength(
"RotX");
235 const double roty = ribContent.
getLength(
"RotY");
236 const double rotz = ribContent.
getLength(
"RotZ");
237 const double x = ribContent.
getLength(
"PosX");
238 const double y = ribContent.
getLength(
"PosY");
239 const double z = ribContent.
getLength(
"PosZ");
240 const int offset = atoi((ribContent.
getString(
"Offset")).c_str());
241 const int ndiv = atoi((ribContent.
getString(
"NDiv")).c_str());
242 Rib rib(ribID, length, width, thick, rotx, roty, rotz, x, y, z, offset, ndiv);
246 const int nRib2s = content.getNumberNodes(
"Covers/Rib2");
247 for (
int i = 0; i < nRib2s; ++i) {
249 rib2Content.
append((boost::format(
"/Covers/Rib2[%1%]/") % (i + 1)).str());
251 const int rib2ID = atoi((rib2Content.
getString(
"@id")).c_str());
252 const double length = rib2Content.
getLength(
"Length");
253 const double width = rib2Content.
getLength(
"Width");
254 const double thick = rib2Content.
getLength(
"Thickness");
255 const double width2 = rib2Content.
getLength(
"Width2");
256 const double thick2 = rib2Content.
getLength(
"Thickness2");
257 const double rotx = rib2Content.
getLength(
"RotX");
258 const double roty = rib2Content.
getLength(
"RotY");
259 const double rotz = rib2Content.
getLength(
"RotZ");
260 const double x = rib2Content.
getLength(
"PosX");
261 const double y = rib2Content.
getLength(
"PosY");
262 const double z = rib2Content.
getLength(
"PosZ");
263 const int ndiv = atoi((rib2Content.
getString(
"NDiv")).c_str());
264 Rib2 rib2(rib2ID, length, width, thick, width2, thick2, rotx, roty, rotz,
269 const int nRib3s = content.getNumberNodes(
"Covers/Rib3");
270 for (
int i = 0; i < nRib3s; ++i) {
272 rib3Content.
append((boost::format(
"/Covers/Rib3[%1%]/") % (i + 1)).str());
274 const int rib3ID = atoi((rib3Content.
getString(
"@id")).c_str());
275 const double length = rib3Content.
getLength(
"Length");
276 const double width = rib3Content.
getLength(
"Width");
277 const double thick = rib3Content.
getLength(
"Thickness");
278 const double r = rib3Content.
getLength(
"HoleR");
279 const double x = rib3Content.
getLength(
"PosX");
280 const double y = rib3Content.
getLength(
"PosY");
281 const double z = rib3Content.
getLength(
"PosZ");
282 const double rx = rib3Content.
getLength(
"HoleX");
283 const double ry = rib3Content.
getLength(
"HoleY");
284 const double rz = rib3Content.
getLength(
"HoleZ");
285 const int offset = atoi((rib3Content.
getString(
"Offset")).c_str());
286 const int ndiv = atoi((rib3Content.
getString(
"NDiv")).c_str());
287 Rib3 rib3(rib3ID, length, width, thick, r, x, y, z, rx, ry, rz, offset, ndiv);
291 const int nRib4s = content.getNumberNodes(
"Covers/Rib4");
292 for (
int i = 0; i < nRib4s; ++i) {
294 rib4Content.
append((boost::format(
"/Covers/Rib4[%1%]/") % (i + 1)).str());
296 const int rib4ID = atoi((rib4Content.
getString(
"@id")).c_str());
297 const double length = rib4Content.
getLength(
"Length");
298 const double width = rib4Content.
getLength(
"Width");
299 const double thick = rib4Content.
getLength(
"Thickness");
300 const double length2 = rib4Content.
getLength(
"Length2");
301 const double width2 = rib4Content.
getLength(
"Width2");
302 const double thick2 = rib4Content.
getLength(
"Thickness2");
303 const double x = rib4Content.
getLength(
"PosX");
304 const double y = rib4Content.
getLength(
"PosY");
305 const double z = rib4Content.
getLength(
"PosZ");
306 const double x2 = rib4Content.
getLength(
"HoleX");
307 const double y2 = rib4Content.
getLength(
"HoleY");
308 const double z2 = rib4Content.
getLength(
"HoleZ");
309 const int offset = atoi((rib4Content.
getString(
"Offset")).c_str());
310 const int ndiv = atoi((rib4Content.
getString(
"NDiv")).c_str());
311 Rib4 rib4(rib4ID, length, width, thick, length2, width2, thick2, x, y, z, x2, y2, z2, offset, ndiv);
315 const int nRib5s = content.getNumberNodes(
"Covers/Rib5");
316 for (
int i = 0; i < nRib5s; ++i) {
318 rib5Content.
append((boost::format(
"/Covers/Rib5[%1%]/") % (i + 1)).str());
320 const int rib5ID = atoi((rib5Content.
getString(
"@id")).c_str());
321 const double dr = rib5Content.
getLength(
"DR");
322 const double dz = rib5Content.
getLength(
"DZ");
323 const double width = rib5Content.
getLength(
"Width");
324 const double thick = rib5Content.
getLength(
"Thickness");
325 const double rin = rib5Content.
getLength(
"Rin");
326 const double x = rib5Content.
getLength(
"PosX");
327 const double y = rib5Content.
getLength(
"PosY");
328 const double z = rib5Content.
getLength(
"PosZ");
329 const double rotx = rib5Content.
getLength(
"RotX");
330 const double roty = rib5Content.
getLength(
"RotY");
331 const double rotz = rib5Content.
getLength(
"RotZ");
332 const int offset = atoi((rib5Content.
getString(
"Offset")).c_str());
333 const int ndiv = atoi((rib5Content.
getString(
"NDiv")).c_str());
334 Rib5 rib5(rib5ID, dr, dz, width, thick, rin, x, y, z,
335 rotx, roty, rotz, offset, ndiv);
342 senseWire.
append(
"/SenseWire/");
349 fieldWire.
append(
"/FieldWire/");