403 if (!
gROOT->GetListOfGeometries()->FindObject(
this))
404 gROOT->GetListOfGeometries()->Add(
this);
405 if (!
gROOT->GetListOfBrowsables()->FindObject(
this))
406 gROOT->GetListOfBrowsables()->Add(
this);
409 BuildDefaultMaterials();
410 if (fgVerboseLevel > 0)
411 Info(
"TGeoManager",
"Geometry %s, %s created", GetName(), GetTitle());
423 Fatal(
"Init",
"New geometry created while the old one locked !!!");
447 fNodes =
new TObjArray(30);
458 fMedia =
new THashList(200, 3);
513 if (
gROOT->GetListOfFiles()) {
514 gROOT->GetListOfGeometries()->Remove(
this);
515 gROOT->GetListOfBrowsables()->Remove(
this);
650 Warning(
"AddProperty",
"Property \"%s\" already exists with value %g",
property, (
pos.first)->second);
749 Error(
"AddVolume",
"invalid volume");
798 std::thread::id threadId = std::this_thread::get_id();
799 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
800 TGeoNavigatorArray *array =
nullptr;
804 array =
new TGeoNavigatorArray(
this);
805 fNavigators.insert(NavigatorsMap_t::value_type(threadId, array));
820 TTHREAD_TLS(TGeoNavigator *) tnav =
nullptr;
823 TGeoNavigator *nav = tnav;
826 std::thread::id threadId = std::this_thread::get_id();
827 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
830 TGeoNavigatorArray *array = it->second;
841 std::thread::id threadId = std::this_thread::get_id();
842 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
845 TGeoNavigatorArray *array = it->second;
854 std::thread::id threadId = std::this_thread::get_id();
855 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
857 Error(
"SetCurrentNavigator",
"No navigator defined for this thread\n");
858 std::cout <<
" thread id: " << threadId << std::endl;
861 TGeoNavigatorArray *array = it->second;
864 Error(
"SetCurrentNavigator",
"Navigator %d not existing for this thread\n",
index);
865 std::cout <<
" thread id: " << threadId << std::endl;
888 TGeoNavigatorArray *arr =
nullptr;
907 TGeoNavigatorArray *arr = (*it).second;
919 Error(
"Remove navigator",
"Navigator %p not found", nav);
930 Error(
"SetMaxThreads",
"Cannot set maximum number of threads before closing the geometry");
935 std::thread::id threadId = std::this_thread::get_id();
936 NavigatorsMap_t::const_iterator it =
fNavigators.find(threadId);
938 TGeoNavigatorArray *array = it->second;
940 fNavigators.insert(NavigatorsMap_t::value_type(threadId, array));
963 while ((vol = (TGeoVolume *)next()))
978 while ((vol = (TGeoVolume *)next()))
1004 TTHREAD_TLS(
Int_t) tid = -1;
1010 std::thread::id threadId = std::this_thread::get_id();
1046 TString browserImp(
gEnv->GetValue(
"Browser.Name",
"TRootBrowserLite"));
1047 TQObject::Connect(browserImp.Data(),
"Checked(TObject*,Bool_t)",
"TGeoManager",
this,
1048 "SetVisibility(TObject*,Bool_t)");
1066 TGeoVolume *vol = (TGeoVolume *)obj;
1070 TGeoNode *node = (TGeoNode *)obj;
1084 fPainter->BombTranslation(tr, bombtr);
1094 fPainter->UnbombTranslation(tr, bombtr);
1131 if (!vorig || !vnew)
1140 Error(
"ReplaceVolume",
"Replacement volume %s has no medium and it is not an assembly", vnew->
GetName());
1143 if (mnew && checkmed) {
1145 Warning(
"ReplaceVolume",
"Replacement volume %s has different medium than original volume %s", vnew->
GetName(),
1157 TGeoVoxelFinder *voxels;
1158 for (i = 0; i < nvol; i++) {
1159 vol = (TGeoVolume *)
fVolumes->At(i);
1162 if (vol == vorig || vol == vnew)
1165 for (j = 0; j < nd; j++) {
1176 Info(
"ReplaceVolume",
"%s replaced with assembly and declared NON-OVERLAPPING!", node->
GetName());
1188 Info(
"ReplaceVolume",
"%s inside substitute assembly %s declared NON-OVERLAPPING!", node->
GetName(),
1197 "Volumes should not be replaced with assemblies if they are positioned in containers having a different "
1198 "medium ID.\n %i occurrences for assembly replacing volume %s",
1210 TGeoVoxelFinder *voxels;
1211 for (
Int_t i = 0; i < nvol; i++) {
1212 vol = (TGeoVolume *)
fVolumes->At(i);
1230 Warning(
"TransformVolumeToAssembly",
"Volume %s not found", vname);
1237 TGeoVolume *transformed;
1238 while (
index < indmax) {
1247 Warning(
"TransformVolumeToAssembly",
"Volume %s already assembly", toTransform->
GetName());
1249 Warning(
"TransformVolumeToAssembly",
"Volume %s has no daughters, cannot transform",
1252 Warning(
"TransformVolumeToAssembly",
"Volume %s divided, cannot transform", toTransform->
GetName());
1256 if (
index >= indmax)
1259 if (!strcmp(toTransform->
GetName(), vname))
1357 return TGeoBuilder::Instance(
this)->
Medium(
name, numed, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil,
1436 TGeoMaterial *mater;
1437 while ((mater = (TGeoMaterial *)next())) {
1444 while ((med = (TGeoMedium *)next1())) {
1451 while ((shape = (TGeoShape *)next2())) {
1454 ((TGeoCompositeShape *)shape)->GetBoolNode()->RegisterMatrices();
1459 while ((matrix = (TGeoMatrix *)next3())) {
1464 while ((matrix = (TGeoMatrix *)next4())) {
1470 while ((vol = (TGeoVolume *)next5()))
1490 TGeoVolume *vol =
nullptr;
1491 while ((vol = (TGeoVolume *)next())) {
1506 Warning(
"CloseGeometry",
"geometry already closed");
1510 Error(
"CloseGeometry",
"you MUST call SetTopVolume() first !");
1513 if (!
gROOT->GetListOfGeometries()->FindObject(
this))
1514 gROOT->GetListOfGeometries()->Add(
this);
1515 if (!
gROOT->GetListOfBrowsables()->FindObject(
this))
1516 gROOT->GetListOfBrowsables()->Add(
this);
1524 Bool_t nodeid = opt.Contains(
"i");
1526 TGeoNavigator *nav =
nullptr;
1527 Int_t nnavigators = 0;
1531 Info(
"CloseGeometry",
"Geometry loaded from file...");
1537 Error(
"CloseGeometry",
"Master volume not streamed");
1542 Info(
"CloseGeometry",
"Voxelization retrieved from file");
1548 if (!opt.Contains(
"nv")) {
1552 for (
Int_t i = 0; i < nnavigators; i++) {
1564 for (i = 0; i < ngvol; i++)
1566 for (i = 0; i < nvol; i++)
1572 Info(
"CloseGeometry",
"Recreating parallel world %s ...",
fParallelWorld->GetName());
1580 Info(
"CloseGeometry",
"----------------modeler ready----------------");
1591 Info(
"CloseGeometry",
"Counting nodes...");
1599 if (!opt.Contains(
"nv")) {
1604 while ((vol = (TGeoVolume *)next())) {
1609 Info(
"CloseGeometry",
"Building cache...");
1611 for (
Int_t i = 0; i < nnavigators; i++) {
1621 Info(
"CloseGeometry",
"----------------modeler ready----------------");
1642 if (
fShapes->FindObject(shape))
1643 fShapes->Remove((TGeoShape *)shape);
1657 TGeoVolume *vol =
nullptr;
1751 Info(
"ConvertReflections",
"Converting reflections in: %s - %s ...",
GetName(),
GetTitle());
1754 TGeoNodeMatrix *nodematrix;
1755 TGeoMatrix *matrix, *mclone;
1756 TGeoVolume *reflected;
1757 while ((node = next())) {
1762 mclone =
new TGeoCombiTrans(*matrix);
1766 nodematrix = (TGeoNodeMatrix *)node;
1775 Info(
"ConvertReflections",
"Done");
1785 Error(
"CountLevels",
"Top node not defined.");
1793 Info(
"CountLevels",
"Fixing volume reference counts");
1797 Int_t maxvertices = 1;
1798 while ((node = next())) {
1801 for (
Int_t ibit = 10; ibit < 14; ibit++) {
1808 if (next.GetLevel() > maxlevel)
1809 maxlevel = next.GetLevel();
1812 if (xtru->
GetNvert() > maxvertices)
1832 top = (TGeoVolume *)vol;
1863 if (tmin < 0 || tmin >= tmax || nframes < 1)
1875 if (opt.Contains(
"/S"))
1878 if (opt.Contains(
"/G"))
1883 Double_t end[6] = {0, 0, 0, 0, 0, 0};
1884 Double_t dd[6] = {0, 0, 0, 0, 0, 0};
1885 Double_t dlat = 0, dlong = 0, dpsi = 0;
1887 fPainter->EstimateCameraMove(tmin + 5 * dt, tmin + 15 * dt,
start, end);
1888 for (i = 0; i < 3; i++) {
1890 end[i + 3] = 20 + 0.9 * end[i + 3];
1892 for (i = 0; i < 6; i++) {
1893 dd[i] = (end[i] -
start[i]) / 10.;
1896 fPainter->GetViewAngles(dlong, dlat, dpsi);
1897 dlong = (-206 - dlong) /
Double_t(nframes);
1898 dlat = (126 - dlat) /
Double_t(nframes);
1899 dpsi = (75 - dpsi) /
Double_t(nframes);
1903 for (i = 0; i < nframes; i++) {
1909 for (j = 0; j < 6; j++)
1911 fPainter->GrabFocus(1, dlong, dlat, dpsi);
1930 TVirtualGeoTrack *track;
1991 static char defaultname[5] = {
"XXX"};
2015 Warning(
"SetPdgName",
"No more than 256 different pdg codes allowed");
2036 Error(
"AddGDMLMatrix",
"Matrix %s already added to manager", mat->
GetName());
2055 Error(
"AddOpticalSurface",
"Surface %s already added to manager", optsurf->
GetName());
2074 Error(
"AddSkinSurface",
"Surface %s already added to manager", surf->
GetName());
2093 Error(
"AddBorderSurface",
"Surface %s already added to manager", surf->
GetName());
2121 fPainter->GetBombFactors(bombx, bomby, bombz, bombr);
2124 bombx = bomby = bombz = bombr = 1.3;
2205 TVirtualGeoTrack *trk =
nullptr;
2211 TVirtualGeoTrack *prim;
2212 while ((prim = (TVirtualGeoTrack *)next())) {
2225 TVirtualGeoTrack *track;
2227 if ((track = (TVirtualGeoTrack *)
fTracks->UncheckedAt(i))) {
2228 if (track->
GetId() ==
id)
2242 if (track->
GetId() ==
id)
2253 TVirtualGeoTrack *track;
2255 if ((track = (TVirtualGeoTrack *)
fTracks->UncheckedAt(i))) {
2256 if (track->
GetId() ==
id)
2288 const TGeoColorScheme *scheme = cs ? cs : &defaultCS;
2290 TGeoVolume *vol =
nullptr;
2293 while ((vol = (TGeoVolume *)next())) {
2323 if (strstr(
name,
"*"))
2327 TString chatt = att;
2329 while ((volume = (TGeoVolume *)next())) {
2345 while ((volume = (TGeoVolume *)next1())) {
2361 Warning(
"SetVolumeAttribute",
"volume: %s does not exist",
name);
2371 fPainter->SetBombFactors(bombx, bomby, bombz, bombr);
2395 Info(
"SetMaxVisNodes",
"Automatic visible depth for %d visible nodes", maxnodes);
2476 Info(
"SetVisLevel",
"Automatic visible depth disabled");
2498 Error(
"OptimizeVoxels",
"Geometry must be closed first");
2504 fname =
"tgeovox.C";
2505 out.open(fname, std::ios::out);
2507 Error(
"OptimizeVoxels",
"cannot open file");
2512 TString sname(fname);
2513 sname.ReplaceAll(
".C",
"");
2514 out << sname.Data() <<
"()" << std::endl;
2515 out <<
"{" << std::endl;
2516 out <<
"//=== Macro generated by ROOT version " <<
gROOT->GetVersion() <<
" : " << t.
AsString() << std::endl;
2517 out <<
"//=== Voxel optimization for " <<
GetTitle() <<
" geometry" << std::endl;
2518 out <<
"//===== <run this macro JUST BEFORE closing the geometry>" << std::endl;
2519 out <<
" TGeoVolume *vol = 0;" << std::endl;
2520 out <<
" // parse all voxelized volumes" << std::endl;
2521 TGeoVolume *vol =
nullptr;
2524 while ((vol = (TGeoVolume *)next())) {
2527 out <<
" vol = gGeoManager->GetVolume(\"" << vol->
GetName() <<
"\");" << std::endl;
2530 out <<
" vol->SetCylVoxels();" << std::endl;
2532 out <<
" vol->SetCylVoxels(kFALSE);" << std::endl;
2535 out <<
"}" << std::endl;
2553 TString startstr(expr);
2559 for (i = 0; i <
len; i++) {
2560 if (startstr(i) ==
' ')
2562 e0 += startstr(i, 1);
2574 while (iloop == 1) {
2580 for (i = 0; i <
len; i++) {
2593 if ((e0(i) ==
'+') || (e0(i) ==
'-') || (e0(i) ==
'*')) {
2595 if (level < levmin) {
2601 if ((e0(i) ==
':') && (level == 0)) {
2608 gGeoManager->Error(
"Parse",
"parentheses does not match");
2611 if (iloop == 1 && (e0(0) ==
'(') && (e0(
len - 1) ==
')')) {
2613 e0 = e0(1,
len - 2);
2618 if (((lastop == 0) && (lastdp > 0)) || ((lastpp > 0) && (lastdp > lastpp) && (indop < lastpp))) {
2619 expr3 = e0(lastdp + 1,
len - lastdp);
2629 for (i = 0; i <
len; i++) {
2639 if (level <= levmin) {
2661 expr1 = e0(0, indop);
2662 expr2 = e0(indop + 1,
len - indop);
2672 Error(
"SaveAttributes",
"geometry must be closed first\n");
2678 fname =
"tgeoatt.C";
2679 out.open(fname, std::ios::out);
2681 Error(
"SaveAttributes",
"cannot open file");
2686 TString sname(fname);
2687 sname.ReplaceAll(
".C",
"");
2688 out << sname.Data() <<
"()" << std::endl;
2689 out <<
"{" << std::endl;
2690 out <<
"//=== Macro generated by ROOT version " <<
gROOT->GetVersion() <<
" : " << t.
AsString() << std::endl;
2691 out <<
"//=== Attributes for " <<
GetTitle() <<
" geometry" << std::endl;
2692 out <<
"//===== <run this macro AFTER loading the geometry in memory>" << std::endl;
2694 out <<
" TGeoVolume *top = gGeoManager->GetVolume(\"" <<
fTopVolume->GetName() <<
"\");" << std::endl;
2695 out <<
" TGeoVolume *vol = 0;" << std::endl;
2696 out <<
" TGeoNode *node = 0;" << std::endl;
2697 out <<
" // clear all volume attributes and get painter" << std::endl;
2698 out <<
" gGeoManager->ClearAttributes();" << std::endl;
2699 out <<
" gGeoManager->GetGeomPainter();" << std::endl;
2700 out <<
" // set visualization modes and bomb factors" << std::endl;
2701 out <<
" gGeoManager->SetVisOption(" <<
GetVisOption() <<
");" << std::endl;
2702 out <<
" gGeoManager->SetVisLevel(" <<
GetVisLevel() <<
");" << std::endl;
2703 out <<
" gGeoManager->SetExplodedView(" <<
GetBombMode() <<
");" << std::endl;
2704 Double_t bombx, bomby, bombz, bombr;
2706 out <<
" gGeoManager->SetBombFactors(" << bombx <<
"," << bomby <<
"," << bombz <<
"," << bombr <<
");"
2708 out <<
" // iterate volumes container and set new attributes" << std::endl;
2710 TGeoVolume *vol =
nullptr;
2714 while ((vol = (TGeoVolume *)next())) {
2717 out <<
" // draw top volume with new settings" << std::endl;
2718 out <<
" top->Draw();" << std::endl;
2719 out <<
"}" << std::endl;
2904 while ((vol = (TGeoVolume *)next()))
2908 while ((matrix = (TGeoMatrix *)next1()))
2912 while ((mat = (TGeoMaterial *)next2()))
2916 while ((med = (TGeoMedium *)next3()))
2919 Info(
"GetByteCount",
"Total size of logical tree : %i bytes", count);
2929 const char *kind =
nullptr;
2931 kind =
gPad->IsWeb() ?
"web" :
"root";
2933 kind =
gEnv->GetValue(
"GeomPainter.Name",
"");
2935 if (!kind || !*kind)
2936 kind = (
gROOT->IsWebDisplay() && !
gROOT->IsWebDisplayBatch()) ?
"web" :
"root";
2938 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualGeoPainter", kind)) {
2939 if (
h->LoadPlugin() == -1) {
2940 Error(
"GetGeomPainter",
"could not load plugin for %s geo_painter", kind);
2943 fPainter = (TVirtualGeoPainter *)
h->ExecPlugin(1,
this);
2945 Error(
"GetGeomPainter",
"could not create %s geo_painter", kind);
2949 Error(
"GetGeomPainter",
"not found plugin %s for geo_painter", kind);
2961 if (
auto h =
gROOT->GetPluginManager()->FindHandler(
"TVirtualGeoChecker",
"root")) {
2962 if (
h->LoadPlugin() == -1) {
2963 Error(
"GetGeomChecker",
"could not load plugin for geo_checker");
2966 fChecker = (TVirtualGeoChecker *)
h->ExecPlugin(1,
this);
2968 Error(
"GetGeomChecker",
"could not create geo_checker");
2972 Error(
"GetGeomChecker",
"not found plugin for geo_checker");
2983 TString sname =
name;
2984 sname = sname.
Strip();
2985 TGeoVolume *vol = (TGeoVolume *)
fVolumes->FindObject(sname.
Data());
3000 for (i = 0; i < ngvol; i++)
3002 for (i = 0; i < nvol; i++)
3005 TString sname =
name;
3006 sname = sname.
Strip();
3036 TGeoMaterial *other;
3041 if (other->
IsEq(mat))
3052 TString sname = matname;
3053 sname = sname.
Strip();
3054 TGeoMaterial *mat = (TGeoMaterial *)
fMaterials->FindObject(sname.
Data());
3063 TString sname = medium;
3064 sname = sname.
Strip();
3065 TGeoMedium *med = (TGeoMedium *)
fMedia->FindObject(sname.
Data());
3076 while ((med = (TGeoMedium *)next())) {
3077 if (med->
GetId() == numed)
3090 TGeoMaterial *mat = (TGeoMaterial *)
fMaterials->At(
id);
3102 TString sname = matname;
3103 sname = sname.
Strip();
3104 while ((mat = (TGeoMaterial *)next())) {
3140 while ((vol = (TGeoVolume *)next()))
3173 Info(
"Voxelize",
"Voxelizing...");
3176 while ((vol = (TGeoVolume *)next())) {
3290 return TGeoBuilder::Instance(
this)->
MakeCtub(
name, medium, rmin, rmax, dz, phi1, phi2, lx, ly, lz, tx, ty, tz);
3353 return TGeoBuilder::Instance(
this)->
MakeTrap(
name, medium, dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2,
3364 return TGeoBuilder::Instance(
this)->
MakeGtra(
name, medium, dz, theta, phi, twist,
h1, bl1, tl1, alpha1, h2, bl2, tl2,
3391 Error(
"SetAlignableEntry",
"An alignable object with name %s already existing. NOT ADDED !", unique_name);
3394 entry =
new TGeoPNEntry(unique_name, path);
3397 fArrayPNE->AddAtAndExpand(entry, ientry);
3401 Error(
"SetAlignableEntry",
"A PN entry: has already uid=%i", uid);
3485 keys[
index + 1] = uid;
3486 values[
index + 1] = ientry;
3516 Error(
"MakeAlignablePN",
"No alignable object named %s found !",
name);
3528 Error(
"MakeAlignablePN",
"No alignable object specified !");
3531 const char *path = entry->
GetTitle();
3533 Error(
"MakeAlignablePN",
"Alignable object %s poins to invalid path: %s", entry->
GetName(), path);
3547 TGeoPhysicalNode *node;
3550 Error(
"MakePhysicalNode",
"path: %s not valid", path);
3553 node =
new TGeoPhysicalNode(path);
3555 node =
new TGeoPhysicalNode(
GetPath());
3567 TIter next(
gGeoManager->GetListOfPhysicalNodes());
3568 TGeoPhysicalNode *pn;
3569 while ((pn = (TGeoPhysicalNode *)next()))
3610 if ((ibomb >= 0) && (ibomb < 4))
3621 if ((phimin == 0) && (phimax == 360)) {
3659 while ((shape = (TGeoShape *)next_shape())) {
3661 ((TGeoCompositeShape *)shape)->InvalidateMeshCaches();
3713 TSeqCollection *brlist =
gROOT->GetListOfBrowsers();
3715 TBrowser *browser =
nullptr;
3724 while ((browser = (TBrowser *)next()))
3739 fTopNode->SetTitle(
"Top logical node");
3745 Int_t nnavigators = 0;
3750 for (
Int_t i = 0; i < nnavigators; i++) {
3751 TGeoNavigator *nav = (TGeoNavigator *)arr->
At(i);
3868 if (!opt.Length()) {
3869 Error(
"CheckGeometryFull",
"The option string must contain a letter. See method documentation.");
3872 Bool_t checkoverlaps = opt.Contains(
"o");
3873 Bool_t checkcrossings = opt.Contains(
"b");
3887 Info(
"CheckGeometry",
"Fixing runtime shapes...");
3893 while ((shape = (TGeoShape *)next())) {
3895 has_runtime =
kTRUE;
3906 Info(
"CheckGeometry",
"...Nothing to fix");
3909 while ((vol = (TGeoVolume *)nextv())) {
3913 Warning(
"CheckGeometry",
"Volume \"%s\" has no medium: assigned dummy medium and material", vol->
GetName());
3925 Error(
"CheckOverlaps",
"Top node not set");
3937 Error(
"CheckOverlaps",
"Top node not set");
3940 fTopNode->CheckOverlapsBySampling(ovlp, npoints);
3969 if (opt.Contains(
"v")) {
3970 if (opt.Contains(
"a")) {
3972 Info(
"Weight",
"Computing analytically weight of %s", volume->
GetName());
3975 Info(
"Weight",
"Computed weight: %f [kg]\n", weight);
3979 Info(
"Weight",
"Estimating weight of %s with %g %% precision",
fTopVolume->GetName(), 100. * precision);
3980 printf(
" event weight err\n");
3981 printf(
"========================================\n");
4020 fPainter->ExecuteManagerEvent(
this, event, px, py);
4044 if (sfile.Contains(
".C")) {
4051 if (sfile.Contains(
".gdml")) {
4058 gROOT->ProcessLineFast(cmd);
4061 if (sfile.Contains(
".root") || sfile.Contains(
".xml")) {
4064 if (!
f ||
f->IsZombie()) {
4065 Error(
"Export",
"Cannot open file");
4068 TString keyname =
name;
4076 Info(
"Export",
"Exporting %s %s as root file. Optimizations streamed.",
GetName(),
GetTitle());
4080 Info(
"Export",
"Exporting %s %s as root file. Optimizations not streamed.",
GetName(),
GetTitle());
4086 if (sfile.Contains(
".xml")) {
4091 if (sfile.Contains(
".xml")) {
4165 ::Warning(
"TGeoManager::Import",
"TGeoMananager in lock mode. NOT IMPORTING new geometry");
4171 ::Info(
"TGeoManager::Import",
"Reading geometry from file: %s",
filename);
4179 new TGeoManager(
"GDMLImport",
"Geometry imported from GDML");
4181 TGeoVolume *world = (TGeoVolume *)
gROOT->ProcessLineFast(cmd);
4183 if (world ==
nullptr) {
4202 if (!
f ||
f->IsZombie()) {
4203 ::Error(
"TGeoManager::Import",
"Cannot open file");
4209 TIter next(
f->GetListOfKeys());
4211 while ((key = (TKey *)next())) {
4240 TGeoElement *elem, *elem_table;
4242 while ((mat = (TGeoMaterial *)next())) {
4244 mix = (TGeoMixture *)mat;
4246 for (i = 0; i < nelem; i++) {
4253 if (elem != elem_table) {
4267 if (elem != elem_table) {
4286 while ((obj = next())) {
4312 if (tmin == 0 && tmax == 999)
4357 Error(
"SetUseParallelWorldNav",
"No parallel world geometry defined. Use CreateParallelWorld.");
4365 Error(
"SetUseParallelWorldNav",
"The geometry must be closed first");
4375 Bool_t val = gGeometryLocked;
4376 gGeometryLocked = new_value;
4388 gGeometryLocked =
true;
4390 }
else if (gGeometryLocked) {
4391 ::Fatal(
"TGeoManager",
"The system of units may only be changed once, \n"
4392 "BEFORE any elements and materials are created! \n"
4393 "Alternatively unlock the default units at own risk.");
4394 }
else if (new_value ==
kG4Units) {
4395 ::Info(
"TGeoManager",
"Changing system of units to Geant4 units (mm, ns, MeV).");
4397 ::Info(
"TGeoManager",
"Changing system of units to ROOT units (cm, s, GeV).");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool).
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
float Float_t
Float 4 bytes (float).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t property
@ kNatural
Natural, material-inspired colors (default).
externTGeoManager * gGeoManager
externTGeoIdentity * gGeoIdentity
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Using a TBrowser one can browse all ROOT objects.
void RecursiveRemove(TObject *obj) override
Recursively remove obj from browser.
static const char * GetFloatFormat()
return current printf format for float members, default "%e"
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e" to change format only for doubles,...
static const char * GetDoubleFormat()
return current printf format for double members, default "%.14e"
static void SetDoubleFormat(const char *fmt="%.14e")
set printf format for double members, default "%.14e" use it after SetFloatFormat,...
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
static ENewType IsCallingNew()
Static method returning the defConstructor flag passed to TClass::New().
const char * AsString() const
Return the date & time as a string (ctime() format).
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
This class is used in the process of reading and writing the GDML "matrix" tag.
Bool_t IsVisTouched() const
void SetVisStreamed(Bool_t vis=kTRUE)
Mark attributes as "streamed to file".
void SetVisTouched(Bool_t vis=kTRUE)
Mark visualization attributes as "modified".
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
Create a node called <name_nr> pointing to the volume called <name> as daughter of the volume called ...
TGeoVolume * MakePgon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
Make in one step a volume pointing to a polygone shape with given medium.
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a twisted trapezoid shape with given medium.
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Make a TGeoXtru-shaped volume with nz planes.
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Make in one step a volume pointing to a polycone shape with given medium.
TGeoVolume * MakeTrap(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
Make in one step a volume pointing to a trapezoid shape with given medium.
Int_t AddShape(TGeoShape *shape)
Add a shape to the list. Returns index of the shape in list.
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
Make in one step a volume pointing to a torus shape with given medium.
static TGeoBuilder * Instance(TGeoManager *geom)
Return pointer to singleton.
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeHype(const char *name, TGeoMedium *medium, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=nullptr)
Make an TGeoArb8 volume.
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
Create material with given A, Z and density, having an unique id.
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
Make in one step a volume pointing to a parallelepiped shape with given medium.
Int_t AddTransformation(TGeoMatrix *matrix)
Add a matrix to the list. Returns index of the matrix in list.
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
TGeoMedium * Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin)
Create tracking medium.
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a tube segment shape with given medium.
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
Make in one step a volume pointing to a box shape with given medium.
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
Create rotation matrix named 'mat<index>'.
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Create a new volume by dividing an existing one (GEANT3 like).
TGeoVolume * MakeParaboloid(const char *name, TGeoMedium *medium, Double_t rlo, Double_t rhi, Double_t dz)
Make in one step a volume pointing to a tube shape with given medium.
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
Make in one step a volume pointing to a TGeoTrd1 shape with given medium.
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Make an assembly of volumes.
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
Make in one step a volume pointing to a cone segment shape with given medium.
Int_t AddMaterial(TGeoMaterial *material)
Add a material to the list. Returns index of the material in list.
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Make in one step a volume pointing to a TGeoTrd2 shape with given medium.
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
TGeoMaterial * Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nelem, Float_t *wmat, Int_t uid)
Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem materials defined by arrays A,...
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Make in one step a volume pointing to a cone shape with given medium.
void RegisterMatrix(TGeoMatrix *matrix)
Register a matrix to the list of matrices.
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
Make in one step a volume pointing to a tube segment shape with given medium.
Strategy object for assigning colors and transparency to geometry volumes.
virtual Int_t Transparency(const TGeoVolume *vol) const
Compute the transparency for a given volume.
virtual Int_t Color(const TGeoVolume *vol) const
Compute the color for a given volume.
void SetDefined(Bool_t flag=kTRUE)
void SetUsed(Bool_t flag=kTRUE)
Matrix class used for computing global transformations Should NOT be used for node definition.
An identity transformation.
Double_t fPhimax
! highest range for phi cut
TGeoVolume * MakeCone(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
void AnimateTracks(Double_t tmin=0, Double_t tmax=5E-8, Int_t nframes=200, Option_t *option="/*")
void AddSkinSurface(TGeoSkinSurface *surf)
TGeoVolume * MakeXtru(const char *name, TGeoMedium *medium, Int_t nz)
Double_t * FindNormalFast()
TGeoVolume * MakePcon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nz)
Int_t fRaytraceMode
! Raytrace mode: 0=normal, 1=pass through, 2=transparent
TGeoNavigator * AddNavigator()
TVirtualGeoTrack * GetTrackOfId(Int_t id) const
TGeoMaterial * FindDuplicateMaterial(const TGeoMaterial *mat) const
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Int_t ReplaceVolume(TGeoVolume *vorig, TGeoVolume *vnew)
Int_t GetCurrentNodeId() const
TGeoPNEntry * GetAlignableEntry(const char *name) const
TGeoVolume * fMasterVolume
TVirtualGeoTrack * FindTrackWithId(Int_t id) const
TObjArray * fArrayPNE
! array of physical node entries
void TestOverlaps(const char *path="")
void RemoveMaterial(Int_t index)
static Int_t GetNumThreads()
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
TGeoElementTable * GetElementTable()
virtual Bool_t cd(const char *path="")
static Int_t fgVerboseLevel
! Verbosity level for Info messages (no IO).
Bool_t InitArrayPNE() const
TObjArray * fPhysicalNodes
TObjArray * fUniqueVolumes
static UInt_t fgExportPrecision
! Precision to be used in ASCII exports
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
TObjArray * fGShapes
! list of runtime shapes
TGeoVolume * fPaintVolume
! volume currently painted
TGeoSkinSurface * GetSkinSurface(const char *name) const
void CheckOverlapsBySampling(Double_t ovlp, Int_t npoints)
TVirtualGeoChecker * GetGeomChecker()
ConstPropMap_t fProperties
TGeoVolume * MakeTube(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz)
static Int_t Parse(const char *expr, TString &expr1, TString &expr2, TString &expr3)
static void SetVerboseLevel(Int_t vl)
void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.)
TGeoPNEntry * GetAlignableEntryByUID(Int_t uid) const
void AddGDMLMatrix(TGDMLMatrix *mat)
void AddBorderSurface(TGeoBorderSurface *surf)
void SetClippingShape(TGeoShape *clip)
TGeoVolume * fCurrentVolume
! current volume
static void SetExportPrecision(UInt_t prec)
TGeoVolume * MakeCons(const char *name, TGeoMedium *medium, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2)
THashList * fHashGVolumes
! hash list of group volumes providing fast search
TVirtualGeoChecker * fChecker
! current checker
static std::mutex fgMutex
! mutex for navigator booking in MT mode
Bool_t IsInPhiRange() const
TGeoNode * SearchNode(Bool_t downwards=kFALSE, const TGeoNode *skipnode=nullptr)
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
void LocalToMaster(const Double_t *local, Double_t *master) const
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
Double_t fPhimin
! lowest range for phi cut
static ThreadsMap_t * fgThreadId
! Thread id's map
static Int_t GetMaxDaughters()
static void SetDefaultUnits(EDefaultUnits new_value)
static void LockGeometry()
static Bool_t fgLockNavigators
! Lock existing navigators
static Int_t GetMaxXtruVert()
void SaveAttributes(const char *filename="tgeoatt.C")
void RestoreMasterVolume()
Bool_t fDrawExtra
! flag that the list of physical nodes has to be drawn
TGeoVolume * MakeArb8(const char *name, TGeoMedium *medium, Double_t dz, Double_t *vertices=nullptr)
TGeoNode * FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE)
Int_t GetUID(const char *volname) const
TGeoShape * fClippingShape
! clipping shape for raytracing
TGeoNavigator * GetCurrentNavigator() const
THashList * fHashVolumes
! hash list of volumes providing fast search
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Int_t AddTransformation(const TGeoMatrix *matrix)
TObjArray * fOpticalSurfaces
TVirtualGeoTrack * GetParentTrackOfId(Int_t id) const
void CdNode(Int_t nodeid)
UChar_t * fBits
! bits used for voxelization
Double_t fTmin
! lower time limit for tracks drawing
TGeoVolume * fTopVolume
! top level volume in geometry
TGeoVolume * fUserPaintVolume
!
TVirtualGeoPainter * GetGeomPainter()
void GetBranchOnlys(Int_t *isonly) const
TGeoNode * GetCurrentNode() const
Int_t AddTrack(Int_t id, Int_t pdgcode, TObject *particle=nullptr)
TGeoManager(const TGeoManager &)=delete
void SetVisOption(Int_t option=0)
void SetPdgName(Int_t pdg, const char *name)
TObjArray * fBorderSurfaces
Int_t GetNAlignable(Bool_t with_uid=kFALSE) const
void RefreshPhysicalNodes(Bool_t lock=kTRUE)
static Bool_t fgLock
! Lock preventing a second geometry to be loaded
TGeoVolume * MakePara(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz, Double_t alpha, Double_t theta, Double_t phi)
void TopToMaster(const Double_t *top, Double_t *master) const
void AddOpticalSurface(TGeoOpticalSurface *optsurf)
Bool_t fLoopVolumes
! flag volume lists loop
Int_t AddMaterial(const TGeoMaterial *material)
static Int_t fgMaxDaughters
! Maximum number of daughters
void SetRTmode(Int_t mode)
Bool_t CheckPath(const char *path) const
void InspectState() const
static Int_t GetMaxLevels()
void ConvertReflections()
void SetVisLevel(Int_t level=3)
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
TGeoPhysicalNode * MakePhysicalNode(const char *path=nullptr)
Int_t fMaxThreads
! Max number of threads
Bool_t fIsGeomReading
! flag set when reading geometry
TGeoVolume * MakeTorus(const char *name, TGeoMedium *medium, Double_t r, Double_t rmin, Double_t rmax, Double_t phi1=0, Double_t dphi=360)
TGeoHMatrix * GetHMatrix()
TGeoParallelWorld * fParallelWorld
void RegisterMatrix(const TGeoMatrix *matrix)
TVirtualGeoTrack * GetTrack(Int_t index)
Int_t AddVolume(TGeoVolume *volume)
TVirtualGeoPainter * fPainter
! current painter
void SetVolumeAttribute(const char *name, const char *att, Int_t val)
const char * GetPdgName(Int_t pdg) const
static Bool_t LockDefaultUnits(Bool_t new_value)
void CheckGeometryFull(Int_t ntracks=1000000, Double_t vx=0., Double_t vy=0., Double_t vz=0., Option_t *option="ob")
Bool_t fIsNodeSelectable
! flag that nodes are the selected objects in pad rather than volumes
TGeoNode * Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE)
Bool_t fActivity
! switch ON/OFF volume activity (default OFF - all volumes active))
void GetBranchNames(Int_t *names) const
void CloseGeometry(Option_t *option="d")
TVirtualGeoTrack * MakeTrack(Int_t id, Int_t pdgcode, TObject *particle)
Int_t GetTrackIndex(Int_t id) const
void OptimizeVoxels(const char *filename="tgeovox.C")
TGeoVolume * GetVolume(const char *name) const
void SetAnimateTracks(Bool_t flag=kTRUE)
Bool_t fIsGeomCleaning
! flag to notify that the manager is being destructed
void DefaultColors(const TGeoColorScheme *cs=nullptr)
Bool_t IsSameLocation() const
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
TGeoVolume * MakeTrd2(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy1, Double_t dy2, Double_t dz)
Double_t * FindNormal(Bool_t forward=kTRUE)
TGeoVolume * MakeGtra(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t twist, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
TGeoElementTable * fElementTable
! table of elements
static Int_t fgMaxXtruVert
! Maximum number of Xtru vertices
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Int_t GetVisOption() const
virtual Int_t GetByteCount(Option_t *option=nullptr)
static UInt_t GetExportPrecision()
TGeoVolume * MakeBox(const char *name, TGeoMedium *medium, Double_t dx, Double_t dy, Double_t dz)
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)
static Int_t fgMaxLevel
! Maximum level in geometry
void PrintOverlaps() const
TGeoVolume * MakeTrd1(const char *name, TGeoMedium *medium, Double_t dx1, Double_t dx2, Double_t dy, Double_t dz)
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
TGeoVolume * FindVolumeFast(const char *name, Bool_t multi=kFALSE)
Bool_t GetTminTmax(Double_t &tmin, Double_t &tmax) const
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
ThreadsMap_t::const_iterator ThreadsMapIt_t
Bool_t fMatrixTransform
! flag for using GL matrix
void SetVisibility(TObject *obj, Bool_t vis)
void SetTopVolume(TGeoVolume *vol)
Bool_t fMatrixReflection
! flag for GL reflections
TGeoPNEntry * SetAlignableEntry(const char *unique_name, const char *path, Int_t uid=-1)
void ClearShape(const TGeoShape *shape)
virtual ULong_t SizeOf(const TGeoNode *node, Option_t *option)
void BombTranslation(const Double_t *tr, Double_t *bombtr)
TGeoNavigator * fCurrentNavigator
! current navigator
TGeoMedium * GetMedium(const char *medium) const
Bool_t InsertPNEId(Int_t uid, Int_t ientry)
void ViewLeaves(Bool_t flag=kTRUE)
TGeoVolume * MakeCtub(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
void SetTminTmax(Double_t tmin=0, Double_t tmax=999)
NavigatorsMap_t fNavigators
! Map between thread id's and navigator arrays
void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const
TGeoNode * CrossBoundaryAndLocate(Bool_t downwards, TGeoNode *skipnode)
void DrawTracks(Option_t *option="")
void Streamer(TBuffer &) override
Stream an object of class TObject.
void BuildDefaultMaterials()
void SetMaxThreads(Int_t nthreads)
TGeoMedium * Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin)
void SetExplodedView(Int_t iopt=0)
Double_t Weight(Double_t precision=0.01, Option_t *option="va")
void ClearPhysicalNodes(Bool_t mustdelete=kFALSE)
static void UnlockGeometry()
void GetBombFactors(Double_t &bombx, Double_t &bomby, Double_t &bombz, Double_t &bombr) const
Double_t GetProperty(const char *name, Bool_t *error=nullptr) const
Bool_t IsAnimatingTracks() const
const char * GetPath() const
static Int_t fgNumThreads
! Number of registered threads
TObjArray * fGDMLMatrices
TGeoPhysicalNode * MakeAlignablePN(const char *name)
void SetCheckedNode(TGeoNode *node)
Int_t AddOverlap(const TNamed *ovlp)
void CreateThreadData() const
TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil=1E-5, const char *g3path="")
TGDMLMatrix * GetGDMLMatrix(const char *name) const
Double_t fTmax
! upper time limit for tracks drawing
void InvalidateMeshCaches()
Int_t TransformVolumeToAssembly(const char *vname)
Bool_t fMultiThread
! Flag for multi-threading
static void SetNavigatorsLock(Bool_t flag)
TGeoVolume * MakePgon(const char *name, TGeoMedium *medium, Double_t phi, Double_t dphi, Int_t nedges, Int_t nz)
TGeoVolume * MakeTrap(const char *name, TGeoMedium *medium, Double_t dz, Double_t theta, Double_t phi, Double_t h1, Double_t bl1, Double_t tl1, Double_t alpha1, Double_t h2, Double_t bl2, Double_t tl2, Double_t alpha2)
void DrawCurrentPoint(Int_t color=2)
TGeoOpticalSurface * GetOpticalSurface(const char *name) const
void SetNsegments(Int_t nseg)
Bool_t IsSamePoint(Double_t x, Double_t y, Double_t z) const
void SetNmeshPoints(Int_t npoints=1000)
void CheckBoundaryReference(Int_t icheck=-1)
TGeoVolume * GetCurrentVolume() const
Int_t GetVisLevel() const
Bool_t AddProperty(const char *property, Double_t value)
Int_t CountNodes(const TGeoVolume *vol=nullptr, Int_t nlevels=10000, Int_t option=0)
TGeoMaterial * GetMaterial(const char *matname) const
static Int_t GetVerboseLevel()
void CheckGeometry(Option_t *option="")
void ExecuteEvent(Int_t event, Int_t px, Int_t py) override
Execute action corresponding to an event at (px,py).
TGeoVolumeAssembly * MakeVolumeAssembly(const char *name)
Int_t GetBombMode() const
Int_t AddRegion(TGeoRegion *region)
void SelectTrackingMedia()
Double_t Safety(Bool_t inside=kFALSE)
TGeoMaterial * Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nelem, Float_t *wmat, Int_t uid)
std::map< std::thread::id, Int_t > ThreadsMap_t
void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="", Double_t safety=0.)
void SetUseParallelWorldNav(Bool_t flag)
static void ClearThreadsMap()
void Browse(TBrowser *b) override
Browse object. May be overridden for another default action.
void Test(Int_t npoints=1000000, Option_t *option="")
Int_t GetSafeLevel() const
TObjArray * fGVolumes
! list of runtime volumes
void SetBombFactors(Double_t bombx=1.3, Double_t bomby=1.3, Double_t bombz=1.3, Double_t bombr=1.3)
TGeoNode * fTopNode
! top physical node
void UnbombTranslation(const Double_t *tr, Double_t *bombtr)
static EDefaultUnits GetDefaultUnits()
void RandomPoints(const TGeoVolume *vol, Int_t npoints=10000, Option_t *option="")
TGeoParallelWorld * CreateParallelWorld(const char *name)
Int_t GetMaterialIndex(const char *matname) const
TGeoNavigatorArray * GetListOfNavigators() const
virtual Int_t Export(const char *filename, const char *name="", Option_t *option="vg")
static EDefaultUnits fgDefaultUnits
! Default units in GDML if not explicit in some tags
void RandomRays(Int_t nrays=1000, Double_t startx=0, Double_t starty=0, Double_t startz=0, const char *target_vol=nullptr, Bool_t check_norm=kFALSE)
TObjArray * fSkinSurfaces
void SetVisDensity(Double_t dens=0.01)
Bool_t fClosed
! flag that geometry is closed
Int_t GetNsegments() const
void SetPhiRange(Double_t phimin=0., Double_t phimax=360.)
TVirtualGeoTrack * fCurrentTrack
! current track
void DrawPath(const char *path, Option_t *option="")
Bool_t SetCurrentNavigator(Int_t index)
void SetTopVisible(Bool_t vis=kTRUE)
TGeoVolume * MakeHype(const char *name, TGeoMedium *medium, Double_t rin, Double_t stin, Double_t rout, Double_t stout, Double_t dz)
TGeoVolume * MakeParaboloid(const char *name, TGeoMedium *medium, Double_t rlo, Double_t rhi, Double_t dz)
Int_t AddShape(const TGeoShape *shape)
void SetMaxVisNodes(Int_t maxnodes=10000)
void Voxelize(Option_t *option=nullptr)
TGeoBorderSurface * GetBorderSurface(const char *name) const
void ClearThreadData() const
virtual void Edit(Option_t *option="")
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
TGeoVolume * MakeTubs(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
TGeoVolume * MakeEltu(const char *name, TGeoMedium *medium, Double_t a, Double_t b, Double_t dz)
void RemoveNavigator(const TGeoNavigator *nav)
void MasterToTop(const Double_t *master, Double_t *top) const
Base class describing materials.
virtual Bool_t IsMixture() const
virtual Int_t GetByteCount() const
TGeoElement * GetElement() const
Get a pointer to the element this material is made of.
virtual Bool_t IsEq(const TGeoMaterial *other) const
return true if the other material has the same physical properties
Geometrical transformation package.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
Bool_t IsReflection() const
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
virtual Int_t GetByteCount() const
Get total size in bytes of this.
Media are used to store properties related to tracking and which are useful only when using geometry ...
virtual Int_t GetByteCount() const
Int_t GetNelements() const override
TGeoElement * GetElement(Int_t i=0) const override
Retrieve the pointer to the element corresponding to component I.
TGeoNavigator * AddNavigator()
Add a new navigator to the array.
TGeoNavigator * GetCurrentNavigator() const
TGeoNavigator * SetCurrentNavigator(Int_t inav)
Class providing navigation API for TGeo geometries.
void CdUp()
Go one level up in geometry.
void DoBackupState()
Backup the current state without affecting the cache stack.
void DoRestoreState()
Restore a backed-up state without affecting the cache stack.
TGeoNode * CrossBoundaryAndLocate(Bool_t downwards, TGeoNode *skipnode)
Cross next boundary and locate within current node The current point must be on the boundary of fCurr...
TGeoHMatrix * GetHMatrix()
Return stored current matrix (global matrix of the next touched node).
void LocalToMaster(const Double_t *local, Double_t *master) const
void CdNext()
Do a cd to the node found next by FindNextBoundary.
Double_t Safety(Bool_t inside=kFALSE)
Compute safe distance from the current point.
Bool_t GotoSafeLevel()
Go upwards the tree until a non-overlapping node.
Bool_t cd(const char *path="")
Browse the tree of nodes starting from top node according to pathname.
Bool_t IsSameLocation(Double_t x, Double_t y, Double_t z, Bool_t change=kFALSE)
Checks if point (x,y,z) is still in the current node.
void MasterToLocal(const Double_t *master, Double_t *local) const
Int_t GetVirtualLevel()
Find level of virtuality of current overlapping node (number of levels up having the same tracking me...
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
Initialize current point and current direction vector (normalized) in MARS.
void InspectState() const
Inspects path and all flags for the current state.
TGeoNode * Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE)
Make a rectiliniar step of length fStep from current point (fPoint) on current direction (fDirection)...
void ResetState()
Reset current state flags.
TGeoNode * FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE)
Computes as fStep the distance to next daughter of the current volume.
void GetBranchNumbers(Int_t *copyNumbers, Int_t *volumeNumbers) const
Fill node copy numbers of current branch into an array.
Bool_t CheckPath(const char *path) const
Check if a geometry path is valid without changing the state of the navigator.
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
Find distance to next boundary and store it in fStep.
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
Compute distance to next boundary within STEPMAX.
void CdTop()
Make top level node the current node.
Int_t GetCurrentNodeId() const
Double_t * FindNormalFast()
Computes fast normal to next crossed boundary, assuming that the current point is close enough to the...
void GetBranchOnlys(Int_t *isonly) const
Fill node copy numbers of current branch into an array.
TGeoNode * SearchNode(Bool_t downwards=kFALSE, const TGeoNode *skipnode=nullptr)
Returns the deepest node containing fPoint, which must be set a priori.
void CdNode(Int_t nodeid)
Change current path to point to the node having this id.
TGeoNodeCache * GetCache() const
void ResetAll()
Reset the navigator.
Bool_t IsSamePoint(Double_t x, Double_t y, Double_t z) const
Check if a new point with given coordinates is the same as the last located one.
void CdDown(Int_t index)
Make a daughter of current node current.
const char * GetPath() const
Get path to the current node in the form /node0/node1/...
Int_t GetSafeLevel() const
Go upwards the tree until a non-overlapping node.
Double_t * FindNormal(Bool_t forward=kTRUE)
Computes normal vector to the next surface that will be or was already crossed when propagating on a ...
void GetBranchNames(Int_t *names) const
Fill volume names of current branch into an array.
void BuildIdArray()
Builds node id array.
void BuildInfoBranch()
Builds info branch. Navigation is possible only after this step.
void SetMatrix(const TGeoMatrix *matrix)
Matrix setter.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Bool_t IsOverlapping() const
TGeoVolume * GetVolume() const
void SetVolume(TGeoVolume *volume)
void SetOverlapping(Bool_t flag=kTRUE)
Int_t GetNdaughters() const
virtual TGeoMatrix * GetMatrix() const =0
void SetVisibility(Bool_t vis=kTRUE) override
Set visibility of the node (obsolete).
void SetMotherVolume(TGeoVolume *mother)
TGeoVolume * GetMotherVolume() const
This is a wrapper class to G4OpticalSurface.
The knowledge of the path to the objects that need to be misaligned is essential since there is no ot...
void SetPhysicalNode(TGeoPhysicalNode *node)
Setter for the corresponding physical node.
Base class for a flat parallel geometry.
Physical nodes are the actual 'touchable' objects in the geometry, representing a path of positioned ...
void Refresh()
Refresh this physical node.
Regions are groups of volumes having a common set of user tracking cuts.
Base abstract class for all shapes.
virtual Bool_t IsComposite() const
Bool_t IsRunTimeShape() const
virtual void ComputeBBox()=0
virtual void AfterStreamer()
TClass * IsA() const override
Bool_t TestShapeBit(UInt_t f) const
static TGeoVolumeAssembly * MakeAssemblyFromVolume(TGeoVolume *vol)
Make a clone of volume VOL but which is an assembly.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Double_t WeightA() const
Analytical computation of the weight.
virtual void ClearThreadData() const
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
void SetNumber(Int_t number)
void SetLineWidth(Width_t lwidth) override
Set the line width.
TGeoMedium * GetMedium() const
void SortNodes()
sort nodes by decreasing volume of the bounding box.
void Voxelize(Option_t *option)
build the voxels for this volume
virtual void CreateThreadData(Int_t nthreads)
virtual Int_t GetByteCount() const
get the total size in bytes for this volume
Bool_t OptimizeVoxels()
Perform an extensive sampling to find which type of voxelization is most efficient.
virtual Bool_t IsVolumeMulti() const
Int_t CountNodes(Int_t nlevels=1000, Int_t option=0)
Count total number of subnodes starting from this volume, nlevels down.
void UnmarkSaved()
Reset SavePrimitive bits.
void SetFinder(TGeoPatternFinder *finder)
Int_t GetNdaughters() const
void SetTransparency(Char_t transparency=0)
void FindOverlaps() const
loop all nodes marked as overlaps and find overlapping brothers
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
virtual void SetMedium(TGeoMedium *medium)
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
static TGeoMedium * DummyMedium()
void SetLineColor(Color_t lcolor) override
Set the line color.
TGeoShape * GetShape() const
void SetField(TObject *field)
static void CreateDummyMedium()
Create a dummy medium.
void SetLineStyle(Style_t lstyle) override
Set the line style.
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
TGeoVolume * MakeReflectedVolume(const char *newname="") const
Make a copy of this volume which is reflected with respect to XY plane.
void SetNeedRebuild(Bool_t flag=kTRUE)
virtual void Voxelize(Option_t *option="")
Voxelize attached volume according to option If the volume is an assembly, make sure the bbox is comp...
Bool_t NeedRebuild() const
TObject * FindObject(const char *name) const override
Find object using its name.
virtual const char * GetClassName() const
virtual TObject * ReadObj()
To read a TObject* from the file.
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Int_t GetEntriesFast() const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * Remove(TObject *obj) override
Remove object from array.
Mother of all ROOT objects.
Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual TClass * IsA() const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Abstract class for geometry checkers.
virtual void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="", Double_t safety=0.)=0
virtual void CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=nullptr)=0
virtual void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option)=0
virtual void RandomPoints(TGeoVolume *vol, Int_t npoints, Option_t *option)=0
void SetNmeshPoints(Int_t npoints=1000)
Set number of points to be generated on the shape outline when checking for overlaps.
virtual void Test(Int_t npoints, Option_t *option)=0
virtual void CheckBoundaryReference(Int_t icheck=-1)=0
virtual void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.)=0
virtual void PrintOverlaps() const =0
virtual TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char *g3path)=0
virtual void SetSelectedNode(TGeoNode *node)=0
virtual void TestOverlaps(const char *path)=0
virtual void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz, const char *target_vol=nullptr, Bool_t check_norm=kFALSE)=0
Abstract class for geometry painters.
virtual void DrawPath(const char *path, Option_t *option="")=0
virtual void ModifiedPad(Bool_t update=kFALSE) const =0
virtual TVirtualGeoTrack * AddTrack(Int_t id, Int_t pdgcode, TObject *particle)=0
virtual void SetClippingShape(TGeoShape *shape)=0
virtual void EditGeometry(Option_t *option="")=0
Base class for user-defined tracks attached to a geometry.
TVirtualGeoTrack * GetMother() const
virtual TVirtualGeoTrack * FindTrackWithId(Int_t id) const
Recursively search through this track for a daughter particle (at any depth) with the specified id.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
constexpr Double_t E()
Base of natural log: .
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .