Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
show_extract.C File Reference

Detailed Description

Helper script for showing of extracted / simplified geometries.

By default shows a simplified ALICE geometry.

#include "TFile.h"
#include "TKey.h"
#include "TGeoShape.h"
namespace REX = ROOT::Experimental;
void show_extract(const char *file = "csg.root")
{
// disable browser cache - all scripts and html files will be loaded every time, useful for development
// gEnv->SetValue("WebGui.HttpMaxAge", 0);
TFile::Open(file);
TIter next(gDirectory->GetListOfKeys());
const TString extract_class("ROOT::Experimental::REveGeoShapeExtract");
REX::REveGeoShape *eve_shape = nullptr;
while (auto key = (TKey *)next()) {
if (extract_class == key->GetClassName()) {
auto gse = (REX::REveGeoShapeExtract *)key->ReadObj();
eve_shape = REX::REveGeoShape::ImportShapeExtract(gse, nullptr);
eveMng->AddGlobalElement(eve_shape);
}
}
if (!eve_shape) {
Error("show_extract.C", "No keys of class '%s'.", extract_class.Data());
return;
}
eve_shape->GetShape()->Draw("ogl");
}
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define gDirectory
Definition TDirectory.h:385
static REveGeoShape * ImportShapeExtract(REveGeoShapeExtract *gse, REveElement *parent=nullptr)
Import a shape extract 'gse' under element 'parent'.
static REveManager * Create()
If global REveManager* REX::gEve is not set initialize it.
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.
Definition TFile.cxx:3787
void Draw(Option_t *option="") override
Draw this shape.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition TKey.h:28
Basic string class.
Definition TString.h:138
ROOT::Experimental::REveManager * eveMng
Namespace for ROOT features in testing.
Definition TROOT.h:100
Author
Matevz Tadel

Definition in file show_extract.C.