GSI Helmholtzzentrum für Schwerionenforschung
Problem in creating geometry from root file
Hi, I want to draw the geometry from the root file given in /pandaroot/geometry folder although I can draw the geometry in TBrowser but not in code. I am using the code below which was for params.root file.The Error is shown below. Also tell me can I draw a .geo file to see its geometry?. drawGeo() { gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C"); rootlogon(); gSystem->Load("libGeom"); TFile *f = TFile::Open("/home/shyam/fairsoft/pandaroot/geometry/LambdaDisksNew.root "); //TFile* file = new TFile("params.root"); f->Get("FairBaseParSet"); gGeoManager->SetVisLevel(3); //defoult 3 gGeoManager->GetMasterVolume()->Draw("ogl"); } Processing drawGeo.C... Note: File "/home/shyam/fairsoft/pandaroot/buildPanda/lib/libDrc.so" already loaded Error: illegal pointer to class object gGeoManager 0x0 2182 drawGeo.C:17: *** Interpreter error recovered ***
Re: Problem in creating geometry from root file
Where did you take such code? It is very very old. Please use the default macro. However, you cannot see the geometry from the geo root file, you need to open a param file.
I have taken this from fts/ drawGeo.C for the purpose of just drawing .root type geometry file.
Hi, you can also add the following line at the end of a simulation macro to write the complete geomanager to file. fRun->CreateGeometryFile("<your_filename>"); Ciao Florian