How to visual the GDML by using restG4

System : Linux, MacOs
REST version : v2.2.16_dev
Hi, @jgalan
l would like to visual the GDML of our new detector in PandaX3.
But the result is not satisfactory when l use the simple command:restViewGeometry.
image

So l come to ask for your help, because l know that the figure in https://arxiv.org/pdf/1610.08883.pdf was your works.
image
Thanks!

Hi Xie,

the command restViewGeometry your are using is actually executing the macro REST_ViewGeometry.C. Looking inside the code I see it uses GdmlPreprocessor so I deduce @nkx is behind the coding of this macro.

In any case, the results you are getting I believe are not that good because the OGL option was not specified.

I am sure for generating the visualisation from GDML from the figure you are showing I used directly the following.

TGeoManager *geo = TGeoManager::Import("main.gdml");
geo0>GetTopVolume()->Draw("ogl");

Then I used keys as t, w, e to change different viewing options in the ROOT window.

Of course, in order to achieve the drawing I modified the geometry first, by removing the water tank, and shifting the cap in order to see the screws, etc.

The problem now at the present implementation is that the GDML might be understood by REST but not by TGeoManager, that’s why restViewGeometry is using GdmlPreprocessor. Because GDML-REST version allows for mathematical expressions and system ${variables} to be evaluated.

So, If you use TGeoManager directly you must take care to replace those variables which are not directly compatible.

If you try with the restViewGeometry command I guess you can try to give as argument “ogl” to the Draw method (line 39 inside the macro), and/or try the “EVE” option. As I can see from the code you probably could first try restViewGeometry file.root EVE.

 38     if (option == "") {
 39         geo->GetMasterVolume()->Draw();
 40     } else if (ToUpper((string)option) == "EVE") {
 41         TRestG4EventViewer* view = new TRestG4EventViewer();
 42         view->SetGeometry(geo);
 43         view->AddEvent(new TRestG4Event());

After deleting the shielding tank and using
image


And when l choose the cross section, a lot of strange lines appear.