133 for (
Int_t i = 0; i < 20; i++)
202 const char *posistr =
"position";
203 const char *setustr =
"setup";
204 const char *consstr =
"constant";
205 const char *varistr =
"variable";
206 const char *quanstr =
"quantity";
207 const char *matrstr =
"matrix";
208 const char *rotastr =
"rotation";
209 const char *scalstr =
"scale";
210 const char *elemstr =
"element";
211 const char *istpstr =
"isotope";
212 const char *matestr =
"material";
213 const char *volustr =
"volume";
214 const char *assestr =
"assembly";
215 const char *twtrstr =
"twistedtrap";
216 const char *cutTstr =
"cutTube";
217 const char *bboxstr =
"box";
218 const char *xtrustr =
"xtru";
219 const char *arb8str =
"arb8";
220 const char *tubestr =
"tube";
221 const char *conestr =
"cone";
222 const char *polystr =
"polycone";
223 const char *hypestr =
"hype";
224 const char *trapstr =
"trap";
225 const char *trdstr =
"trd";
226 const char *sphestr =
"sphere";
227 const char *orbstr =
"orb";
228 const char *parastr =
"para";
229 const char *torustr =
"torus";
230 const char *hedrstr =
"polyhedra";
231 const char *eltustr =
"eltube";
232 const char *subtstr =
"subtraction";
233 const char *uniostr =
"union";
234 const char *parbstr =
"paraboloid";
235 const char *intestr =
"intersection";
236 const char *reflstr =
"reflectedSolid";
237 const char *ellistr =
"ellipsoid";
238 const char *elcnstr =
"elcone";
239 const char *optsstr =
"opticalsurface";
240 const char *skinstr =
"skinsurface";
241 const char *bordstr =
"bordersurface";
242 const char *usrstr =
"userinfo";
243 const char *tslstr =
"tessellated";
245 Bool_t hasIsotopesExtended;
247 if ((strcmp(
name, posistr)) == 0) {
249 }
else if ((strcmp(
name, rotastr)) == 0) {
251 }
else if ((strcmp(
name, scalstr)) == 0) {
253 }
else if ((strcmp(
name, setustr)) == 0) {
255 }
else if ((strcmp(
name, consstr)) == 0) {
257 }
else if ((strcmp(
name, varistr)) == 0) {
259 }
else if ((strcmp(
name, quanstr)) == 0) {
261 }
else if ((strcmp(
name, matrstr)) == 0) {
263 }
else if ((strcmp(
name, optsstr)) == 0) {
265 }
else if ((strcmp(
name, skinstr)) == 0) {
267 }
else if ((strcmp(
name, bordstr)) == 0) {
272 else if (((strcmp(
name,
"atom")) == 0) && ((strcmp(parent, elemstr)) == 0)) {
274 hasIsotopesExtended =
kFALSE;
275 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
276 }
else if ((strcmp(
name, elemstr) == 0) && !gdml->
HasAttr(node,
"Z")) {
278 hasIsotopesExtended =
kFALSE;
279 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
282 else if ((strcmp(
name, elemstr) == 0) && gdml->
HasAttr(node,
"Z")) {
284 if ((strcmp(gdml->
GetNodeName(childtmp),
"fraction") == 0)) {
286 hasIsotopesExtended =
kTRUE;
287 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
293 else if (((strcmp(
name,
"atom")) == 0) && ((strcmp(parent, istpstr)) == 0)) {
298 else if ((strcmp(
name, matestr)) == 0 && gdml->
HasAttr(node,
"Z")) {
306 atom = strcmp(gdml->
GetNodeName(childtmp),
"atom") == 0;
309 int z = (atom) ? 1 : 0;
311 }
else if ((strcmp(
name, matestr)) == 0 && !gdml->
HasAttr(node,
"Z")) {
317 else if ((strcmp(
name, volustr)) == 0) {
319 }
else if ((strcmp(
name, bboxstr)) == 0) {
320 node =
Box(gdml, node, attr);
321 }
else if ((strcmp(
name, ellistr)) == 0) {
323 }
else if ((strcmp(
name, elcnstr)) == 0) {
324 node =
ElCone(gdml, node, attr);
325 }
else if ((strcmp(
name, cutTstr)) == 0) {
326 node =
CutTube(gdml, node, attr);
327 }
else if ((strcmp(
name, arb8str)) == 0) {
328 node =
Arb8(gdml, node, attr);
329 }
else if ((strcmp(
name, tubestr)) == 0) {
330 node =
Tube(gdml, node, attr);
331 }
else if ((strcmp(
name, conestr)) == 0) {
332 node =
Cone(gdml, node, attr);
333 }
else if ((strcmp(
name, polystr)) == 0) {
335 }
else if ((strcmp(
name, trapstr)) == 0) {
336 node =
Trap(gdml, node, attr);
337 }
else if ((strcmp(
name, trdstr)) == 0) {
338 node =
Trd(gdml, node, attr);
339 }
else if ((strcmp(
name, sphestr)) == 0) {
340 node =
Sphere(gdml, node, attr);
341 }
else if ((strcmp(
name, xtrustr)) == 0) {
342 node =
Xtru(gdml, node, attr);
343 }
else if ((strcmp(
name, twtrstr)) == 0) {
345 }
else if ((strcmp(
name, hypestr)) == 0) {
346 node =
Hype(gdml, node, attr);
347 }
else if ((strcmp(
name, orbstr)) == 0) {
348 node =
Orb(gdml, node, attr);
349 }
else if ((strcmp(
name, parastr)) == 0) {
350 node =
Para(gdml, node, attr);
351 }
else if ((strcmp(
name, torustr)) == 0) {
352 node =
Torus(gdml, node, attr);
353 }
else if ((strcmp(
name, eltustr)) == 0) {
354 node =
ElTube(gdml, node, attr);
355 }
else if ((strcmp(
name, hedrstr)) == 0) {
357 }
else if ((strcmp(
name, tslstr)) == 0) {
359 }
else if ((strcmp(
name, parbstr)) == 0) {
361 }
else if ((strcmp(
name, subtstr)) == 0) {
362 node =
BooSolid(gdml, node, attr, 1);
363 }
else if ((strcmp(
name, intestr)) == 0) {
364 node =
BooSolid(gdml, node, attr, 2);
365 }
else if ((strcmp(
name, uniostr)) == 0) {
366 node =
BooSolid(gdml, node, attr, 3);
367 }
else if ((strcmp(
name, reflstr)) == 0) {
369 }
else if ((strcmp(
name, assestr)) == 0) {
371 }
else if ((strcmp(
name, usrstr)) == 0) {
374 }
else if (((strcmp(
name,
"gdml")) != 0) && ((strcmp(
name,
"define")) != 0) && ((strcmp(
name,
"element")) != 0) &&
375 ((strcmp(
name,
"materials")) != 0) && ((strcmp(
name,
"solids")) != 0) &&
376 ((strcmp(
name,
"structure")) != 0) && ((strcmp(
name,
"zplane")) != 0) && ((strcmp(
name,
"first")) != 0) &&
377 ((strcmp(
name,
"second")) != 0) && ((strcmp(
name,
"twoDimVertex")) != 0) &&
378 ((strcmp(
name,
"firstposition")) != 0) && ((strcmp(
name,
"firstpositionref")) != 0) &&
379 ((strcmp(
name,
"firstrotation")) != 0) && ((strcmp(
name,
"firstrotationref")) != 0) &&
380 ((strcmp(
name,
"section")) != 0) && ((strcmp(
name,
"world")) != 0) && ((strcmp(
name,
"isotope")) != 0) &&
381 ((strcmp(
name,
"triangular")) != 0) && ((strcmp(
name,
"quadrangular")) != 0)) {
382 std::cout <<
"Error: Unsupported GDML Tag Used :" <<
name <<
". Please Check Geometry/Schema." << std::endl;
414 if ((strcmp(axisString,
"kXAxis")) == 0) {
416 }
else if ((strcmp(axisString,
"kYAxis")) == 0) {
418 }
else if ((strcmp(axisString,
"kZAxis")) == 0) {
420 }
else if ((strcmp(axisString,
"kRho")) == 0) {
422 }
else if ((strcmp(axisString,
"kPhi")) == 0) {
441 stripped = stripped(0, index);
442 return stripped.
Data();
461 if (tempattr ==
"name") {
464 if (tempattr ==
"value") {
535 if (tempattr ==
"name") {
538 if (tempattr ==
"value") {
541 if (tempattr ==
"unit") {
566 if (tempattr ==
"name") {
569 if (tempattr ==
"coldim") {
572 if (tempattr ==
"values") {
579 std::stringstream valueStream(values);
580 std::vector<Double_t> valueList;
581 while (!valueStream.eof()) {
582 std::string matrixValue;
583 valueStream >> matrixValue;
585 if (matrixValue.empty())
587 valueList.push_back(
Value(matrixValue.c_str()));
592 for (
size_t i = 0; i < valueList.size(); ++i)
593 matrix->
Set(i / coldim, i % coldim, valueList[i]);
617 if (tempattr ==
"name") {
620 if (tempattr ==
"model") {
623 if (tempattr ==
"finish") {
626 if (tempattr ==
"type") {
629 if (tempattr ==
"value") {
640 if ((strcmp(gdml->
GetNodeName(child),
"property")) == 0) {
644 if (tempattr ==
"name") {
646 }
else if (tempattr ==
"ref") {
650 Error(
"OpticalSurfaceProcess",
"Reference matrix %s for optical surface %s not found", ref.
Data(),
673 if (strcmp(unit,
"mm") == 0) {
675 }
else if (strcmp(unit,
"millimeter") == 0 || strcmp(unit,
"milimeter") == 0) {
677 }
else if (strcmp(unit,
"cm") == 0) {
679 }
else if (strcmp(unit,
"centimeter") == 0) {
681 }
else if (strcmp(unit,
"m") == 0) {
683 }
else if (strcmp(unit,
"meter") == 0) {
685 }
else if (strcmp(unit,
"km") == 0) {
686 retunit =
"100000.0";
687 }
else if (strcmp(unit,
"kilometer") == 0) {
688 retunit =
"100000.0";
689 }
else if (strcmp(unit,
"rad") == 0) {
691 }
else if (strcmp(unit,
"radian") == 0) {
693 }
else if (strcmp(unit,
"deg") == 0) {
695 }
else if (strcmp(unit,
"degree") == 0) {
697 }
else if (strcmp(unit,
"pi") == 0) {
699 }
else if (strcmp(unit,
"avogadro") == 0) {
702 Fatal(
"GetScale",
"Unit <%s> not known", unit);
721 if ((unit ==
"mm") || (unit ==
"millimeter") || (unit ==
"milimeter")) {
723 }
else if ((unit ==
"cm") || (unit ==
"centimeter")) {
725 }
else if ((unit ==
"m") || (unit ==
"meter")) {
727 }
else if ((unit ==
"km") || (unit ==
"kilometer")) {
729 }
else if ((unit ==
"rad") || (unit ==
"radian")) {
731 }
else if ((unit ==
"deg") || (unit ==
"degree")) {
733 }
else if ((unit ==
"ev") || (unit ==
"electronvolt")) {
735 }
else if ((unit ==
"kev") || (unit ==
"kiloelectronvolt")) {
737 }
else if ((unit ==
"mev") || (unit ==
"megaelectronvolt")) {
739 }
else if ((unit ==
"gev") || (unit ==
"gigaelectronvolt")) {
741 }
else if (unit ==
"pi") {
743 }
else if (unit ==
"avogadro") {
746 Fatal(
"GetScaleVal",
"Unit <%s> not known", sunit);
758 double val = strtod(svalue, &end);
761 while (*end != 0 && isspace(*end))
773 std::string expanded;
774 expanded.reserve(strlen(svalue) * 2);
778 const std::locale &loc = std::locale::classic();
781 const char *p = svalue;
784 for (; *p != 0; ++p) {
785 if (std::isalpha(*p, loc) || *p ==
'_') {
786 const char *pe = p + 1;
789 for (; *pe != 0; ++pe) {
790 if (!isalnum(*pe, loc) && *pe !=
'_') {
816 TFormula f(
"TFormula", expanded.c_str());
820 f.SetParameter(it.first.c_str(), it.second);
824 if (std::isnan(val) || std::isinf(val)) {
825 Fatal(
"Value",
"Got bad value %lf from string '%s'", val, svalue);
852 if (tempattr ==
"name") {
854 }
else if (tempattr ==
"x") {
856 }
else if (tempattr ==
"y") {
858 }
else if (tempattr ==
"z") {
860 }
else if (tempattr ==
"unit") {
904 if (tempattr ==
"name") {
906 }
else if (tempattr ==
"x") {
908 }
else if (tempattr ==
"y") {
910 }
else if (tempattr ==
"z") {
912 }
else if (tempattr ==
"unit") {
960 if (tempattr ==
"name") {
962 }
else if (tempattr ==
"x") {
964 }
else if (tempattr ==
"y") {
966 }
else if (tempattr ==
"z") {
1008 if (tempattr ==
"name") {
1010 }
else if (tempattr ==
"z") {
1012 }
else if (tempattr ==
"n") {
1027 if (tempattr ==
"value") {
1048 }
else if (
gDebug >= 2) {
1049 Info(
"TGDMLParse",
"Re-use existing isotope: %s", iso->
GetName());
1087 if (tempattr ==
"name") {
1099 while (child != 0) {
1102 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1105 ncompo = ncompo + 1;
1110 if (tempattr ==
"n") {
1112 }
else if (tempattr ==
"ref") {
1120 fracmap[ref.
Data()] =
n;
1127 if (ele && ele->
Z() == 0)
1131 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1136 }
else if (
gDebug >= 2) {
1137 Info(
"TGDMLParse",
"Re-use existing element: %s", ele->
GetName());
1145 if (hasIsotopesExtended) {
1150 if (tempattr ==
"name") {
1162 while (child != 0) {
1165 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1168 ncompo = ncompo + 1;
1173 if (tempattr ==
"n") {
1175 }
else if (tempattr ==
"ref") {
1183 fracmap[ref.
Data()] =
n;
1190 if (ele && ele->
Z() == 0)
1194 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1199 }
else if (
gDebug >= 2) {
1200 Info(
"TGDMLParse",
"Re-use existing element: %s", ele->
GetName());
1214 if (tempattr ==
"name") {
1217 }
else if (tempattr ==
"z") {
1219 }
else if (tempattr ==
"formula") {
1235 if (tempattr ==
"value") {
1250 if (ele && ele->
Z() == 0)
1255 }
else if (
gDebug >= 2) {
1256 Info(
"TGDMLParse",
"Re-use existing element: %s", ele->
GetName());
1281 TList properties, constproperties;
1288 Int_t ncompo = 0, mixflag = 2;
1306 while (child != 0) {
1309 if ((strcmp(gdml->
GetNodeName(child),
"property")) == 0) {
1315 if (tempattr ==
"name") {
1317 }
else if (tempattr ==
"ref") {
1321 properties.
Add(property);
1326 Error(
"MatProcess",
"Reference %s for material %s not found", property->GetTitle(),
1329 constproperties.
Add(property);
1336 if ((strcmp(gdml->
GetNodeName(child),
"atom")) == 0) {
1341 if (tempattr ==
"value") {
1348 if ((strcmp(gdml->
GetNodeName(child),
"D")) == 0) {
1353 if (tempattr ==
"value") {
1363 tempconst = gdml->
GetAttr(node,
"Z");
1370 if (tmpname ==
"vacuum") {
1378 Info(
"TGDMLParse",
"Re-use existing material: %s", mat->
GetName());
1382 TIter next(&properties);
1383 while ((property = (
TNamed *)next()))
1386 if (constproperties.
GetSize()) {
1388 TIter next(&constproperties);
1389 while ((property = (
TNamed *)next()))
1396 if (mat_ele && mat_ele->
Z() == 0)
1400 mat_ele =
new TGeoElement(mat_name, mat_name, atoi(tempconst),
a);
1401 }
else if (
gDebug >= 2) {
1402 Info(
"TGDMLParse",
"Re-use existing material-element: %s", mat_ele->
GetName());
1408 while (child != 0) {
1411 if ((strcmp(gdml->
GetNodeName(child),
"property")) == 0) {
1417 if (tempattr ==
"name") {
1419 }
else if (tempattr ==
"ref") {
1423 properties.
Add(property);
1428 Error(
"MatProcess",
"Reference %s for material %s not found", property->GetTitle(),
1431 constproperties.
Add(property);
1437 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1440 ncompo = ncompo + 1;
1446 if (tempattr ==
"n") {
1448 }
else if (tempattr ==
"ref") {
1456 fracmap[ref.
Data()] =
n;
1459 else if ((strcmp(gdml->
GetNodeName(child),
"composite")) == 0) {
1463 ncompo = ncompo + 1;
1468 if (tempattr ==
"n") {
1470 }
else if (tempattr ==
"ref") {
1478 fracmap[ref.
Data()] =
n;
1479 }
else if ((strcmp(gdml->
GetNodeName(child),
"D")) == 0) {
1484 if (tempattr ==
"value") {
1507 Info(
"TGDMLParse",
"Re-use existing material-mixture: %s", mix->
GetName());
1509 Fatal(
"TGDMLParse",
"WARNING! Inconsistent material definitions between GDML and TGeoManager");
1514 TIter next(&properties);
1515 while ((property = (
TNamed *)next()))
1518 if (constproperties.
GetSize()) {
1520 TIter next(&constproperties);
1521 while ((property = (
TNamed *)next()))
1527 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1535 natoms = (
Int_t)
f->second;
1560 }
else if (mixflag == 0) {
1564 }
else if (
gDebug >= 2) {
1565 Info(
"TGDMLParse",
"Re-use existing medium: %s", med->
GetName());
1584 if (tempattr ==
"name") {
1587 if (tempattr ==
"surfaceproperty") {
1594 while (child != 0) {
1596 if ((strcmp(gdml->
GetNodeName(child),
"volumeref")) == 0) {
1600 if (tempattr ==
"ref") {
1610 Fatal(
"SkinSurfaceProcess",
"Skin surface %s: referenced optical surface %s not defined",
name.Data(),
1630 if (tempattr ==
"name") {
1633 if (tempattr ==
"surfaceproperty") {
1641 while (child != 0) {
1643 if ((strcmp(gdml->
GetNodeName(child),
"physvolref")) == 0) {
1647 if (tempattr ==
"ref") {
1656 Fatal(
"BorderSurfaceProcess",
"Border surface %s not referencing two nodes",
name.Data());
1659 Fatal(
"BorderSurfaceProcess",
"Border surface %s: referenced optical surface %s not defined",
name.Data(),
1663 if (!node1 || !node2)
1664 Fatal(
"BorderSurfaceProcess",
"Border surface %s: not found nodes %s [%s] or %s [%s]",
name.Data(),
1665 nodename[0].
Data(), node1 ?
"present" :
"missing", nodename[1].
Data(), node2 ?
"present" :
"missing");
1707 while (child != 0) {
1708 if ((strcmp(gdml->
GetNodeName(child),
"solidref")) == 0) {
1710 reftemp = gdml->
GetAttr(child,
"ref");
1717 solidname = reftemp;
1720 printf(
"Solid: %s, Not Yet Defined!\n", reftemp.
Data());
1724 if ((strcmp(gdml->
GetNodeName(child),
"materialref")) == 0) {
1725 reftemp = gdml->
GetAttr(child,
"ref");
1732 printf(
"Medium: %s, Not Yet Defined!\n", gdml->
GetAttr(child,
"ref"));
1761 while (child != 0) {
1762 if ((strcmp(gdml->
GetNodeName(child),
"physvol")) == 0) {
1775 while (subchild != 0) {
1779 if (tempattr ==
"volumeref") {
1780 reftemp = gdml->
GetAttr(subchild,
"ref");
1786 }
else if (tempattr ==
"file") {
1787 const char *filevol;
1791 filevol = gdml->
GetAttr(subchild,
"volname");
1796 if (filedoc1 == 0) {
1828 }
else if (tempattr ==
"position") {
1831 reftemp = gdml->
GetAttr(subchild,
"name");
1836 }
else if (tempattr ==
"positionref") {
1837 reftemp = gdml->
GetAttr(subchild,
"ref");
1844 std::cout <<
"ERROR! Physvol's position " << reftemp <<
" not found!" << std::endl;
1845 }
else if (tempattr ==
"rotation") {
1848 reftemp = gdml->
GetAttr(subchild,
"name");
1853 }
else if (tempattr ==
"rotationref") {
1854 reftemp = gdml->
GetAttr(subchild,
"ref");
1861 std::cout <<
"ERROR! Physvol's rotation " << reftemp <<
" not found!" << std::endl;
1862 }
else if (tempattr ==
"scale") {
1865 reftemp = gdml->
GetAttr(subchild,
"name");
1870 }
else if (tempattr ==
"scaleref") {
1871 reftemp = gdml->
GetAttr(subchild,
"ref");
1878 std::cout <<
"ERROR! Physvol's scale " << reftemp <<
" not found!" << std::endl;
1881 subchild = gdml->
GetNext(subchild);
1897 memset(scale3x3, 0, 9 *
sizeof(
Double_t));
1900 scale3x3[0] = diagonal[0];
1901 scale3x3[4] = diagonal[1];
1902 scale3x3[8] = diagonal[2];
1931 }
else if ((strcmp(gdml->
GetNodeName(child),
"divisionvol")) == 0) {
1947 if (tempattr ==
"axis") {
1949 }
else if (tempattr ==
"number") {
1951 }
else if (tempattr ==
"width") {
1953 }
else if (tempattr ==
"offset") {
1955 }
else if (tempattr ==
"unit") {
1964 while (subchild != 0) {
1968 if (tempattr ==
"volumeref") {
1969 reftemp = gdml->
GetAttr(subchild,
"ref");
1973 divVolref = reftemp;
1976 subchild = gdml->
GetNext(subchild);
2001 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2011 else if ((strcmp(gdml->
GetNodeName(child),
"replicavol")) == 0) {
2030 if (tempattr ==
"number") {
2038 while (subchild != 0) {
2042 if (tempattr ==
"volumeref") {
2043 reftemp = gdml->
GetAttr(subchild,
"ref");
2047 divVolref = reftemp;
2050 if (tempattr ==
"replicate_along_axis") {
2051 subsubchild = gdml->
GetChild(subchild);
2053 while (subsubchild != 0) {
2054 if ((strcmp(gdml->
GetNodeName(subsubchild),
"width")) == 0) {
2059 if (tempattr ==
"value") {
2061 }
else if (tempattr ==
"unit") {
2067 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"offset")) == 0) {
2072 if (tempattr ==
"value") {
2074 }
else if (tempattr ==
"unit") {
2079 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"direction")) == 0) {
2084 if (tempattr ==
"x") {
2086 }
else if (tempattr ==
"y") {
2088 }
else if (tempattr ==
"z") {
2090 }
else if (tempattr ==
"rho") {
2092 }
else if (tempattr ==
"phi") {
2100 subsubchild = gdml->
GetNext(subsubchild);
2104 subchild = gdml->
GetNext(subchild);
2111 Double_t widthline = wvalue * retwunit;
2112 Double_t offsetline = ovalue * retounit;
2132 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2141 else if (strcmp(gdml->
GetNodeName(child),
"auxiliary") == 0) {
2142 TString auxType, auxUnit, auxValue;
2145 auxmap =
new TMap();
2152 else if (!strcmp(gdml->
GetAttrName(attr),
"auxvalue"))
2154 else if (!strcmp(gdml->
GetAttrName(attr),
"auxunit"))
2209 while (child != 0) {
2213 if (tempattr ==
"first") {
2214 reftemp = gdml->
GetAttr(child,
"ref");
2221 }
else if (tempattr ==
"second") {
2222 reftemp = gdml->
GetAttr(child,
"ref");
2229 }
else if (tempattr ==
"position") {
2232 reftemp = gdml->
GetAttr(child,
"name");
2237 }
else if (tempattr ==
"positionref") {
2238 reftemp = gdml->
GetAttr(child,
"ref");
2245 }
else if (tempattr ==
"rotation") {
2248 reftemp = gdml->
GetAttr(child,
"name");
2253 }
else if (tempattr ==
"rotationref") {
2254 reftemp = gdml->
GetAttr(child,
"ref");
2261 }
else if (tempattr ==
"firstposition") {
2264 reftemp = gdml->
GetAttr(child,
"name");
2269 }
else if (tempattr ==
"firstpositionref") {
2270 reftemp = gdml->
GetAttr(child,
"ref");
2277 }
else if (tempattr ==
"firstrotation") {
2280 reftemp = gdml->
GetAttr(child,
"name");
2285 }
else if (tempattr ==
"firstrotationref") {
2286 reftemp = gdml->
GetAttr(child,
"ref");
2301 if (!
first || !second) {
2302 Fatal(
"BooSolid",
"Incomplete solid %s, missing shape components",
name.Data());
2329 TString nodename, auxtype, auxtypec, auxvalue, auxvaluec, auxunit, auxunitc;
2335 if (nodename ==
"auxiliary") {
2336 auxtype = gdml->
GetAttr(child,
"auxtype");
2337 auxvalue = gdml->
GetAttr(child,
"auxvalue");
2338 if (auxtype ==
"Region") {
2345 auxtypec = gdml->
GetAttr(subchild,
"auxtype");
2346 auxvaluec = gdml->
GetAttr(subchild,
"auxvalue");
2347 auxunitc = gdml->
GetAttr(subchild,
"auxunit");
2348 if (auxtypec ==
"volume") {
2356 region->
AddCut(auxtypec, value);
2358 subchild = gdml->
GetNext(subchild);
2403 while (child != 0) {
2404 if ((strcmp(gdml->
GetNodeName(child),
"physvol")) == 0) {
2413 while (subchild != 0) {
2417 if (tempattr ==
"volumeref") {
2418 reftemp = gdml->
GetAttr(subchild,
"ref");
2423 }
else if (tempattr ==
"positionref") {
2424 reftemp = gdml->
GetAttr(subchild,
"ref");
2431 }
else if (tempattr ==
"position") {
2434 reftemp = gdml->
GetAttr(subchild,
"name");
2439 }
else if (tempattr ==
"rotationref") {
2440 reftemp = gdml->
GetAttr(subchild,
"ref");
2447 }
else if (tempattr ==
"rotation") {
2450 reftemp = gdml->
GetAttr(subchild,
"name");
2457 subchild = gdml->
GetNext(subchild);
2488 while (child != 0) {
2490 if ((strcmp(gdml->
GetNodeName(child),
"world") == 0)) {
2493 reftemp = gdml->
GetAttr(child,
"ref");
2527 if (tempattr ==
"name") {
2529 }
else if (tempattr ==
"x") {
2531 }
else if (tempattr ==
"y") {
2533 }
else if (tempattr ==
"z") {
2535 }
else if (tempattr ==
"lunit") {
2585 if (tempattr ==
"name") {
2587 }
else if (tempattr ==
"ax") {
2589 }
else if (tempattr ==
"by") {
2591 }
else if (tempattr ==
"cz") {
2593 }
else if (tempattr ==
"zcut1") {
2595 }
else if (tempattr ==
"zcut2") {
2597 }
else if (tempattr ==
"lunit") {
2621 z1 =
Value(zcut1) * retunit;
2626 z2 =
Value(zcut2) * retunit;
2634 origin[2] = 0.5 * (z1 + z2);
2668 if (tempattr ==
"name") {
2670 }
else if (tempattr ==
"dx") {
2672 }
else if (tempattr ==
"dy") {
2674 }
else if (tempattr ==
"zmax") {
2676 }
else if (tempattr ==
"zcut") {
2678 }
else if (tempattr ==
"lunit") {
2700 Info(
"ElCone",
"ERROR! Parameter zcut = %.12g is not set properly, elcone will not be imported.", z1);
2743 if (tempattr ==
"name") {
2745 }
else if (tempattr ==
"rlo") {
2747 }
else if (tempattr ==
"rhi") {
2749 }
else if (tempattr ==
"dz") {
2751 }
else if (tempattr ==
"lunit") {
2810 if (tempattr ==
"name") {
2812 }
else if (tempattr ==
"v1x") {
2814 }
else if (tempattr ==
"v1y") {
2816 }
else if (tempattr ==
"v2x") {
2818 }
else if (tempattr ==
"v2y") {
2820 }
else if (tempattr ==
"v3x") {
2822 }
else if (tempattr ==
"v3y") {
2824 }
else if (tempattr ==
"v4x") {
2826 }
else if (tempattr ==
"v4y") {
2828 }
else if (tempattr ==
"v5x") {
2830 }
else if (tempattr ==
"v5y") {
2832 }
else if (tempattr ==
"v6x") {
2834 }
else if (tempattr ==
"v6y") {
2836 }
else if (tempattr ==
"v7x") {
2838 }
else if (tempattr ==
"v7y") {
2840 }
else if (tempattr ==
"v8x") {
2842 }
else if (tempattr ==
"v8y") {
2844 }
else if (tempattr ==
"dz") {
2846 }
else if (tempattr ==
"lunit") {
2917 if (tempattr ==
"name") {
2919 }
else if (tempattr ==
"rmin") {
2921 }
else if (tempattr ==
"rmax") {
2923 }
else if (tempattr ==
"z") {
2925 }
else if (tempattr ==
"lunit") {
2927 }
else if (tempattr ==
"aunit") {
2929 }
else if (tempattr ==
"startphi") {
2931 }
else if (tempattr ==
"deltaphi") {
2950 Double_t endphideg = startphideg + deltaphideg;
2953 if (deltaphideg < 360.)
2992 if (tempattr ==
"name") {
2994 }
else if (tempattr ==
"rmin") {
2996 }
else if (tempattr ==
"rmax") {
2998 }
else if (tempattr ==
"z") {
3000 }
else if (tempattr ==
"lunit") {
3002 }
else if (tempattr ==
"aunit") {
3004 }
else if (tempattr ==
"startphi") {
3006 }
else if (tempattr ==
"deltaphi") {
3008 }
else if (tempattr ==
"lowx") {
3010 }
else if (tempattr ==
"lowy") {
3012 }
else if (tempattr ==
"lowz") {
3014 }
else if (tempattr ==
"highx") {
3016 }
else if (tempattr ==
"highy") {
3018 }
else if (tempattr ==
"highz") {
3036 Double_t deltaphiline =
Value(deltaphi) * retaunit + startphiline;
3045 lowXline, lowYline, lowZline, highXline, highYline, highZline);
3078 if (tempattr ==
"name") {
3080 }
else if (tempattr ==
"rmin1") {
3082 }
else if (tempattr ==
"rmax1") {
3084 }
else if (tempattr ==
"rmin2") {
3086 }
else if (tempattr ==
"rmax2") {
3088 }
else if (tempattr ==
"z") {
3090 }
else if (tempattr ==
"lunit") {
3092 }
else if (tempattr ==
"aunit") {
3094 }
else if (tempattr ==
"startphi") {
3096 }
else if (tempattr ==
"deltaphi") {
3160 if (tempattr ==
"name") {
3162 }
else if (tempattr ==
"x1") {
3164 }
else if (tempattr ==
"x2") {
3166 }
else if (tempattr ==
"x3") {
3168 }
else if (tempattr ==
"x4") {
3170 }
else if (tempattr ==
"y1") {
3172 }
else if (tempattr ==
"y2") {
3174 }
else if (tempattr ==
"z") {
3176 }
else if (tempattr ==
"lunit") {
3178 }
else if (tempattr ==
"aunit") {
3180 }
else if (tempattr ==
"phi") {
3182 }
else if (tempattr ==
"theta") {
3184 }
else if (tempattr ==
"alpha1") {
3186 }
else if (tempattr ==
"alpha2") {
3213 alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
3243 if (tempattr ==
"name") {
3245 }
else if (tempattr ==
"x1") {
3247 }
else if (tempattr ==
"x2") {
3249 }
else if (tempattr ==
"y1") {
3251 }
else if (tempattr ==
"y2") {
3253 }
else if (tempattr ==
"z") {
3255 }
else if (tempattr ==
"lunit") {
3306 if (tempattr ==
"name") {
3308 }
else if (tempattr ==
"lunit") {
3310 }
else if (tempattr ==
"aunit") {
3312 }
else if (tempattr ==
"startphi") {
3314 }
else if (tempattr ==
"deltaphi") {
3332 while (child != 0) {
3333 numplanes = numplanes + 1;
3336 if (numplanes < 2) {
3337 Fatal(
"Polycone",
"Found less than 2 planes for polycone %s",
name.Data());
3344 double **table =
new double *[numplanes];
3345 for (i = 0; i < numplanes; i++) {
3346 table[i] =
new double[cols];
3352 while (child != 0) {
3353 if (strcmp(gdml->
GetNodeName(child),
"zplane") == 0) {
3365 if (tempattr ==
"rmin") {
3367 rminline =
Value(rmin) * retlunit;
3368 table[planeno][0] = rminline;
3369 }
else if (tempattr ==
"rmax") {
3371 rmaxline =
Value(rmax) * retlunit;
3372 table[planeno][1] = rmaxline;
3373 }
else if (tempattr ==
"z") {
3375 zline =
Value(z) * retlunit;
3376 table[planeno][2] = zline;
3381 planeno = planeno + 1;
3391 for (
int j = 0; j < numplanes; j++) {
3392 poly->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3397 for (i = 0; i < numplanes; i++) {
3431 if (tempattr ==
"name") {
3433 }
else if (tempattr ==
"lunit") {
3435 }
else if (tempattr ==
"aunit") {
3437 }
else if (tempattr ==
"startphi") {
3439 }
else if (tempattr ==
"deltaphi") {
3441 }
else if (tempattr ==
"numsides") {
3460 while (child != 0) {
3461 numplanes = numplanes + 1;
3464 if (numplanes < 2) {
3465 Fatal(
"Polyhedra",
"Found less than 2 planes for polyhedra %s",
name.Data());
3472 double **table =
new double *[numplanes];
3473 for (i = 0; i < numplanes; i++) {
3474 table[i] =
new double[cols];
3480 while (child != 0) {
3481 if (strcmp(gdml->
GetNodeName(child),
"zplane") == 0) {
3492 if (tempattr ==
"rmin") {
3494 rminline =
Value(rmin) * retlunit;
3495 table[planeno][0] = rminline;
3496 }
else if (tempattr ==
"rmax") {
3498 rmaxline =
Value(rmax) * retlunit;
3499 table[planeno][1] = rmaxline;
3500 }
else if (tempattr ==
"z") {
3502 zline =
Value(z) * retlunit;
3503 table[planeno][2] = zline;
3509 planeno = planeno + 1;
3520 for (
int j = 0; j < numplanes; j++) {
3521 polyg->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3526 for (i = 0; i < numplanes; i++) {
3558 if (tempattr ==
"name") {
3560 }
else if (tempattr ==
"rmin") {
3562 }
else if (tempattr ==
"rmax") {
3564 }
else if (tempattr ==
"lunit") {
3566 }
else if (tempattr ==
"aunit") {
3568 }
else if (tempattr ==
"startphi") {
3570 }
else if (tempattr ==
"deltaphi") {
3572 }
else if (tempattr ==
"starttheta") {
3574 }
else if (tempattr ==
"deltatheta") {
3591 Double_t deltaphiline = startphiline +
Value(deltaphi) * retaunit;
3593 Double_t deltathetaline = startthetaline +
Value(deltatheta) * retaunit;
3596 new TGeoSphere(
NameShort(
name), rminline, rmaxline, startthetaline, deltathetaline, startphiline, deltaphiline);
3627 if (tempattr ==
"name") {
3629 }
else if (tempattr ==
"rmin") {
3631 }
else if (tempattr ==
"rmax") {
3633 }
else if (tempattr ==
"rtor") {
3635 }
else if (tempattr ==
"lunit") {
3637 }
else if (tempattr ==
"aunit") {
3639 }
else if (tempattr ==
"startphi") {
3641 }
else if (tempattr ==
"deltaphi") {
3691 if (tempattr ==
"name") {
3693 }
else if (tempattr ==
"rmin") {
3695 }
else if (tempattr ==
"rmax") {
3697 }
else if (tempattr ==
"z") {
3699 }
else if (tempattr ==
"lunit") {
3701 }
else if (tempattr ==
"aunit") {
3703 }
else if (tempattr ==
"inst") {
3705 }
else if (tempattr ==
"outst") {
3757 if (tempattr ==
"name") {
3759 }
else if (tempattr ==
"x") {
3761 }
else if (tempattr ==
"y") {
3763 }
else if (tempattr ==
"z") {
3765 }
else if (tempattr ==
"lunit") {
3767 }
else if (tempattr ==
"aunit") {
3769 }
else if (tempattr ==
"phi") {
3771 }
else if (tempattr ==
"theta") {
3773 }
else if (tempattr ==
"alpha") {
3832 if (tempattr ==
"name") {
3834 }
else if (tempattr ==
"x1") {
3836 }
else if (tempattr ==
"x2") {
3838 }
else if (tempattr ==
"x3") {
3840 }
else if (tempattr ==
"x4") {
3842 }
else if (tempattr ==
"y1") {
3844 }
else if (tempattr ==
"y2") {
3846 }
else if (tempattr ==
"z") {
3848 }
else if (tempattr ==
"lunit") {
3850 }
else if (tempattr ==
"aunit") {
3852 }
else if (tempattr ==
"phi") {
3854 }
else if (tempattr ==
"theta") {
3856 }
else if (tempattr ==
"alph") {
3861 }
else if (tempattr ==
"phitwist") {
3889 x2line / 2, alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
3917 if (tempattr ==
"name") {
3919 }
else if (tempattr ==
"dx") {
3921 }
else if (tempattr ==
"dy") {
3923 }
else if (tempattr ==
"dz") {
3925 }
else if (tempattr ==
"lunit") {
3967 if (tempattr ==
"name") {
3969 }
else if (tempattr ==
"r") {
3971 }
else if (tempattr ==
"lunit") {
4022 if (tempattr ==
"name") {
4024 }
else if (tempattr ==
"lunit") {
4043 while (child != 0) {
4046 if (tempattr ==
"twoDimVertex") {
4047 noverts = noverts + 1;
4048 }
else if (tempattr ==
"section") {
4049 nosects = nosects + 1;
4055 if (nosects < 2 || noverts < 3) {
4056 Fatal(
"Xtru",
"Invalid number of sections/vertices found forxtru %s",
name.Data());
4063 double *vertx =
new double[noverts];
4064 double *verty =
new double[noverts];
4066 double **section =
new double *[nosects];
4067 for (i = 0; i < nosects; i++) {
4068 section[i] =
new double[cols];
4075 while (child != 0) {
4076 if (strcmp(gdml->
GetNodeName(child),
"twoDimVertex") == 0) {
4085 if (tempattr ==
"x") {
4087 xline =
Value(
x) * retlunit;
4088 vertx[vert] = xline;
4089 }
else if (tempattr ==
"y") {
4091 yline =
Value(
y) * retlunit;
4092 verty[vert] = yline;
4101 else if (strcmp(gdml->
GetNodeName(child),
"section") == 0) {
4112 if (tempattr ==
"zOrder") {
4114 section[sect][0] =
Value(zorder);
4115 }
else if (tempattr ==
"zPosition") {
4117 zposline =
Value(zpos) * retlunit;
4118 section[sect][1] = zposline;
4119 }
else if (tempattr ==
"xOffset") {
4121 xoffline =
Value(xoff) * retlunit;
4122 section[sect][2] = xoffline;
4123 }
else if (tempattr ==
"yOffset") {
4125 yoffline =
Value(yoff) * retlunit;
4126 section[sect][3] = yoffline;
4127 }
else if (tempattr ==
"scalingFactor") {
4129 section[sect][4] =
Value(scale);
4144 for (
int j = 0; j < sect; j++) {
4145 xtru->
DefineSection((
int)section[j][0], section[j][1], section[j][2], section[j][3], section[j][4]);
4151 for (i = 0; i < nosects; i++) {
4152 delete[] section[i];
4170 while (attr !=
nullptr) {
4173 if (tempattr ==
"name") {
4188 if (trans ==
nullptr)
4190 const double *tr = trans->GetTranslation();
4191 vertices[i].Set(tr[0], tr[1], tr[2]);
4194 auto AddTriangularFacet = [&](
bool relative) {
4196 vertices[2] += vertices[0] + vertices[1];
4197 vertices[1] += vertices[0];
4199 tsl->AddFacet(vertices[0], vertices[1], vertices[2]);
4202 auto AddQuadrangularFacet = [&](
bool relative) {
4204 vertices[3] += vertices[0] + vertices[1] + vertices[2];
4205 vertices[2] += vertices[0] + vertices[1];
4206 vertices[1] += vertices[0];
4208 tsl->AddFacet(vertices[0], vertices[1], vertices[2], vertices[3]);
4213 while (child !=
nullptr) {
4216 if (tempattr ==
"triangular") {
4218 bool relative =
false;
4220 while (attr !=
nullptr) {
4223 if (tempattr ==
"vertex1") {
4228 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4232 else if (tempattr ==
"vertex2") {
4237 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4241 else if (tempattr ==
"vertex3") {
4246 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4250 else if (tempattr ==
"type") {
4253 relative = (
type ==
"relative") ?
true :
false;
4258 AddTriangularFacet(relative);
4261 else if (tempattr ==
"quadrangular") {
4263 bool relative =
false;
4265 while (attr !=
nullptr) {
4268 if (tempattr ==
"vertex1") {
4273 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4277 else if (tempattr ==
"vertex2") {
4282 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4286 else if (tempattr ==
"vertex3") {
4291 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4295 else if (tempattr ==
"vertex4") {
4300 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4304 else if (tempattr ==
"type") {
4307 relative = (
type ==
"relative") ?
true :
false;
4312 AddQuadrangularFacet(relative);
4316 tsl->CloseShape(
false);
4335 std::cout <<
"WARNING! The reflectedSolid is obsolete! Use scale transformation instead!" << std::endl;
4355 if (tempattr ==
"name") {
4357 }
else if (tempattr ==
"sx") {
4359 }
else if (tempattr ==
"sy") {
4361 }
else if (tempattr ==
"sz") {
4363 }
else if (tempattr ==
"rx") {
4365 }
else if (tempattr ==
"ry") {
4367 }
else if (tempattr ==
"rz") {
4369 }
else if (tempattr ==
"dx") {
4371 }
else if (tempattr ==
"dy") {
4373 }
else if (tempattr ==
"dz") {
4375 }
else if (tempattr ==
"solid") {
4393 if (atoi(sx) == -1) {
4396 if (atoi(sy) == -1) {
4399 if (atoi(sz) == -1) {
static const double x2[5]
static const double x4[22]
static const double x1[5]
static const double x3[11]
include TDocParser_001 C image html pict1_TDocParser_001 png width
R__EXTERN TGeoManager * gGeoManager
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class is used in the process of reading and writing the GDML "matrix" tag.
void Set(size_t r, size_t c, Double_t a)
void SetMatrixAsString(const char *mat)
This class contains the implementation of the GDML parser associated to all the supported GDML elemen...
XMLNodePointer_t Ellipsoid(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an ellipsoid may be declared.
double Evaluate(const char *evalline)
Takes a string containing a mathematical expression and returns the value of the expression.
TGeoVolume * GDMLReadFile(const char *filename="test.gdml")
Creates the new instance of the XMLEngine called 'gdml', using the filename >> then parses the file a...
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...
XMLNodePointer_t TopProcess(TXMLEngine *gdml, XMLNodePointer_t node)
In the setup section of the GDML file, the top volume need to be declared.
ReflSolidMap freflsolidmap
Map containing reflection names and the Solid name ir references to.
const char * ParseGDML(TXMLEngine *gdml, XMLNodePointer_t node)
This function recursively moves thru the DOM tree of the GDML file.
XMLNodePointer_t SclProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, rotations can be declared.
XMLNodePointer_t BorderSurfaceProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the structure section of the GDML file, border surfaces can be declared.
XMLNodePointer_t Trd(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Trd may be declared.
const char * fCurrentFile
void DefineConstants()
Define constant expressions used.
const char * NameShort(const char *name)
This function looks thru a string for the chars '0x' next to each other, when it finds this,...
XMLNodePointer_t Orb(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an Orb may be declared.
FileMap ffilemap
Map containing reflected volume names and the solid ref for it.
MatrixMap fmatrices
Map containing values of constants declared in the file.
XMLNodePointer_t Hype(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Hype may be declared.
VolMap fvolmap
Map containing solid names and the TGeoShape for it.
double GetScaleVal(const char *unit)
Throughout the GDML file, a unit can de specified.
std::string fDefault_lunit
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.
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 Arb8(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, an Arb8 may be declared.
RotMap frotmap
Map containing position names and the TGeoTranslation for it.
XMLNodePointer_t PosProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, positions can be declared.
ReflVolMap freflvolmap
Map containing reflection names and the TGDMLRefl for it - containing refl matrix.
XMLNodePointer_t Sphere(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Sphere may be declared.
ReflectionsMap freflectmap
Map containing placed volume names and the TGeoNode for it.
XMLNodePointer_t Trap(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Trap may be declared.
std::map< std::string, double > FracMap
XMLNodePointer_t EleProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLNodePointer_t parentn, Bool_t hasIsotopes, Bool_t hasIsotopesExtended)
When the element keyword is found, this function is called, and the name and values of the element ar...
XMLNodePointer_t Polyhedra(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Polyhedra may be declared.
XMLNodePointer_t Cone(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a cone may be declared.
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.
MatMap fmatmap
Map containing element names and the TGeoElement for it.
SclMap fsclmap
Map containing rotation names and the TGeoRotation for it.
XMLNodePointer_t MatrixProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, matrices These are referenced by other GDML tags,...
XMLNodePointer_t Tessellated(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a tessellated shape may be declared.
IsoMap fisomap
Map containing scale names and the TGeoScale for it.
XMLNodePointer_t IsoProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLNodePointer_t parentn)
In the material section of the GDML file, an isotope may be declared.
PvolMap fpvolmap
Map containing volume names and the TGeoVolume for it.
double Value(const char *svalue) const
Convert number in string format to double value.
XMLNodePointer_t TwistTrap(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a TwistTrap may be declared.
MedMap fmedmap
Map containing material names and the TGeoMaterial for it.
XMLNodePointer_t Paraboloid(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Paraboloid may be declared.
Int_t SetAxis(const char *axisString)
When using the 'divide' process in the geometry this function sets the variable 'axis' depending on w...
ConstMap fconsts
Map containing files parsed during entire parsing, with their world volume name.
std::string fDefault_aunit
XMLNodePointer_t QuantityProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, quantities can 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.
XMLNodePointer_t Box(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a box may be declared.
SolMap fsolmap
Map containing mixture names and the TGeoMixture for it.
EleMap felemap
Map containing isotope names and the TGeoIsotope for it.
XMLNodePointer_t Tube(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Tube may be declared.
TString GetScale(const char *unit)
Throughout the GDML file, a unit can de specified.
XMLNodePointer_t AssProcess(TXMLEngine *gdml, XMLNodePointer_t node)
In the structure section of the GDML file, assembly volumes can be declared.
TXMLEngine * fFileEngine[20]
XMLNodePointer_t RotProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, rotations can be declared.
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 ConProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the define section of the GDML file, constants can be declared.
XMLNodePointer_t VolProcess(TXMLEngine *gdml, XMLNodePointer_t node)
In the structure section of the GDML file, volumes can be declared.
XMLNodePointer_t OpticalSurfaceProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, optical surfaces can be defined.
XMLNodePointer_t SkinSurfaceProcess(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the structure section of the GDML file, skin surfaces can be declared.
XMLNodePointer_t ElTube(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a ElTube 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.
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 CutTube(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Cut Tube may be declared.
MixMap fmixmap
Map containing medium names and the TGeoMedium for it.
XMLNodePointer_t UsrProcess(TXMLEngine *gdml, XMLNodePointer_t node)
User data to be processed.
This class is a helper class for TGDMLParse.
TGeoMatrix * fMatrix
solid name being reflected
TGeoMatrix * GetMatrix()
This accessor method returns the matrix.
const char * fSolid
reflected solid name
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Set values for a given vertex.
Base class for Boolean operations between two shapes.
Class describing rotation + translation.
Composite shapes are Boolean combinations of two or more shape components.
A cone segment is a cone having a range in phi.
The cones are defined by 5 parameters:
The cut tubes constructor has the form:
TGeoIsotope * FindIsotope(const char *name) const
Find existing isotope by name. Not optimized for a big number of isotopes.
TGeoElement * FindElement(const char *name) const
Search an element by symbol or full name Exact matching.
Base class for chemical elements.
void AddIsotope(TGeoIsotope *isotope, Double_t relativeAbundance)
Add an isotope for this element. All isotopes have to be isotopes of the same element.
An elliptical tube is defined by the two semi-axes A and B.
Matrix class used for computing global transformations Should NOT be used for node definition.
void SetRotation(const Double_t *matrix)
void MultiplyLeft(const TGeoMatrix *left)
multiply to the left with an other transformation if right is identity matrix, just return
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
void SetTranslation(const Double_t *vect)
A hyperboloid is represented as a solid limited by two planes perpendicular to the Z axis (top and bo...
The manager class for any TGeo geometry.
void AddSkinSurface(TGeoSkinSurface *surf)
Add skin surface;.
static EDefaultUnits GetDefaultUnits()
TList * GetListOfMedia() const
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
void AddGDMLMatrix(TGDMLMatrix *mat)
Add GDML matrix;.
void AddBorderSurface(TGeoBorderSurface *surf)
Add border surface;.
void AddOpticalSurface(TGeoOpticalSurface *optsurf)
Add optical surface;.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
Double_t GetProperty(const char *name, Bool_t *error=nullptr) const
Get a user-defined property.
TGeoOpticalSurface * GetOpticalSurface(const char *name) const
Get optical surface with a given name;.
Bool_t AddProperty(const char *property, Double_t value)
Add a user-defined property. Returns true if added, false if existing.
TGeoMaterial * GetMaterial(const char *matname) const
Search for a named material. All trailing blanks stripped.
Int_t AddRegion(TGeoRegion *region)
Add a new region of volumes.
TList * GetListOfMaterials() const
Base class describing materials.
virtual Bool_t IsMixture() const
bool AddConstProperty(const char *property, const char *ref)
bool AddProperty(const char *property, const char *ref)
Geometrical transformation package.
virtual const Double_t * GetRotationMatrix() const =0
Media are used to store properties related to tracking and which are useful only when using geometry ...
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
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
This is a wrapper class to G4OpticalSurface.
static ESurfaceType StringToType(const char *type)
bool AddProperty(const char *property, const char *ref)
static ESurfaceFinish StringToFinish(const char *finish)
static ESurfaceModel StringToModel(const char *model)
A paraboloid is defined by the revolution surface generated by a parabola and is bounded by two plane...
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
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.
Polygons are defined in the same way as polycones, the difference being just that the segments betwee...
Reference counted extension which has a pointer to and owns a user defined TObject.
Regions are groups of volumes having a common set of user tracking cuts.
void AddCut(const char *name, Double_t cut)
Add cut to the region.
void AddVolume(TGeoVolume *vol)
Class describing rotations.
virtual void RotateY(Double_t angle)
Rotate about Y axis of the master frame with angle expressed in degrees.
virtual void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to YZ.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
virtual const Double_t * GetRotationMatrix() const
void SetMatrix(const Double_t *rot)
virtual void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to ZX.
virtual void RotateX(Double_t angle)
Rotate about X axis of the master frame with angle expressed in degrees.
TGeoHMatrix Inverse() const
Return a temporary inverse of this.
virtual void RotateZ(Double_t angle)
Rotate about Z axis of the master frame with angle expressed in degrees.
Class describing scale transformations.
virtual const Double_t * GetScale() const
A shape scaled by a TGeoScale transformation.
Base abstract class for all shapes.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
The torus is defined by its axial radius, its inner and outer radius.
Class describing translations.
virtual const Double_t * GetTranslation() const
A trapezoid with only X varying with Z.
A tube segment is a tube having a range in phi.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a component to the assembly.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void SetUserExtension(TGeoExtension *ext)
Connect user-defined extension to the volume.
TGeoMedium * GetMedium() const
void ReplayCreation(const TGeoVolume *other)
Recreate the content of the other volume without pointer copying.
Int_t GetNdaughters() const
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=0, Option_t *option="")
Add a TGeoNode to the list of nodes.
TGeoShape * GetShape() const
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.
A TGeoXtru shape is represented by the extrusion of an arbitrary polygon with fixed outline between s...
Bool_t DefinePolygon(Int_t nvert, const Double_t *xv, const Double_t *yv)
Creates the polygon representing the blueprint of any Xtru section.
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.
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
The TNamed class is the base class for all named ROOT classes.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
Collectable string class.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void ToLower()
Change string to lower-case.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
XMLNodePointer_t GetChild(XMLNodePointer_t xmlnode, Bool_t realnode=kTRUE)
returns first child of xmlnode
void FreeDoc(XMLDocPointer_t xmldoc)
frees allocated document data and deletes document itself
XMLNodePointer_t DocGetRootElement(XMLDocPointer_t xmldoc)
returns root node of document
Bool_t HasAttr(XMLNodePointer_t xmlnode, const char *name)
checks if node has attribute of specified name
XMLAttrPointer_t GetNextAttr(XMLAttrPointer_t xmlattr)
return next attribute in the list
const char * GetAttrName(XMLAttrPointer_t xmlattr)
return name of the attribute
XMLAttrPointer_t GetFirstAttr(XMLNodePointer_t xmlnode)
return first attribute in the list, namespace (if exists) will be skipped
const char * GetNodeName(XMLNodePointer_t xmlnode)
returns name of xmlnode
const char * GetAttr(XMLNodePointer_t xmlnode, const char *name)
returns value of attribute for xmlnode
XMLDocPointer_t ParseFile(const char *filename, Int_t maxbuf=100000)
Parses content of file and tries to produce xml structures.
void SetSkipComments(Bool_t on=kTRUE)
const char * GetAttrValue(XMLAttrPointer_t xmlattr)
return value of attribute
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 ShiftToNext(XMLNodePointer_t &xmlnode, Bool_t realnode=kTRUE)
shifts specified node to next if realnode==kTRUE, any special nodes in between will be skipped
XMLNodePointer_t GetParent(XMLNodePointer_t xmlnode)
returns parent of xmlnode
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
static constexpr double GeV
static constexpr double us
static constexpr double s
static constexpr double mm
static constexpr double g
static constexpr double km
static constexpr double keV
static constexpr double ns
static constexpr double m
static constexpr double cm
static constexpr double ms
static constexpr double kg
static constexpr double mg
static constexpr double eV
static constexpr double MeV
static constexpr double mg
static constexpr double us
static constexpr double ms
static constexpr double s
static constexpr double mm
static constexpr double MeV
static constexpr double pi
static constexpr double keV
static constexpr double GeV
static constexpr double twopi
static constexpr double rad
static constexpr double kg
static constexpr double cm
static constexpr double m
static constexpr double ns
static constexpr double deg
static constexpr double eV
static constexpr double g
static constexpr double km
constexpr Double_t Na()
Avogadro constant (Avogadro's Number) in .
constexpr Double_t RadToDeg()
Conversion from radian to degree:
Typedefs used by the geometry group.