165 fgG4Compatibility(0),
178 if (fgGDMLWrite)
delete fgGDMLWrite;
201 fgNamingSpeed = naming;
215 Info(
"WriteGDMLfile",
"Geant4 compatibility mode set");
221 Info(
"WriteGDMLfile",
"Fast naming convetion with pointer suffix set");
224 Info(
"WriteGDMLfile",
"Naming without prefix set - be careful uniqness of name is not ensured");
227 Info(
"WriteGDMLfile",
"Potentially slow with incremental suffix naming convention set");
231 Int_t outputLayout = 1;
232 const char * krootNodeName =
"gdml";
233 const char * knsRefGeneral =
"http://www.w3.org/2001/XMLSchema-instance";
234 const char * knsNameGeneral =
"xsi";
235 const char * knsRefGdml =
"http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd";
236 const char * knsNameGdml =
"xsi:noNamespaceSchemaLocation";
243 fGdmlFile = fGdmlE->NewDoc();
247 fGdmlE->DocSetRootElement(fGdmlFile, rootNode);
250 fGdmlE->NewNS(rootNode, knsRefGeneral, knsNameGeneral);
251 fGdmlE->NewAttr(rootNode, 0, knsNameGdml, knsRefGdml);
259 fDefineNode = fGdmlE->NewChild(0, 0,
"define", 0);
260 fSolidsNode = fGdmlE->NewChild(0, 0,
"solids", 0);
261 fStructureNode = fGdmlE->NewChild(0, 0,
"structure", 0);
267 fAccPatt->fLst[
"TGeoPatternY"] =
kTRUE;
268 fAccPatt->fLst[
"TGeoPatternZ"] =
kTRUE;
269 fAccPatt->fLst[
"TGeoPatternCylR"] =
kTRUE;
270 fAccPatt->fLst[
"TGeoPatternCylPhi"] =
kTRUE;
279 fRejShape->fLst[
"TGeoTrd2"] =
kTRUE;
294 Info(
"WriteGDMLfile",
"Extracting volumes");
298 Info(
"WriteGDMLfile",
"Top volume does not exist!");
301 Info(
"WriteGDMLfile",
"%i solids added", fSolCnt);
302 Info(
"WriteGDMLfile",
"%i volumes added", fVolCnt);
303 Info(
"WriteGDMLfile",
"%i physvolumes added", fPhysVolCnt);
306 fGdmlE->AddChild(rootNode, fDefineNode);
307 fGdmlE->AddChild(rootNode, fMaterialsNode);
308 fGdmlE->AddChild(rootNode, fSolidsNode);
309 fGdmlE->AddChild(rootNode, fStructureNode);
310 fGdmlE->AddChild(rootNode,
CreateSetupN(fTopVolumeName.Data()));
312 Double_t tdiffI = difftime(endT, startT);
314 Info(
"WriteGDMLfile",
"Exporting time: %s", tdiffS.
Data());
318 fGdmlE->SaveDoc(fGdmlFile, filename, outputLayout);
319 Info(
"WriteGDMLfile",
"File %s saved", filename);
321 fGdmlE->FreeDoc(fGdmlFile);
333 Info(
"ExtractMaterials",
"Extracting materials");
349 fGdmlE->AddChild(materialsN, mixtureN);
352 fGdmlE->AddChild(materialsN, materialN);
356 Info(
"ExtractMaterials",
"%i materials added", matcnt);
368 fGdmlE->AddChild(fSolidsNode, solidN);
369 if (solidN !=
NULL) fSolCnt++;
384 TString volname, matname, solname, pattClsName, nodeVolNameBak;
392 fTopVolumeName = volname;
407 if (solname ==
"-1") {
408 Info(
"ExtractVolumes",
"ERROR! %s volume was not added, because solid is either not supported or corrupted",
423 if ((fAccPatt->fLst[pattClsName] ==
kTRUE) &&
424 (fRejShape->fLst[shapeCls] !=
kTRUE)) {
445 if (nodevolname.
Contains(
"missing_")) {
449 nodeVolNameBak = nodevolname;
452 if (isPattern ==
kFALSE) {
454 TString nodename, posname, rotname;
456 nodename = nodename +
"in" + volname;
459 posname = nodename +
"pos";
469 fGdmlE->AddChild(fDefineNode, childN);
480 scaleN = fGdmlE->NewChild(0, 0,
"scale", 0);
481 fGdmlE->NewAttr(scaleN, 0,
"name", (nodename +
"scl").
Data());
498 if ((lxyz.
x != 0.0) || (lxyz.
y != 0.0) || (lxyz.
z != 0.0)) {
499 rotname = nodename +
"rot";
501 fGdmlE->AddChild(fDefineNode, childN);
506 fGdmlE->AddChild(volumeN, childN);
511 if (isPattern && pattFinder) {
524 offset = pattFinder->
GetStart() - xlo;
529 fGdmlE->AddChild(volumeN, childN);
534 fGdmlE->AddChild(fStructureNode, volumeN);
544 fGdmlE->NewAttr(atomN, 0,
"unit", unit);
555 fGdmlE->NewAttr(densN, 0,
"unit", unit);
567 fGdmlE->NewAttr(fractN, 0,
"ref", refName);
577 fGdmlE->NewAttr(mainN, 0,
"name", name);
591 fGdmlE->NewAttr(mainN, 0,
"name", name);
600 for (
Int_t idx = 0; idx < nOfIso; idx++) {
603 Fatal(
"CreateElementN",
"Missing isotopes for element %s", element->
GetName());
619 if (
IsInList(fIsotopeList->fLst, lname)) {
623 fIsotopeList->fLst[lname] =
kTRUE;
625 fGdmlE->AddChild(materials, isoNode);
628 for (NameListI::iterator itr = wCounter.begin(); itr != wCounter.end(); itr++) {
629 if (itr->second > 1) {
630 Info(
"CreateMixtureN",
"WARNING! 2 equal isotopes in one element. Check: %s isotope of %s element",
631 itr->first.Data(),
name);
634 fGdmlE->AddChild(mainN,
CreateFractionN(wPercentage[itr->first], itr->first.Data()));
637 fGdmlE->NewAttr(mainN, 0,
"formula", element->
GetName());
638 Int_t valZ = element->
Z();
654 fGdmlE->NewAttr(mainN, 0,
"name", mname);
663 for (
Int_t idx = 0; idx < nOfElm; idx++) {
675 wPercentage[lname] += mixture->
GetWmixt()[idx];
679 if (
IsInList(fElementList->fLst, lname)) {
684 fElementList->fLst[lname] =
kTRUE;
686 fGdmlE->AddChild(materials, elmNode);
689 for (NameListI::iterator itr = wCounter.begin(); itr != wCounter.end(); itr++) {
690 if (itr->second > 1) {
691 Info(
"CreateMixtureN",
"WARNING! 2 equal elements in one material. Check: %s element of %s material",
692 itr->first.Data(), mname.
Data());
695 fGdmlE->AddChild(mainN,
CreateFractionN(wPercentage[itr->first], itr->first.Data()));
707 fGdmlE->NewAttr(mainN, 0,
"name", mname);
713 if (tmpname ==
"vacuum") {
716 if (fgG4Compatibility ==
kTRUE) {
717 Info(
"CreateMaterialN",
"WARNING! value of Z in %s material can't be < 1 in Geant4, that is why it was changed to 1, please check it manually! ",
721 Info(
"CreateMaterialN",
"WARNING! value of Z in %s material can't be < 1 in Geant4", mname.
Data());
738 fGdmlE->NewAttr(mainN, 0,
"name", lname);
748 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
759 fGdmlE->NewAttr(mainN, 0,
"name", lname);
768 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
779 fGdmlE->NewAttr(mainN, 0,
"name", lname);
791 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
792 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
803 fGdmlE->NewAttr(mainN, 0,
"name", lname);
826 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
837 fGdmlE->NewAttr(mainN, 0,
"name", lname);
850 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
851 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
862 fGdmlE->NewAttr(mainN, 0,
"name", lname);
875 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
876 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
895 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
896 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
908 if ((geoShape->
GetBl1() == 0 || geoShape->
GetTl1() == 0 || geoShape->
GetH1() == 0) ||
909 (geoShape->
GetBl2() == 0 || geoShape->
GetTl2() == 0 || geoShape->
GetH2() == 0)) {
920 mainN = fGdmlE->NewChild(0, 0,
"trap", 0);
922 fGdmlE->NewAttr(mainN, 0,
"name", lname);
940 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
941 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
953 if ((geoShape->
GetBl1() == 0 && geoShape->
GetTl1() == 0 && geoShape->
GetH1() == 0) ||
954 (geoShape->
GetBl2() == 0 && geoShape->
GetTl2() == 0 && geoShape->
GetH2() == 0)) {
971 mainN = fGdmlE->NewChild(0, 0,
"twistedtrap", 0);
973 fGdmlE->NewAttr(mainN, 0,
"name", lname);
992 Info(
"CreateTwistedTrapN",
993 "ERROR! Object %s is not exported correctly because parameter Alpha2 is not declared in GDML schema",
999 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1000 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1011 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1022 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1033 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1044 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1055 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1067 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1068 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1079 mainN = fGdmlE->NewChild(0, 0,
"cutTube", 0);
1081 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1094 Info(
"CreateCutTubeN",
"WARNING! %s - CutTube was replaced by intersection of TGeoTubSeg and two TGeoBBoxes",
1110 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1111 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1123 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1135 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1136 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1161 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1166 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1167 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1169 for (
Int_t it = 0; it < nZPlns; it++) {
1173 if ((it < nZPlns - 1) && (geoShape->
GetZ(it) == geoShape->
GetZ(it + 1))) {
1180 if (fgG4Compatibility ==
kTRUE) {
1182 Info(
"CreatePolyconeN",
"WARNING! One plane was added to %s solid to be compatible with Geant4", lname.
Data());
1184 Info(
"CreatePolyconeN",
"WARNING! Solid %s definition seemds not contiguous may cause problems in Geant4", lname.
Data());
1194 if (fgG4Compatibility ==
kTRUE) {
1196 Info(
"CreatePolyconeN",
"WARNING! One plane was added to %s solid to be compatible with Geant4", lname.
Data());
1198 Info(
"CreatePolyconeN",
"WARNING! Solid %s definition seemds not contiguous may cause problems in Geant4", lname.
Data());
1213 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1224 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1225 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1242 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1243 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1244 for (
Int_t it = 0; it < geoShape->
GetNz(); it++) {
1258 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1269 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1281 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1293 fGdmlE->NewAttr(mainN, 0,
"aunit",
"deg");
1294 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1306 fGdmlE->NewAttr(mainN, 0,
"name", lname);
1308 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1312 if (vertNum < 3 || secNum < 2) {
1313 Info(
"CreateXtrusionN",
"ERROR! TGeoXtru %s has only %i vertices and %i sections. It was not exported",
1314 lname.
Data(), vertNum, secNum);
1318 for (
Int_t it = 0; it < vertNum; it++) {
1320 childN = fGdmlE->NewChild(0, 0,
"twoDimVertex", 0);
1323 fGdmlE->AddChild(mainN, childN);
1325 for (
Int_t it = 0; it < secNum; it++) {
1327 childN = fGdmlE->NewChild(0, 0,
"section", 0);
1333 fGdmlE->AddChild(mainN, childN);
1351 fGdmlE->NewAttr(mainN, 0,
"name", elName.
Data());
1364 Double_t zcut1 = 2 * zorig - zcut2;
1372 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1389 Double_t zmax = zcut * ((rx1 + rx2) / (rx1 - rx2));
1395 fGdmlE->NewAttr(mainN, 0,
"dx",
TString::Format(
"%.12g/%.12g", rx1, z));
1396 fGdmlE->NewAttr(mainN, 0,
"dy",
TString::Format(
"%.12g/%.12g", ry1, z));
1399 fGdmlE->NewAttr(mainN, 0,
"lunit",
"cm");
1415 lboolType =
"union";
1418 lboolType =
"subtraction";
1421 lboolType =
"intersection";
1436 if (strcmp(leftS->
ClassName(),
"TGeoScaledShape") == 0 &&
1437 strcmp(rightS->
ClassName(),
"TGeoBBox") == 0) {
1438 if (strcmp(((
TGeoScaledShape *)leftS)->GetShape()->ClassName(),
"TGeoSphere") == 0) {
1439 if (lboolType ==
"intersection") {
1446 Xyz translL, translR;
1465 fGdmlE->AddChild(fSolidsNode, ndL);
1468 if (lname.Contains(
"missing_") || lname ==
"") {
1469 Info(
"CreateCommonBoolN",
"ERROR! Left node is NULL - Boolean Shape will be skipped");
1474 fGdmlE->AddChild(fSolidsNode, ndR);
1477 if (rname.
Contains(
"missing_") || rname ==
"") {
1478 Info(
"CreateCommonBoolN",
"ERROR! Right node is NULL - Boolean Shape will be skipped");
1493 mainN = fGdmlE->NewChild(0, 0, lboolType.Data(), 0);
1494 fGdmlE->NewAttr(mainN, 0,
"name", nodeName);
1497 childN = fGdmlE->NewChild(0, 0,
"first", 0);
1498 fGdmlE->NewAttr(childN, 0,
"ref", lname);
1499 fGdmlE->AddChild(mainN, childN);
1502 childN = fGdmlE->NewChild(0, 0,
"second", 0);
1503 fGdmlE->NewAttr(childN, 0,
"ref", rname);
1504 fGdmlE->AddChild(mainN, childN);
1507 if ((translL.
x != 0.0) || (translL.
y != 0.0) || (translL.
z != 0.0)) {
1509 fGdmlE->AddChild(mainN, childN);
1512 if ((lrot.
x != 0.0) || (lrot.
y != 0.0) || (lrot.
z != 0.0)) {
1514 fGdmlE->AddChild(mainN, childN);
1517 if ((translR.
x != 0.0) || (translR.
y != 0.0) || (translR.
z != 0.0)) {
1519 fGdmlE->AddChild(mainN, childN);
1522 if ((rrot.
x != 0.0) || (rrot.
y != 0.0) || (rrot.
z != 0.0)) {
1524 fGdmlE->AddChild(mainN, childN);
1537 fGdmlE->NewAttr(mainN, 0,
"name", name);
1541 fGdmlE->NewAttr(mainN, 0,
"unit", unit);
1551 fGdmlE->NewAttr(mainN, 0,
"name", name);
1555 fGdmlE->NewAttr(mainN, 0,
"unit", unit);
1565 fGdmlE->NewAttr(setupN, 0,
"name", name);
1566 fGdmlE->NewAttr(setupN, 0,
"version", version);
1568 fGdmlE->NewAttr(fworldN, 0,
"ref", topVolName);
1579 fGdmlE->NewAttr(mainN, 0,
"name", name);
1581 childN = fGdmlE->NewChild(0, 0,
"materialref", 0);
1582 fGdmlE->NewAttr(childN, 0,
"ref", material);
1583 fGdmlE->AddChild(mainN, childN);
1585 childN = fGdmlE->NewChild(0, 0,
"solidref", 0);
1586 fGdmlE->NewAttr(childN, 0,
"ref", solid);
1587 fGdmlE->AddChild(mainN, childN);
1598 fGdmlE->NewAttr(mainN, 0,
"name", name);
1611 fGdmlE->NewAttr(mainN, 0,
"name", name);
1612 fGdmlE->NewAttr(mainN, 0,
"copynumber",
TString::Format(
"%d",copyno));
1614 childN = fGdmlE->NewChild(0, 0,
"volumeref", 0);
1615 fGdmlE->NewAttr(childN, 0,
"ref", volref);
1616 fGdmlE->AddChild(mainN, childN);
1618 childN = fGdmlE->NewChild(0, 0,
"positionref", 0);
1619 fGdmlE->NewAttr(childN, 0,
"ref", posref);
1620 fGdmlE->AddChild(mainN, childN);
1623 if (strcmp(rotref,
"") != 0) {
1624 childN = fGdmlE->NewChild(0, 0,
"rotationref", 0);
1625 fGdmlE->NewAttr(childN, 0,
"ref", rotref);
1626 fGdmlE->AddChild(mainN, childN);
1628 if (scaleN !=
NULL) {
1629 fGdmlE->AddChild(mainN, scaleN);
1642 fGdmlE->NewAttr(mainN, 0,
"axis", axis);
1644 if (fgG4Compatibility ==
kTRUE) {
1647 width = (
floor(width * 1E4)) * 1
E-4;
1648 if ((offset >= 0.) && (strcmp(axis,
"kPhi") == 0)) {
1650 Double_t decimals = offset - offsetI;
1652 offset = (offsetI % 360) + decimals - 360;
1657 fGdmlE->NewAttr(mainN, 0,
"offset",
TString::Format(
"%.12g", offset));
1658 fGdmlE->NewAttr(mainN, 0,
"unit", unit);
1659 if (strcmp(volref,
"") != 0) {
1660 childN = fGdmlE->NewChild(0, 0,
"volumeref", 0);
1661 fGdmlE->NewAttr(childN, 0,
"ref", volref);
1663 fGdmlE->AddChild(mainN, childN);
1674 const char * clsname = geoShape->
ClassName();
1682 if (strcmp(clsname,
"TGeoBBox") == 0) {
1684 }
else if (strcmp(clsname,
"TGeoParaboloid") == 0) {
1686 }
else if (strcmp(clsname,
"TGeoSphere") == 0) {
1688 }
else if (strcmp(clsname,
"TGeoArb8") == 0) {
1690 }
else if (strcmp(clsname,
"TGeoConeSeg") == 0) {
1692 }
else if (strcmp(clsname,
"TGeoCone") == 0) {
1694 }
else if (strcmp(clsname,
"TGeoPara") == 0) {
1696 }
else if (strcmp(clsname,
"TGeoTrap") == 0) {
1698 }
else if (strcmp(clsname,
"TGeoGtra") == 0) {
1700 }
else if (strcmp(clsname,
"TGeoTrd1") == 0) {
1702 }
else if (strcmp(clsname,
"TGeoTrd2") == 0) {
1704 }
else if (strcmp(clsname,
"TGeoTubeSeg") == 0) {
1706 }
else if (strcmp(clsname,
"TGeoCtub") == 0) {
1708 }
else if (strcmp(clsname,
"TGeoTube") == 0) {
1710 }
else if (strcmp(clsname,
"TGeoPcon") == 0) {
1712 }
else if (strcmp(clsname,
"TGeoTorus") == 0) {
1714 }
else if (strcmp(clsname,
"TGeoPgon") == 0) {
1716 }
else if (strcmp(clsname,
"TGeoEltu") == 0) {
1718 }
else if (strcmp(clsname,
"TGeoHype") == 0) {
1720 }
else if (strcmp(clsname,
"TGeoXtru") == 0) {
1722 }
else if (strcmp(clsname,
"TGeoScaledShape") == 0) {
1725 if (scaleObjClsName ==
"TGeoCone") {
1728 Info(
"ChooseObject",
1729 "ERROR! TGeoScaledShape object is not possible to process correctly. %s object is processed without scale",
1730 scaleObjClsName.
Data());
1736 }
else if (strcmp(clsname,
"TGeoCompositeShape") == 0) {
1738 }
else if (strcmp(clsname,
"TGeoUnion") == 0) {
1740 }
else if (strcmp(clsname,
"TGeoIntersection") == 0) {
1742 }
else if (strcmp(clsname,
"TGeoSubtraction") == 0) {
1745 Info(
"ChooseObject",
"ERROR! %s Solid CANNOT be processed, solid is NOT supported",
1749 if (solidN ==
NULL) {
1771 if (cosb > 0.00001) {
1809 Double_t boxdx = 1E8 * (2 * rmax) + (2 * z);
1870 Bool_t isIN = list[name2check];
1898 TString fstLet = newname(0, 1);
1900 newname =
"O" + newname(1, newname.
Length());
1911 if (newname != oldname) {
1914 "WARNING! Name of the object was changed because it failed to comply with NCNAME xml datatype restrictions.");
1917 "WARNING! Probably more names are going to be changed to comply with NCNAME xml datatype restriction, but it will not be displayed on the screen.");
1923 switch (fgNamingSpeed) {
1925 newname = newname +
"0x" + objPointer;
1929 iter = fNameList->fLstIter[newname];
1935 fNameList->fLstIter[newname]++;
1936 newname = newname + nameIter;
1944 fNameList->fLst[objPointer] = newname;
1957 return !(isProcessed);
1969 if (strcmp(pattName,
"TGeoPatternX") == 0) {
1971 }
else if (strcmp(pattName,
"TGeoPatternCylR") == 0) {
1976 if (strcmp(pattName,
"TGeoPatternY") == 0) {
1978 }
else if (strcmp(pattName,
"TGeoPatternCylPhi") == 0) {
1984 if (strcmp(pattName,
"TGeoPatternZ") == 0) {
1989 return "kUndefined";
1992 return "kUndefined";
2000 if (parValue == 0.) {
2001 Info(
"IsNullParam",
"ERROR! %s is NULL due to %s = %.12g, Volume based on this shape will be skipped",
Double_t GetStOut() const
XMLNodePointer_t CreateMixtureN(TGeoMixture *mixture, XMLNodePointer_t materials, TString mname)
Creates "material" node for GDML with references to other sub elements.
virtual const char * GetTitle() const
Returns title of object.
Double_t GetStart() const
XMLNodePointer_t CreateHypeN(TGeoHype *geoShape)
Creates "hype" node for GDML.
TList * GetListOfMaterials() const
virtual Double_t GetRmin1() const
XMLNodePointer_t CreateFractionN(Double_t percentage, const char *refName)
Creates "fraction" node for GDML.
TGeoVolume * GetVolume() const
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
XMLNodePointer_t CreateParaN(TGeoPara *geoShape)
Creates "para" node for GDML.
TGeoPatternFinder * GetFinder() const
XMLNodePointer_t StartVolumeN(const char *name, const char *solid, const char *material)
Creates "volume" node for GDML.
virtual Double_t GetRmax2() const
TString & ReplaceAll(const TString &s1, const TString &s2)
virtual const Double_t * GetRotationMatrix() const =0
Bool_t HasIsotopes() const
TString ExtractSolid(TGeoShape *volShape)
Method creating solid to xml file and returning its name.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TGeoShape * GetLeftShape() const
Double_t GetScale(Int_t i) const
static const char * filename()
void UnsetTemporaryBits(TGeoManager *geoMng)
Unsetting bits that were changed in gGeoManager during export so that export can be run more times wi...
XMLNodePointer_t CreateMaterialN(TGeoMaterial *material, TString mname)
Creates "material" node for GDML.
Bool_t CanProcess(TObject *pointer)
Method which tests whether solids can be processed.
void ToLower()
Change string to lower-case.
XMLNodePointer_t CreatePositionN(const char *name, Xyz position, const char *type="position", const char *unit="cm")
Creates "position" kind of node for GDML.
void WriteGDMLfile(TGeoManager *geomanager, const char *filename="test.gdml", TString option="")
Wrapper of all exporting methods Creates blank GDML file and fills it with gGeoManager structure conv...
void SetSkipComments(Bool_t on=kTRUE)
std::map< TString, Float_t > NameListF
virtual Double_t GetDY() const
virtual EGeoBoolType GetBooleanOperator() const =0
XMLNodePointer_t CreateXtrusionN(TGeoXtru *geoShape)
Creates "xtru" node for GDML.
Bool_t IsReflection() const
XMLNodePointer_t CreateEllipsoidN(TGeoCompositeShape *geoShape, TString elName)
Creates "ellipsoid" node for GDML this is a special case, because ellipsoid is not defined in ROOT so...
XMLNodePointer_t StartAssemblyN(const char *name)
Creates "assembly" node for GDML.
virtual Double_t GetDZ() const
XMLNodePointer_t CreateTwistedTrapN(TGeoGtra *geoShape)
Creates "twistedtrap" node for GDML.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Double_t GetRmax1() const
const char * Data() const
XMLNodePointer_t CreateElConeN(TGeoScaledShape *geoShape)
Creates "elcone" (elliptical cone) node for GDML this is a special case, because elliptical cone is n...
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
XMLNodePointer_t CreateArb8N(TGeoArb8 *geoShape)
Creates "arb8" node for GDML.
static const double x2[5]
Int_t GetNisotopes() const
XMLNodePointer_t CreateZplaneN(Double_t z, Double_t rmin, Double_t rmax)
Creates "zplane" node for GDML.
XMLNodePointer_t CreateConeN(TGeoConeSeg *geoShape)
Creates "cone" node for GDML from TGeoConeSeg object.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
TGeoMatrix * GetRightMatrix() const
XMLNodePointer_t CreateTrapN(TGeoTrap *geoShape)
Creates "trap" node for GDML.
Bool_t IsInList(NameList list, TString name2check)
Checks whether name2check is in (NameList) list.
Double_t GetY(Int_t i) const
Double_t * GetWmixt() const
XMLNodePointer_t CreateIsotopN(TGeoIsotope *isotope, const char *name)
Creates "isotope" node for GDML.
virtual Double_t GetA() const
Double_t GetAlpha() const
virtual const Double_t * GetScale() const
XMLNodePointer_t ExtractMaterials(TList *materialsLst)
Method exporting materials.
virtual Double_t GetRmax() const
virtual ~TGDMLWrite()
Destructor.
std::map< std::string, std::string >::const_iterator iter
virtual Bool_t IsMixture() const
std::vector< std::vector< double > > Data
Double_t GetTwistAngle() const
virtual TGeoMatrix * GetMatrix() const =0
virtual TGeoElement * GetElement(Int_t i=0) const
Retreive the pointer to the element corresponding to component I.
void SetG4Compatibility(Bool_t G4Compatible)
Double_t ATan2(Double_t, Double_t)
Double_t GetTheta() const
TGeoMaterial * GetMaterial() const
TGeoVolume * GetTopVolume() const
const Double_t * GetNlow() const
XMLNodePointer_t CreateEltubeN(TGeoEltu *geoShape)
Creates "eltube" node for GDML.
Double_t GetXOffset(Int_t i) const
virtual Double_t GetA() const
virtual const Double_t * GetOrigin() const
Double_t GetAlpha2() const
Bool_t IsNullParam(Double_t parValue, TString parName, TString objName)
Check for null parameter to skip the NULL objects.
TObjArray * GetListOfVolumes() const
virtual Int_t GetNelements() const
virtual Double_t GetDX() const
Xyz GetXYZangles(const Double_t *rotationMatrix)
Retrieves X Y Z angles from rotation matrix.
XMLNodePointer_t CreatePhysVolN(const char *name, Int_t copyno, const char *volref, const char *posref, const char *rotref, XMLNodePointer_t scaleN)
Creates "physvol" node for GDML.
virtual Double_t GetRmin2() const
void SetNamingSpeed(ENamingType naming)
Set convetion of naming solids and volumes.
XMLNodePointer_t CreateBoxN(TGeoBBox *geoShape)
Creates "box" node for GDML.
std::map< TString, Bool_t > NameList
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
XMLNodePointer_t CreatePolyconeN(TGeoPcon *geoShape)
Creates "polycone" node for GDML.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
XMLNodePointer_t CreateParaboloidN(TGeoParaboloid *geoShape)
Creates "paraboloid" node for GDML.
XMLNodePointer_t CreateTorusN(TGeoTorus *geoShape)
Creates "torus" node for GDML.
unsigned int r1[N_CITIES]
TGeoShape * GetShape() const
virtual Double_t GetRmin() const
Double_t GetTheta2() const
Bool_t TestBit(UInt_t f) const
TGeoBoolNode * GetBoolNode() const
virtual const char * GetName() const
Returns name of object.
virtual Double_t GetDz() const
TGeoCompositeShape * CreateFakeCtub(TGeoCtub *geoShape)
Method creating cutTube as an intersection of tube and two boxes.
TGeoMatrix * GetLeftMatrix() const
Bool_t TestAttBit(UInt_t f) const
const Double_t * GetNhigh() const
Double_t GetRelativeAbundance(Int_t i) const
Return relative abundance of i-th isotope in this element.
virtual const char * GetName() const
Get the shape name.
virtual Double_t GetRmin() const
TString GenName(TString oldname)
NCNAME basic restrictions Replace "$" character with empty character etc.
TGeoShape * GetRightShape() const
XMLNodePointer_t CreateDivisionN(Double_t offset, Double_t width, Int_t number, const char *axis, const char *unit, const char *volref)
Creates "divisionvol" node for GDML.
Double_t GetYOffset(Int_t i) const
Double_t * GetRmin() const
TGeoShape * GetShape() const
static const double x1[5]
virtual TGeoMatrix & Inverse() const =0
Double_t GetTheta1() const
TGeoScale * GetScale() const
XMLNodePointer_t CreateTrdN(TGeoTrd1 *geoShape)
Creates "trd" node for GDML from object TGeoTrd1.
static const UInt_t fgkProcBitVol
XMLNodePointer_t CreatePolyhedraN(TGeoPgon *geoShape)
Creates "polyhedra" node for GDML.
XMLNodePointer_t CreateAtomN(Double_t atom, const char *unit="g/mole")
Creates "atom" node for GDML.
Double_t GetX(Int_t i) const
Double_t GetTheta() const
virtual Double_t GetZ() const
virtual Int_t GetDivAxis()
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
XMLNodePointer_t ChooseObject(TGeoShape *geoShape)
Chooses the object and method that should be used for processing object.
XMLNodePointer_t CreateSphereN(TGeoSphere *geoShape)
Creates "sphere" node for GDML.
Double_t * GetRmax() const
void ExtractVolumes(TGeoVolume *volume)
Method extracting geometry structure recursively.
virtual Double_t GetDensity() const
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
XMLNodePointer_t CreateTubeN(TGeoTubeSeg *geoShape)
Creates "tube" node for GDML from object TGeoTubeSeg.
Double_t GetAlpha1() const
XMLNodePointer_t CreateDN(Double_t density, const char *unit="g/cm3")
Creates "D" density node for GDML.
static const UInt_t fgkMaxNameErr
virtual Double_t GetDz() const
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
XMLNodePointer_t CreateElementN(TGeoElement *element, XMLNodePointer_t materials, const char *name)
Creates "element" node for GDML element node and attribute.
XMLNodePointer_t CreateCommonBoolN(TGeoCompositeShape *geoShape)
Creates common part of union intersection and subtraction nodes.
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
Set matrix elements according to Euler angles.
Double_t Sqrt(Double_t x)
virtual const Double_t * GetTranslation() const =0
std::map< TString, Int_t > NameListI
XMLNodePointer_t CreateSetupN(const char *topVolName, const char *name="default", const char *version="1.0")
Creates "setup" node for GDML.
TString GetPattAxis(Int_t divAxis, const char *pattName, TString &unit)
Method that retrieves axis and unit along which object is divided.
TGeoIsotope * GetIsotope(Int_t i) const
Return i-th isotope in the element.
unsigned int r2[N_CITIES]
XMLNodePointer_t CreateRotationN(const char *name, Xyz rotation, const char *type="rotation", const char *unit="deg")
Creates "rotation" kind of node for GDML.
virtual Double_t GetRmax() const
static const UInt_t fgkProcBit
virtual Double_t GetB() const
XMLNodePointer_t CreateCutTubeN(TGeoCtub *geoShape)
Creates "cutTube" node for GDML.