Geant4 visualization with RayTracerX

I am trying to use the RayTracerX visualization driver, but I have a problem with the X11 window. As you know, RaytracerX is a X-Window version of RayTracer that simultaneously renders to screen so you can watch as rendering grows progressively smoother.

To enable RayTracerX I have set ON the flag GEANT4_USE_RAYTRACER_X11 for CMake at Geant4 library build time and it worked properly.

As a test, I tried to run the basic B1 example using in vis.mac the RayTracerX driver instead of OpenGL:
/vis/open RayTracerX (instead of OpenGL)
that corresponds to the three lines:
/vis/sceneHandler/create RayTracerX
/vis/sceneHandler/attach
/vis/viewer/create ! ! 600

These 3 commands are correctly exexuted and a black X-window with 600x600 pixels size is opened, but the the next commands in the macro are not executed.
Or, in the case of intercative commands, after “/vis/viewer/create ! ! 600”, it open the X-window but it does not come back to the “Idle>” state. The only way to abort is Ctrl-C.

Do you have any idea what the problem is?

Mmmm. Works fine for me.

What UI session are you using? Qt or tcsh? If Qt, control is passed to the Qt window (small input box marked “Session” , bottom right), even if there is nothing in the viewer sub-window. With tcsh, control should be passed back to the terminal from which the application is launched. If control is not passes back one way or another, I’m puzzled.

Have you modified exampleB1.cc?

Anyway, you need /vis/viewer/refresh to get an image and file in Ray Tracer.

Maybe a better way is to leave vis.mac as is, get the detector component(s) and view you want (it’s easier with OGL), then

/vis/open RayTracerX
/vis/viewer/copyViewFrom viewer-0
/vis/viewer/refresh

Dear John,
thank you for your prompt answer.

I don’t use Qt and I didn’t change exampleB1.cc, I simply modified the macro vis.mac line 8:
/vis/open OGL 600x600-0+0 to /vis/open RayTracerX 600x600-0+0

I cannot run /vis/viewer/refresh because the macro stop just after “/vis/open RayTracerX” and the same happens in the case of interactive session.

As I said before, after the /vis/open line the X-window opens but the terminal does not come back to the “Idle>” state.

I have verified it on two different machines using “Ubuntu 16.04.6 LTS” and “Ubuntu 18.04.2 LTS”

Do you think that using Qt I can solve this problem?

Mmmm. Strange.

What happens if you use the original vis.mac? Do you get control back?

If you do, what happens if you “/vis/open RayTracerX”?

We have found with some Linux systems on some makes of computer that it’s important to have a graphics driver that matches the graphics hardware. Find out what your graphics hardware is and google for the download of a driver for your system,

I have an update.
I verified that RayTracerX works as expected when I connect to the server with my Geant4 simulation using a Mac. The problem is present only when I connect to the server using a PC with Windows.
I tested many different ssh clients and X servers in Windows but the result is always the same:
after I type the command “/vis/open RayTracerX”, it opens the X-window but it does not come back to the “Idle>” state, so it is impossible to give further commands for drawing the geometry.
The only way to abort is Ctrl-C.

You don’t mention if you succeeded in verifying and installing the correct graphics driver for your graphics hardware. It’s distinct from the X server.