133 for (
Int_t i = 0; i < 20; i++)
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 *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")) {
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) {
329 }
else if ((strcmp(
name, ellistr)) == 0) {
331 }
else if ((strcmp(
name, elcnstr)) == 0) {
333 }
else if ((strcmp(
name, cutTstr)) == 0) {
335 }
else if ((strcmp(
name, arb8str)) == 0) {
337 }
else if ((strcmp(
name, tubestr)) == 0) {
339 }
else if ((strcmp(
name, conestr)) == 0) {
341 }
else if ((strcmp(
name, polystr)) == 0) {
343 }
else if ((strcmp(
name, trapstr)) == 0) {
345 }
else if ((strcmp(
name, trdstr)) == 0) {
347 }
else if ((strcmp(
name, sphestr)) == 0) {
349 }
else if ((strcmp(
name, xtrustr)) == 0) {
351 }
else if ((strcmp(
name, twtrstr)) == 0) {
353 }
else if ((strcmp(
name, hypestr)) == 0) {
355 }
else if ((strcmp(
name, orbstr)) == 0) {
357 }
else if ((strcmp(
name, parastr)) == 0) {
359 }
else if ((strcmp(
name, torustr)) == 0) {
361 }
else if ((strcmp(
name, eltustr)) == 0) {
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) {
371 }
else if ((strcmp(
name, intestr)) == 0) {
373 }
else if ((strcmp(
name, uniostr)) == 0) {
375 }
else if ((strcmp(
name, reflstr)) == 0) {
377 }
else if ((strcmp(
name, assestr)) == 0) {
379 }
else if ((strcmp(
name, usrstr)) == 0) {
382 }
else if (((strcmp(
name,
"gdml")) != 0) && ((strcmp(
name,
"define")) != 0) && ((strcmp(
name,
"element")) != 0) &&
383 ((strcmp(
name,
"materials")) != 0) && ((strcmp(
name,
"solids")) != 0) &&
384 ((strcmp(
name,
"structure")) != 0) && ((strcmp(
name,
"zplane")) != 0) && ((strcmp(
name,
"first")) != 0) &&
385 ((strcmp(
name,
"second")) != 0) && ((strcmp(
name,
"twoDimVertex")) != 0) &&
386 ((strcmp(
name,
"firstposition")) != 0) && ((strcmp(
name,
"firstpositionref")) != 0) &&
387 ((strcmp(
name,
"firstrotation")) != 0) && ((strcmp(
name,
"firstrotationref")) != 0) &&
388 ((strcmp(
name,
"section")) != 0) && ((strcmp(
name,
"world")) != 0) && ((strcmp(
name,
"isotope")) != 0) &&
389 ((strcmp(
name,
"triangular")) != 0) && ((strcmp(
name,
"quadrangular")) != 0)) {
390 std::cout <<
"Error: Unsupported GDML Tag Used :" <<
name <<
". Please Check Geometry/Schema." << std::endl;
422 if ((strcmp(axisString,
"kXAxis")) == 0) {
424 }
else if ((strcmp(axisString,
"kYAxis")) == 0) {
426 }
else if ((strcmp(axisString,
"kZAxis")) == 0) {
428 }
else if ((strcmp(axisString,
"kRho")) == 0) {
430 }
else if ((strcmp(axisString,
"kPhi")) == 0) {
449 stripped = stripped(0,
index);
450 return stripped.
Data();
469 if (tempattr ==
"name") {
472 if (tempattr ==
"value") {
543 if (tempattr ==
"name") {
546 if (tempattr ==
"value") {
549 if (tempattr ==
"unit") {
574 if (tempattr ==
"name") {
577 if (tempattr ==
"coldim") {
580 if (tempattr ==
"values") {
587 std::stringstream valueStream(values);
588 std::vector<Double_t> valueList;
589 while (!valueStream.eof()) {
590 std::string matrixValue;
591 valueStream >> matrixValue;
593 if (matrixValue.empty())
595 valueList.push_back(
Value(matrixValue.c_str()));
600 if ( coldim == 1 && valueList.size() == 1 ) {
606 for (
size_t i = 0; i < valueList.size(); ++i)
607 matrix->
Set(i / coldim, i % coldim, valueList[i]);
631 if (tempattr ==
"name") {
634 if (tempattr ==
"model") {
637 if (tempattr ==
"finish") {
640 if (tempattr ==
"type") {
643 if (tempattr ==
"value") {
658 if (tempattr ==
"name") {
660 }
else if (tempattr ==
"ref") {
664 Error(
"OpticalSurfaceProcess",
"Reference matrix %s for optical surface %s not found", ref.
Data(),
687 if (strcmp(unit,
"mm") == 0) {
689 }
else if (strcmp(unit,
"millimeter") == 0 || strcmp(unit,
"milimeter") == 0) {
691 }
else if (strcmp(unit,
"cm") == 0) {
693 }
else if (strcmp(unit,
"centimeter") == 0) {
695 }
else if (strcmp(unit,
"m") == 0) {
697 }
else if (strcmp(unit,
"meter") == 0) {
699 }
else if (strcmp(unit,
"km") == 0) {
700 retunit =
"100000.0";
701 }
else if (strcmp(unit,
"kilometer") == 0) {
702 retunit =
"100000.0";
703 }
else if (strcmp(unit,
"rad") == 0) {
705 }
else if (strcmp(unit,
"radian") == 0) {
707 }
else if (strcmp(unit,
"deg") == 0) {
709 }
else if (strcmp(unit,
"degree") == 0) {
711 }
else if (strcmp(unit,
"pi") == 0) {
713 }
else if (strcmp(unit,
"avogadro") == 0) {
716 Fatal(
"GetScale",
"Unit <%s> not known", unit);
735 if ((unit ==
"mm") || (unit ==
"millimeter") || (unit ==
"milimeter")) {
737 }
else if ((unit ==
"cm") || (unit ==
"centimeter")) {
739 }
else if ((unit ==
"m") || (unit ==
"meter")) {
741 }
else if ((unit ==
"km") || (unit ==
"kilometer")) {
743 }
else if ((unit ==
"rad") || (unit ==
"radian")) {
745 }
else if ((unit ==
"deg") || (unit ==
"degree")) {
747 }
else if ((unit ==
"ev") || (unit ==
"electronvolt")) {
749 }
else if ((unit ==
"kev") || (unit ==
"kiloelectronvolt")) {
751 }
else if ((unit ==
"mev") || (unit ==
"megaelectronvolt")) {
753 }
else if ((unit ==
"gev") || (unit ==
"gigaelectronvolt")) {
755 }
else if (unit ==
"pi") {
757 }
else if (unit ==
"avogadro") {
760 Fatal(
"GetScaleVal",
"Unit <%s> not known", sunit);
772 double val = strtod(svalue, &end);
775 while (*end != 0 && isspace(*end))
787 std::string expanded;
788 expanded.reserve(strlen(svalue) * 2);
792 const std::locale &loc = std::locale::classic();
795 const char *
p = svalue;
798 for (; *
p != 0; ++
p) {
799 if (std::isalpha(*
p, loc) || *
p ==
'_') {
800 const char *pe =
p + 1;
803 for (; *pe != 0; ++pe) {
804 if (!isalnum(*pe, loc) && *pe !=
'_') {
830 TFormula f(
"TFormula", expanded.c_str());
834 f.SetParameter(it.first.c_str(), it.second);
838 if (std::isnan(val) || std::isinf(val)) {
839 Fatal(
"Value",
"Got bad value %lf from string '%s'", val, svalue);
855 bool unitless_l =
true;
868 if (tempattr ==
"name") {
870 }
else if (tempattr ==
"x") {
872 }
else if (tempattr ==
"y") {
874 }
else if (tempattr ==
"z") {
876 }
else if (tempattr ==
"unit") {
912 bool unitless_l =
true;
924 if (tempattr ==
"name") {
926 }
else if (tempattr ==
"x") {
928 }
else if (tempattr ==
"y") {
930 }
else if (tempattr ==
"z") {
932 }
else if (tempattr ==
"unit") {
982 if (tempattr ==
"name") {
984 }
else if (tempattr ==
"x") {
986 }
else if (tempattr ==
"y") {
988 }
else if (tempattr ==
"z") {
1030 if (tempattr ==
"name") {
1032 }
else if (tempattr ==
"z") {
1034 }
else if (tempattr ==
"n") {
1049 if (tempattr ==
"value") {
1071 }
else if (
gDebug >= 2) {
1072 Info(
"TGDMLParse",
"Re-use existing isotope: %s", iso->
GetName());
1110 if (tempattr ==
"name") {
1122 while (
child != 0) {
1128 ncompo = ncompo + 1;
1133 if (tempattr ==
"n") {
1135 }
else if (tempattr ==
"ref") {
1143 fracmap[ref.
Data()] =
n;
1150 if (ele && ele->
Z() == 0)
1154 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1165 if (hasIsotopesExtended) {
1170 if (tempattr ==
"name") {
1182 while (
child != 0) {
1188 ncompo = ncompo + 1;
1193 if (tempattr ==
"n") {
1195 }
else if (tempattr ==
"ref") {
1203 fracmap[ref.
Data()] =
n;
1210 if (ele && ele->
Z() == 0)
1214 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1231 if (tempattr ==
"name") {
1234 }
else if (tempattr ==
"z") {
1236 }
else if (tempattr ==
"formula") {
1252 if (tempattr ==
"value") {
1268 if (ele && ele->
Z() == 0)
1273 }
else if (
gDebug >= 2) {
1274 Info(
"TGDMLParse",
"Re-use existing element: %s", ele->
GetName());
1299 TList properties, constproperties;
1306 Int_t ncompo = 0, mixflag = 2;
1325 while (
child != 0) {
1334 if (tempattr ==
"name") {
1336 }
else if (tempattr ==
"ref") {
1345 Error(
"MatProcess",
"Reference %s for material %s not found",
property->GetTitle(),
1360 if (tempattr ==
"value") {
1372 if (tempattr ==
"value") {
1382 tempconst = gdml->
GetAttr(node,
"Z");
1389 if (tmpname ==
"vacuum") {
1397 Info(
"TGDMLParse",
"Re-use existing material: %s", mat->
GetName());
1401 TIter next(&properties);
1405 if (constproperties.
GetSize()) {
1407 TIter next(&constproperties);
1415 if (mat_ele && mat_ele->
Z() == 0)
1419 mat_ele =
new TGeoElement(mat_name, mat_name, atoi(tempconst),
a);
1420 }
else if (
gDebug >= 2) {
1421 Info(
"TGDMLParse",
"Re-use existing material-element: %s", mat_ele->
GetName());
1427 while (
child != 0) {
1436 if (tempattr ==
"name") {
1438 }
else if (tempattr ==
"ref") {
1447 Error(
"MatProcess",
"Reference %s for material %s not found",
property->GetTitle(),
1459 ncompo = ncompo + 1;
1465 if (tempattr ==
"n") {
1467 }
else if (tempattr ==
"ref") {
1475 fracmap[ref.
Data()] =
n;
1482 ncompo = ncompo + 1;
1487 if (tempattr ==
"n") {
1489 }
else if (tempattr ==
"ref") {
1497 fracmap[ref.
Data()] =
n;
1503 if (tempattr ==
"value") {
1527 Info(
"TGDMLParse",
"Re-use existing material-mixture: %s", mix->
GetName());
1529 Fatal(
"TGDMLParse",
"WARNING! Inconsistent material definitions between GDML and TGeoManager");
1534 TIter next(&properties);
1538 if (constproperties.
GetSize()) {
1540 TIter next(&constproperties);
1547 for (
fractions f = fracmap.begin();
f != fracmap.end(); ++
f) {
1555 natoms = (
Int_t)
f->second;
1580 }
else if (mixflag == 0) {
1584 }
else if (
gDebug >= 2) {
1585 Info(
"TGDMLParse",
"Re-use existing medium: %s", med->
GetName());
1604 if (tempattr ==
"name") {
1607 if (tempattr ==
"surfaceproperty") {
1614 while (
child != 0) {
1620 if (tempattr ==
"ref") {
1630 Fatal(
"SkinSurfaceProcess",
"Skin surface %s: referenced optical surface %s not defined",
name.Data(),
1650 if (tempattr ==
"name") {
1653 if (tempattr ==
"surfaceproperty") {
1661 while (
child != 0) {
1667 if (tempattr ==
"ref") {
1676 Fatal(
"BorderSurfaceProcess",
"Border surface %s not referencing two nodes",
name.Data());
1679 Fatal(
"BorderSurfaceProcess",
"Border surface %s: referenced optical surface %s not defined",
name.Data(),
1683 if (!node1 || !node2)
1684 Fatal(
"BorderSurfaceProcess",
"Border surface %s: not found nodes %s [%s] or %s [%s]",
name.Data(),
1685 nodename[0].
Data(), node1 ?
"present" :
"missing", nodename[1].
Data(), node2 ?
"present" :
"missing");
1707 Error(
"GetPosition",
"Position %s not defined",
name);
1726 Error(
"GetRotation",
"Rotation %s not defined",
name);
1745 Error(
"GetScale",
"Scale %s not defined",
name);
1764 Error(
"GetSolid",
"Solid %s not defined",
name);
1783 Error(
"GetVolume",
"Volume %s not defined",
name);
1822 while (
child != 0) {
1832 solidname = reftemp;
1835 printf(
"Solid: %s, Not Yet Defined!\n", reftemp.
Data());
1847 printf(
"Medium: %s, Not Yet Defined!\n", gdml->
GetAttr(
child,
"ref"));
1876 while (
child != 0) {
1890 while (subchild != 0) {
1894 if (tempattr ==
"volumeref") {
1895 reftemp = gdml->
GetAttr(subchild,
"ref");
1898 }
else if (tempattr ==
"file") {
1899 const char *filevol;
1903 filevol = gdml->
GetAttr(subchild,
"volname");
1908 if (filedoc1 == 0) {
1924 if (filevol) volref = filevol;
1935 }
else if (tempattr ==
"position") {
1938 reftemp = gdml->
GetAttr(subchild,
"name");
1940 }
else if (tempattr ==
"positionref") {
1941 reftemp = gdml->
GetAttr(subchild,
"ref");
1944 Fatal(
"VolProcess",
"Physvol's position %s not found", reftemp.
Data());
1945 }
else if (tempattr ==
"rotation") {
1948 reftemp = gdml->
GetAttr(subchild,
"name");
1950 }
else if (tempattr ==
"rotationref") {
1951 reftemp = gdml->
GetAttr(subchild,
"ref");
1954 Fatal(
"VolProcess",
"Physvol's rotation %s not found", reftemp.
Data());
1955 }
else if (tempattr ==
"scale") {
1958 reftemp = gdml->
GetAttr(subchild,
"name");
1960 }
else if (tempattr ==
"scaleref") {
1961 reftemp = gdml->
GetAttr(subchild,
"ref");
1964 Fatal(
"VolProcess",
"Physvol's scale %s not found", reftemp.
Data());
1967 subchild = gdml->
GetNext(subchild);
1983 memset(scale3x3, 0, 9 *
sizeof(
Double_t));
1986 scale3x3[0] = diagonal[0];
1987 scale3x3[4] = diagonal[1];
1988 scale3x3[8] = diagonal[2];
2025 bool unitless_l =
true;
2036 if (tempattr ==
"axis") {
2038 }
else if (tempattr ==
"number") {
2040 }
else if (tempattr ==
"width") {
2042 }
else if (tempattr ==
"offset") {
2044 }
else if (tempattr ==
"unit") {
2054 while (subchild != 0) {
2058 if (tempattr ==
"volumeref") {
2059 reftemp = gdml->
GetAttr(subchild,
"ref");
2060 local_name = reftemp;
2064 divVolref = reftemp;
2067 subchild = gdml->
GetNext(subchild);
2092 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2111 bool unitless_l =
true;
2124 if (tempattr ==
"number") {
2132 while (subchild != 0) {
2136 if (tempattr ==
"volumeref") {
2137 reftemp = gdml->
GetAttr(subchild,
"ref");
2138 local_name = reftemp;
2142 divVolref = reftemp;
2145 if (tempattr ==
"replicate_along_axis") {
2146 subsubchild = gdml->
GetChild(subchild);
2148 while (subsubchild != 0) {
2149 if ((strcmp(gdml->
GetNodeName(subsubchild),
"width")) == 0) {
2154 if (tempattr ==
"value") {
2156 }
else if (tempattr ==
"unit") {
2163 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"offset")) == 0) {
2168 if (tempattr ==
"value") {
2170 }
else if (tempattr ==
"unit") {
2176 }
else if ((strcmp(gdml->
GetNodeName(subsubchild),
"direction")) == 0) {
2181 if (tempattr ==
"x") {
2183 }
else if (tempattr ==
"y") {
2185 }
else if (tempattr ==
"z") {
2187 }
else if (tempattr ==
"rho") {
2189 }
else if (tempattr ==
"phi") {
2197 subsubchild = gdml->
GetNext(subsubchild);
2201 subchild = gdml->
GetNext(subchild);
2209 Double_t widthline = wvalue * retwunit;
2210 Double_t offsetline = ovalue * retounit;
2229 Fatal(
"VolProcess",
"Cannot divide volume %s", vol->
GetName());
2239 TString auxType, auxUnit, auxValue;
2242 auxmap =
new TMap();
2307 while (
child != 0) {
2311 if (tempattr ==
"first") {
2315 Fatal(
"BooSolid",
"First solid %s not found", reftemp.
Data());
2316 }
else if (tempattr ==
"second") {
2320 Fatal(
"BooSolid",
"Second solid %s not found", reftemp.
Data());
2321 }
else if (tempattr ==
"position") {
2326 }
else if (tempattr ==
"positionref") {
2330 Fatal(
"BooSolid",
"Second position %s not found", reftemp.
Data());
2331 }
else if (tempattr ==
"rotation") {
2336 }
else if (tempattr ==
"rotationref") {
2340 Fatal(
"BooSolid",
"Second rotation %s not found", reftemp.
Data());
2341 }
else if (tempattr ==
"firstposition") {
2346 }
else if (tempattr ==
"firstpositionref") {
2350 Fatal(
"BooSolid",
"First position %s not found", reftemp.
Data());
2351 }
else if (tempattr ==
"firstrotation") {
2356 }
else if (tempattr ==
"firstrotationref") {
2360 Fatal(
"BooSolid",
"First rotation %s not found", reftemp.
Data());
2393 TString nodename, auxtype, auxtypec, auxvalue, auxvaluec, auxunit, auxunitc;
2399 if (nodename ==
"auxiliary") {
2402 if (auxtype ==
"Region") {
2409 auxtypec = gdml->
GetAttr(subchild,
"auxtype");
2410 auxvaluec = gdml->
GetAttr(subchild,
"auxvalue");
2411 auxunitc = gdml->
GetAttr(subchild,
"auxunit");
2412 if (auxtypec ==
"volume") {
2422 subchild = gdml->
GetNext(subchild);
2467 while (
child != 0) {
2477 while (subchild != 0) {
2481 if (tempattr ==
"volumeref") {
2482 reftemp = gdml->
GetAttr(subchild,
"ref");
2484 }
else if (tempattr ==
"positionref") {
2485 reftemp = gdml->
GetAttr(subchild,
"ref");
2488 Fatal(
"AssProcess",
"Position %s not found", reftemp.
Data());
2489 }
else if (tempattr ==
"position") {
2492 reftemp = gdml->
GetAttr(subchild,
"name");
2494 }
else if (tempattr ==
"rotationref") {
2495 reftemp = gdml->
GetAttr(subchild,
"ref");
2498 Fatal(
"AssProcess",
"Rotation %s not found", reftemp.
Data());
2499 }
else if (tempattr ==
"rotation") {
2502 reftemp = gdml->
GetAttr(subchild,
"name");
2506 subchild = gdml->
GetNext(subchild);
2537 while (
child != 0) {
2561 bool unitless_l =
true;
2573 if (tempattr ==
"name") {
2575 }
else if (tempattr ==
"x") {
2577 }
else if (tempattr ==
"y") {
2579 }
else if (tempattr ==
"z") {
2581 }
else if (tempattr ==
"lunit") {
2619 bool unitless_l =
true;
2634 if (tempattr ==
"name") {
2636 }
else if (tempattr ==
"ax") {
2638 }
else if (tempattr ==
"by") {
2640 }
else if (tempattr ==
"cz") {
2642 }
else if (tempattr ==
"zcut1") {
2644 }
else if (tempattr ==
"zcut2") {
2646 }
else if (tempattr ==
"lunit") {
2672 z1 =
Value(zcut1) * retunit;
2677 z2 =
Value(zcut2) * retunit;
2685 origin[2] = 0.5 * (z1 + z2);
2707 bool unitless_l =
true;
2720 if (tempattr ==
"name") {
2722 }
else if (tempattr ==
"dx") {
2724 }
else if (tempattr ==
"dy") {
2726 }
else if (tempattr ==
"zmax") {
2728 }
else if (tempattr ==
"zcut") {
2730 }
else if (tempattr ==
"lunit") {
2754 Info(
"ElCone",
"ERROR! Parameter zcut = %.12g is not set properly, elcone will not be imported.", z1);
2786 bool unitless_l =
true;
2798 if (tempattr ==
"name") {
2800 }
else if (tempattr ==
"rlo") {
2802 }
else if (tempattr ==
"rhi") {
2804 }
else if (tempattr ==
"dz") {
2806 }
else if (tempattr ==
"lunit") {
2842 bool unitless_l =
true;
2868 if (tempattr ==
"name") {
2870 }
else if (tempattr ==
"v1x") {
2872 }
else if (tempattr ==
"v1y") {
2874 }
else if (tempattr ==
"v2x") {
2876 }
else if (tempattr ==
"v2y") {
2878 }
else if (tempattr ==
"v3x") {
2880 }
else if (tempattr ==
"v3y") {
2882 }
else if (tempattr ==
"v4x") {
2884 }
else if (tempattr ==
"v4y") {
2886 }
else if (tempattr ==
"v5x") {
2888 }
else if (tempattr ==
"v5y") {
2890 }
else if (tempattr ==
"v6x") {
2892 }
else if (tempattr ==
"v6y") {
2894 }
else if (tempattr ==
"v7x") {
2896 }
else if (tempattr ==
"v7y") {
2898 }
else if (tempattr ==
"v8x") {
2900 }
else if (tempattr ==
"v8y") {
2902 }
else if (tempattr ==
"dz") {
2904 }
else if (tempattr ==
"lunit") {
2964 bool unitless_l =
true;
2965 bool unitless_a =
true;
2979 if (tempattr ==
"name") {
2981 }
else if (tempattr ==
"rmin") {
2983 }
else if (tempattr ==
"rmax") {
2985 }
else if (tempattr ==
"z") {
2987 }
else if (tempattr ==
"lunit") {
2990 }
else if (tempattr ==
"aunit") {
2993 }
else if (tempattr ==
"startphi") {
2995 }
else if (tempattr ==
"deltaphi") {
3015 Double_t endphideg = startphideg + deltaphideg;
3018 if (deltaphideg < 360.)
3038 bool unitless_l =
true;
3039 bool unitless_a =
true;
3059 if (tempattr ==
"name") {
3061 }
else if (tempattr ==
"rmin") {
3063 }
else if (tempattr ==
"rmax") {
3065 }
else if (tempattr ==
"z") {
3067 }
else if (tempattr ==
"lunit") {
3070 }
else if (tempattr ==
"aunit") {
3073 }
else if (tempattr ==
"startphi") {
3075 }
else if (tempattr ==
"deltaphi") {
3077 }
else if (tempattr ==
"lowx") {
3079 }
else if (tempattr ==
"lowy") {
3081 }
else if (tempattr ==
"lowz") {
3083 }
else if (tempattr ==
"highx") {
3085 }
else if (tempattr ==
"highy") {
3087 }
else if (tempattr ==
"highz") {
3106 Double_t deltaphiline =
Value(deltaphi) * retaunit + startphiline;
3115 lowXline, lowYline, lowZline, highXline, highYline, highZline);
3133 bool unitless_l =
true;
3134 bool unitless_a =
true;
3150 if (tempattr ==
"name") {
3152 }
else if (tempattr ==
"rmin1") {
3154 }
else if (tempattr ==
"rmax1") {
3156 }
else if (tempattr ==
"rmin2") {
3158 }
else if (tempattr ==
"rmax2") {
3160 }
else if (tempattr ==
"z") {
3162 }
else if (tempattr ==
"lunit") {
3165 }
else if (tempattr ==
"aunit") {
3168 }
else if (tempattr ==
"startphi") {
3170 }
else if (tempattr ==
"deltaphi") {
3216 bool unitless_l =
true;
3217 bool unitless_a =
true;
3237 if (tempattr ==
"name") {
3239 }
else if (tempattr ==
"x1") {
3241 }
else if (tempattr ==
"x2") {
3243 }
else if (tempattr ==
"x3") {
3245 }
else if (tempattr ==
"x4") {
3247 }
else if (tempattr ==
"y1") {
3249 }
else if (tempattr ==
"y2") {
3251 }
else if (tempattr ==
"z") {
3253 }
else if (tempattr ==
"lunit") {
3256 }
else if (tempattr ==
"aunit") {
3259 }
else if (tempattr ==
"phi") {
3261 }
else if (tempattr ==
"theta") {
3263 }
else if (tempattr ==
"alpha1") {
3265 }
else if (tempattr ==
"alpha2") {
3293 alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
3310 bool unitless_l =
true;
3324 if (tempattr ==
"name") {
3326 }
else if (tempattr ==
"x1") {
3328 }
else if (tempattr ==
"x2") {
3330 }
else if (tempattr ==
"y1") {
3332 }
else if (tempattr ==
"y2") {
3334 }
else if (tempattr ==
"z") {
3336 }
else if (tempattr ==
"lunit") {
3376 bool unitless_l =
true;
3377 bool unitless_a =
true;
3391 if (tempattr ==
"name") {
3393 }
else if (tempattr ==
"lunit") {
3396 }
else if (tempattr ==
"aunit") {
3399 }
else if (tempattr ==
"startphi") {
3401 }
else if (tempattr ==
"deltaphi") {
3420 while (
child != 0) {
3421 numplanes = numplanes + 1;
3424 if (numplanes < 2) {
3425 Fatal(
"Polycone",
"Found less than 2 planes for polycone %s",
name.Data());
3432 double **table =
new double *[numplanes];
3433 for (i = 0; i < numplanes; i++) {
3434 table[i] =
new double[cols];
3440 while (
child != 0) {
3453 if (tempattr ==
"rmin") {
3455 rminline =
Value(rmin) * retlunit;
3456 table[planeno][0] = rminline;
3457 }
else if (tempattr ==
"rmax") {
3459 rmaxline =
Value(rmax) * retlunit;
3460 table[planeno][1] = rmaxline;
3461 }
else if (tempattr ==
"z") {
3463 zline =
Value(z) * retlunit;
3464 table[planeno][2] = zline;
3469 planeno = planeno + 1;
3479 for (
int j = 0; j < numplanes; j++) {
3480 poly->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3485 for (i = 0; i < numplanes; i++) {
3505 bool unitless_l =
true;
3506 bool unitless_a =
true;
3521 if (tempattr ==
"name") {
3523 }
else if (tempattr ==
"lunit") {
3526 }
else if (tempattr ==
"aunit") {
3529 }
else if (tempattr ==
"startphi") {
3531 }
else if (tempattr ==
"deltaphi") {
3533 }
else if (tempattr ==
"numsides") {
3553 while (
child != 0) {
3554 numplanes = numplanes + 1;
3557 if (numplanes < 2) {
3558 Fatal(
"Polyhedra",
"Found less than 2 planes for polyhedra %s",
name.Data());
3565 double **table =
new double *[numplanes];
3566 for (i = 0; i < numplanes; i++) {
3567 table[i] =
new double[cols];
3573 while (
child != 0) {
3585 if (tempattr ==
"rmin") {
3587 rminline =
Value(rmin) * retlunit;
3588 table[planeno][0] = rminline;
3589 }
else if (tempattr ==
"rmax") {
3591 rmaxline =
Value(rmax) * retlunit;
3592 table[planeno][1] = rmaxline;
3593 }
else if (tempattr ==
"z") {
3595 zline =
Value(z) * retlunit;
3596 table[planeno][2] = zline;
3602 planeno = planeno + 1;
3613 for (
int j = 0; j < numplanes; j++) {
3614 polyg->
DefineSection(zno, table[j][2], table[j][0], table[j][1]);
3619 for (i = 0; i < numplanes; i++) {
3638 bool unitless_l =
true;
3639 bool unitless_a =
true;
3653 if (tempattr ==
"name") {
3655 }
else if (tempattr ==
"rmin") {
3657 }
else if (tempattr ==
"rmax") {
3659 }
else if (tempattr ==
"lunit") {
3662 }
else if (tempattr ==
"aunit") {
3665 }
else if (tempattr ==
"startphi") {
3667 }
else if (tempattr ==
"deltaphi") {
3669 }
else if (tempattr ==
"starttheta") {
3671 }
else if (tempattr ==
"deltatheta") {
3689 Double_t deltaphiline = startphiline +
Value(deltaphi) * retaunit;
3691 Double_t deltathetaline = startthetaline +
Value(deltatheta) * retaunit;
3694 new TGeoSphere(
NameShort(
name), rminline, rmaxline, startthetaline, deltathetaline, startphiline, deltaphiline);
3712 bool unitless_l =
true;
3713 bool unitless_a =
true;
3727 if (tempattr ==
"name") {
3729 }
else if (tempattr ==
"rmin") {
3731 }
else if (tempattr ==
"rmax") {
3733 }
else if (tempattr ==
"rtor") {
3735 }
else if (tempattr ==
"lunit") {
3738 }
else if (tempattr ==
"aunit") {
3741 }
else if (tempattr ==
"startphi") {
3743 }
else if (tempattr ==
"deltaphi") {
3782 bool unitless_l =
true;
3783 bool unitless_a =
true;
3796 if (tempattr ==
"name") {
3798 }
else if (tempattr ==
"rmin") {
3800 }
else if (tempattr ==
"rmax") {
3802 }
else if (tempattr ==
"z") {
3804 }
else if (tempattr ==
"lunit") {
3807 }
else if (tempattr ==
"aunit") {
3810 }
else if (tempattr ==
"inst") {
3812 }
else if (tempattr ==
"outst") {
3851 bool unitless_l =
true;
3852 bool unitless_a =
true;
3867 if (tempattr ==
"name") {
3869 }
else if (tempattr ==
"x") {
3871 }
else if (tempattr ==
"y") {
3873 }
else if (tempattr ==
"z") {
3875 }
else if (tempattr ==
"lunit") {
3878 }
else if (tempattr ==
"aunit") {
3881 }
else if (tempattr ==
"phi") {
3883 }
else if (tempattr ==
"theta") {
3885 }
else if (tempattr ==
"alpha") {
3925 bool unitless_l =
true;
3926 bool unitless_a =
true;
3947 if (tempattr ==
"name") {
3949 }
else if (tempattr ==
"x1") {
3951 }
else if (tempattr ==
"x2") {
3953 }
else if (tempattr ==
"x3") {
3955 }
else if (tempattr ==
"x4") {
3957 }
else if (tempattr ==
"y1") {
3959 }
else if (tempattr ==
"y2") {
3961 }
else if (tempattr ==
"z") {
3963 }
else if (tempattr ==
"lunit") {
3966 }
else if (tempattr ==
"aunit") {
3969 }
else if (tempattr ==
"phi") {
3971 }
else if (tempattr ==
"theta") {
3973 }
else if (tempattr ==
"alph") {
3978 }
else if (tempattr ==
"phitwist") {
4007 x2line / 2, alpha1line, y2line / 2, x3line / 2, x4line / 2, alpha2line);
4024 bool unitless_l =
true;
4036 if (tempattr ==
"name") {
4038 }
else if (tempattr ==
"dx") {
4040 }
else if (tempattr ==
"dy") {
4042 }
else if (tempattr ==
"dz") {
4044 }
else if (tempattr ==
"lunit") {
4079 bool unitless_l =
true;
4089 if (tempattr ==
"name") {
4091 }
else if (tempattr ==
"r") {
4093 }
else if (tempattr ==
"lunit") {
4130 bool unitless_l =
true;
4146 if (tempattr ==
"name") {
4148 }
else if (tempattr ==
"lunit") {
4169 while (
child != 0) {
4172 if (tempattr ==
"twoDimVertex") {
4173 noverts = noverts + 1;
4174 }
else if (tempattr ==
"section") {
4175 nosects = nosects + 1;
4181 if (nosects < 2 || noverts < 3) {
4182 Fatal(
"Xtru",
"Invalid number of sections/vertices found forxtru %s",
name.Data());
4189 double *vertx =
new double[noverts];
4190 double *verty =
new double[noverts];
4192 double **section =
new double *[nosects];
4193 for (i = 0; i < nosects; i++) {
4194 section[i] =
new double[cols];
4201 while (
child != 0) {
4211 if (tempattr ==
"x") {
4213 xline =
Value(
x) * retlunit;
4214 vertx[vert] = xline;
4215 }
else if (tempattr ==
"y") {
4217 yline =
Value(
y) * retlunit;
4218 verty[vert] = yline;
4238 if (tempattr ==
"zOrder") {
4240 section[sect][0] =
Value(zorder);
4241 }
else if (tempattr ==
"zPosition") {
4243 zposline =
Value(zpos) * retlunit;
4244 section[sect][1] = zposline;
4245 }
else if (tempattr ==
"xOffset") {
4247 xoffline =
Value(xoff) * retlunit;
4248 section[sect][2] = xoffline;
4249 }
else if (tempattr ==
"yOffset") {
4251 yoffline =
Value(yoff) * retlunit;
4252 section[sect][3] = yoffline;
4253 }
else if (tempattr ==
"scalingFactor") {
4255 section[sect][4] =
Value(scale);
4270 for (
int j = 0; j < sect; j++) {
4271 xtru->
DefineSection((
int)section[j][0], section[j][1], section[j][2], section[j][3], section[j][4]);
4277 for (i = 0; i < nosects; i++) {
4278 delete[] section[i];
4296 while (
attr !=
nullptr) {
4299 if (tempattr ==
"name") {
4314 if (trans ==
nullptr)
4316 const double *tr = trans->GetTranslation();
4317 vertices[i].
Set(tr[0], tr[1], tr[2]);
4320 auto AddTriangularFacet = [&](
bool relative) {
4322 vertices[2] += vertices[0] + vertices[1];
4323 vertices[1] += vertices[0];
4325 tsl->AddFacet(vertices[0], vertices[1], vertices[2]);
4328 auto AddQuadrangularFacet = [&](
bool relative) {
4330 vertices[3] += vertices[0] + vertices[1] + vertices[2];
4331 vertices[2] += vertices[0] + vertices[1];
4332 vertices[1] += vertices[0];
4334 tsl->AddFacet(vertices[0], vertices[1], vertices[2], vertices[3]);
4339 while (
child !=
nullptr) {
4342 if (tempattr ==
"triangular") {
4344 bool relative =
false;
4346 while (
attr !=
nullptr) {
4349 if (tempattr ==
"vertex1") {
4353 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4357 else if (tempattr ==
"vertex2") {
4361 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4365 else if (tempattr ==
"vertex3") {
4369 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4373 else if (tempattr ==
"type") {
4376 relative = (
type ==
"relative") ?
true :
false;
4381 AddTriangularFacet(relative);
4384 else if (tempattr ==
"quadrangular") {
4386 bool relative =
false;
4388 while (
attr !=
nullptr) {
4391 if (tempattr ==
"vertex1") {
4395 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4399 else if (tempattr ==
"vertex2") {
4403 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4407 else if (tempattr ==
"vertex3") {
4411 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4415 else if (tempattr ==
"vertex4") {
4419 Fatal(
"Tessellated",
"Vertex %s not defined", vname.
Data());
4423 else if (tempattr ==
"type") {
4426 relative = (
type ==
"relative") ?
true :
false;
4431 AddQuadrangularFacet(relative);