173 struct MaterialExtractor {
174 std::set<TGeoMaterial*> materials;
176 materials.insert(
v->GetMaterial());
177 for(
Int_t i=0; i<
v->GetNdaughters(); ++i)
178 (*
this)(
v->GetNode(i)->GetVolume());
194 fgG4Compatibility(0),
241 Info(
"WriteGDMLfile",
"Top volume does not exist!");
245 WriteGDMLfile(geomanager, node, materials, filename, option);
253 TList materials, volumes, nodes;
254 MaterialExtractor extract;
256 Info(
"WriteGDMLfile",
"Invalid Volume reference to extract GDML information!");
266 WriteGDMLfile(geomanager, node, &materials, filename, option);
267 materials.
Clear(
"nodelete");
268 volumes.
Clear(
"nodelete");
269 nodes.
Clear(
"nodelete");
280 const char* filename,
287 Info(
"WriteGDMLfile",
"Geant4 compatibility mode set");
293 Info(
"WriteGDMLfile",
"Fast naming convention with pointer suffix set");
296 Info(
"WriteGDMLfile",
"Naming without prefix set - be careful uniqness of name is not ensured");
299 Info(
"WriteGDMLfile",
"Potentially slow with incremental suffix naming convention set");
303 Int_t outputLayout = 1;
304 const char * krootNodeName =
"gdml";
305 const char * knsRefGeneral =
"http://www.w3.org/2001/XMLSchema-instance";
306 const char * knsNameGeneral =
"xsi";
307 const char * knsRefGdml =
"http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd";
308 const char * knsNameGdml =
"xsi:noNamespaceSchemaLocation";
322 fGdmlE->
NewNS(rootNode, knsRefGeneral, knsNameGeneral);
362 startT = time(
nullptr);
367 Info(
"WriteGDMLfile",
"Extracting volumes");
370 Info(
"WriteGDMLfile",
"%i volumes added",
fVolCnt);
375 endT = time(
nullptr);
383 Double_t tdiffI = difftime(endT, startT);
385 Info(
"WriteGDMLfile",
"Exporting time: %s", tdiffS.
Data());
390 Info(
"WriteGDMLfile",
"File %s saved", filename);
405 TIter next(matrixList);
434 if (!
surfaces->GetEntriesFast())
return;
451 if (!
surfaces->GetEntriesFast())
return;
469 if (!
surfaces->GetEntriesFast())
return;
480 Warning(
"ExtractBorderSurfaces",
"Inconsistent border surface extraction %s: Node %s"
485 Warning(
"ExtractBorderSurfaces",
"Inconsistent border surface extraction %s: Node %s"
501 Info(
"ExtractMaterials",
"Extracting materials");
507 TIter next(materialsLst);
524 Info(
"ExtractMaterials",
"%i materials added", matcnt);
537 if (solidN !=
nullptr)
fSolCnt++;
553 TString volname, matname, solname, pattClsName, nodeVolNameBak;
579 if (solname ==
"-1") {
580 Info(
"ExtractVolumes",
"ERROR! %s volume was not added, because solid is either not supported or corrupted",
607 while ((geoNode = (
TGeoNode *) next())) {
618 if (nodevolname.
Contains(
"missing_")) {
622 nodeVolNameBak = nodevolname;
625 if (isPattern ==
kFALSE) {
627 TString nodename, posname, rotname;
629 nodename = nodename +
"in" + volname;
632 posname = nodename +
"pos";
654 fGdmlE->
NewAttr(scaleN,
nullptr,
"name", (nodename +
"scl").Data());
671 if ((lxyz.
x != 0.0) || (lxyz.
y != 0.0) || (lxyz.
z != 0.0)) {
672 rotname = nodename +
"rot";
684 if (isPattern && pattFinder) {
697 offset = pattFinder->
GetStart() - xlo;
787 for (
Int_t idx = 0; idx < nOfIso; idx++) {
790 Fatal(
"CreateElementN",
"Missing isotopes for element %s", element->
GetName());
815 for (NameListI::iterator itr = wCounter.begin(); itr != wCounter.end(); ++itr) {
816 if (itr->second > 1) {
817 Info(
"CreateMixtureN",
"WARNING! 2 equal isotopes in one element. Check: %s isotope of %s element",
818 itr->first.Data(),
name);
825 Int_t valZ = element->
Z();
850 for (
Int_t idx = 0; idx < nOfElm; idx++) {
862 wPercentage[lname] += mixture->
GetWmixt()[idx];
876 for (NameListI::iterator itr = wCounter.begin(); itr != wCounter.end(); ++itr) {
877 if (itr->second > 1) {
878 Info(
"CreateMixtureN",
"WARNING! 2 equal elements in one material. Check: %s element of %s material",
879 itr->first.Data(), mname.
Data());
888 TIter next(&properties);
890 while ((property = (
TNamed*)next()))
895 if (const_properties.
GetSize()) {
896 TIter next(&const_properties);
898 while ((property = (
TNamed*)next()))
918 if (tmpname ==
"vacuum") {
922 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! ",
926 Info(
"CreateMaterialN",
"WARNING! value of Z in %s material can't be < 1 in Geant4", mname.
Data());
936 TIter next(&properties);
938 while ((property = (
TNamed*)next()))
943 if (const_properties.
GetSize()) {
944 TIter next(&const_properties);
946 while ((property = (
TNamed*)next()))
1137 if ((geoShape->
GetBl1() == 0 || geoShape->
GetTl1() == 0 || geoShape->
GetH1() == 0) ||
1138 (geoShape->
GetBl2() == 0 || geoShape->
GetTl2() == 0 || geoShape->
GetH2() == 0)) {
1183 if ((geoShape->
GetBl1() == 0 && geoShape->
GetTl1() == 0 && geoShape->
GetH1() == 0) ||
1184 (geoShape->
GetBl2() == 0 && geoShape->
GetTl2() == 0 && geoShape->
GetH2() == 0)) {
1201 mainN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"twistedtrap",
nullptr);
1222 Info(
"CreateTwistedTrapN",
1223 "ERROR! Object %s is not exported correctly because parameter Alpha2 is not declared in GDML schema",
1328 Info(
"CreateCutTubeN",
"WARNING! %s - CutTube was replaced by intersection of TGeoTubSeg and two TGeoBBoxes",
1406 for (
Int_t it = 0; it < nZPlns; it++) {
1410 if ((it < nZPlns - 1) && (geoShape->
GetZ(it) == geoShape->
GetZ(it + 1))) {
1419 Info(
"CreatePolyconeN",
"WARNING! One plane was added to %s solid to be compatible with Geant4", lname.
Data());
1421 Info(
"CreatePolyconeN",
"WARNING! Solid %s definition seems not contiguous may cause problems in Geant4", lname.
Data());
1433 Info(
"CreatePolyconeN",
"WARNING! One plane was added to %s solid to be compatible with Geant4", lname.
Data());
1435 Info(
"CreatePolyconeN",
"WARNING! Solid %s definition seems not contiguous may cause problems in Geant4", lname.
Data());
1483 for (
Int_t it = 0; it < geoShape->
GetNz(); it++) {
1554 if (vertNum < 3 || secNum < 2) {
1555 Info(
"CreateXtrusionN",
"ERROR! TGeoXtru %s has only %i vertices and %i sections. It was not exported",
1556 lname.
Data(), vertNum, secNum);
1560 for (
Int_t it = 0; it < vertNum; it++) {
1562 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"twoDimVertex",
nullptr);
1567 for (
Int_t it = 0; it < secNum; it++) {
1607 Double_t zcut1 = 2 * zorig - zcut2;
1633 Double_t zmax = zcut * ((rx1 + rx2) / (rx1 - rx2));
1660 lboolType =
"union";
1663 lboolType =
"subtraction";
1666 lboolType =
"intersection";
1681 if (strcmp(leftS->
ClassName(),
"TGeoScaledShape") == 0 &&
1682 strcmp(rightS->
ClassName(),
"TGeoBBox") == 0) {
1684 if (lboolType ==
"intersection") {
1691 Xyz translL, translR;
1709 if (ndL !=
nullptr) {
1713 if (lname.
Contains(
"missing_") || lname ==
"") {
1714 Info(
"CreateCommonBoolN",
"ERROR! Left node is NULL - Boolean Shape will be skipped");
1718 if (ndR !=
nullptr) {
1722 if (rname.
Contains(
"missing_") || rname ==
"") {
1723 Info(
"CreateCommonBoolN",
"ERROR! Right node is NULL - Boolean Shape will be skipped");
1752 if ((translL.
x != 0.0) || (translL.
y != 0.0) || (translL.
z != 0.0)) {
1753 childN =
CreatePositionN((nodeName + lname +
"pos").Data(), translL,
"firstposition");
1757 if ((lrot.
x != 0.0) || (lrot.
y != 0.0) || (lrot.
z != 0.0)) {
1758 childN =
CreateRotationN((nodeName + lname +
"rot").Data(), lrot,
"firstrotation");
1762 if ((translR.
x != 0.0) || (translR.
y != 0.0) || (translR.
z != 0.0)) {
1763 childN =
CreatePositionN((nodeName + rname +
"pos").Data(), translR,
"position");
1767 if ((rrot.
x != 0.0) || (rrot.
y != 0.0) || (rrot.
z != 0.0)) {
1768 childN =
CreateRotationN((nodeName + rname +
"rot").Data(), rrot,
"rotation");
1791 TIter next(&properties);
1793 while ((property = (
TNamed*)next()))
1808 auto childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"volumeref",
nullptr);
1823 auto childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"physvolref",
nullptr);
1865 std::stringstream vals;
1866 size_t cols = matrix->
GetCols();
1867 size_t rows = matrix->
GetRows();
1871 for(
size_t i=0; i<rows; ++i) {
1872 for(
size_t j=0; j<cols; ++j) {
1873 vals << matrix->
Get(i,j);
1874 if ( j < cols-1 ) vals <<
' ';
1876 if ( i < rows-1 ) vals <<
'\n';
1878 fGdmlE->
NewAttr(mainN,
nullptr,
"values", vals.str().c_str());
1916 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"materialref",
nullptr);
1920 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"solidref",
nullptr);
1949 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"volumeref",
nullptr);
1953 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"positionref",
nullptr);
1958 if (strcmp(rotref,
"") != 0) {
1959 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"rotationref",
nullptr);
1963 if (scaleN !=
nullptr) {
1984 if ((offset >= 0.) && (strcmp(axis,
"kPhi") == 0)) {
1986 Double_t decimals = offset - offsetI;
1988 offset = (offsetI % 360) + decimals - 360;
1995 if (strcmp(volref,
"") != 0) {
1996 childN =
fGdmlE->
NewChild(
nullptr,
nullptr,
"volumeref",
nullptr);
2010 const char * clsname = geoShape->
ClassName();
2018 if (strcmp(clsname,
"TGeoBBox") == 0) {
2020 }
else if (strcmp(clsname,
"TGeoParaboloid") == 0) {
2022 }
else if (strcmp(clsname,
"TGeoSphere") == 0) {
2024 }
else if (strcmp(clsname,
"TGeoArb8") == 0) {
2026 }
else if (strcmp(clsname,
"TGeoConeSeg") == 0) {
2028 }
else if (strcmp(clsname,
"TGeoCone") == 0) {
2030 }
else if (strcmp(clsname,
"TGeoPara") == 0) {
2032 }
else if (strcmp(clsname,
"TGeoTrap") == 0) {
2034 }
else if (strcmp(clsname,
"TGeoGtra") == 0) {
2036 }
else if (strcmp(clsname,
"TGeoTrd1") == 0) {
2038 }
else if (strcmp(clsname,
"TGeoTrd2") == 0) {
2040 }
else if (strcmp(clsname,
"TGeoTubeSeg") == 0) {
2042 }
else if (strcmp(clsname,
"TGeoCtub") == 0) {
2044 }
else if (strcmp(clsname,
"TGeoTube") == 0) {
2046 }
else if (strcmp(clsname,
"TGeoPcon") == 0) {
2048 }
else if (strcmp(clsname,
"TGeoTorus") == 0) {
2050 }
else if (strcmp(clsname,
"TGeoPgon") == 0) {
2052 }
else if (strcmp(clsname,
"TGeoEltu") == 0) {
2054 }
else if (strcmp(clsname,
"TGeoHype") == 0) {
2056 }
else if (strcmp(clsname,
"TGeoXtru") == 0) {
2058 }
else if (strcmp(clsname,
"TGeoScaledShape") == 0) {
2061 if (scaleObjClsName ==
"TGeoCone") {
2064 Info(
"ChooseObject",
2065 "ERROR! TGeoScaledShape object is not possible to process correctly. %s object is processed without scale",
2066 scaleObjClsName.
Data());
2072 }
else if (strcmp(clsname,
"TGeoCompositeShape") == 0) {
2074 }
else if (strcmp(clsname,
"TGeoUnion") == 0) {
2076 }
else if (strcmp(clsname,
"TGeoIntersection") == 0) {
2078 }
else if (strcmp(clsname,
"TGeoSubtraction") == 0) {
2081 Info(
"ChooseObject",
"ERROR! %s Solid CANNOT be processed, solid is NOT supported",
2085 if (solidN ==
nullptr) {
2107 if (cosb > 0.00001) {
2145 Double_t boxdx = 1E8 * (2 * rmax) + (2 * z);
2206 Bool_t isIN = list[name2check];
2234 TString fstLet = newname(0, 1);
2236 newname =
"O" + newname(1, newname.
Length());
2247 if (newname != oldname) {
2250 "WARNING! Name of the object was changed because it failed to comply with NCNAME xml datatype restrictions.");
2253 "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.");
2261 newname = newname +
"0x" + objPointer;
2272 newname = newname + nameIter;
2292 return !(isProcessed);
2304 if (strcmp(pattName,
"TGeoPatternX") == 0) {
2306 }
else if (strcmp(pattName,
"TGeoPatternCylR") == 0) {
2311 if (strcmp(pattName,
"TGeoPatternY") == 0) {
2313 }
else if (strcmp(pattName,
"TGeoPatternCylPhi") == 0) {
2319 if (strcmp(pattName,
"TGeoPatternZ") == 0) {
2324 return "kUndefined";
2327 return "kUndefined";
2335 if (parValue == 0.) {
2336 Info(
"IsNullParam",
"ERROR! %s is NULL due to %s = %.12g, Volume based on this shape will be skipped",
2371 TList materials, volumes, nodes;
2372 MaterialExtractor extract;
2374 Info(
"WriteGDMLfile",
"Invalid Volume reference to extract GDML information!");
2384 WriteGDMLfile(geomanager, volume, &materials, filename, option);
2385 materials.
Clear(
"nodelete");
2386 volumes.
Clear(
"nodelete");
2387 nodes.
Clear(
"nodelete");
2398 TList* materialsLst,
2399 const char* filename,
2406 Info(
"WriteGDMLfile",
"Geant4 compatibility mode set");
2412 Info(
"WriteGDMLfile",
"Fast naming convention with pointer suffix set");
2415 Info(
"WriteGDMLfile",
"Naming without prefix set - be careful uniqness of name is not ensured");
2418 Info(
"WriteGDMLfile",
"Potentially slow with incremental suffix naming convention set");
2422 Int_t outputLayout = 1;
2423 const char * krootNodeName =
"gdml";
2424 const char * knsRefGeneral =
"http://www.w3.org/2001/XMLSchema-instance";
2425 const char * knsNameGeneral =
"xsi";
2426 const char * knsRefGdml =
"http://service-spi.web.cern.ch/service-spi/app/releases/GDML/schema/gdml.xsd";
2427 const char * knsNameGdml =
"xsi:noNamespaceSchemaLocation";
2441 fGdmlE->
NewNS(rootNode, knsRefGeneral, knsNameGeneral);
2442 fGdmlE->
NewAttr(rootNode,
nullptr, knsNameGdml, knsRefGdml);
2480 time_t startT, endT;
2481 startT = time(
nullptr);
2486 Info(
"WriteGDMLfile",
"Extracting volumes");
2488 Info(
"WriteGDMLfile",
"%i solids added",
fSolCnt);
2489 Info(
"WriteGDMLfile",
"%i volumes added",
fVolCnt);
2494 endT = time(
nullptr);
2502 Double_t tdiffI = difftime(endT, startT);
2504 Info(
"WriteGDMLfile",
"Exporting time: %s", tdiffS.
Data());
2509 Info(
"WriteGDMLfile",
"File %s saved", filename);
2526 TString volname, matname, solname, pattClsName, nodeVolNameBak;
2550 if (solname ==
"-1") {
2551 Info(
"ExtractVolumes",
"ERROR! %s volume was not added, because solid is either not supported or corrupted",
2574 TIter next(nodeLst);
2578 while ((geoNode = (
TGeoNode *) next())) {
2588 if (nodevolname.
Contains(
"missing_")) {
2592 nodeVolNameBak = nodevolname;
2595 if (isPattern ==
kFALSE) {
2597 TString nodename, posname, rotname;
2599 nodename = nodename +
"in" + volname;
2602 posname = nodename +
"pos";
2624 fGdmlE->
NewAttr(scaleN,
nullptr,
"name", (nodename +
"scl").Data());
2641 if ((lxyz.
x != 0.0) || (lxyz.
y != 0.0) || (lxyz.
z != 0.0)) {
2642 rotname = nodename +
"rot";
2654 if (isPattern && pattFinder) {
2656 Int_t ndiv, divaxis;
2667 offset = pattFinder->
GetStart() - xlo;
static const double x2[5]
static const double x1[5]
include TDocParser_001 C image html pict1_TDocParser_001 png width
TRObject operator()(const T1 &t1) const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class is used in the process of reading and writing the GDML "matrix" tag.
Double_t Get(size_t r, size_t c) const
This class contains implementation of converting ROOT's gGeoManager geometry to GDML file.
XMLNodePointer_t fSolidsNode
void UnsetTemporaryBits(TGeoManager *geoMng)
Unsetting bits that were changed in gGeoManager during export so that export can be run more times wi...
std::map< TString, Bool_t > NameList
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.
static const UInt_t fgkProcBitVol
XMLNodePointer_t CreatePolyconeN(TGeoPcon *geoShape)
Creates "polycone" node for GDML.
XMLNodePointer_t CreateFractionN(Double_t percentage, const char *refName)
Creates "fraction" node for GDML.
void ExtractMatrices(TObjArray *matrices)
Method exporting GDML matrices.
XMLDocPointer_t fGdmlFile
void SetG4Compatibility(Bool_t G4Compatible)
XMLNodePointer_t CreateParaboloidN(TGeoParaboloid *geoShape)
Creates "paraboloid" node for GDML.
TGeoCompositeShape * CreateFakeCtub(TGeoCtub *geoShape)
Method creating cutTube as an intersection of tube and two boxes.
TGDMLWrite()
Default constructor.
XMLNodePointer_t CreateBoxN(TGeoBBox *geoShape)
Creates "box" node for GDML.
std::map< TString, Float_t > NameListF
XMLNodePointer_t CreateMaterialN(TGeoMaterial *material, TString mname)
Creates "material" node for GDML.
XMLNodePointer_t CreateSphereN(TGeoSphere *geoShape)
Creates "sphere" node for GDML.
XMLNodePointer_t CreateTwistedTrapN(TGeoGtra *geoShape)
Creates "twistedtrap" node for GDML.
XMLNodePointer_t CreateZplaneN(Double_t z, Double_t rmin, Double_t rmax)
Creates "zplane" node for GDML.
static const UInt_t fgkMaxNameErr
Bool_t IsNullParam(Double_t parValue, TString parName, TString objName)
Check for null parameter to skip the NULL objects.
static TGDMLWrite * fgGDMLWrite
TString ExtractSolid(TGeoShape *volShape)
Method creating solid to xml file and returning its name.
XMLNodePointer_t CreateHypeN(TGeoHype *geoShape)
Creates "hype" node for GDML.
XMLNodePointer_t CreateElConeN(TGeoScaledShape *geoShape)
Creates "elcone" (elliptical cone) node for GDML this is a special case, because elliptical cone is n...
XMLNodePointer_t CreateConstantN(const char *name, Double_t value)
Creates "constant" kind of node for GDML.
XMLNodePointer_t CreateMatrixN(TGDMLMatrix const *matrix)
Creates "matrix" kind of node for GDML.
XMLNodePointer_t CreateOpticalSurfaceN(TGeoOpticalSurface *geoSurf)
Creates "opticalsurface" node for GDML.
XMLNodePointer_t CreateMixtureN(TGeoMixture *mixture, XMLNodePointer_t materials, TString mname)
Creates "material" node for GDML with references to other sub elements.
std::map< TString, Int_t > NameListI
void ExtractBorderSurfaces(TObjArray *surfaces)
Method exporting border surfaces.
static const UInt_t fgkProcBit
floating point precision when writing
Bool_t CanProcess(TObject *pointer)
Method which tests whether solids can be processed.
XMLNodePointer_t CreatePolyhedraN(TGeoPgon *geoShape)
Creates "polyhedra" node for GDML.
void WriteGDMLfile(TGeoManager *geomanager, const char *filename="test.gdml", TString option="")
XMLNodePointer_t CreateRotationN(const char *name, Xyz rotation, const char *type="rotation", const char *unit="deg")
Creates "rotation" kind of node for GDML.
XMLNodePointer_t CreatePositionN(const char *name, Xyz position, const char *type="position", const char *unit="cm")
Creates "position" kind of node for GDML.
XMLNodePointer_t CreatePropertyN(TNamed const &property)
Creates "property" node for GDML.
XMLNodePointer_t CreateElementN(TGeoElement *element, XMLNodePointer_t materials, const char *name)
Creates "element" node for GDML element node and attribute.
XMLNodePointer_t CreateConeN(TGeoConeSeg *geoShape)
Creates "cone" node for GDML from TGeoConeSeg object.
XMLNodePointer_t CreateSkinSurfaceN(TGeoSkinSurface *geoSurf)
Creates "skinsurface" node for GDML.
XMLNodePointer_t CreateCutTubeN(TGeoCtub *geoShape)
Creates "cutTube" node for GDML.
XMLNodePointer_t fStructureNode
void ExtractSkinSurfaces(TObjArray *surfaces)
Method exporting skin surfaces.
XMLNodePointer_t fDefineNode
virtual ~TGDMLWrite()
Destructor.
XMLNodePointer_t CreateTorusN(TGeoTorus *geoShape)
Creates "torus" node for GDML.
XMLNodePointer_t ExtractMaterials(TList *materialsLst)
Method exporting materials.
XMLNodePointer_t fMaterialsNode
void ExtractOpticalSurfaces(TObjArray *surfaces)
Method exporting optical surfaces.
XMLNodePointer_t CreateDN(Double_t density, const char *unit="g/cm3")
Creates "D" density node for GDML.
void ExtractConstants(TGeoManager *geom)
Method exporting GDML matrices.
XMLNodePointer_t CreateArb8N(TGeoArb8 *geoShape)
Creates "arb8" node for GDML.
XMLNodePointer_t StartVolumeN(const char *name, const char *solid, const char *material)
Creates "volume" node for GDML.
void SetNamingSpeed(ENamingType naming)
Set convention of naming solids and volumes.
TString GetPattAxis(Int_t divAxis, const char *pattName, TString &unit)
Method that retrieves axis and unit along which object is divided.
TString GenName(TString oldname)
NCNAME basic restrictions Replace "$" character with empty character etc.
XMLNodePointer_t CreateXtrusionN(TGeoXtru *geoShape)
Creates "xtru" node for GDML.
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.
Bool_t IsInList(NameList list, TString name2check)
Checks whether name2check is in (NameList) list.
XMLNodePointer_t StartAssemblyN(const char *name)
Creates "assembly" node for GDML.
XMLNodePointer_t CreateParaN(TGeoPara *geoShape)
Creates "para" node for GDML.
XMLNodePointer_t CreateSetupN(const char *topVolName, const char *name="default", const char *version="1.0")
Creates "setup" node for GDML.
XMLNodePointer_t CreateTrapN(TGeoTrap *geoShape)
Creates "trap" node for GDML.
Xyz GetXYZangles(const Double_t *rotationMatrix)
Retrieves X Y Z angles from rotation matrix.
XMLNodePointer_t CreateTubeN(TGeoTubeSeg *geoShape)
Creates "tube" node for GDML from object TGeoTubeSeg.
XMLNodePointer_t CreateBorderSurfaceN(TGeoBorderSurface *geoSurf)
Creates "bordersurface" node for GDML.
XMLNodePointer_t CreateAtomN(Double_t atom, const char *unit="g/mole")
Creates "atom" node for GDML.
XMLNodePointer_t CreateEltubeN(TGeoEltu *geoShape)
Creates "eltube" node for GDML.
void ExtractVolumes(TGeoNode *topNode)
Method extracting geometry structure recursively.
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 CreateIsotopN(TGeoIsotope *isotope, const char *name)
Creates "isotope" node for GDML.
XMLNodePointer_t CreateCommonBoolN(TGeoCompositeShape *geoShape)
Creates common part of union intersection and subtraction nodes.
XMLNodePointer_t CreateTrdN(TGeoTrd1 *geoShape)
Creates "trd" node for GDML from object TGeoTrd1.
XMLNodePointer_t ChooseObject(TGeoShape *geoShape)
Chooses the object and method that should be used for processing object.
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
Bool_t TestAttBit(UInt_t f) const
virtual const Double_t * GetOrigin() const
virtual Double_t GetDX() const
virtual Double_t GetDZ() const
virtual Double_t GetDY() const
virtual EGeoBoolType GetBooleanOperator() const =0
TGeoMatrix * GetRightMatrix() const
TGeoShape * GetLeftShape() const
TGeoMatrix * GetLeftMatrix() const
TGeoShape * GetRightShape() const
TGeoNode const * GetNode2() const
TGeoOpticalSurface const * GetSurface() const
TGeoNode const * GetNode1() const
Class describing rotation + translation.
Class handling Boolean composition of shapes.
TGeoBoolNode * GetBoolNode() const
A phi segment of a conical tube.
virtual Double_t GetRmax2() const
virtual Double_t GetDz() const
virtual Double_t GetRmin2() const
virtual Double_t GetRmin1() const
virtual Double_t GetRmax1() const
A tube segment cut with 2 planes.
const Double_t * GetNlow() const
const Double_t * GetNhigh() const
Base class for chemical elements.
Int_t GetNisotopes() const
Bool_t HasIsotopes() const
Double_t GetRelativeAbundance(Int_t i) const
Return relative abundance of i-th isotope in this element.
TGeoIsotope * GetIsotope(Int_t i) const
Return i-th isotope in the element.
virtual Double_t GetA() const
virtual Double_t GetB() const
Gtra is a twisted trapezoid.
Double_t GetTwistAngle() const
virtual const Double_t * GetRotationMatrix() const
Hyperboloid class defined by 5 parameters.
Double_t GetStOut() const
The manager class for any TGeo geometry.
TObjArray * GetListOfVolumes() const
TObjArray * GetListOfSkinSurfaces() const
TObjArray * GetListOfGDMLMatrices() const
Int_t GetNproperties() const
TObjArray * GetListOfBorderSurfaces() const
TGeoNode * GetTopNode() const
Double_t GetProperty(const char *name, Bool_t *error=nullptr) const
Get a user-defined property.
TObjArray * GetListOfOpticalSurfaces() const
TList * GetListOfMaterials() const
Base class describing materials.
virtual Bool_t IsMixture() const
TList const & GetConstProperties() const
TList const & GetProperties() const
virtual Double_t GetA() const
virtual Double_t GetDensity() const
virtual Double_t GetZ() const
Geometrical transformation package.
virtual const Double_t * GetTranslation() const =0
Bool_t IsReflection() const
virtual const Double_t * GetRotationMatrix() const =0
virtual TGeoHMatrix Inverse() const =0
virtual TGeoElement * GetElement(Int_t i=0) const
Retrieve the pointer to the element corresponding to component I.
Double_t * GetWmixt() const
virtual Int_t GetNelements() const
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoVolume * GetVolume() const
virtual TGeoMatrix * GetMatrix() const =0
TList const & GetProperties() const
static const char * ModelToString(ESurfaceModel model)
static const char * TypeToString(ESurfaceType type)
ESurfaceModel GetModel() const
ESurfaceFinish GetFinish() const
static const char * FinishToString(ESurfaceFinish finish)
Double_t GetValue() const
ESurfaceType GetType() const
Double_t GetAlpha() const
Double_t GetTheta() const
Base finder class for patterns.
virtual Int_t GetDivAxis()
Double_t GetStart() const
Double_t * GetRmax() const
Double_t * GetRmin() const
Class describing rotations.
void SetAngles(Double_t phi, Double_t theta, Double_t psi)
Set matrix elements according to Euler angles.
virtual const Double_t * GetScale() const
A shape scaled by a TGeoScale transformation.
TGeoShape * GetShape() const
TGeoScale * GetScale() const
Base abstract class for all shapes.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
virtual const char * GetName() const
Get the shape name.
TGeoVolume const * GetVolume() const
TGeoOpticalSurface const * GetSurface() const
virtual Double_t GetRmin() const
Double_t GetTheta2() const
virtual Double_t GetRmax() const
Double_t GetTheta1() const
Class describing translations.
TRAP is a general trapezoid, i.e.
Double_t GetAlpha2() const
Double_t GetTheta() const
Double_t GetAlpha1() const
A trapezoid with only x length varying with z.
A trapezoid with both x and y lengths varying with z.
virtual Double_t GetRmin() const
virtual Double_t GetDz() const
virtual Double_t GetRmax() const
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoMaterial * GetMaterial() const
TGeoPatternFinder * GetFinder() const
Bool_t IsTopVolume() const
True if this is the top volume of the geometry.
TGeoShape * GetShape() const
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
An extrusion with fixed outline shape in x-y and a sequence of z extents (segments).
Double_t GetYOffset(Int_t i) const
Double_t GetY(Int_t i) const
Double_t GetScale(Int_t i) const
Double_t GetXOffset(Int_t i) const
Double_t GetX(Int_t i) const
virtual void Add(TObject *obj)
virtual void Clear(Option_t *option="")
Remove all objects from the list.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t GetEntriesFast() const
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
void ToLower()
Change string to lower-case.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
XMLNodePointer_t NewChild(XMLNodePointer_t parent, XMLNsPointer_t ns, const char *name, const char *content=nullptr)
create new child element for parent node
XMLAttrPointer_t NewAttr(XMLNodePointer_t xmlnode, XMLNsPointer_t, const char *name, const char *value)
creates new attribute for xmlnode, namespaces are not supported for attributes
void SaveDoc(XMLDocPointer_t xmldoc, const char *filename, Int_t layout=1)
store document content to file if layout<=0, no any spaces or newlines will be placed between xmlnode...
void FreeDoc(XMLDocPointer_t xmldoc)
frees allocated document data and deletes document itself
void AddChild(XMLNodePointer_t parent, XMLNodePointer_t child)
add child element to xmlnode
XMLNsPointer_t NewNS(XMLNodePointer_t xmlnode, const char *reference, const char *name=nullptr)
create namespace attribute for xmlnode.
XMLDocPointer_t NewDoc(const char *version="1.0")
creates new xml document with provided version
void SetSkipComments(Bool_t on=kTRUE)
void DocSetRootElement(XMLDocPointer_t xmldoc, XMLNodePointer_t xmlnode)
set main (root) node for document
static constexpr double rad
static constexpr double m2
Double_t ATan2(Double_t y, Double_t x)
constexpr Double_t E()
Base of natural log:
constexpr Double_t DegToRad()
Conversion from degree to radian:
Double_t Sqrt(Double_t x)
constexpr Double_t RadToDeg()
Conversion from radian to degree: