132 for (
Int_t i = 0; i < 20; i++)
165 if (gdmldoc ==
nullptr) {
186 "\x1B[31m Found %d GDML entities missing explicit units, while the default "
187 "units are currently ROOT units [cm, deg]. This can cause unexpected behaviour with respect "
188 "to the GDML schema. To remove this warning, either use explicit units or call the static method "
189 "TGeoManager::SetDefaultUnits(kG4Units) before importing the GDML file \x1B[34m%s \x1B[0m",
209 const char *posistr =
"position";
210 const char *setustr =
"setup";
211 const char *consstr =
"constant";
212 const char *varistr =
"variable";
213 const char *quanstr =
"quantity";
214 const char *matrstr =
"matrix";
215 const char *rotastr =
"rotation";
216 const char *scalstr =
"scale";
217 const char *elemstr =
"element";
218 const char *istpstr =
"isotope";
219 const char *matestr =
"material";
220 const char *volustr =
"volume";
221 const char *assestr =
"assembly";
222 const char *twtrstr =
"twistedtrap";
223 const char *cutTstr =
"cutTube";
224 const char *bboxstr =
"box";
225 const char *xtrustr =
"xtru";
226 const char *arb8str =
"arb8";
227 const char *tubestr =
"tube";
228 const char *conestr =
"cone";
229 const char *polystr =
"polycone";
230 const char *hypestr =
"hype";
231 const char *trapstr =
"trap";
232 const char *trdstr =
"trd";
233 const char *sphestr =
"sphere";
234 const char *orbstr =
"orb";
235 const char *parastr =
"para";
236 const char *torustr =
"torus";
237 const char *hedrstr =
"polyhedra";
238 const char *eltustr =
"eltube";
239 const char *subtstr =
"subtraction";
240 const char *uniostr =
"union";
241 const char *parbstr =
"paraboloid";
242 const char *intestr =
"intersection";
243 const char *reflstr =
"reflectedSolid";
244 const char *ssolstr =
"scaledSolid";
245 const char *ellistr =
"ellipsoid";
246 const char *elcnstr =
"elcone";
247 const char *optsstr =
"opticalsurface";
248 const char *skinstr =
"skinsurface";
249 const char *bordstr =
"bordersurface";
250 const char *usrstr =
"userinfo";
251 const char *tslstr =
"tessellated";
253 Bool_t hasIsotopesExtended;
255 if ((strcmp(
name, posistr)) == 0) {
257 }
else if ((strcmp(
name, rotastr)) == 0) {
259 }
else if ((strcmp(
name, scalstr)) == 0) {
261 }
else if ((strcmp(
name, setustr)) == 0) {
263 }
else if ((strcmp(
name, consstr)) == 0) {
265 }
else if ((strcmp(
name, varistr)) == 0) {
267 }
else if ((strcmp(
name, quanstr)) == 0) {
269 }
else if ((strcmp(
name, matrstr)) == 0) {
271 }
else if ((strcmp(
name, optsstr)) == 0) {
273 }
else if ((strcmp(
name, skinstr)) == 0) {
275 }
else if ((strcmp(
name, bordstr)) == 0) {
280 else if (((strcmp(
name,
"atom")) == 0) && ((strcmp(parent, elemstr)) == 0)) {
282 hasIsotopesExtended =
kFALSE;
283 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
284 }
else if ((strcmp(
name, elemstr) == 0) && !gdml->
HasAttr(node,
"Z")) {
286 hasIsotopesExtended =
kFALSE;
287 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
290 else if ((strcmp(
name, elemstr) == 0) && gdml->
HasAttr(node,
"Z")) {
292 if ((strcmp(gdml->
GetNodeName(childtmp),
"fraction") == 0)) {
294 hasIsotopesExtended =
kTRUE;
295 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
301 else if (((strcmp(
name,
"atom")) == 0) && ((strcmp(parent, istpstr)) == 0)) {
306 else if ((strcmp(
name, matestr)) == 0 && gdml->
HasAttr(node,
"Z")) {
314 atom = strcmp(gdml->
GetNodeName(childtmp),
"atom") == 0;
317 int z = (atom) ? 1 : 0;
319 }
else if ((strcmp(
name, matestr)) == 0 && !gdml->
HasAttr(node,
"Z")) {
325 else if ((strcmp(
name, volustr)) == 0) {
327 }
else if ((strcmp(
name, bboxstr)) == 0) {
328 node =
Box(gdml, node, attr);
329 }
else if ((strcmp(
name, ellistr)) == 0) {
331 }
else if ((strcmp(
name, elcnstr)) == 0) {
332 node =
ElCone(gdml, node, attr);
333 }
else if ((strcmp(
name, cutTstr)) == 0) {
334 node =
CutTube(gdml, node, attr);
335 }
else if ((strcmp(
name, arb8str)) == 0) {
336 node =
Arb8(gdml, node, attr);
337 }
else if ((strcmp(
name, tubestr)) == 0) {
338 node =
Tube(gdml, node, attr);
339 }
else if ((strcmp(
name, conestr)) == 0) {
340 node =
Cone(gdml, node, attr);
341 }
else if ((strcmp(
name, polystr)) == 0) {
343 }
else if ((strcmp(
name, trapstr)) == 0) {
344 node =
Trap(gdml, node, attr);
345 }
else if ((strcmp(
name, trdstr)) == 0) {
346 node =
Trd(gdml, node, attr);
347 }
else if ((strcmp(
name, sphestr)) == 0) {
348 node =
Sphere(gdml, node, attr);
349 }
else if ((strcmp(
name, xtrustr)) == 0) {
350 node =
Xtru(gdml, node, attr);
351 }
else if ((strcmp(
name, twtrstr)) == 0) {
353 }
else if ((strcmp(
name, hypestr)) == 0) {
354 node =
Hype(gdml, node, attr);
355 }
else if ((strcmp(
name, orbstr)) == 0) {
356 node =
Orb(gdml, node, attr);
357 }
else if ((strcmp(
name, parastr)) == 0) {
358 node =
Para(gdml, node, attr);
359 }
else if ((strcmp(
name, torustr)) == 0) {
360 node =
Torus(gdml, node, attr);
361 }
else if ((strcmp(
name, eltustr)) == 0) {
362 node =
ElTube(gdml, node, attr);
363 }
else if ((strcmp(
name, hedrstr)) == 0) {
365 }
else if ((strcmp(
name, tslstr)) == 0) {
367 }
else if ((strcmp(
name, parbstr)) == 0) {
369 }
else if ((strcmp(
name, subtstr)) == 0) {
370 node =
BooSolid(gdml, node, attr, 1);
371 }
else if ((strcmp(
name, intestr)) == 0) {
372 node =
BooSolid(gdml, node, attr, 2);
373 }
else if ((strcmp(
name, uniostr)) == 0) {
374 node =
BooSolid(gdml, node, attr, 3);
375 }
else if ((strcmp(
name, reflstr)) == 0) {
377 }
else if ((strcmp(
name, ssolstr)) == 0) {
379 }
else if ((strcmp(
name, assestr)) == 0) {
381 }
else if ((strcmp(
name, usrstr)) == 0) {
384 }
else if (((strcmp(
name,
"gdml")) != 0) && ((strcmp(
name,
"define")) != 0) && ((strcmp(
name,
"element")) != 0) &&
385 ((strcmp(
name,
"materials")) != 0) && ((strcmp(
name,
"solids")) != 0) &&
386 ((strcmp(
name,
"structure")) != 0) && ((strcmp(
name,
"zplane")) != 0) && ((strcmp(
name,
"first")) != 0) &&
387 ((strcmp(
name,
"second")) != 0) && ((strcmp(
name,
"twoDimVertex")) != 0) &&
388 ((strcmp(
name,
"firstposition")) != 0) && ((strcmp(
name,
"firstpositionref")) != 0) &&
389 ((strcmp(
name,
"firstrotation")) != 0) && ((strcmp(
name,
"firstrotationref")) != 0) &&
390 ((strcmp(
name,
"section")) != 0) && ((strcmp(
name,
"world")) != 0) && ((strcmp(
name,
"isotope")) != 0) &&
391 ((strcmp(
name,
"triangular")) != 0) && ((strcmp(
name,
"quadrangular")) != 0)) {
392 std::cout <<
"Error: Unsupported GDML Tag Used :" <<
name <<
". Please Check Geometry/Schema." << std::endl;
398 while (child !=
nullptr) {
424 if ((strcmp(axisString,
"kXAxis")) == 0) {
426 }
else if ((strcmp(axisString,
"kYAxis")) == 0) {
428 }
else if ((strcmp(axisString,
"kZAxis")) == 0) {
430 }
else if ((strcmp(axisString,
"kRho")) == 0) {
432 }
else if ((strcmp(axisString,
"kPhi")) == 0) {
451 stripped = stripped(0, index);
452 return stripped.
Data();
467 while (attr !=
nullptr) {
471 if (tempattr ==
"name") {
474 if (tempattr ==
"value") {
541 while (attr !=
nullptr) {
545 if (tempattr ==
"name") {
548 if (tempattr ==
"value") {
551 if (tempattr ==
"unit") {
572 while (attr !=
nullptr) {
576 if (tempattr ==
"name") {
579 if (tempattr ==
"coldim") {
582 if (tempattr ==
"values") {
589 std::stringstream valueStream(values);
590 std::vector<Double_t> valueList;
591 while (!valueStream.eof()) {
592 std::string matrixValue;
593 valueStream >> matrixValue;
595 if (matrixValue.empty())
597 valueList.push_back(
Value(matrixValue.c_str()));
602 if (coldim == 1 && valueList.size() == 1) {
607 for (
size_t i = 0; i < valueList.size(); ++i)
608 matrix->
Set(i / coldim, i % coldim, valueList[i]);
628 while (attr !=
nullptr) {
632 if (tempattr ==
"name") {
635 if (tempattr ==
"model") {
638 if (tempattr ==
"finish") {
641 if (tempattr ==
"type") {
644 if (tempattr ==
"value") {
653 while (child !=
nullptr) {
655 if ((strcmp(gdml->
GetNodeName(child),
"property")) == 0) {
656 while (attr !=
nullptr) {
659 if (tempattr ==
"name") {
661 }
else if (tempattr ==
"ref") {
665 Error(
"OpticalSurfaceProcess",
"Reference matrix %s for optical surface %s not found", ref.
Data(),
688 if (strcmp(unit,
"mm") == 0) {
690 }
else if (strcmp(unit,
"millimeter") == 0 || strcmp(unit,
"milimeter") == 0) {
692 }
else if (strcmp(unit,
"cm") == 0) {
694 }
else if (strcmp(unit,
"centimeter") == 0) {
696 }
else if (strcmp(unit,
"m") == 0) {
698 }
else if (strcmp(unit,
"meter") == 0) {
700 }
else if (strcmp(unit,
"km") == 0) {
701 retunit =
"100000.0";
702 }
else if (strcmp(unit,
"kilometer") == 0) {
703 retunit =
"100000.0";
704 }
else if (strcmp(unit,
"rad") == 0) {
706 }
else if (strcmp(unit,
"radian") == 0) {
708 }
else if (strcmp(unit,
"deg") == 0) {
710 }
else if (strcmp(unit,
"degree") == 0) {
712 }
else if (strcmp(unit,
"pi") == 0) {
714 }
else if (strcmp(unit,
"avogadro") == 0) {
717 Fatal(
"GetScale",
"Unit <%s> not known", unit);
736 if ((unit ==
"mm") || (unit ==
"millimeter") || (unit ==
"milimeter")) {
738 }
else if ((unit ==
"cm") || (unit ==
"centimeter")) {
740 }
else if ((unit ==
"m") || (unit ==
"meter")) {
742 }
else if ((unit ==
"km") || (unit ==
"kilometer")) {
744 }
else if ((unit ==
"rad") || (unit ==
"radian")) {
746 }
else if ((unit ==
"deg") || (unit ==
"degree")) {
748 }
else if ((unit ==
"ev") || (unit ==
"electronvolt")) {
750 }
else if ((unit ==
"kev") || (unit ==
"kiloelectronvolt")) {
752 }
else if ((unit ==
"mev") || (unit ==
"megaelectronvolt")) {
754 }
else if ((unit ==
"gev") || (unit ==
"gigaelectronvolt")) {
756 }
else if (unit ==
"pi") {
758 }
else if (unit ==
"avogadro") {
761 Fatal(
"GetScaleVal",
"Unit <%s> not known", sunit);
773 double val = strtod(svalue, &end);
776 while (*end != 0 && isspace(*end))
788 std::string expanded;
789 expanded.reserve(strlen(svalue) * 2);
793 const std::locale &loc = std::locale::classic();
796 const char *p = svalue;
799 for (; *p != 0; ++p) {
800 if (std::isalpha(*p, loc) || *p ==
'_') {
801 const char *pe = p + 1;
804 for (; *pe != 0; ++pe) {
805 if (!isalnum(*pe, loc) && *pe !=
'_') {
831 TFormula f(
"TFormula", expanded.c_str());
835 f.SetParameter(it.first.c_str(), it.second);
839 if (std::isnan(val) || std::isinf(val)) {
840 Fatal(
"Value",
"Got bad value %lf from string '%s'", val, svalue);
856 bool unitless_l =
true;
864 while (attr !=
nullptr) {
869 if (tempattr ==
"name") {
871 }
else if (tempattr ==
"x") {
873 }
else if (tempattr ==
"y") {
875 }
else if (tempattr ==
"z") {
877 }
else if (tempattr ==
"unit") {
913 bool unitless_l =
true;
920 while (attr !=
nullptr) {
925 if (tempattr ==
"name") {
927 }
else if (tempattr ==
"x") {
929 }
else if (tempattr ==
"y") {
931 }
else if (tempattr ==
"z") {
933 }
else if (tempattr ==
"unit") {
978 while (attr !=
nullptr) {
983 if (tempattr ==
"name") {
985 }
else if (tempattr ==
"x") {
987 }
else if (tempattr ==
"y") {
989 }
else if (tempattr ==
"z") {
1026 while (attr !=
nullptr) {
1031 if (tempattr ==
"name") {
1033 }
else if (tempattr ==
"z") {
1035 }
else if (tempattr ==
"n") {
1046 while (attr !=
nullptr) {
1050 if (tempattr ==
"value") {
1072 }
else if (
gDebug >= 2) {
1073 Info(
"TGDMLParse",
"Re-use existing isotope: %s", iso->
GetName());
1109 while (attr !=
nullptr) {
1111 if (tempattr ==
"name") {
1123 while (child !=
nullptr) {
1126 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1129 ncompo = ncompo + 1;
1131 while (attr !=
nullptr) {
1134 if (tempattr ==
"n") {
1136 }
else if (tempattr ==
"ref") {
1144 fracmap[ref.
Data()] =
n;
1151 if (ele && ele->
Z() == 0)
1155 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1166 if (hasIsotopesExtended) {
1168 while (attr !=
nullptr) {
1171 if (tempattr ==
"name") {
1183 while (child !=
nullptr) {
1186 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1189 ncompo = ncompo + 1;
1191 while (attr !=
nullptr) {
1194 if (tempattr ==
"n") {
1196 }
else if (tempattr ==
"ref") {
1204 fracmap[ref.
Data()] =
n;
1211 if (ele && ele->
Z() == 0)
1215 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1227 while (attr !=
nullptr) {
1232 if (tempattr ==
"name") {
1235 }
else if (tempattr ==
"z") {
1237 }
else if (tempattr ==
"formula") {
1248 while (attr !=
nullptr) {
1253 if (tempattr ==
"value") {
1269 if (ele && ele->
Z() == 0)
1274 }
else if (
gDebug >= 2) {
1275 Info(
"TGDMLParse",
"Re-use existing element: %s", ele->
GetName());
1300 TList properties, constproperties;
1307 Int_t ncompo = 0, mixflag = 2;
1326 while (child !=
nullptr) {
1329 if ((strcmp(gdml->
GetNodeName(child),
"property")) == 0) {
1331 while (attr !=
nullptr) {
1335 if (tempattr ==
"name") {
1337 }
else if (tempattr ==
"ref") {
1341 properties.
Add(property);
1344 gGeoManager->GetProperty(property->GetTitle(), &error);
1346 Error(
"MatProcess",
"Reference %s for material %s not found", property->GetTitle(),
1349 constproperties.
Add(property);
1356 if ((strcmp(gdml->
GetNodeName(child),
"atom")) == 0) {
1357 while (attr !=
nullptr) {
1361 if (tempattr ==
"value") {
1368 if ((strcmp(gdml->
GetNodeName(child),
"D")) == 0) {
1369 while (attr !=
nullptr) {
1373 if (tempattr ==
"value") {
1383 tempconst = gdml->
GetAttr(node,
"Z");
1390 if (tmpname ==
"vacuum") {
1398 Info(
"TGDMLParse",
"Re-use existing material: %s", mat->
GetName());
1402 TIter next(&properties);
1403 while ((property = (
TNamed *)next()))
1406 if (constproperties.
GetSize()) {
1408 TIter next(&constproperties);
1409 while ((property = (
TNamed *)next()))
1416 if (mat_ele && mat_ele->
Z() == 0)
1420 mat_ele =
new TGeoElement(mat_name, mat_name, atoi(tempconst),
a);
1421 }
else if (
gDebug >= 2) {
1422 Info(
"TGDMLParse",
"Re-use existing material-element: %s", mat_ele->
GetName());
1428 while (child !=
nullptr) {
1431 if ((strcmp(gdml->
GetNodeName(child),
"property")) == 0) {
1433 while (attr !=
nullptr) {
1437 if (tempattr ==
"name") {
1439 }
else if (tempattr ==
"ref") {
1443 properties.
Add(property);
1446 gGeoManager->GetProperty(property->GetTitle(), &error);
1448 Error(
"MatProcess",
"Reference %s for material %s not found", property->GetTitle(),
1451 constproperties.
Add(property);
1457 if ((strcmp(gdml->
GetNodeName(child),
"fraction")) == 0) {
1460 ncompo = ncompo + 1;
1462 while (attr !=
nullptr) {
1466 if (tempattr ==
"n") {
1468 }
else if (tempattr ==
"ref") {
1476 fracmap[ref.
Data()] =
n;
1479 else if ((strcmp(gdml->
GetNodeName(child),
"composite")) == 0) {
1483 ncompo = ncompo + 1;
1485 while (attr !=
nullptr) {
1488 if (tempattr ==
"n") {
1490 }
else if (tempattr ==
"ref") {
1498 fracmap[ref.
Data()] =
n;
1499 }
else if ((strcmp(gdml->
GetNodeName(child),
"D")) == 0) {
1500 while (attr !=
nullptr) {
1504 if (tempattr ==
"value") {
1528 Info(
"TGDMLParse",
"Re-use existing material-mixture: %s", mix->
GetName());
1530 Fatal(
"TGDMLParse",
"WARNING! Inconsistent material definitions between GDML and TGeoManager");
1535 TIter next(&properties);
1536 while ((property = (
TNamed *)next()))
1539 if (constproperties.
GetSize()) {
1541 TIter next(&constproperties);
1542 while ((property = (
TNamed *)next()))
1548 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1556 natoms = (
Int_t)
f->second;
1581 }
else if (mixflag == 0) {
1585 }
else if (
gDebug >= 2) {
1586 Info(
"TGDMLParse",
"Re-use existing medium: %s", med->
GetName());
1601 while (attr !=
nullptr) {
1605 if (tempattr ==
"name") {
1608 if (tempattr ==
"surfaceproperty") {
1615 while (child !=
nullptr) {
1617 if ((strcmp(gdml->
GetNodeName(child),
"volumeref")) == 0) {
1618 while (attr !=
nullptr) {
1621 if (tempattr ==
"ref") {
1631 Fatal(
"SkinSurfaceProcess",
"Skin surface %s: referenced optical surface %s not defined",
name.Data(),
1647 while (attr !=
nullptr) {
1651 if (tempattr ==
"name") {
1654 if (tempattr ==
"surfaceproperty") {
1662 while (child !=
nullptr) {
1664 if ((strcmp(gdml->
GetNodeName(child),
"physvolref")) == 0) {
1665 while (attr !=
nullptr) {
1668 if (tempattr ==
"ref") {
1677 Fatal(
"BorderSurfaceProcess",
"Border surface %s not referencing two nodes",
name.Data());
1680 Fatal(
"BorderSurfaceProcess",
"Border surface %s: referenced optical surface %s not defined",
name.Data(),
1684 if (!node1 || !node2)
1685 Fatal(
"BorderSurfaceProcess",
"Border surface %s: not found nodes %s [%s] or %s [%s]",
name.Data(),
1686 nodename[0].
Data(), node1 ?
"present" :
"missing", nodename[1].
Data(), node2 ?
"present" :
"missing");
1708 Error(
"GetPosition",
"Position %s not defined",
name);
1727 Error(
"GetRotation",
"Rotation %s not defined",
name);
1746 Error(
"GetScale",
"Scale %s not defined",
name);
1765 Error(
"GetSolid",
"Solid %s not defined",
name);
1784 Error(
"GetVolume",
"Volume %s not defined",
name);
1818 const Double_t *parentrot =
nullptr;
1821 TMap *auxmap =
nullptr;
1823 while (child !=
nullptr) {
1824 if ((strcmp(gdml->
GetNodeName(child),
"solidref")) == 0) {
1826 reftemp = gdml->
GetAttr(child,
"ref");
1833 solidname = reftemp;
1836 printf(
"Solid: %s, Not Yet Defined!\n", reftemp.
Data());
1840 if ((strcmp(gdml->
GetNodeName(child),
"materialref")) == 0) {
1841 reftemp = gdml->
GetAttr(child,
"ref");
1848 printf(
"Medium: %s, Not Yet Defined!\n", gdml->
GetAttr(child,
"ref"));
1861 if (reflex ==
nullptr) {
1877 while (child !=
nullptr) {
1878 if ((strcmp(gdml->
GetNodeName(child),
"physvol")) == 0) {
1891 while (subchild !=
nullptr) {
1895 if (tempattr ==
"volumeref") {
1896 reftemp = gdml->
GetAttr(subchild,
"ref");
1899 }
else if (tempattr ==
"file") {
1900 const char *filevol;
1904 filevol = gdml->
GetAttr(subchild,
"volname");
1909 if (filedoc1 ==
nullptr) {
1937 }
else if (tempattr ==
"position") {
1940 reftemp = gdml->
GetAttr(subchild,
"name");
1942 }
else if (tempattr ==
"positionref") {
1943 reftemp = gdml->
GetAttr(subchild,
"ref");
1946 Fatal(
"VolProcess",
"Physvol's position %s not found", reftemp.
Data());
1947 }
else if (tempattr ==
"rotation") {
1950 reftemp = gdml->
GetAttr(subchild,
"name");
1952 }
else if (tempattr ==
"rotationref") {
1953 reftemp = gdml->
GetAttr(subchild,
"ref");
1956 Fatal(
"VolProcess",
"Physvol's rotation %s not found", reftemp.
Data());
1957 }
else if (tempattr ==
"scale") {
1960 reftemp = gdml->
GetAttr(subchild,
"name");
1962 }
else if (tempattr ==
"scaleref") {
1963 reftemp = gdml->
GetAttr(subchild,
"ref");
1966 Fatal(
"VolProcess",
"Physvol's scale %s not found", reftemp.
Data());
1969 subchild = gdml->
GetNext(subchild);
1978 transform->SetTranslation(pos->GetTranslation());
1982 if (scl !=
nullptr) {
1985 memset(scale3x3, 0, 9 *
sizeof(
Double_t));
1988 scale3x3[0] = diagonal[0];
1989 scale3x3[4] = diagonal[1];
1990 scale3x3[8] = diagonal[2];
1994 transform->Multiply(&scaleMatrix);
2002 transform->Multiply(temprefl->
GetMatrix());
2009 transform->MultiplyLeft(&prot);
2019 }
else if ((strcmp(gdml->
GetNodeName(child),
"divisionvol")) == 0) {
2027 bool unitless_l =
true;
2033 while (attr !=
nullptr) {
2038 if (tempattr ==
"axis") {
2040 }
else if (tempattr ==
"number") {
2042 }
else if (tempattr ==
"width") {
2044 }
else if (tempattr ==
"offset") {
2046 }
else if (tempattr ==
"unit") {
2056 while (subchild !=
nullptr) {
2060 if (tempattr ==
"volumeref") {
2061 reftemp = gdml->
GetAttr(subchild,
"ref");
2062 local_name = reftemp;
2066 divVolref = reftemp;
2069 subchild = gdml->
GetNext(subchild);
2094 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2104 else if ((strcmp(gdml->
GetNodeName(child),
"replicavol")) == 0) {
2113 bool unitless_l =
true;
2121 while (attr !=
nullptr) {
2126 if (tempattr ==
"number") {
2134 while (subchild !=
nullptr) {
2138 if (tempattr ==
"volumeref") {
2139 reftemp = gdml->
GetAttr(subchild,
"ref");
2140 local_name = reftemp;
2144 divVolref = reftemp;
2147 if (tempattr ==
"replicate_along_axis") {
2148 subsubchild = gdml->
GetChild(subchild);
2150 while (subsubchild !=
nullptr) {
2151 if ((strcmp(gdml->
GetNodeName(subsubchild),
"width")) == 0) {
2153 while (attr !=
nullptr) {
2156 if (tempattr ==
"value") {
2158 }
else if (tempattr ==
"unit") {
2165 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"offset")) == 0) {
2167 while (attr !=
nullptr) {
2170 if (tempattr ==
"value") {
2172 }
else if (tempattr ==
"unit") {
2178 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"direction")) == 0) {
2180 while (attr !=
nullptr) {
2183 if (tempattr ==
"x") {
2185 }
else if (tempattr ==
"y") {
2187 }
else if (tempattr ==
"z") {
2189 }
else if (tempattr ==
"rho") {
2191 }
else if (tempattr ==
"phi") {
2199 subsubchild = gdml->
GetNext(subsubchild);
2203 subchild = gdml->
GetNext(subchild);
2211 Double_t widthline = wvalue * retwunit;
2212 Double_t offsetline = ovalue * retounit;
2231 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2240 else if (strcmp(gdml->
GetNodeName(child),
"auxiliary") == 0) {
2241 TString auxType, auxUnit, auxValue;
2244 auxmap =
new TMap();
2253 else if (!strcmp(gdml->
GetAttrName(attr),
"auxvalue"))
2255 else if (!strcmp(gdml->
GetAttrName(attr),
"auxunit"))
2311 while (child !=
nullptr) {
2315 if (tempattr ==
"first") {
2316 reftemp = gdml->
GetAttr(child,
"ref");
2319 Fatal(
"BooSolid",
"First solid %s not found", reftemp.
Data());
2320 }
else if (tempattr ==
"second") {
2321 reftemp = gdml->
GetAttr(child,
"ref");
2324 Fatal(
"BooSolid",
"Second solid %s not found", reftemp.
Data());
2325 }
else if (tempattr ==
"position") {
2328 reftemp = gdml->
GetAttr(child,
"name");
2330 }
else if (tempattr ==
"positionref") {
2331 reftemp = gdml->
GetAttr(child,
"ref");
2334 Fatal(
"BooSolid",
"Second position %s not found", reftemp.
Data());
2335 }
else if (tempattr ==
"rotation") {
2338 reftemp = gdml->
GetAttr(child,
"name");
2340 }
else if (tempattr ==
"rotationref") {
2341 reftemp = gdml->
GetAttr(child,
"ref");
2344 Fatal(
"BooSolid",
"Second rotation %s not found", reftemp.
Data());
2345 }
else if (tempattr ==
"firstposition") {
2348 reftemp = gdml->
GetAttr(child,
"name");
2350 }
else if (tempattr ==
"firstpositionref") {
2351 reftemp = gdml->
GetAttr(child,
"ref");
2354 Fatal(
"BooSolid",
"First position %s not found", reftemp.
Data());
2355 }
else if (tempattr ==
"firstrotation") {
2358 reftemp = gdml->
GetAttr(child,
"name");
2360 }
else if (tempattr ==
"firstrotationref") {
2361 reftemp = gdml->
GetAttr(child,
"ref");
2364 Fatal(
"BooSolid",
"First rotation %s not found", reftemp.
Data());
2397 TString nodename, auxtype, auxtypec, auxvalue, auxvaluec, auxunit, auxunitc;
2403 if (nodename ==
"auxiliary") {
2404 auxtype = gdml->
GetAttr(child,
"auxtype");
2405 auxvalue = gdml->
GetAttr(child,
"auxvalue");
2406 if (auxtype ==
"Region") {
2413 auxtypec = gdml->
GetAttr(subchild,
"auxtype");
2414 auxvaluec = gdml->
GetAttr(subchild,
"auxvalue");
2415 auxunitc = gdml->
GetAttr(subchild,
"auxunit");
2416 if (auxtypec ==
"volume") {
2424 region->
AddCut(auxtypec, value);
2426 subchild = gdml->
GetNext(subchild);
2471 while (child !=
nullptr) {
2472 if ((strcmp(gdml->
GetNodeName(child),
"physvol")) == 0) {
2481 while (subchild !=
nullptr) {
2485 if (tempattr ==
"volumeref") {
2486 reftemp = gdml->
GetAttr(subchild,
"ref");
2488 }
else if (tempattr ==
"positionref") {
2489 reftemp = gdml->
GetAttr(subchild,
"ref");
2492 Fatal(
"AssProcess",
"Position %s not found", reftemp.
Data());
2493 }
else if (tempattr ==
"position") {
2496 reftemp = gdml->
GetAttr(subchild,
"name");
2498 }
else if (tempattr ==
"rotationref") {
2499 reftemp = gdml->
GetAttr(subchild,
"ref");
2502 Fatal(
"AssProcess",
"Rotation %s not found", reftemp.
Data());
2503 }
else if (tempattr ==
"rotation") {
2506 reftemp = gdml->
GetAttr(subchild,
"name");
2510 subchild = gdml->
GetNext(subchild);
2541 while (child !=
nullptr) {
2543 if ((strcmp(gdml->
GetNodeName(child),
"world") == 0)) {
2546 reftemp = gdml->
GetAttr(child,
"ref");
2565 bool unitless_l =
true;
2572 while (attr !=
nullptr) {
2577 if (tempattr ==
"name") {
2579 }
else if (tempattr ==
"x") {
2581 }
else if (tempattr ==
"y") {
2583 }
else if (tempattr ==
"z") {
2585 }
else if (tempattr ==
"lunit") {
2623 bool unitless_l =
true;
2633 while (attr !=
nullptr) {
2638 if (tempattr ==
"name") {
2640 }
else if (tempattr ==
"ax") {
2642 }
else if (tempattr ==
"by") {
2644 }
else if (tempattr ==
"cz") {
2646 }
else if (tempattr ==
"zcut1") {
2648 }
else if (tempattr ==
"zcut2") {
2650 }
else if (tempattr ==
"lunit") {
2676 z1 =
Value(zcut1) * retunit;
2681 z2 =
Value(zcut2) * retunit;
2689 origin[2] = 0.5 * (z1 + z2);
2711 bool unitless_l =
true;
2719 while (attr !=
nullptr) {
2724 if (tempattr ==
"name") {
2726 }
else if (tempattr ==
"dx") {
2728 }
else if (tempattr ==
"dy") {
2730 }
else if (tempattr ==
"zmax") {
2732 }
else if (tempattr ==
"zcut") {
2734 }
else if (tempattr ==
"lunit") {
2758 Info(
"ElCone",
"ERROR! Parameter zcut = %.12g is not set properly, elcone will not be imported.", z1);
2790 bool unitless_l =
true;
2797 while (attr !=
nullptr) {
2802 if (tempattr ==
"name") {
2804 }
else if (tempattr ==
"rlo") {
2806 }
else if (tempattr ==
"rhi") {
2808 }
else if (tempattr ==
"dz") {
2810 }
else if (tempattr ==
"lunit") {
2846 bool unitless_l =
true;
2867 while (attr !=
nullptr) {
2872 if (tempattr ==
"name") {
2874 }
else if (tempattr ==
"v1x") {
2876 }
else if (tempattr ==
"v1y") {
2878 }
else if (tempattr ==
"v2x") {
2880 }
else if (tempattr ==
"v2y") {
2882 }
else if (tempattr ==
"v3x") {
2884 }
else if (tempattr ==
"v3y") {
2886 }
else if (tempattr ==
"v4x") {
2888 }
else if (tempattr ==
"v4y") {
2890 }
else if (tempattr ==
"v5x") {
2892 }
else if (tempattr ==
"v5y") {
2894 }
else if (tempattr ==
"v6x") {
2896 }
else if (tempattr ==
"v6y") {
2898 }
else if (tempattr ==
"v7x") {
2900 }
else if (tempattr ==
"v7y") {
2902 }
else if (tempattr ==
"v8x") {
2904 }
else if (tempattr ==
"v8y") {
2906 }
else if (tempattr ==
"dz") {
2908 }
else if (tempattr ==
"lunit") {
2968 bool unitless_l =
true;
2969 bool unitless_a =
true;
2978 while (attr !=
nullptr) {
2983 if (tempattr ==
"name") {
2985 }
else if (tempattr ==
"rmin") {
2987 }
else if (tempattr ==
"rmax") {
2989 }
else if (tempattr ==
"z") {
2991 }
else if (tempattr ==
"lunit") {
2994 }
else if (tempattr ==
"aunit") {
2997 }
else if (tempattr ==
"startphi") {
2999 }
else if (tempattr ==
"deltaphi") {
3019 Double_t endphideg = startphideg + deltaphideg;
3022 if (deltaphideg < 360.)
3042 bool unitless_l =
true;
3043 bool unitless_a =
true;
3058 while (attr !=
nullptr) {
3063 if (tempattr ==
"name") {
3065 }
else if (tempattr ==
"rmin") {
3067 }
else if (tempattr ==
"rmax") {
3069 }
else if (tempattr ==
"z") {
3071 }
else if (tempattr ==
"lunit") {
3074 }
else if (tempattr ==
"aunit") {
3077 }
else if (tempattr ==
"startphi") {
3079 }
else if (tempattr ==
"deltaphi") {
3081 }
else if (tempattr ==
"lowx") {
3083 }
else if (tempattr ==
"lowy") {
3085 }
else if (tempattr ==
"lowz") {
3087 }
else if (tempattr ==
"highx") {
3089 }
else if (tempattr ==
"highy") {
3091 }
else if (tempattr ==
"highz") {
3110 Double_t deltaphiline =
Value(deltaphi) * retaunit + startphiline;
3119 lowXline, lowYline, lowZline, highXline, highYline, highZline);
3137 bool unitless_l =
true;
3138 bool unitless_a =
true;
3149 while (attr !=
nullptr) {
3154 if (tempattr ==
"name") {
3156 }
else if (tempattr ==
"rmin1") {
3158 }
else if (tempattr ==
"rmax1") {
3160 }
else if (tempattr ==
"rmin2") {
3162 }
else if (tempattr ==
"rmax2") {
3164 }
else if (tempattr ==
"z") {
3166 }
else if (tempattr ==
"lunit") {
3169 }
else if (tempattr ==
"aunit") {
3172 }
else if (tempattr ==
"startphi") {
3174 }
else if (tempattr ==
"deltaphi") {
3220 bool unitless_l =
true;
3221 bool unitless_a =
true;
3236 while (attr !=
nullptr) {
3241 if (tempattr ==
"name") {
3243 }
else if (tempattr ==
"x1") {
3245 }
else if (tempattr ==
"x2") {
3247 }
else if (tempattr ==
"x3") {
3249 }
else if (tempattr ==
"x4") {
3251 }
else if (tempattr ==
"y1") {
3253 }
else if (tempattr ==
"y2") {
3255 }
else if (tempattr ==
"z") {
3257 }
else if (tempattr ==
"lunit") {
3260 }
else if (tempattr ==
"aunit") {
3263 }
else if (tempattr ==
"phi") {
3265 }
else if (tempattr ==
"theta") {
3267 }
else if (tempattr ==
"alpha1") {
3269 }
else if (tempattr ==
"alpha2") {
3297 alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
3314 bool unitless_l =
true;
3323 while (attr !=
nullptr) {
3328 if (tempattr ==
"name") {
3330 }
else if (tempattr ==
"x1") {
3332 }
else if (tempattr ==
"x2") {
3334 }
else if (tempattr ==
"y1") {
3336 }
else if (tempattr ==
"y2") {
3338 }
else if (tempattr ==
"z") {
3340 }
else if (tempattr ==
"lunit") {
3380 bool unitless_l =
true;
3381 bool unitless_a =
true;
3390 while (attr !=
nullptr) {
3395 if (tempattr ==
"name") {
3397 }
else if (tempattr ==
"lunit") {
3400 }
else if (tempattr ==
"aunit") {
3403 }
else if (tempattr ==
"startphi") {
3405 }
else if (tempattr ==
"deltaphi") {
3424 while (child !=
nullptr) {
3425 numplanes = numplanes + 1;
3428 if (numplanes < 2) {
3429 Fatal(
"Polycone",
"Found less than 2 planes for polycone %s",
name.Data());
3436 double **table =
new double *[numplanes];
3437 for (i = 0; i < numplanes; i++) {
3438 table[i] =
new double[cols];
3444 while (child !=
nullptr) {
3445 if (strcmp(gdml->
GetNodeName(child),
"zplane") == 0) {
3453 while (attr !=
nullptr) {
3457 if (tempattr ==
"rmin") {
3459 rminline =
Value(rmin) * retlunit;
3460 table[planeno][0] = rminline;
3461 }
else if (tempattr ==
"rmax") {
3463 rmaxline =
Value(rmax) * retlunit;
3464 table[planeno][1] = rmaxline;
3465 }
else if (tempattr ==
"z") {
3467 zline =
Value(z) * retlunit;
3468 table[planeno][2] = zline;
3473 planeno = planeno + 1;
3483 for (
int j = 0; j < numplanes; j++) {
3484 poly->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3489 for (i = 0; i < numplanes; i++) {
3509 bool unitless_l =
true;
3510 bool unitless_a =
true;
3520 while (attr !=
nullptr) {
3525 if (tempattr ==
"name") {
3527 }
else if (tempattr ==
"lunit") {
3530 }
else if (tempattr ==
"aunit") {
3533 }
else if (tempattr ==
"startphi") {
3535 }
else if (tempattr ==
"deltaphi") {
3537 }
else if (tempattr ==
"numsides") {
3557 while (child !=
nullptr) {
3558 numplanes = numplanes + 1;
3561 if (numplanes < 2) {
3562 Fatal(
"Polyhedra",
"Found less than 2 planes for polyhedra %s",
name.Data());
3569 double **table =
new double *[numplanes];
3570 for (i = 0; i < numplanes; i++) {
3571 table[i] =
new double[cols];
3577 while (child !=
nullptr) {
3578 if (strcmp(gdml->
GetNodeName(child),
"zplane") == 0) {
3585 while (attr !=
nullptr) {
3589 if (tempattr ==
"rmin") {
3591 rminline =
Value(rmin) * retlunit;
3592 table[planeno][0] = rminline;
3593 }
else if (tempattr ==
"rmax") {
3595 rmaxline =
Value(rmax) * retlunit;
3596 table[planeno][1] = rmaxline;
3597 }
else if (tempattr ==
"z") {
3599 zline =
Value(z) * retlunit;
3600 table[planeno][2] = zline;
3606 planeno = planeno + 1;
3617 for (
int j = 0; j < numplanes; j++) {
3618 polyg->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3623 for (i = 0; i < numplanes; i++) {
3642 bool unitless_l =
true;
3643 bool unitless_a =
true;
3653 while (attr !=
nullptr) {
3657 if (tempattr ==
"name") {
3659 }
else if (tempattr ==
"rmin") {
3661 }
else if (tempattr ==
"rmax") {
3663 }
else if (tempattr ==
"lunit") {
3666 }
else if (tempattr ==
"aunit") {
3669 }
else if (tempattr ==
"startphi") {
3671 }
else if (tempattr ==
"deltaphi") {
3673 }
else if (tempattr ==
"starttheta") {
3675 }
else if (tempattr ==
"deltatheta") {
3693 Double_t deltaphiline = startphiline +
Value(deltaphi) * retaunit;
3695 Double_t deltathetaline = startthetaline +
Value(deltatheta) * retaunit;
3698 new TGeoSphere(
NameShort(
name), rminline, rmaxline, startthetaline, deltathetaline, startphiline, deltaphiline);
3716 bool unitless_l =
true;
3717 bool unitless_a =
true;
3726 while (attr !=
nullptr) {
3731 if (tempattr ==
"name") {
3733 }
else if (tempattr ==
"rmin") {
3735 }
else if (tempattr ==
"rmax") {
3737 }
else if (tempattr ==
"rtor") {
3739 }
else if (tempattr ==
"lunit") {
3742 }
else if (tempattr ==
"aunit") {
3745 }
else if (tempattr ==
"startphi") {
3747 }
else if (tempattr ==
"deltaphi") {
3786 bool unitless_l =
true;
3787 bool unitless_a =
true;
3796 while (attr !=
nullptr) {
3800 if (tempattr ==
"name") {
3802 }
else if (tempattr ==
"rmin") {
3804 }
else if (tempattr ==
"rmax") {
3806 }
else if (tempattr ==
"z") {
3808 }
else if (tempattr ==
"lunit") {
3811 }
else if (tempattr ==
"aunit") {
3814 }
else if (tempattr ==
"inst") {
3816 }
else if (tempattr ==
"outst") {
3855 bool unitless_l =
true;
3856 bool unitless_a =
true;
3866 while (attr !=
nullptr) {
3871 if (tempattr ==
"name") {
3873 }
else if (tempattr ==
"x") {
3875 }
else if (tempattr ==
"y") {
3877 }
else if (tempattr ==
"z") {
3879 }
else if (tempattr ==
"lunit") {
3882 }
else if (tempattr ==
"aunit") {
3885 }
else if (tempattr ==
"phi") {
3887 }
else if (tempattr ==
"theta") {
3889 }
else if (tempattr ==
"alpha") {
3929 bool unitless_l =
true;
3930 bool unitless_a =
true;
3946 while (attr !=
nullptr) {
3951 if (tempattr ==
"name") {
3953 }
else if (tempattr ==
"x1") {
3955 }
else if (tempattr ==
"x2") {
3957 }
else if (tempattr ==
"x3") {
3959 }
else if (tempattr ==
"x4") {
3961 }
else if (tempattr ==
"y1") {
3963 }
else if (tempattr ==
"y2") {
3965 }
else if (tempattr ==
"z") {
3967 }
else if (tempattr ==
"lunit") {
3970 }
else if (tempattr ==
"aunit") {
3973 }
else if (tempattr ==
"phi") {
3975 }
else if (tempattr ==
"theta") {
3977 }
else if (tempattr ==
"alph") {
3982 }
else if (tempattr ==
"phitwist") {
4011 x2line / 2, alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
4028 bool unitless_l =
true;
4035 while (attr !=
nullptr) {
4040 if (tempattr ==
"name") {
4042 }
else if (tempattr ==
"dx") {
4044 }
else if (tempattr ==
"dy") {
4046 }
else if (tempattr ==
"dz") {
4048 }
else if (tempattr ==
"lunit") {
4083 bool unitless_l =
true;
4088 while (attr !=
nullptr) {
4093 if (tempattr ==
"name") {
4095 }
else if (tempattr ==
"r") {
4097 }
else if (tempattr ==
"lunit") {
4134 bool unitless_l =
true;
4145 while (attr !=
nullptr) {
4150 if (tempattr ==
"name") {
4152 }
else if (tempattr ==
"lunit") {
4173 while (child !=
nullptr) {
4176 if (tempattr ==
"twoDimVertex") {
4177 noverts = noverts + 1;
4178 }
else if (tempattr ==
"section") {
4179 nosects = nosects + 1;
4185 if (nosects < 2 || noverts < 3) {
4186 Fatal(
"Xtru",
"Invalid number of sections/vertices found forxtru %s",
name.Data());
4193 double *vertx =
new double[noverts];
4194 double *verty =
new double[noverts];
4196 double **section =
new double *[nosects];
4197 for (i = 0; i < nosects; i++) {
4198 section[i] =
new double[cols];
4205 while (child !=
nullptr) {
4206 if (strcmp(gdml->
GetNodeName(child),
"twoDimVertex") == 0) {
4212 while (attr !=
nullptr) {
4215 if (tempattr ==
"x") {
4217 xline =
Value(
x) * retlunit;
4218 vertx[vert] = xline;
4219 }
else if (tempattr ==
"y") {
4221 yline =
Value(
y) * retlunit;
4222 verty[vert] = yline;
4231 else if (strcmp(gdml->
GetNodeName(child),
"section") == 0) {
4239 while (attr !=
nullptr) {
4242 if (tempattr ==
"zOrder") {
4244 section[sect][0] =
Value(zorder);
4245 }
else if (tempattr ==
"zPosition") {
4247 zposline =
Value(zpos) * retlunit;
4248 section[sect][1] = zposline;
4249 }
else if (tempattr ==
"xOffset") {
4251 xoffline =
Value(xoff) * retlunit;
4252 section[sect][2] = xoffline;
4253 }
else if (tempattr ==
"yOffset") {
4255 yoffline =
Value(yoff) * retlunit;
4256 section[sect][3] = yoffline;
4257 }
else if (tempattr ==
"scalingFactor") {
4259 section[sect][4] =
Value(scale);
4274 for (
int j = 0; j < sect; j++) {
4275 xtru->
DefineSection((
int)section[j][0], section[j][1], section[j][2], section[j][3], section[j][4]);
4281 for (i = 0; i < nosects; i++) {
4282 delete[] section[i];
4300 while (attr !=
nullptr) {
4303 if (tempattr ==
"name") {
4318 if (trans ==
nullptr)
4320 const double *tr = trans->GetTranslation();
4321 vertices[i].
Set(tr[0], tr[1], tr[2]);
4324 auto AddTriangularFacet = [&](
bool relative) {
4326 vertices[2] += vertices[0] + vertices[1];
4327 vertices[1] += vertices[0];
4329 tsl->AddFacet(vertices[0], vertices[1], vertices[2]);
4332 auto AddQuadrangularFacet = [&](
bool relative) {
4334 vertices[3] += vertices[0] + vertices[1] + vertices[2];
4335 vertices[2] += vertices[0] + vertices[1];
4336 vertices[1] += vertices[0];
4338 tsl->AddFacet(vertices[0], vertices[1], vertices[2], vertices[3]);
4343 while (child !=
nullptr) {
4346 if (tempattr ==
"triangular") {
4348 bool relative =
false;
4350 while (attr !=
nullptr) {
4353 if (tempattr ==
"vertex1") {
4357 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4361 else if (tempattr ==
"vertex2") {
4365 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4369 else if (tempattr ==
"vertex3") {
4373 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4377 else if (tempattr ==
"type") {
4380 relative = (type ==
"relative") ?
true :
false;
4385 AddTriangularFacet(relative);
4388 else if (tempattr ==
"quadrangular") {
4390 bool relative =
false;
4392 while (attr !=
nullptr) {
4395 if (tempattr ==
"vertex1") {
4399 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4403 else if (tempattr ==
"vertex2") {
4407 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4411 else if (tempattr ==
"vertex3") {
4415 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4419 else if (tempattr ==
"vertex4") {
4423 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4427 else if (tempattr ==
"type") {
4430 relative = (type ==
"relative") ?
true :
false;
4435 AddQuadrangularFacet(relative);
4439 tsl->CloseShape(
false);
4462 while (attr !=
nullptr) {
4465 if (tempattr ==
"name") {
4475 while (child !=
nullptr) {
4478 if (tempattr ==
"solidref") {
4479 reftemp = gdml->
GetAttr(child,
"ref");
4486 printf(
"Solid: %s, Not Yet Defined!\n", reftemp.
Data());
4488 }
else if (tempattr ==
"scale") {
4491 reftemp = gdml->
GetAttr(child,
"name");
4493 }
else if (tempattr ==
"scaleref") {
4494 reftemp = gdml->
GetAttr(child,
"ref");
4497 Fatal(
"ScaledSolid",
"Solid's scale %s not found", reftemp.
Data());
4521 std::cout <<
"WARNING! The reflectedSolid is obsolete! Use scale transformation instead!" << std::endl;
4536 while (attr !=
nullptr) {
4541 if (tempattr ==
"name") {
4543 }
else if (tempattr ==
"sx") {
4545 }
else if (tempattr ==
"sy") {
4547 }
else if (tempattr ==
"sz") {
4549 }
else if (tempattr ==
"rx") {
4551 }
else if (tempattr ==
"ry") {
4553 }
else if (tempattr ==
"rz") {
4555 }
else if (tempattr ==
"dx") {
4557 }
else if (tempattr ==
"dy") {
4559 }
else if (tempattr ==
"dz") {
4561 }
else if (tempattr ==
"solid") {
4579 if (atoi(sx) == -1) {
4582 if (atoi(sy) == -1) {
4585 if (atoi(sz) == -1) {
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
externTGeoManager * 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)
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.
TGeoVolume * GetVolume(const char *name)
TGeoScale * GetScaleObj(const char *name)
ReflSolidMap freflsolidmap
! Map containing reflection names and the TGDMLRefl for it - containing refl matrix
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
TGeoRotation * GetRotation(const char *name)
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 files parsed during entire parsing, with their world volume name
MatrixMap fmatrices
! Map containing matrices defined in the GDML 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 volume names and the TGeoVolume 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 rotation names and the TGeoRotation 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 reflected volume names and the solid ref for it
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 reflection names and the Solid name ir references to
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 material names and the TGeoMaterial for it
SclMap fsclmap
! Map containing scale names and the TGeoScale 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 isotope names and the TGeoIsotope 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 placed volume names and the TGeoNode for it
double Value(const char *svalue) const
Convert number in string format to double value.
TGeoTranslation * GetPosition(const char *name)
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 medium names and the TGeoMedium 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 values of constants declared in the file
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 solid names and the TGeoShape for it
EleMap felemap
! Map containing element names and the TGeoElement 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.
PosMap fposmap
! Map containing position names and the TGeoTranslation for it
TGeoShape * GetSolid(const char *name)
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.
XMLNodePointer_t ScaledSolid(TXMLEngine *gdml, XMLNodePointer_t node, XMLAttrPointer_t attr)
In the solids section of the GDML file, a Scaled Solid may be declared when the scaledSolid keyword i...
MixMap fmixmap
! Map containing mixture names and the TGeoMixture for it
XMLNodePointer_t UsrProcess(TXMLEngine *gdml, XMLNodePointer_t node)
User data to be processed.
This class is a helper class for TGDMLParse.
const char * fNameS
! reflected solid name
TGeoMatrix * fMatrix
! matrix of reflected solid
TGeoMatrix * GetMatrix()
This accessor method returns the matrix.
const char * fSolid
! solid name being reflected
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Base class for Boolean operations between two shapes.
Class describing rotation + translation.
Composite shapes are Boolean combinations of two or more shape components.
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.
Matrix class used for computing global transformations Should NOT be used for node definition.
Boolean node representing an intersection between two components.
an isotope defined by the atomic number, number of nucleons and atomic weight (g/mole)
The manager class for any TGeo geometry.
TList * GetListOfMedia() const
TGeoElementTable * GetElementTable()
Returns material table. Creates it if not existing.
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
TGeoMaterial * GetMaterial(const char *matname) const
Search for a named material. All trailing blanks stripped.
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...
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
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.
void RotateX(Double_t angle) override
Rotate about X axis of the master frame with angle expressed in degrees.
void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE) override
Multiply by a reflection respect to XY.
const Double_t * GetRotationMatrix() const override
void RotateY(Double_t angle) override
Rotate about Y axis of the master frame with angle expressed in degrees.
void SetMatrix(const Double_t *rot)
void RotateZ(Double_t angle) override
Rotate about Z axis of the master frame with angle expressed in degrees.
void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE) override
Multiply by a reflection respect to ZX.
void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE) override
Multiply by a reflection respect to YZ.
TGeoHMatrix Inverse() const override
Return a temporary inverse of this.
Class describing scale transformations.
const Double_t * GetScale() const override
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
Boolean node representing a subtraction.
Class describing translations.
Boolean node representing a union between two components.
TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="") override
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.
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
Int_t GetNdaughters() const
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.
void Add(TObject *obj) override
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void Add(TObject *obj) override
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.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
TObject * Last() const override
Return the object in the last filled slot. Returns 0 if no entries.
Collectable string class.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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.
ROOT::Geom::Vertex_t Vertex_t
void Set(double const &a, double const &b, double const &c)