37 if (!
f ||
f->IsZombie()) {
38 std::cerr <<
"cannot open " << fname <<
"\n";
41 TIter next(
f->GetListOfKeys());
42 while (
auto *key = (
TKey *)next())
43 if (!std::strcmp(key->GetClassName(),
"TGeoManager"))
45 std::cerr <<
"no TGeoManager in " << fname <<
"\n";
49void geom_overlaps(
const char *fname =
"http://root.cern/files/cms.root",
double precision = 0.001)
51 auto *geom = load_geometry(fname);
55 auto *eveMng = REveManager::Create();
56 eveMng->AllowMultipleRemoteConnections(
false,
false);
62 std::cout <<
">>> checking overlaps (precision " << precision <<
" cm) ...\n";
63 table->ScanOverlaps(geom, precision);
64 std::cout <<
">>> found " << table->GetNumOverlaps() <<
" overlaps\n";
68 auto *tableScene = eveMng->SpawnNewScene(
"Overlap List");
69 tableScene->AddElement(table);
70 auto *tableViewer = eveMng->SpawnNewViewer(
"GeoOverlapTable",
"");
71 tableViewer->AddScene(tableScene);
74 eveMng->GetEventScene()->AddElement(table->GetVizHolder());
78 eveMng->GetDefaultViewer()->SetCameraCenter(REveViewer::kCameraCenterBBox);
The overlaps and extrusions of a geometry, as a flat list plus a 3D view.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
The manager class for any TGeo geometry.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Namespace for ROOT features in testing.