143 fFileEngine[fFILENO] = gdml;
148 ParseGDML(gdml, mainnode);
172 const char* posistr =
"position";
173 const char* setustr =
"setup";
174 const char* consstr =
"constant";
175 const char* varistr =
"variable";
176 const char* rotastr =
"rotation";
177 const char* scalstr =
"scale";
178 const char* elemstr =
"element";
179 const char* istpstr =
"isotope";
180 const char* matestr =
"material";
181 const char* volustr =
"volume";
182 const char* assestr =
"assembly";
183 const char* twtrstr =
"twistedtrap";
184 const char* cutTstr =
"cutTube";
185 const char* bboxstr =
"box";
186 const char* xtrustr =
"xtru";
187 const char* arb8str =
"arb8";
188 const char* tubestr =
"tube";
189 const char* conestr =
"cone";
190 const char* polystr =
"polycone";
191 const char* hypestr =
"hype";
192 const char* trapstr =
"trap";
193 const char* trdstr =
"trd";
194 const char* sphestr =
"sphere";
195 const char* orbstr =
"orb";
196 const char* parastr =
"para";
197 const char* torustr =
"torus";
198 const char* hedrstr =
"polyhedra";
199 const char* eltustr =
"eltube";
200 const char* subtstr =
"subtraction";
201 const char* uniostr =
"union";
202 const char* parbstr =
"paraboloid";
203 const char* intestr =
"intersection";
204 const char* reflstr =
"reflectedSolid";
205 const char* ellistr =
"ellipsoid";
206 const char* elcnstr =
"elcone";
207 const char* usrstr =
"userinfo";
209 Bool_t hasIsotopesExtended;
211 if ((strcmp(name, posistr)) == 0) {
213 }
else if ((strcmp(name, rotastr)) == 0) {
215 }
else if ((strcmp(name, scalstr)) == 0) {
217 }
else if ((strcmp(name, setustr)) == 0) {
219 }
else if ((strcmp(name, consstr)) == 0) {
221 }
else if ((strcmp(name, varistr)) == 0) {
226 else if (((strcmp(name,
"atom")) == 0) && ((strcmp(parent, elemstr)) == 0)) {
228 hasIsotopesExtended =
kFALSE;
229 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
231 else if ((strcmp(name, elemstr) == 0) && !gdml->
HasAttr(node,
"Z")) {
233 hasIsotopesExtended =
kFALSE;
234 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
237 else if ((strcmp(name, elemstr) == 0) && gdml->
HasAttr(node,
"Z")) {
239 if ((strcmp(gdml->
GetNodeName(childtmp),
"fraction") == 0) ){
241 hasIsotopesExtended =
kTRUE;
242 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);}
247 else if (((strcmp(name,
"atom")) == 0) && ((strcmp(parent, istpstr)) == 0)) {
252 else if ((strcmp(name, matestr)) == 0 && gdml->
HasAttr(node,
"Z")) {
259 atom = strcmp(gdml->
GetNodeName(childtmp),
"atom")==0;
262 int z = (atom) ? 1 : 0;
265 else if ((strcmp(name, matestr)) == 0 && !gdml->
HasAttr(node,
"Z")) {
271 else if ((strcmp(name, volustr)) == 0) {
273 }
else if ((strcmp(name, bboxstr)) == 0) {
274 node =
Box(gdml, node, attr);
275 }
else if ((strcmp(name, ellistr)) == 0) {
277 }
else if ((strcmp(name, elcnstr)) == 0) {
278 node =
ElCone(gdml, node, attr);
279 }
else if ((strcmp(name, cutTstr)) == 0) {
280 node =
CutTube(gdml, node, attr);
281 }
else if ((strcmp(name, arb8str)) == 0) {
282 node =
Arb8(gdml, node, attr);
283 }
else if ((strcmp(name, tubestr)) == 0) {
284 node =
Tube(gdml, node, attr);
285 }
else if ((strcmp(name, conestr)) == 0) {
286 node =
Cone(gdml, node, attr);
287 }
else if ((strcmp(name, polystr)) == 0) {
289 }
else if ((strcmp(name, trapstr)) == 0) {
290 node =
Trap(gdml, node, attr);
291 }
else if ((strcmp(name, trdstr)) == 0) {
292 node =
Trd(gdml, node, attr);
293 }
else if ((strcmp(name, sphestr)) == 0) {
294 node =
Sphere(gdml, node, attr);
295 }
else if ((strcmp(name, xtrustr)) == 0) {
296 node =
Xtru(gdml, node, attr);
297 }
else if ((strcmp(name, twtrstr)) == 0) {
299 }
else if ((strcmp(name, hypestr)) == 0) {
300 node =
Hype(gdml, node, attr);
301 }
else if ((strcmp(name, orbstr)) == 0) {
302 node =
Orb(gdml, node, attr);
303 }
else if ((strcmp(name, parastr)) == 0) {
304 node =
Para(gdml, node, attr);
305 }
else if ((strcmp(name, torustr)) == 0) {
306 node =
Torus(gdml, node, attr);
307 }
else if ((strcmp(name, eltustr)) == 0) {
308 node =
ElTube(gdml, node, attr);
309 }
else if ((strcmp(name, hedrstr)) == 0) {
311 }
else if ((strcmp(name, parbstr)) == 0) {
313 }
else if ((strcmp(name, subtstr)) == 0) {
314 node =
BooSolid(gdml, node, attr, 1);
315 }
else if ((strcmp(name, intestr)) == 0) {
316 node =
BooSolid(gdml, node, attr, 2);
317 }
else if ((strcmp(name, uniostr)) == 0) {
318 node =
BooSolid(gdml, node, attr, 3);
319 }
else if ((strcmp(name, reflstr)) == 0) {
321 }
else if ((strcmp(name, assestr)) == 0) {
323 }
else if ((strcmp(name, usrstr)) == 0) {
326 }
else if (((strcmp(name,
"gdml")) != 0) && ((strcmp(name,
"define")) != 0) &&
327 ((strcmp(name,
"element")) != 0) && ((strcmp(name,
"materials")) != 0) &&
328 ((strcmp(name,
"solids")) != 0) && ((strcmp(name,
"structure")) != 0) &&
329 ((strcmp(name,
"zplane")) != 0) && ((strcmp(name,
"first")) != 0) &&
330 ((strcmp(name,
"second")) != 0) && ((strcmp(name,
"twoDimVertex")) != 0) &&
331 ((strcmp(name,
"firstposition")) != 0) && ((strcmp(name,
"firstpositionref")) != 0) &&
332 ((strcmp(name,
"firstrotation")) != 0) && ((strcmp(name,
"firstrotationref")) != 0) &&
333 ((strcmp(name,
"section")) != 0) && ((strcmp(name,
"world")) != 0) &&
334 ((strcmp(name,
"isotope")) != 0)) {
335 std::cout <<
"Error: Unsupported GDML Tag Used :" << name <<
". Please Check Geometry/Schema." << std::endl;
367 if ((strcmp(axisString,
"kXAxis")) == 0) {
369 }
else if ((strcmp(axisString,
"kYAxis")) == 0) {
371 }
else if ((strcmp(axisString,
"kZAxis")) == 0) {
373 }
else if ((strcmp(axisString,
"kRho")) == 0) {
375 }
else if ((strcmp(axisString,
"kPhi")) == 0) {
393 if (index >= 0) stripped = stripped(0, index);
394 return stripped.
Data();
413 if (tempattr ==
"name") {
416 if (tempattr ==
"value") {
440 if (strcmp(unit,
"mm") == 0) {
442 }
else if (strcmp(unit,
"milimeter") == 0) {
444 }
else if (strcmp(unit,
"cm") == 0) {
446 }
else if (strcmp(unit,
"centimeter") == 0) {
448 }
else if (strcmp(unit,
"m") == 0) {
450 }
else if (strcmp(unit,
"meter") == 0) {
452 }
else if (strcmp(unit,
"km") == 0) {
453 retunit =
"100000.0";
454 }
else if (strcmp(unit,
"kilometer") == 0) {
455 retunit =
"100000.0";
456 }
else if (strcmp(unit,
"rad") == 0) {
458 }
else if (strcmp(unit,
"radian") == 0) {
460 }
else if (strcmp(unit,
"deg") == 0) {
462 }
else if (strcmp(unit,
"degree") == 0) {
464 }
else if (strcmp(unit,
"pi") == 0) {
466 }
else if (strcmp(unit,
"avogadro") == 0) {
469 Fatal(
"GetScale",
"Unit <%s> not known", unit);
488 if ((unit ==
"mm") || (unit ==
"milimeter")) {
490 }
else if ((unit ==
"cm") || (unit ==
"centimeter")) {
492 }
else if ((unit ==
"m") || (unit ==
"meter")) {
494 }
else if ((unit ==
"km") || (unit ==
"kilometer")) {
496 }
else if ((unit ==
"rad") || (unit ==
"radian")) {
498 }
else if ((unit ==
"deg") || (unit ==
"degree")) {
500 }
else if ((unit ==
"ev") || (unit ==
"electronvolt")) {
501 retunit = 0.000000001;
502 }
else if ((unit ==
"kev") || (unit ==
"kiloelectronvolt")) {
504 }
else if ((unit ==
"mev") || (unit ==
"megaelectronvolt")) {
506 }
else if ((unit ==
"gev") || (unit ==
"gigaelectronvolt")) {
508 }
else if (unit ==
"pi") {
510 }
else if (unit ==
"avogadro") {
513 Fatal(
"GetScaleVal",
"Unit <%s> not known", sunit);
550 if (tempattr ==
"name") {
552 }
else if (tempattr ==
"x") {
554 }
else if (tempattr ==
"y") {
556 }
else if (tempattr ==
"z") {
558 }
else if (tempattr ==
"unit") {
603 if (tempattr ==
"name") {
605 }
else if (tempattr ==
"x") {
607 }
else if (tempattr ==
"y") {
609 }
else if (tempattr ==
"z") {
611 }
else if (tempattr ==
"unit") {
660 if (tempattr ==
"name") {
662 }
else if (tempattr ==
"x") {
664 }
else if (tempattr ==
"y") {
666 }
else if (tempattr ==
"z") {
708 if (tempattr ==
"name") {
710 }
else if (tempattr ==
"z") {
712 }
else if (tempattr ==
"n") {
727 if (tempattr ==
"value") {
779 if (tempattr ==
"name") {
794 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
802 if (tempattr ==
"n") {
804 }
else if (tempattr ==
"ref") {
812 fracmap[ref.
Data()] =
n;
818 for (fractions
f = fracmap.begin();
f != fracmap.end();
f++) {
830 if (hasIsotopesExtended) {
835 if (tempattr ==
"name") {
850 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
858 if (tempattr ==
"n") {
860 }
else if (tempattr ==
"ref") {
868 fracmap[ref.
Data()] =
n;
874 for (fractions
f = fracmap.begin();
f != fracmap.end();
f++) {
893 if (tempattr ==
"name") {
896 }
else if (tempattr ==
"z") {
898 }
else if (tempattr ==
"formula") {
914 if (tempattr ==
"value") {
953 static int medid = 0;
956 Int_t ncompo = 0, mixflag = 2;
972 if ((strcmp(gdml->
GetNodeName(child),
"atom")) == 0) {
977 if (tempattr ==
"value") {
984 if ((strcmp(gdml->
GetNodeName(child),
"D")) == 0) {
989 if (tempattr ==
"value") {
999 name = gdml->
GetAttr(node,
"name");
1006 tempconst = gdml->
GetAttr(node,
"Z");
1013 if (tmpname ==
"vacuum") {
1025 while (child != 0) {
1028 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1031 ncompo = ncompo + 1;
1037 if (tempattr ==
"n") {
1039 }
else if (tempattr ==
"ref") {
1049 fracmap[ref.
Data()] =
n;
1053 else if ((strcmp(gdml->
GetNodeName(child),
"composite")) == 0) {
1057 ncompo = ncompo + 1;
1063 if (tempattr ==
"n") {
1065 }
else if (tempattr ==
"ref") {
1075 fracmap[ref.
Data()] =
n;
1078 else if ((strcmp(gdml->
GetNodeName(child),
"D")) == 0) {
1083 if (tempattr ==
"value") {
1095 name = gdml->
GetAttr(node,
"name");
1105 for (fractions
f = fracmap.begin();
f != fracmap.end();
f++) {
1113 natoms = (
Int_t)
f->second;
1142 }
else if (mixflag == 0) {
1188 while (child != 0) {
1189 if ((strcmp(gdml->
GetNodeName(child),
"solidref")) == 0) {
1191 reftemp = gdml->
GetAttr(child,
"ref");
1198 solidname = reftemp;
1201 printf(
"Solid: %s, Not Yet Defined!\n", reftemp.
Data());
1205 if ((strcmp(gdml->
GetNodeName(child),
"materialref")) == 0) {
1206 reftemp = gdml->
GetAttr(child,
"ref");
1213 printf(
"Medium: %s, Not Yet Defined!\n", gdml->
GetAttr(child,
"ref"));
1220 name = gdml->
GetAttr(node,
"name");
1242 while (child != 0) {
1243 if ((strcmp(gdml->
GetNodeName(child),
"physvol")) == 0) {
1256 while (subchild != 0) {
1260 if (tempattr ==
"volumeref") {
1261 reftemp = gdml->
GetAttr(subchild,
"ref");
1268 else if (tempattr ==
"file") {
1269 const char* filevol;
1273 filevol = gdml->
GetAttr(subchild,
"volname");
1278 if (filedoc1 == 0) {
1311 else if (tempattr ==
"position") {
1314 reftemp = gdml->
GetAttr(subchild,
"name");
1319 }
else if (tempattr ==
"positionref") {
1320 reftemp = gdml->
GetAttr(subchild,
"ref");
1325 else std::cout <<
"ERROR! Physvol's position " << reftemp <<
" not found!" << std::endl;
1326 }
else if (tempattr ==
"rotation") {
1329 reftemp = gdml->
GetAttr(subchild,
"name");
1334 }
else if (tempattr ==
"rotationref") {
1335 reftemp = gdml->
GetAttr(subchild,
"ref");
1340 else std::cout <<
"ERROR! Physvol's rotation " << reftemp <<
" not found!" << std::endl;
1341 }
else if (tempattr ==
"scale") {
1344 reftemp = gdml->
GetAttr(subchild,
"name");
1349 }
else if (tempattr ==
"scaleref") {
1350 reftemp = gdml->
GetAttr(subchild,
"ref");
1355 else std::cout <<
"ERROR! Physvol's scale " << reftemp <<
" not found!" << std::endl;
1358 subchild = gdml->
GetNext(subchild);
1372 memset(scale3x3, 0, 9 *
sizeof(
Double_t));
1375 scale3x3[0] = diagonal[0];
1376 scale3x3[4] = diagonal[1];
1377 scale3x3[8] = diagonal[2];
1401 vol->
AddNode(lv, copynum, transform);
1404 }
else if ((strcmp(gdml->
GetNodeName(child),
"divisionvol")) == 0) {
1420 if (tempattr ==
"axis") {
1422 }
else if (tempattr ==
"number") {
1424 }
else if (tempattr ==
"width") {
1426 }
else if (tempattr ==
"offset") {
1428 }
else if (tempattr ==
"unit") {
1438 while (subchild != 0) {
1442 if (tempattr ==
"volumeref") {
1443 reftemp = gdml->
GetAttr(subchild,
"ref");
1447 divVolref = reftemp;
1450 subchild = gdml->
GetNext(subchild);
1476 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
1487 else if ((strcmp(gdml->
GetNodeName(child),
"replicavol")) == 0) {
1507 if (tempattr ==
"number") {
1515 while (subchild != 0) {
1519 if (tempattr ==
"volumeref") {
1520 reftemp = gdml->
GetAttr(subchild,
"ref");
1524 divVolref = reftemp;
1527 if (tempattr ==
"replicate_along_axis") {
1528 subsubchild = gdml->
GetChild(subchild);
1530 while (subsubchild != 0) {
1531 if ((strcmp(gdml->
GetNodeName(subsubchild),
"width")) == 0) {
1536 if (tempattr ==
"value") {
1539 else if (tempattr ==
"unit"){
1546 else if ((strcmp(gdml->
GetNodeName(subsubchild),
"offset")) == 0) {
1551 if (tempattr ==
"value") {
1554 else if (tempattr ==
"unit"){
1560 else if ((strcmp(gdml->
GetNodeName(subsubchild),
"direction")) == 0) {
1565 if (tempattr ==
"x") {
1568 else if (tempattr ==
"y"){
1571 else if (tempattr ==
"z"){
1574 else if (tempattr ==
"rho"){
1577 else if (tempattr ==
"phi"){
1585 subsubchild = gdml->
GetNext(subsubchild);
1590 subchild = gdml->
GetNext(subchild);
1598 Double_t widthline = wvalue*retwunit;
1599 Double_t offsetline = ovalue*retounit;
1619 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
1628 else if (strcmp(gdml->
GetNodeName(child),
"auxiliary") == 0) {
1629 TString auxType, auxUnit, auxValue;
1632 auxmap =
new TMap();
1693 while (child != 0) {
1697 if (tempattr ==
"first") {
1698 reftemp = gdml->
GetAttr(child,
"ref");
1705 }
else if (tempattr ==
"second") {
1706 reftemp = gdml->
GetAttr(child,
"ref");
1713 }
else if (tempattr ==
"position") {
1716 reftemp = gdml->
GetAttr(child,
"name");
1721 }
else if (tempattr ==
"positionref") {
1722 reftemp = gdml->
GetAttr(child,
"ref");
1729 }
else if (tempattr ==
"rotation") {
1732 reftemp = gdml->
GetAttr(child,
"name");
1737 }
else if (tempattr ==
"rotationref") {
1738 reftemp = gdml->
GetAttr(child,
"ref");
1745 }
else if (tempattr ==
"firstposition") {
1748 reftemp = gdml->
GetAttr(child,
"name");
1753 }
else if (tempattr ==
"firstpositionref") {
1754 reftemp = gdml->
GetAttr(child,
"ref");
1761 }
else if (tempattr ==
"firstrotation") {
1764 reftemp = gdml->
GetAttr(child,
"name");
1769 }
else if (tempattr ==
"firstrotationref") {
1770 reftemp = gdml->
GetAttr(child,
"ref");
1785 if (!first || !second) {
1786 Fatal(
"BooSolid",
"Incomplete solid %s, missing shape components", name.
Data());
1812 Warning(
"ParseGDML",
"<userinfo> not supported yet. Skipping.");
1814 while (child != 0) {
1855 while (child != 0) {
1856 if ((strcmp(gdml->
GetNodeName(child),
"physvol")) == 0) {
1865 while (subchild != 0) {
1869 if (tempattr ==
"volumeref") {
1870 reftemp = gdml->
GetAttr(subchild,
"ref");
1875 }
else if (tempattr ==
"positionref") {
1876 reftemp = gdml->
GetAttr(subchild,
"ref");
1883 }
else if (tempattr ==
"position") {
1886 reftemp = gdml->
GetAttr(subchild,
"name");
1891 }
else if (tempattr ==
"rotationref") {
1892 reftemp = gdml->
GetAttr(subchild,
"ref");
1899 }
else if (tempattr ==
"rotation") {
1902 reftemp = gdml->
GetAttr(subchild,
"name");
1909 subchild = gdml->
GetNext(subchild);
1915 assem->
AddNode(lv, copynum, matr);
1939 while (child != 0) {
1941 if ((strcmp(gdml->
GetNodeName(child),
"world") == 0)) {
1944 reftemp = gdml->
GetAttr(child,
"ref");
1981 if (tempattr ==
"name") {
1983 }
else if (tempattr ==
"x") {
1985 }
else if (tempattr ==
"y") {
1987 }
else if (tempattr ==
"z") {
1989 }
else if (tempattr ==
"lunit") {
2041 if (tempattr ==
"name") {
2043 }
else if (tempattr ==
"ax") {
2045 }
else if (tempattr ==
"by") {
2047 }
else if (tempattr ==
"cz") {
2049 }
else if (tempattr ==
"zcut1") {
2051 }
else if (tempattr ==
"zcut2") {
2053 }
else if (tempattr ==
"lunit") {
2077 z1 =
Value(zcut1)*retunit;
2082 z2 =
Value(zcut2)*retunit;
2090 origin[2] = 0.5 * (z1 + z2);
2125 if (tempattr ==
"name") {
2127 }
else if (tempattr ==
"dx") {
2129 }
else if (tempattr ==
"dy") {
2131 }
else if (tempattr ==
"zmax") {
2133 }
else if (tempattr ==
"zcut") {
2135 }
else if (tempattr ==
"lunit") {
2157 Info(
"ElCone",
"ERROR! Parameter zcut = %.12g is not set properly, elcone will not be imported.", z1);
2201 if (tempattr ==
"name") {
2203 }
else if (tempattr ==
"rlo") {
2205 }
else if (tempattr ==
"rhi") {
2207 }
else if (tempattr ==
"dz") {
2209 }
else if (tempattr ==
"lunit") {
2269 if (tempattr ==
"name") {
2271 }
else if (tempattr ==
"v1x") {
2273 }
else if (tempattr ==
"v1y") {
2275 }
else if (tempattr ==
"v2x") {
2277 }
else if (tempattr ==
"v2y") {
2279 }
else if (tempattr ==
"v3x") {
2281 }
else if (tempattr ==
"v3y") {
2283 }
else if (tempattr ==
"v4x") {
2285 }
else if (tempattr ==
"v4y") {
2287 }
else if (tempattr ==
"v5x") {
2289 }
else if (tempattr ==
"v5y") {
2291 }
else if (tempattr ==
"v6x") {
2293 }
else if (tempattr ==
"v6y") {
2295 }
else if (tempattr ==
"v7x") {
2297 }
else if (tempattr ==
"v7y") {
2299 }
else if (tempattr ==
"v8x") {
2301 }
else if (tempattr ==
"v8y") {
2303 }
else if (tempattr ==
"dz") {
2305 }
else if (tempattr ==
"lunit") {
2378 if (tempattr ==
"name") {
2380 }
else if (tempattr ==
"rmin") {
2382 }
else if (tempattr ==
"rmax") {
2384 }
else if (tempattr ==
"z") {
2386 }
else if (tempattr ==
"lunit") {
2388 }
else if (tempattr ==
"aunit") {
2390 }
else if (tempattr ==
"startphi") {
2392 }
else if (tempattr ==
"deltaphi") {
2411 Double_t endphideg = startphideg + deltaphideg;
2414 if (deltaphideg < 360.)
2460 if (tempattr ==
"name") {
2462 }
else if (tempattr ==
"rmin") {
2464 }
else if (tempattr ==
"rmax") {
2466 }
else if (tempattr ==
"z") {
2468 }
else if (tempattr ==
"lunit") {
2470 }
else if (tempattr ==
"aunit") {
2472 }
else if (tempattr ==
"startphi") {
2474 }
else if (tempattr ==
"deltaphi") {
2476 }
else if (tempattr ==
"lowx") {
2478 }
else if (tempattr ==
"lowy") {
2480 }
else if (tempattr ==
"lowz") {
2482 }
else if (tempattr ==
"highx") {
2484 }
else if (tempattr ==
"highy") {
2486 }
else if (tempattr ==
"highz") {
2504 Double_t deltaphiline =
Value(deltaphi)*retaunit + startphiline;
2558 if (tempattr ==
"name") {
2560 }
else if (tempattr ==
"rmin1") {
2562 }
else if (tempattr ==
"rmax1") {
2564 }
else if (tempattr ==
"rmin2") {
2566 }
else if (tempattr ==
"rmax2") {
2568 }
else if (tempattr ==
"z") {
2570 }
else if (tempattr ==
"lunit") {
2572 }
else if (tempattr ==
"aunit") {
2574 }
else if (tempattr ==
"startphi") {
2576 }
else if (tempattr ==
"deltaphi") {
2650 if (tempattr ==
"name") {
2652 }
else if (tempattr ==
"x1") {
2654 }
else if (tempattr ==
"x2") {
2656 }
else if (tempattr ==
"x3") {
2658 }
else if (tempattr ==
"x4") {
2660 }
else if (tempattr ==
"y1") {
2662 }
else if (tempattr ==
"y2") {
2664 }
else if (tempattr ==
"z") {
2666 }
else if (tempattr ==
"lunit") {
2668 }
else if (tempattr ==
"aunit") {
2670 }
else if (tempattr ==
"phi") {
2672 }
else if (tempattr ==
"theta") {
2674 }
else if (tempattr ==
"alpha1") {
2676 }
else if (tempattr ==
"alpha2") {
2743 if (tempattr ==
"name") {
2745 }
else if (tempattr ==
"x1") {
2747 }
else if (tempattr ==
"x2") {
2749 }
else if (tempattr ==
"y1") {
2751 }
else if (tempattr ==
"y2") {
2753 }
else if (tempattr ==
"z") {
2755 }
else if (tempattr ==
"lunit") {
2812 if (tempattr ==
"name") {
2814 }
else if (tempattr ==
"lunit") {
2816 }
else if (tempattr ==
"aunit") {
2818 }
else if (tempattr ==
"startphi") {
2820 }
else if (tempattr ==
"deltaphi") {
2838 while (child != 0) {
2839 numplanes = numplanes + 1;
2846 double ** table =
new double*[numplanes];
2847 for (i = 0; i < numplanes; i++) {
2848 table[i] =
new double[cols];
2854 while (child != 0) {
2855 if (strcmp(gdml->
GetNodeName(child),
"zplane") == 0) {
2867 if (tempattr ==
"rmin") {
2869 rminline =
Value(rmin)*retlunit;
2870 table[planeno][0] = rminline;
2871 }
else if (tempattr ==
"rmax") {
2873 rmaxline =
Value(rmax)*retlunit;
2874 table[planeno][1] = rmaxline;
2875 }
else if (tempattr ==
"z") {
2877 zline =
Value(z)*retlunit;
2878 table[planeno][2] = zline;
2883 planeno = planeno + 1;
2896 for (
int j = 0; j < numplanes; j++) {
2897 poly->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
2902 for (i = 0; i < numplanes; i++) {
2936 if (tempattr ==
"name") {
2938 }
else if (tempattr ==
"lunit") {
2940 }
else if (tempattr ==
"aunit") {
2942 }
else if (tempattr ==
"startphi") {
2944 }
else if (tempattr ==
"deltaphi") {
2946 }
else if (tempattr ==
"numsides") {
2965 while (child != 0) {
2966 numplanes = numplanes + 1;
2973 double ** table =
new double*[numplanes];
2974 for (i = 0; i < numplanes; i++) {
2975 table[i] =
new double[cols];
2981 while (child != 0) {
2982 if (strcmp(gdml->
GetNodeName(child),
"zplane") == 0) {
2993 if (tempattr ==
"rmin") {
2995 rminline =
Value(rmin)*retlunit;
2996 table[planeno][0] = rminline;
2997 }
else if (tempattr ==
"rmax") {
2999 rmaxline =
Value(rmax)*retlunit;
3000 table[planeno][1] = rmaxline;
3001 }
else if (tempattr ==
"z") {
3003 zline =
Value(z)*retlunit;
3004 table[planeno][2] = zline;
3010 planeno = planeno + 1;
3025 for (
int j = 0; j < numplanes; j++) {
3026 polyg->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3031 for (i = 0; i < numplanes; i++) {
3064 if (tempattr ==
"name") {
3066 }
else if (tempattr ==
"rmin") {
3068 }
else if (tempattr ==
"rmax") {
3070 }
else if (tempattr ==
"lunit") {
3072 }
else if (tempattr ==
"aunit") {
3074 }
else if (tempattr ==
"startphi") {
3076 }
else if (tempattr ==
"deltaphi") {
3078 }
else if (tempattr ==
"starttheta") {
3080 }
else if (tempattr ==
"deltatheta") {
3097 Double_t deltaphiline = startphiline+
Value(deltaphi)*retaunit;
3099 Double_t deltathetaline = startthetaline +
Value(deltatheta)*retaunit;
3139 if (tempattr ==
"name") {
3141 }
else if (tempattr ==
"rmin") {
3143 }
else if (tempattr ==
"rmax") {
3145 }
else if (tempattr ==
"rtor") {
3147 }
else if (tempattr ==
"lunit") {
3149 }
else if (tempattr ==
"aunit") {
3151 }
else if (tempattr ==
"startphi") {
3153 }
else if (tempattr ==
"deltaphi") {
3209 if (tempattr ==
"name") {
3211 }
else if (tempattr ==
"rmin") {
3213 }
else if (tempattr ==
"rmax") {
3215 }
else if (tempattr ==
"z") {
3217 }
else if (tempattr ==
"lunit") {
3219 }
else if (tempattr ==
"aunit") {
3221 }
else if (tempattr ==
"inst") {
3223 }
else if (tempattr ==
"outst") {
3282 if (tempattr ==
"name") {
3284 }
else if (tempattr ==
"x") {
3286 }
else if (tempattr ==
"y") {
3288 }
else if (tempattr ==
"z") {
3290 }
else if (tempattr ==
"lunit") {
3292 }
else if (tempattr ==
"aunit") {
3294 }
else if (tempattr ==
"phi") {
3296 }
else if (tempattr ==
"theta") {
3298 }
else if (tempattr ==
"alpha") {
3365 if (tempattr ==
"name") {
3367 }
else if (tempattr ==
"x1") {
3369 }
else if (tempattr ==
"x2") {
3371 }
else if (tempattr ==
"x3") {
3373 }
else if (tempattr ==
"x4") {
3375 }
else if (tempattr ==
"y1") {
3377 }
else if (tempattr ==
"y2") {
3379 }
else if (tempattr ==
"z") {
3381 }
else if (tempattr ==
"lunit") {
3383 }
else if (tempattr ==
"aunit") {
3385 }
else if (tempattr ==
"phi") {
3387 }
else if (tempattr ==
"theta") {
3389 }
else if (tempattr ==
"alph") {
3394 }
else if (tempattr ==
"phitwist") {
3463 if (tempattr ==
"name") {
3465 }
else if (tempattr ==
"dx") {
3467 }
else if (tempattr ==
"dy") {
3469 }
else if (tempattr ==
"dz") {
3471 }
else if (tempattr ==
"lunit") {
3516 if (tempattr ==
"name") {
3518 }
else if (tempattr ==
"r") {
3520 }
else if (tempattr ==
"lunit") {
3573 if (tempattr ==
"name") {
3575 }
else if (tempattr ==
"lunit") {
3594 while (child != 0) {
3597 if (tempattr ==
"twoDimVertex") {
3598 noverts = noverts + 1;
3599 }
else if (tempattr ==
"section") {
3600 nosects = nosects + 1;
3609 double *vertx =
new double[noverts];
3610 double *verty =
new double[noverts];
3612 double ** section =
new double*[nosects];
3613 for (i = 0; i < nosects; i++) {
3614 section[i] =
new double[cols];
3621 while (child != 0) {
3622 if (strcmp(gdml->
GetNodeName(child),
"twoDimVertex") == 0) {
3631 if (tempattr ==
"x") {
3633 xline =
Value(x)*retlunit;
3634 vertx[vert] = xline;
3635 }
else if (tempattr ==
"y") {
3637 yline =
Value(y)*retlunit;
3638 verty[vert] = yline;
3647 else if (strcmp(gdml->
GetNodeName(child),
"section") == 0) {
3658 if (tempattr ==
"zOrder") {
3660 section[sect][0] =
Value(zorder);
3661 }
else if (tempattr ==
"zPosition") {
3663 zposline =
Value(zpos)*retlunit;
3664 section[sect][1] = zposline;
3665 }
else if (tempattr ==
"xOffset") {
3667 xoffline =
Value(xoff)*retlunit;
3668 section[sect][2] = xoffline;
3669 }
else if (tempattr ==
"yOffset") {
3671 yoffline =
Value(yoff)*retlunit;
3672 section[sect][3] = yoffline;
3673 }
else if (tempattr ==
"scalingFactor") {
3675 section[sect][4] =
Value(scale);
3690 for (
int j = 0; j < sect; j++) {
3691 xtru->
DefineSection((
int)section[j][0], section[j][1], section[j][2], section[j][3], section[j][4]);
3697 for (i = 0; i < nosects; i++) {
3698 delete [] section[i];
3716 std::cout <<
"WARNING! The reflectedSolid is obsolete! Use scale transformation instead!" << std::endl;
3736 if (tempattr ==
"name") {
3738 }
else if (tempattr ==
"sx") {
3740 }
else if (tempattr ==
"sy") {
3742 }
else if (tempattr ==
"sz") {
3744 }
else if (tempattr ==
"rx") {
3746 }
else if (tempattr ==
"ry") {
3748 }
else if (tempattr ==
"rz") {
3750 }
else if (tempattr ==
"dx") {
3752 }
else if (tempattr ==
"dy") {
3754 }
else if (tempattr ==
"dz") {
3756 }
else if (tempattr ==
"solid") {
3774 if (atoi(sx) == -1) {
3777 if (atoi(sy) == -1) {
3780 if (atoi(sz) == -1) {
XMLNodePointer_t UsrProcess(TXMLEngine *gdml, XMLNodePointer_t node)
User data to be processed.
XMLNodePointer_t ConProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, constants can be declared.
void arb8(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
void para(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
XMLNodePointer_t TwistTrap(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a TwistTrap may be declared.
TList * GetListOfMaterials() const
RotMap frotmap
Map containing position names and the TGeoTranslation for it.
virtual TGeoMatrix & Inverse() const
Return a temporary inverse of this.
XMLNodePointer_t Trd(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Trd may be declared.
MatMap fmatmap
Map containing element names and the TGeoElement for it.
void sphere(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
Collectable string class.
void MultiplyLeft(const TGeoMatrix *left)
multiply to the left with an other transformation if right is identity matrix, just return ...
XMLNodePointer_t Paraboloid(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Paraboloid may be declared.
XMLNodePointer_t Xtru(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an Xtru may be declared.
virtual const Double_t * GetRotationMatrix() const =0
virtual void SetName(const char *name)
Change (i.e.
XMLNodePointer_t Reflection(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Reflected Solid may be declared when the ReflectedSolid key...
EleMap felemap
Map containing isotope names and the TGeoIsotope for it.
Double_t Atof() const
Return floating-point value contained in string.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void RotateX(Double_t angle)
Rotate about X axis of the master frame with angle expressed in degrees.
XMLNodePointer_t Cone(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a cone may be declared.
void SetTranslation(const Double_t *vect)
static const char * filename()
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
virtual void DefineSection(Int_t snum, Double_t z, Double_t x0=0., Double_t y0=0., Double_t scale=1.)
defines z position of a section plane, rmin and rmax at this z.
TString GetScale(const char *unit)
Throughout the GDML file, a unit can de specified.
XMLNodePointer_t GetNext(XMLNodePointer_t xmlnode, Bool_t realnode=kTRUE)
return next to xmlnode node if realnode==kTRUE, any special nodes in between will be skipped ...
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return ...
XMLNodePointer_t IsoProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLNodePointer_t parentn)
In the material section of the GDML file, an isotope may be declared.
XMLNodePointer_t Polycone(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Polycone may be declared.
void ToLower()
Change string to lower-case.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
void SetSkipComments(Bool_t on=kTRUE)
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
void trap(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
XMLAttrPointer_t GetNextAttr(XMLAttrPointer_t xmlattr)
return next attribute in the list
void FreeDoc(XMLDocPointer_t xmldoc)
frees allocated document data and deletes document itself
Int_t GetNdaughters() const
double GetScaleVal(const char *unit)
Throughout the GDML file, a unit can de specified.
ReflectionsMap freflectmap
Map containing volume names and the TGeoVolume for it.
const char * Data() const
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
const char * fCurrentFile
XMLNodePointer_t SclProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, rotations can be declared.
TGeoMatrix * fMatrix
solid name being reflected
static const double x2[5]
XMLNodePointer_t BooSolid(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr, int num)
In the solid section of the GDML file, boolean solids can be declared.
virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to ZX.
double Evaluate(const char *evalline)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
FormVec fformvec
Map containing files parsed during entire parsing, with their world volume name.
The TNamed class is the base class for all named ROOT classes.
TGeoMatrix * GetMatrix()
this accessor method returns the matrix.
virtual const Double_t * GetScale() const
double Value(const char *svalue) const
Convert number in string format to double value.
void AddIsotope(TGeoIsotope *isotope, Double_t relativeAbundance)
Add an isotope for this element. All isotopes have to be isotopes of the same element.
static const double x4[22]
XMLNodePointer_t Arb8(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an Arb8 may be declared.
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Set values for a given vertex.
virtual void RotateY(Double_t angle)
Rotate about Y axis of the master frame with angle expressed in degrees.
FileMap ffilemap
Map containing reflected volume names and the solid ref for it.
virtual TGeoVolume * Divide(const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Division a la G3.
const char * GetNodeName(XMLNodePointer_t xmlnode)
returns name of xmlnode
XMLNodePointer_t CutTube(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Cut Tube may be declared.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
XMLNodePointer_t Sphere(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Sphere may be declared.
XMLNodePointer_t Orb(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an Orb may be declared.
void AddElement(Double_t a, Double_t z, Double_t weight)
add an element to the mixture using fraction by weight Check if the element is already defined ...
XMLNodePointer_t PosProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, positions can be declared.
void eltu(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
XMLNodePointer_t Torus(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Torus may be declared.
XMLNodePointer_t Box(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a box may be declared.
XMLNodePointer_t Ellipsoid(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an ellipsoid may be declared.
void ShiftToNext(XMLNodePointer_t &xmlnode, Bool_t realnode=kTRUE)
shifts specified node to next if realnode==kTRUE, any special nodes in between will be skipped ...
std::map< std::string, double > FracMap
XMLNodePointer_t Para(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Para may be declared.
XMLNodePointer_t Trap(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Trap may be declared.
void tube(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
virtual const Double_t * GetTranslation() const
virtual const Double_t * GetRotationMatrix() const
const char * GetAttrValue(XMLAttrPointer_t xmlattr)
return value of attribute
virtual const char * GetName() const
Returns name of object.
XMLNodePointer_t RotProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, rotations can be declared.
XMLAttrPointer_t GetFirstAttr(XMLNodePointer_t xmlnode)
return first attribute in the list, namespace (if exists) will be skiped
void cone(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
TXMLEngine * fFileEngine[20]
XMLNodePointer_t Hype(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Hype may be declared.
IsoMap fisomap
Map containing scale names and the TGeoScale for it.
virtual void AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a component to the assembly.
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the volume.
virtual void RotateZ(Double_t angle)
Rotate about Z axis of the master frame with angle expressed in degrees.
XMLNodePointer_t TopProcess(TXMLEngine *gdml, XMLNodePointer_t node)
In the setup section of the GDML file, the top volume need to be declared.
Bool_t HasAttr(XMLNodePointer_t xmlnode, const char *name)
checks if node has attribute of specified name
XMLDocPointer_t ParseFile(const char *filename, Int_t maxbuf=100000)
Parses content of file and tries to produce xml structures.
TGeoShape * GetShape() const
static const double x1[5]
XMLNodePointer_t Polyhedra(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Polyhedra may be declared.
virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to YZ.
R__EXTERN TGeoManager * gGeoManager
const char * GetAttr(XMLNodePointer_t xmlnode, const char *name)
returns value of attribute for xmlnode
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
MixMap fmixmap
Map containing medium names and the TGeoMedium for it.
Int_t SetAxis(const char *axisString)
When using the 'divide' process in the geometry this function sets the variable 'axis' depending on w...
const char * NameShort(const char *name)
this function looks thru a string for the chars '0x' next to each other, when it finds this...
void SetMatrix(const Double_t *rot)
MedMap fmedmap
Map containing material names and the TGeoMaterial for it.
void torus(Int_t iaxis=0, Int_t ndiv=8, Double_t start=0, Double_t step=0)
SclMap fsclmap
Map containing rotation names and the TGeoRotation for it.
SolMap fsolmap
Map containing mixture names and the TGeoMixture for it.
const char * ParseGDML(TXMLEngine *gdml, XMLNodePointer_t node)
this function recursively moves thru the DOM tree of the GDML file.
ReflVolMap freflvolmap
Map containing reflection names and the TGDMLRefl for it - containing refl matrix.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
VolMap fvolmap
Map containing solid names and the TGeoShape for it.
XMLNodePointer_t GetChild(XMLNodePointer_t xmlnode, Bool_t realnode=kTRUE)
returns first child of xml node
XMLNodePointer_t GetParent(XMLNodePointer_t xmlnode)
returns parent of xmlnode
TGeoMedium * GetMedium() const
void SetRotation(const Double_t *matrix)
XMLNodePointer_t DocGetRootElement(XMLDocPointer_t xmldoc)
returns root node of document
XMLNodePointer_t ElTube(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a ElTube may be declared.
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Defines z position of a section plane, rmin and rmax at this z.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
ClassImp(TGDMLParse) TGeoVolume *TGDMLParse
creates the new instance of the XMLEngine called 'gdml', using the filename >> then parses the file a...
ReflSolidMap freflsolidmap
Map containing reflection names and the Solid name ir references to.
XMLNodePointer_t MatProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr, int z)
In the materials section of the GDML file, materials can be declared.
XMLNodePointer_t EleProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLNodePointer_t parentn, Bool_t hasIsotopes, Bool_t hasIsotopesExtended)
XMLNodePointer_t Tube(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Tube may be declared.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
XMLNodePointer_t AssProcess(TXMLEngine *gdml, XMLNodePointer_t node)
In the structure section of the GDML file, assembly volumes can be declared.
XMLNodePointer_t VolProcess(TXMLEngine *gdml, XMLNodePointer_t node)
In the structure section of the GDML file, volumes can be declared.
const char * GetAttrName(XMLAttrPointer_t xmlattr)
return name of the attribute
XMLNodePointer_t ElCone(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an elliptical cone may be declared.
Bool_t DefinePolygon(Int_t nvert, const Double_t *xv, const Double_t *yv)
Creates the polygon representing the blueprint of any Xtru section.
static const double x3[11]
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.