133 for (
Int_t i = 0; i < 20; i++)
166 if (gdmldoc ==
nullptr) {
187 "\x1B[31m Found %d GDML entities missing explicit units, while the default "
188 "units are currently ROOT units [cm, deg]. This can cause unexpected behaviour with respect "
189 "to the GDML schema. To remove this warning, either use explicit units or call the static method "
190 "TGeoManager::SetDefaultUnits(kG4Units) before importing the GDML file \x1B[34m%s \x1B[0m",
210 const char *posistr =
"position";
211 const char *setustr =
"setup";
212 const char *consstr =
"constant";
213 const char *varistr =
"variable";
214 const char *quanstr =
"quantity";
215 const char *matrstr =
"matrix";
216 const char *rotastr =
"rotation";
217 const char *scalstr =
"scale";
218 const char *elemstr =
"element";
219 const char *istpstr =
"isotope";
220 const char *matestr =
"material";
221 const char *volustr =
"volume";
222 const char *assestr =
"assembly";
223 const char *twtrstr =
"twistedtrap";
224 const char *cutTstr =
"cutTube";
225 const char *bboxstr =
"box";
226 const char *xtrustr =
"xtru";
227 const char *arb8str =
"arb8";
228 const char *tubestr =
"tube";
229 const char *conestr =
"cone";
230 const char *polystr =
"polycone";
231 const char *hypestr =
"hype";
232 const char *trapstr =
"trap";
233 const char *trdstr =
"trd";
234 const char *sphestr =
"sphere";
235 const char *orbstr =
"orb";
236 const char *parastr =
"para";
237 const char *torustr =
"torus";
238 const char *hedrstr =
"polyhedra";
239 const char *eltustr =
"eltube";
240 const char *subtstr =
"subtraction";
241 const char *uniostr =
"union";
242 const char *parbstr =
"paraboloid";
243 const char *intestr =
"intersection";
244 const char *reflstr =
"reflectedSolid";
245 const char *ssolstr =
"scaledSolid";
246 const char *ellistr =
"ellipsoid";
247 const char *elcnstr =
"elcone";
248 const char *optsstr =
"opticalsurface";
249 const char *skinstr =
"skinsurface";
250 const char *bordstr =
"bordersurface";
251 const char *usrstr =
"userinfo";
252 const char *tslstr =
"tessellated";
254 Bool_t hasIsotopesExtended;
256 if ((strcmp(
name, posistr)) == 0) {
258 }
else if ((strcmp(
name, rotastr)) == 0) {
260 }
else if ((strcmp(
name, scalstr)) == 0) {
262 }
else if ((strcmp(
name, setustr)) == 0) {
264 }
else if ((strcmp(
name, consstr)) == 0) {
266 }
else if ((strcmp(
name, varistr)) == 0) {
268 }
else if ((strcmp(
name, quanstr)) == 0) {
270 }
else if ((strcmp(
name, matrstr)) == 0) {
272 }
else if ((strcmp(
name, optsstr)) == 0) {
274 }
else if ((strcmp(
name, skinstr)) == 0) {
276 }
else if ((strcmp(
name, bordstr)) == 0) {
281 else if (((strcmp(
name,
"atom")) == 0) && ((strcmp(parent, elemstr)) == 0)) {
283 hasIsotopesExtended =
kFALSE;
284 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
285 }
else if ((strcmp(
name, elemstr) == 0) && !gdml->
HasAttr(node,
"Z")) {
287 hasIsotopesExtended =
kFALSE;
288 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
291 else if ((strcmp(
name, elemstr) == 0) && gdml->
HasAttr(node,
"Z")) {
293 if ((strcmp(gdml->
GetNodeName(childtmp),
"fraction") == 0)) {
295 hasIsotopesExtended =
kTRUE;
296 node =
EleProcess(gdml, node, parentn, hasIsotopes, hasIsotopesExtended);
302 else if (((strcmp(
name,
"atom")) == 0) && ((strcmp(parent, istpstr)) == 0)) {
307 else if ((strcmp(
name, matestr)) == 0 && gdml->
HasAttr(node,
"Z")) {
318 int z = (
atom) ? 1 : 0;
320 }
else if ((strcmp(
name, matestr)) == 0 && !gdml->
HasAttr(node,
"Z")) {
326 else if ((strcmp(
name, volustr)) == 0) {
328 }
else if ((strcmp(
name, bboxstr)) == 0) {
330 }
else if ((strcmp(
name, ellistr)) == 0) {
332 }
else if ((strcmp(
name, elcnstr)) == 0) {
334 }
else if ((strcmp(
name, cutTstr)) == 0) {
336 }
else if ((strcmp(
name, arb8str)) == 0) {
338 }
else if ((strcmp(
name, tubestr)) == 0) {
340 }
else if ((strcmp(
name, conestr)) == 0) {
342 }
else if ((strcmp(
name, polystr)) == 0) {
344 }
else if ((strcmp(
name, trapstr)) == 0) {
346 }
else if ((strcmp(
name, trdstr)) == 0) {
348 }
else if ((strcmp(
name, sphestr)) == 0) {
350 }
else if ((strcmp(
name, xtrustr)) == 0) {
352 }
else if ((strcmp(
name, twtrstr)) == 0) {
354 }
else if ((strcmp(
name, hypestr)) == 0) {
356 }
else if ((strcmp(
name, orbstr)) == 0) {
358 }
else if ((strcmp(
name, parastr)) == 0) {
360 }
else if ((strcmp(
name, torustr)) == 0) {
362 }
else if ((strcmp(
name, eltustr)) == 0) {
364 }
else if ((strcmp(
name, hedrstr)) == 0) {
366 }
else if ((strcmp(
name, tslstr)) == 0) {
368 }
else if ((strcmp(
name, parbstr)) == 0) {
370 }
else if ((strcmp(
name, subtstr)) == 0) {
372 }
else if ((strcmp(
name, intestr)) == 0) {
374 }
else if ((strcmp(
name, uniostr)) == 0) {
376 }
else if ((strcmp(
name, reflstr)) == 0) {
378 }
else if ((strcmp(
name, ssolstr)) == 0) {
380 }
else if ((strcmp(
name, assestr)) == 0) {
382 }
else if ((strcmp(
name, usrstr)) == 0) {
385 }
else if (((strcmp(
name,
"gdml")) != 0) && ((strcmp(
name,
"define")) != 0) && ((strcmp(
name,
"element")) != 0) &&
386 ((strcmp(
name,
"materials")) != 0) && ((strcmp(
name,
"solids")) != 0) &&
387 ((strcmp(
name,
"structure")) != 0) && ((strcmp(
name,
"zplane")) != 0) && ((strcmp(
name,
"first")) != 0) &&
388 ((strcmp(
name,
"second")) != 0) && ((strcmp(
name,
"twoDimVertex")) != 0) &&
389 ((strcmp(
name,
"firstposition")) != 0) && ((strcmp(
name,
"firstpositionref")) != 0) &&
390 ((strcmp(
name,
"firstrotation")) != 0) && ((strcmp(
name,
"firstrotationref")) != 0) &&
391 ((strcmp(
name,
"section")) != 0) && ((strcmp(
name,
"world")) != 0) && ((strcmp(
name,
"isotope")) != 0) &&
392 ((strcmp(
name,
"triangular")) != 0) && ((strcmp(
name,
"quadrangular")) != 0)) {
393 std::cout <<
"Error: Unsupported GDML Tag Used :" <<
name <<
". Please Check Geometry/Schema." << std::endl;
399 while (
child !=
nullptr) {
425 if ((strcmp(axisString,
"kXAxis")) == 0) {
427 }
else if ((strcmp(axisString,
"kYAxis")) == 0) {
429 }
else if ((strcmp(axisString,
"kZAxis")) == 0) {
431 }
else if ((strcmp(axisString,
"kRho")) == 0) {
433 }
else if ((strcmp(axisString,
"kPhi")) == 0) {
452 stripped = stripped(0,
index);
453 return stripped.
Data();
468 while (
attr !=
nullptr) {
472 if (tempattr ==
"name") {
475 if (tempattr ==
"value") {
542 while (
attr !=
nullptr) {
546 if (tempattr ==
"name") {
549 if (tempattr ==
"value") {
552 if (tempattr ==
"unit") {
573 while (
attr !=
nullptr) {
577 if (tempattr ==
"name") {
580 if (tempattr ==
"coldim") {
583 if (tempattr ==
"values") {
590 std::stringstream valueStream(values);
591 std::vector<Double_t> valueList;
592 while (!valueStream.eof()) {
593 std::string matrixValue;
594 valueStream >> matrixValue;
596 if (matrixValue.empty())
598 valueList.push_back(
Value(matrixValue.c_str()));
603 if (coldim == 1 && valueList.size() == 1) {
608 for (
size_t i = 0; i < valueList.size(); ++i)
609 matrix->
Set(i / coldim, i % coldim, valueList[i]);
629 while (
attr !=
nullptr) {
633 if (tempattr ==
"name") {
636 if (tempattr ==
"model") {
639 if (tempattr ==
"finish") {
642 if (tempattr ==
"type") {
645 if (tempattr ==
"value") {
654 while (
child !=
nullptr) {
657 while (
attr !=
nullptr) {
660 if (tempattr ==
"name") {
662 }
else if (tempattr ==
"ref") {
666 Error(
"OpticalSurfaceProcess",
"Reference matrix %s for optical surface %s not found", ref.
Data(),
689 if (strcmp(unit,
"mm") == 0) {
691 }
else if (strcmp(unit,
"millimeter") == 0 || strcmp(unit,
"milimeter") == 0) {
693 }
else if (strcmp(unit,
"cm") == 0) {
695 }
else if (strcmp(unit,
"centimeter") == 0) {
697 }
else if (strcmp(unit,
"m") == 0) {
699 }
else if (strcmp(unit,
"meter") == 0) {
701 }
else if (strcmp(unit,
"km") == 0) {
702 retunit =
"100000.0";
703 }
else if (strcmp(unit,
"kilometer") == 0) {
704 retunit =
"100000.0";
705 }
else if (strcmp(unit,
"rad") == 0) {
707 }
else if (strcmp(unit,
"radian") == 0) {
709 }
else if (strcmp(unit,
"deg") == 0) {
711 }
else if (strcmp(unit,
"degree") == 0) {
713 }
else if (strcmp(unit,
"pi") == 0) {
715 }
else if (strcmp(unit,
"avogadro") == 0) {
718 Fatal(
"GetScale",
"Unit <%s> not known", unit);
737 if ((unit ==
"mm") || (unit ==
"millimeter") || (unit ==
"milimeter")) {
739 }
else if ((unit ==
"cm") || (unit ==
"centimeter")) {
741 }
else if ((unit ==
"m") || (unit ==
"meter")) {
743 }
else if ((unit ==
"km") || (unit ==
"kilometer")) {
745 }
else if ((unit ==
"rad") || (unit ==
"radian")) {
747 }
else if ((unit ==
"deg") || (unit ==
"degree")) {
749 }
else if ((unit ==
"ev") || (unit ==
"electronvolt")) {
751 }
else if ((unit ==
"kev") || (unit ==
"kiloelectronvolt")) {
753 }
else if ((unit ==
"mev") || (unit ==
"megaelectronvolt")) {
755 }
else if ((unit ==
"gev") || (unit ==
"gigaelectronvolt")) {
757 }
else if (unit ==
"pi") {
759 }
else if (unit ==
"avogadro") {
762 Fatal(
"GetScaleVal",
"Unit <%s> not known", sunit);
774 double val = strtod(svalue, &end);
777 while (*end != 0 && isspace(*end))
789 std::string expanded;
790 expanded.reserve(strlen(svalue) * 2);
794 const std::locale &loc = std::locale::classic();
797 const char *
p = svalue;
800 for (; *
p != 0; ++
p) {
801 if (std::isalpha(*
p, loc) || *
p ==
'_') {
802 const char *pe =
p + 1;
805 for (; *pe != 0; ++pe) {
806 if (!isalnum(*pe, loc) && *pe !=
'_') {
832 TFormula f(
"TFormula", expanded.c_str());
836 f.SetParameter(it.first.c_str(), it.second);
840 if (std::isnan(val) || std::isinf(val)) {
841 Fatal(
"Value",
"Got bad value %lf from string '%s'", val, svalue);
857 bool unitless_l =
true;
865 while (
attr !=
nullptr) {
870 if (tempattr ==
"name") {
872 }
else if (tempattr ==
"x") {
874 }
else if (tempattr ==
"y") {
876 }
else if (tempattr ==
"z") {
878 }
else if (tempattr ==
"unit") {
914 bool unitless_l =
true;
921 while (
attr !=
nullptr) {
926 if (tempattr ==
"name") {
928 }
else if (tempattr ==
"x") {
930 }
else if (tempattr ==
"y") {
932 }
else if (tempattr ==
"z") {
934 }
else if (tempattr ==
"unit") {
979 while (
attr !=
nullptr) {
984 if (tempattr ==
"name") {
986 }
else if (tempattr ==
"x") {
988 }
else if (tempattr ==
"y") {
990 }
else if (tempattr ==
"z") {
1027 while (
attr !=
nullptr) {
1032 if (tempattr ==
"name") {
1034 }
else if (tempattr ==
"z") {
1036 }
else if (tempattr ==
"n") {
1047 while (
attr !=
nullptr) {
1051 if (tempattr ==
"value") {
1073 }
else if (
gDebug >= 2) {
1074 Info(
"TGDMLParse",
"Re-use existing isotope: %s", iso->
GetName());
1110 while (
attr !=
nullptr) {
1112 if (tempattr ==
"name") {
1124 while (
child !=
nullptr) {
1130 ncompo = ncompo + 1;
1132 while (
attr !=
nullptr) {
1135 if (tempattr ==
"n") {
1137 }
else if (tempattr ==
"ref") {
1145 fracmap[ref.
Data()] =
n;
1152 if (ele && ele->
Z() == 0)
1156 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1167 if (hasIsotopesExtended) {
1169 while (
attr !=
nullptr) {
1172 if (tempattr ==
"name") {
1184 while (
child !=
nullptr) {
1190 ncompo = ncompo + 1;
1192 while (
attr !=
nullptr) {
1195 if (tempattr ==
"n") {
1197 }
else if (tempattr ==
"ref") {
1205 fracmap[ref.
Data()] =
n;
1212 if (ele && ele->
Z() == 0)
1216 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1228 while (
attr !=
nullptr) {
1233 if (tempattr ==
"name") {
1236 }
else if (tempattr ==
"z") {
1238 }
else if (tempattr ==
"formula") {
1249 while (
attr !=
nullptr) {
1254 if (tempattr ==
"value") {
1270 if (ele && ele->
Z() == 0)
1275 }
else if (
gDebug >= 2) {
1276 Info(
"TGDMLParse",
"Re-use existing element: %s", ele->
GetName());
1301 TList properties, constproperties;
1308 Int_t ncompo = 0, mixflag = 2;
1327 while (
child !=
nullptr) {
1332 while (
attr !=
nullptr) {
1336 if (tempattr ==
"name") {
1338 }
else if (tempattr ==
"ref") {
1347 Error(
"MatProcess",
"Reference %s for material %s not found",
property->GetTitle(),
1358 while (
attr !=
nullptr) {
1362 if (tempattr ==
"value") {
1370 while (
attr !=
nullptr) {
1374 if (tempattr ==
"value") {
1384 tempconst = gdml->
GetAttr(node,
"Z");
1391 if (tmpname ==
"vacuum") {
1399 Info(
"TGDMLParse",
"Re-use existing material: %s", mat->
GetName());
1403 TIter next(&properties);
1407 if (constproperties.
GetSize()) {
1409 TIter next(&constproperties);
1417 if (mat_ele && mat_ele->
Z() == 0)
1421 mat_ele =
new TGeoElement(mat_name, mat_name, atoi(tempconst),
a);
1422 }
else if (
gDebug >= 2) {
1423 Info(
"TGDMLParse",
"Re-use existing material-element: %s", mat_ele->
GetName());
1429 while (
child !=
nullptr) {
1434 while (
attr !=
nullptr) {
1438 if (tempattr ==
"name") {
1440 }
else if (tempattr ==
"ref") {
1449 Error(
"MatProcess",
"Reference %s for material %s not found",
property->GetTitle(),
1461 ncompo = ncompo + 1;
1463 while (
attr !=
nullptr) {
1467 if (tempattr ==
"n") {
1469 }
else if (tempattr ==
"ref") {
1477 fracmap[ref.
Data()] =
n;
1484 ncompo = ncompo + 1;
1486 while (
attr !=
nullptr) {
1489 if (tempattr ==
"n") {
1491 }
else if (tempattr ==
"ref") {
1499 fracmap[ref.
Data()] =
n;
1501 while (
attr !=
nullptr) {
1505 if (tempattr ==
"value") {
1529 Info(
"TGDMLParse",
"Re-use existing material-mixture: %s", mix->
GetName());
1531 Fatal(
"TGDMLParse",
"WARNING! Inconsistent material definitions between GDML and TGeoManager");
1536 TIter next(&properties);
1540 if (constproperties.
GetSize()) {
1542 TIter next(&constproperties);
1549 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1557 natoms = (
Int_t)
f->second;
1582 }
else if (mixflag == 0) {
1586 }
else if (
gDebug >= 2) {
1587 Info(
"TGDMLParse",
"Re-use existing medium: %s", med->
GetName());
1602 while (
attr !=
nullptr) {
1606 if (tempattr ==
"name") {
1609 if (tempattr ==
"surfaceproperty") {
1616 while (
child !=
nullptr) {
1619 while (
attr !=
nullptr) {
1622 if (tempattr ==
"ref") {
1632 Fatal(
"SkinSurfaceProcess",
"Skin surface %s: referenced optical surface %s not defined",
name.Data(),
1648 while (
attr !=
nullptr) {
1652 if (tempattr ==
"name") {
1655 if (tempattr ==
"surfaceproperty") {
1663 while (
child !=
nullptr) {
1666 while (
attr !=
nullptr) {
1669 if (tempattr ==
"ref") {
1678 Fatal(
"BorderSurfaceProcess",
"Border surface %s not referencing two nodes",
name.Data());
1681 Fatal(
"BorderSurfaceProcess",
"Border surface %s: referenced optical surface %s not defined",
name.Data(),
1685 if (!node1 || !node2)
1686 Fatal(
"BorderSurfaceProcess",
"Border surface %s: not found nodes %s [%s] or %s [%s]",
name.Data(),
1687 nodename[0].
Data(), node1 ?
"present" :
"missing", nodename[1].
Data(), node2 ?
"present" :
"missing");
1709 Error(
"GetPosition",
"Position %s not defined",
name);
1728 Error(
"GetRotation",
"Rotation %s not defined",
name);
1747 Error(
"GetScale",
"Scale %s not defined",
name);
1766 Error(
"GetSolid",
"Solid %s not defined",
name);
1785 Error(
"GetVolume",
"Volume %s not defined",
name);
1819 const Double_t *parentrot =
nullptr;
1822 TMap *auxmap =
nullptr;
1824 while (
child !=
nullptr) {
1834 solidname = reftemp;
1837 printf(
"Solid: %s, Not Yet Defined!\n", reftemp.
Data());
1849 printf(
"Medium: %s, Not Yet Defined!\n", gdml->
GetAttr(
child,
"ref"));
1862 if (reflex ==
nullptr) {
1878 while (
child !=
nullptr) {
1892 while (subchild !=
nullptr) {
1896 if (tempattr ==
"volumeref") {
1897 reftemp = gdml->
GetAttr(subchild,
"ref");
1900 }
else if (tempattr ==
"file") {
1901 const char *filevol;
1905 filevol = gdml->
GetAttr(subchild,
"volname");
1910 if (filedoc1 ==
nullptr) {
1938 }
else if (tempattr ==
"position") {
1941 reftemp = gdml->
GetAttr(subchild,
"name");
1943 }
else if (tempattr ==
"positionref") {
1944 reftemp = gdml->
GetAttr(subchild,
"ref");
1947 Fatal(
"VolProcess",
"Physvol's position %s not found", reftemp.
Data());
1948 }
else if (tempattr ==
"rotation") {
1951 reftemp = gdml->
GetAttr(subchild,
"name");
1953 }
else if (tempattr ==
"rotationref") {
1954 reftemp = gdml->
GetAttr(subchild,
"ref");
1957 Fatal(
"VolProcess",
"Physvol's rotation %s not found", reftemp.
Data());
1958 }
else if (tempattr ==
"scale") {
1961 reftemp = gdml->
GetAttr(subchild,
"name");
1963 }
else if (tempattr ==
"scaleref") {
1964 reftemp = gdml->
GetAttr(subchild,
"ref");
1967 Fatal(
"VolProcess",
"Physvol's scale %s not found", reftemp.
Data());
1970 subchild = gdml->
GetNext(subchild);
1983 if (scl !=
nullptr) {
1986 memset(scale3x3, 0, 9 *
sizeof(
Double_t));
1989 scale3x3[0] = diagonal[0];
1990 scale3x3[4] = diagonal[1];
1991 scale3x3[8] = diagonal[2];
2028 bool unitless_l =
true;
2034 while (
attr !=
nullptr) {
2039 if (tempattr ==
"axis") {
2041 }
else if (tempattr ==
"number") {
2043 }
else if (tempattr ==
"width") {
2045 }
else if (tempattr ==
"offset") {
2047 }
else if (tempattr ==
"unit") {
2057 while (subchild !=
nullptr) {
2061 if (tempattr ==
"volumeref") {
2062 reftemp = gdml->
GetAttr(subchild,
"ref");
2063 local_name = reftemp;
2067 divVolref = reftemp;
2070 subchild = gdml->
GetNext(subchild);
2095 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2114 bool unitless_l =
true;
2122 while (
attr !=
nullptr) {
2127 if (tempattr ==
"number") {
2135 while (subchild !=
nullptr) {
2139 if (tempattr ==
"volumeref") {
2140 reftemp = gdml->
GetAttr(subchild,
"ref");
2141 local_name = reftemp;
2145 divVolref = reftemp;
2148 if (tempattr ==
"replicate_along_axis") {
2149 subsubchild = gdml->
GetChild(subchild);
2151 while (subsubchild !=
nullptr) {
2152 if ((strcmp(gdml->
GetNodeName(subsubchild),
"width")) == 0) {
2154 while (
attr !=
nullptr) {
2157 if (tempattr ==
"value") {
2159 }
else if (tempattr ==
"unit") {
2166 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"offset")) == 0) {
2168 while (
attr !=
nullptr) {
2171 if (tempattr ==
"value") {
2173 }
else if (tempattr ==
"unit") {
2179 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"direction")) == 0) {
2181 while (
attr !=
nullptr) {
2184 if (tempattr ==
"x") {
2186 }
else if (tempattr ==
"y") {
2188 }
else if (tempattr ==
"z") {
2190 }
else if (tempattr ==
"rho") {
2192 }
else if (tempattr ==
"phi") {
2200 subsubchild = gdml->
GetNext(subsubchild);
2204 subchild = gdml->
GetNext(subchild);
2212 Double_t widthline = wvalue * retwunit;
2213 Double_t offsetline = ovalue * retounit;
2232 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2242 TString auxType, auxUnit, auxValue;
2245 auxmap =
new TMap();
2310 while (
child !=
nullptr) {
2314 if (tempattr ==
"first") {
2318 Fatal(
"BooSolid",
"First solid %s not found", reftemp.
Data());
2319 }
else if (tempattr ==
"second") {
2323 Fatal(
"BooSolid",
"Second solid %s not found", reftemp.
Data());
2324 }
else if (tempattr ==
"position") {
2329 }
else if (tempattr ==
"positionref") {
2333 Fatal(
"BooSolid",
"Second position %s not found", reftemp.
Data());
2334 }
else if (tempattr ==
"rotation") {
2339 }
else if (tempattr ==
"rotationref") {
2343 Fatal(
"BooSolid",
"Second rotation %s not found", reftemp.
Data());
2344 }
else if (tempattr ==
"firstposition") {
2349 }
else if (tempattr ==
"firstpositionref") {
2353 Fatal(
"BooSolid",
"First position %s not found", reftemp.
Data());
2354 }
else if (tempattr ==
"firstrotation") {
2359 }
else if (tempattr ==
"firstrotationref") {
2363 Fatal(
"BooSolid",
"First rotation %s not found", reftemp.
Data());
2396 TString nodename, auxtype, auxtypec, auxvalue, auxvaluec, auxunit, auxunitc;
2402 if (nodename ==
"auxiliary") {
2405 if (auxtype ==
"Region") {
2412 auxtypec = gdml->
GetAttr(subchild,
"auxtype");
2413 auxvaluec = gdml->
GetAttr(subchild,
"auxvalue");
2414 auxunitc = gdml->
GetAttr(subchild,
"auxunit");
2415 if (auxtypec ==
"volume") {
2425 subchild = gdml->
GetNext(subchild);
2470 while (
child !=
nullptr) {
2480 while (subchild !=
nullptr) {
2484 if (tempattr ==
"volumeref") {
2485 reftemp = gdml->
GetAttr(subchild,
"ref");
2487 }
else if (tempattr ==
"positionref") {
2488 reftemp = gdml->
GetAttr(subchild,
"ref");
2491 Fatal(
"AssProcess",
"Position %s not found", reftemp.
Data());
2492 }
else if (tempattr ==
"position") {
2495 reftemp = gdml->
GetAttr(subchild,
"name");
2497 }
else if (tempattr ==
"rotationref") {
2498 reftemp = gdml->
GetAttr(subchild,
"ref");
2501 Fatal(
"AssProcess",
"Rotation %s not found", reftemp.
Data());
2502 }
else if (tempattr ==
"rotation") {
2505 reftemp = gdml->
GetAttr(subchild,
"name");
2509 subchild = gdml->
GetNext(subchild);
2540 while (
child !=
nullptr) {
2564 bool unitless_l =
true;
2571 while (
attr !=
nullptr) {
2576 if (tempattr ==
"name") {
2578 }
else if (tempattr ==
"x") {
2580 }
else if (tempattr ==
"y") {
2582 }
else if (tempattr ==
"z") {
2584 }
else if (tempattr ==
"lunit") {
2622 bool unitless_l =
true;
2632 while (
attr !=
nullptr) {
2637 if (tempattr ==
"name") {
2639 }
else if (tempattr ==
"ax") {
2641 }
else if (tempattr ==
"by") {
2643 }
else if (tempattr ==
"cz") {
2645 }
else if (tempattr ==
"zcut1") {
2647 }
else if (tempattr ==
"zcut2") {
2649 }
else if (tempattr ==
"lunit") {
2675 z1 =
Value(zcut1) * retunit;
2680 z2 =
Value(zcut2) * retunit;
2688 origin[2] = 0.5 * (z1 + z2);
2710 bool unitless_l =
true;
2718 while (
attr !=
nullptr) {
2723 if (tempattr ==
"name") {
2725 }
else if (tempattr ==
"dx") {
2727 }
else if (tempattr ==
"dy") {
2729 }
else if (tempattr ==
"zmax") {
2731 }
else if (tempattr ==
"zcut") {
2733 }
else if (tempattr ==
"lunit") {
2757 Info(
"ElCone",
"ERROR! Parameter zcut = %.12g is not set properly, elcone will not be imported.", z1);
2789 bool unitless_l =
true;
2796 while (
attr !=
nullptr) {
2801 if (tempattr ==
"name") {
2803 }
else if (tempattr ==
"rlo") {
2805 }
else if (tempattr ==
"rhi") {
2807 }
else if (tempattr ==
"dz") {
2809 }
else if (tempattr ==
"lunit") {
2845 bool unitless_l =
true;
2866 while (
attr !=
nullptr) {
2871 if (tempattr ==
"name") {
2873 }
else if (tempattr ==
"v1x") {
2875 }
else if (tempattr ==
"v1y") {
2877 }
else if (tempattr ==
"v2x") {
2879 }
else if (tempattr ==
"v2y") {
2881 }
else if (tempattr ==
"v3x") {
2883 }
else if (tempattr ==
"v3y") {
2885 }
else if (tempattr ==
"v4x") {
2887 }
else if (tempattr ==
"v4y") {
2889 }
else if (tempattr ==
"v5x") {
2891 }
else if (tempattr ==
"v5y") {
2893 }
else if (tempattr ==
"v6x") {
2895 }
else if (tempattr ==
"v6y") {
2897 }
else if (tempattr ==
"v7x") {
2899 }
else if (tempattr ==
"v7y") {
2901 }
else if (tempattr ==
"v8x") {
2903 }
else if (tempattr ==
"v8y") {
2905 }
else if (tempattr ==
"dz") {
2907 }
else if (tempattr ==
"lunit") {
2967 bool unitless_l =
true;
2968 bool unitless_a =
true;
2977 while (
attr !=
nullptr) {
2982 if (tempattr ==
"name") {
2984 }
else if (tempattr ==
"rmin") {
2986 }
else if (tempattr ==
"rmax") {
2988 }
else if (tempattr ==
"z") {
2990 }
else if (tempattr ==
"lunit") {
2993 }
else if (tempattr ==
"aunit") {
2996 }
else if (tempattr ==
"startphi") {
2998 }
else if (tempattr ==
"deltaphi") {
3018 Double_t endphideg = startphideg + deltaphideg;
3021 if (deltaphideg < 360.)
3041 bool unitless_l =
true;
3042 bool unitless_a =
true;
3057 while (
attr !=
nullptr) {
3062 if (tempattr ==
"name") {
3064 }
else if (tempattr ==
"rmin") {
3066 }
else if (tempattr ==
"rmax") {
3068 }
else if (tempattr ==
"z") {
3070 }
else if (tempattr ==
"lunit") {
3073 }
else if (tempattr ==
"aunit") {
3076 }
else if (tempattr ==
"startphi") {
3078 }
else if (tempattr ==
"deltaphi") {
3080 }
else if (tempattr ==
"lowx") {
3082 }
else if (tempattr ==
"lowy") {
3084 }
else if (tempattr ==
"lowz") {
3086 }
else if (tempattr ==
"highx") {
3088 }
else if (tempattr ==
"highy") {
3090 }
else if (tempattr ==
"highz") {
3109 Double_t deltaphiline =
Value(deltaphi) * retaunit + startphiline;
3118 lowXline, lowYline, lowZline, highXline, highYline, highZline);
3136 bool unitless_l =
true;
3137 bool unitless_a =
true;
3148 while (
attr !=
nullptr) {
3153 if (tempattr ==
"name") {
3155 }
else if (tempattr ==
"rmin1") {
3157 }
else if (tempattr ==
"rmax1") {
3159 }
else if (tempattr ==
"rmin2") {
3161 }
else if (tempattr ==
"rmax2") {
3163 }
else if (tempattr ==
"z") {
3165 }
else if (tempattr ==
"lunit") {
3168 }
else if (tempattr ==
"aunit") {
3171 }
else if (tempattr ==
"startphi") {
3173 }
else if (tempattr ==
"deltaphi") {
3219 bool unitless_l =
true;
3220 bool unitless_a =
true;
3235 while (
attr !=
nullptr) {
3240 if (tempattr ==
"name") {
3242 }
else if (tempattr ==
"x1") {
3244 }
else if (tempattr ==
"x2") {
3246 }
else if (tempattr ==
"x3") {
3248 }
else if (tempattr ==
"x4") {
3250 }
else if (tempattr ==
"y1") {
3252 }
else if (tempattr ==
"y2") {
3254 }
else if (tempattr ==
"z") {
3256 }
else if (tempattr ==
"lunit") {
3259 }
else if (tempattr ==
"aunit") {
3262 }
else if (tempattr ==
"phi") {
3264 }
else if (tempattr ==
"theta") {
3266 }
else if (tempattr ==
"alpha1") {
3268 }
else if (tempattr ==
"alpha2") {
3296 alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
3313 bool unitless_l =
true;
3322 while (
attr !=
nullptr) {
3327 if (tempattr ==
"name") {
3329 }
else if (tempattr ==
"x1") {
3331 }
else if (tempattr ==
"x2") {
3333 }
else if (tempattr ==
"y1") {
3335 }
else if (tempattr ==
"y2") {
3337 }
else if (tempattr ==
"z") {
3339 }
else if (tempattr ==
"lunit") {
3379 bool unitless_l =
true;
3380 bool unitless_a =
true;
3389 while (
attr !=
nullptr) {
3394 if (tempattr ==
"name") {
3396 }
else if (tempattr ==
"lunit") {
3399 }
else if (tempattr ==
"aunit") {
3402 }
else if (tempattr ==
"startphi") {
3404 }
else if (tempattr ==
"deltaphi") {
3423 while (
child !=
nullptr) {
3424 numplanes = numplanes + 1;
3427 if (numplanes < 2) {
3428 Fatal(
"Polycone",
"Found less than 2 planes for polycone %s",
name.Data());
3435 double **table =
new double *[numplanes];
3436 for (i = 0; i < numplanes; i++) {
3437 table[i] =
new double[cols];
3443 while (
child !=
nullptr) {
3452 while (
attr !=
nullptr) {
3456 if (tempattr ==
"rmin") {
3458 rminline =
Value(rmin) * retlunit;
3459 table[planeno][0] = rminline;
3460 }
else if (tempattr ==
"rmax") {
3462 rmaxline =
Value(rmax) * retlunit;
3463 table[planeno][1] = rmaxline;
3464 }
else if (tempattr ==
"z") {
3466 zline =
Value(z) * retlunit;
3467 table[planeno][2] = zline;
3472 planeno = planeno + 1;
3482 for (
int j = 0; j < numplanes; j++) {
3483 poly->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3488 for (i = 0; i < numplanes; i++) {
3508 bool unitless_l =
true;
3509 bool unitless_a =
true;
3519 while (
attr !=
nullptr) {
3524 if (tempattr ==
"name") {
3526 }
else if (tempattr ==
"lunit") {
3529 }
else if (tempattr ==
"aunit") {
3532 }
else if (tempattr ==
"startphi") {
3534 }
else if (tempattr ==
"deltaphi") {
3536 }
else if (tempattr ==
"numsides") {
3556 while (
child !=
nullptr) {
3557 numplanes = numplanes + 1;
3560 if (numplanes < 2) {
3561 Fatal(
"Polyhedra",
"Found less than 2 planes for polyhedra %s",
name.Data());
3568 double **table =
new double *[numplanes];
3569 for (i = 0; i < numplanes; i++) {
3570 table[i] =
new double[cols];
3576 while (
child !=
nullptr) {
3584 while (
attr !=
nullptr) {
3588 if (tempattr ==
"rmin") {
3590 rminline =
Value(rmin) * retlunit;
3591 table[planeno][0] = rminline;
3592 }
else if (tempattr ==
"rmax") {
3594 rmaxline =
Value(rmax) * retlunit;
3595 table[planeno][1] = rmaxline;
3596 }
else if (tempattr ==
"z") {
3598 zline =
Value(z) * retlunit;
3599 table[planeno][2] = zline;
3605 planeno = planeno + 1;
3616 for (
int j = 0; j < numplanes; j++) {
3617 polyg->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3622 for (i = 0; i < numplanes; i++) {
3641 bool unitless_l =
true;
3642 bool unitless_a =
true;
3652 while (
attr !=
nullptr) {
3656 if (tempattr ==
"name") {
3658 }
else if (tempattr ==
"rmin") {
3660 }
else if (tempattr ==
"rmax") {
3662 }
else if (tempattr ==
"lunit") {
3665 }
else if (tempattr ==
"aunit") {
3668 }
else if (tempattr ==
"startphi") {
3670 }
else if (tempattr ==
"deltaphi") {
3672 }
else if (tempattr ==
"starttheta") {
3674 }
else if (tempattr ==
"deltatheta") {
3692 Double_t deltaphiline = startphiline +
Value(deltaphi) * retaunit;
3694 Double_t deltathetaline = startthetaline +
Value(deltatheta) * retaunit;
3697 new TGeoSphere(
NameShort(
name), rminline, rmaxline, startthetaline, deltathetaline, startphiline, deltaphiline);
3715 bool unitless_l =
true;
3716 bool unitless_a =
true;
3725 while (
attr !=
nullptr) {
3730 if (tempattr ==
"name") {
3732 }
else if (tempattr ==
"rmin") {
3734 }
else if (tempattr ==
"rmax") {
3736 }
else if (tempattr ==
"rtor") {
3738 }
else if (tempattr ==
"lunit") {
3741 }
else if (tempattr ==
"aunit") {
3744 }
else if (tempattr ==
"startphi") {
3746 }
else if (tempattr ==
"deltaphi") {
3785 bool unitless_l =
true;
3786 bool unitless_a =
true;
3795 while (
attr !=
nullptr) {
3799 if (tempattr ==
"name") {
3801 }
else if (tempattr ==
"rmin") {
3803 }
else if (tempattr ==
"rmax") {
3805 }
else if (tempattr ==
"z") {
3807 }
else if (tempattr ==
"lunit") {
3810 }
else if (tempattr ==
"aunit") {
3813 }
else if (tempattr ==
"inst") {
3815 }
else if (tempattr ==
"outst") {
3854 bool unitless_l =
true;
3855 bool unitless_a =
true;
3865 while (
attr !=
nullptr) {
3870 if (tempattr ==
"name") {
3872 }
else if (tempattr ==
"x") {
3874 }
else if (tempattr ==
"y") {
3876 }
else if (tempattr ==
"z") {
3878 }
else if (tempattr ==
"lunit") {
3881 }
else if (tempattr ==
"aunit") {
3884 }
else if (tempattr ==
"phi") {
3886 }
else if (tempattr ==
"theta") {
3888 }
else if (tempattr ==
"alpha") {
3928 bool unitless_l =
true;
3929 bool unitless_a =
true;
3945 while (
attr !=
nullptr) {
3950 if (tempattr ==
"name") {
3952 }
else if (tempattr ==
"x1") {
3954 }
else if (tempattr ==
"x2") {
3956 }
else if (tempattr ==
"x3") {
3958 }
else if (tempattr ==
"x4") {
3960 }
else if (tempattr ==
"y1") {
3962 }
else if (tempattr ==
"y2") {
3964 }
else if (tempattr ==
"z") {
3966 }
else if (tempattr ==
"lunit") {
3969 }
else if (tempattr ==
"aunit") {
3972 }
else if (tempattr ==
"phi") {
3974 }
else if (tempattr ==
"theta") {
3976 }
else if (tempattr ==
"alph") {
3981 }
else if (tempattr ==
"phitwist") {
4010 x2line / 2, alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
4027 bool unitless_l =
true;
4034 while (
attr !=
nullptr) {
4039 if (tempattr ==
"name") {
4041 }
else if (tempattr ==
"dx") {
4043 }
else if (tempattr ==
"dy") {
4045 }
else if (tempattr ==
"dz") {
4047 }
else if (tempattr ==
"lunit") {
4082 bool unitless_l =
true;
4087 while (
attr !=
nullptr) {
4092 if (tempattr ==
"name") {
4094 }
else if (tempattr ==
"r") {
4096 }
else if (tempattr ==
"lunit") {
4133 bool unitless_l =
true;
4144 while (
attr !=
nullptr) {
4149 if (tempattr ==
"name") {
4151 }
else if (tempattr ==
"lunit") {
4172 while (
child !=
nullptr) {
4175 if (tempattr ==
"twoDimVertex") {
4176 noverts = noverts + 1;
4177 }
else if (tempattr ==
"section") {
4178 nosects = nosects + 1;
4184 if (nosects < 2 || noverts < 3) {
4185 Fatal(
"Xtru",
"Invalid number of sections/vertices found forxtru %s",
name.Data());
4192 double *vertx =
new double[noverts];
4193 double *verty =
new double[noverts];
4195 double **section =
new double *[nosects];
4196 for (i = 0; i < nosects; i++) {
4197 section[i] =
new double[cols];
4204 while (
child !=
nullptr) {
4211 while (
attr !=
nullptr) {
4214 if (tempattr ==
"x") {
4216 xline =
Value(
x) * retlunit;
4217 vertx[vert] = xline;
4218 }
else if (tempattr ==
"y") {
4220 yline =
Value(
y) * retlunit;
4221 verty[vert] = yline;
4238 while (
attr !=
nullptr) {
4241 if (tempattr ==
"zOrder") {
4243 section[sect][0] =
Value(zorder);
4244 }
else if (tempattr ==
"zPosition") {
4246 zposline =
Value(zpos) * retlunit;
4247 section[sect][1] = zposline;
4248 }
else if (tempattr ==
"xOffset") {
4250 xoffline =
Value(xoff) * retlunit;
4251 section[sect][2] = xoffline;
4252 }
else if (tempattr ==
"yOffset") {
4254 yoffline =
Value(yoff) * retlunit;
4255 section[sect][3] = yoffline;
4256 }
else if (tempattr ==
"scalingFactor") {
4258 section[sect][4] =
Value(scale);
4273 for (
int j = 0; j < sect; j++) {
4274 xtru->
DefineSection((
int)section[j][0], section[j][1], section[j][2], section[j][3], section[j][4]);
4280 for (i = 0; i < nosects; i++) {
4281 delete[] section[i];
4299 while (
attr !=
nullptr) {
4302 if (tempattr ==
"name") {
4317 if (trans ==
nullptr)
4319 const double *tr = trans->GetTranslation();
4320 vertices[i].
Set(tr[0], tr[1], tr[2]);
4323 auto AddTriangularFacet = [&](
bool relative) {
4325 vertices[2] += vertices[0] + vertices[1];
4326 vertices[1] += vertices[0];
4328 tsl->AddFacet(vertices[0], vertices[1], vertices[2]);
4331 auto AddQuadrangularFacet = [&](
bool relative) {
4333 vertices[3] += vertices[0] + vertices[1] + vertices[2];
4334 vertices[2] += vertices[0] + vertices[1];
4335 vertices[1] += vertices[0];
4337 tsl->AddFacet(vertices[0], vertices[1], vertices[2], vertices[3]);
4342 while (
child !=
nullptr) {
4345 if (tempattr ==
"triangular") {
4347 bool relative =
false;
4349 while (
attr !=
nullptr) {
4352 if (tempattr ==
"vertex1") {
4356 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4360 else if (tempattr ==
"vertex2") {
4364 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4368 else if (tempattr ==
"vertex3") {
4372 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4376 else if (tempattr ==
"type") {
4379 relative = (
type ==
"relative") ?
true :
false;
4384 AddTriangularFacet(relative);
4387 else if (tempattr ==
"quadrangular") {
4389 bool relative =
false;
4391 while (
attr !=
nullptr) {
4394 if (tempattr ==
"vertex1") {
4398 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4402 else if (tempattr ==
"vertex2") {
4406 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4410 else if (tempattr ==
"vertex3") {
4414 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4418 else if (tempattr ==
"vertex4") {
4422 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4426 else if (tempattr ==
"type") {
4429 relative = (
type ==
"relative") ?
true :
false;
4434 AddQuadrangularFacet(relative);
4438 tsl->CloseShape(
false);