Visualization of Configuration using Geant4

Hi,
The Qt visualization viewer by Geant4 is not available from the CVMFS. As a result, now the [VisualizationGeant4] of the AllPix2 conf file does not work for the CVMFS installation of AllPix2. Is it possible to save the Geant4 configuration in some output file and then see it using a local Geant4 installation? At present, I see the output file containing only the quality parameter histograms (like cluster width, drift velocity etc) saved in the modules.root file; I don’t see anything related to the detector configuration.

Thank you very much,
Arka

Dear @asantra

For me the visualization works flawlessly with the CVMFS version, both on local machines as well as on LXPLUS:

I have used the following configuration files as an example:

Main config

[Allpix]
detectors_file = "detector.conf"
log_level = "INFO"
output_directory = "output"
number_of_events = 5

[GeometryBuilderGeant4]

[DepositionGeant4]
physics_list = QGSP_BERT
number_of_particles = 1
particle_type = "e-"
source_energy = 5GeV
source_type = "beam"
source_position = 0 0 -10mm
beam_size = 1.5mm
beam_divergence = 1mrad 1mrad
beam_direction = 0 0 1

[VisualizationGeant4]
mode = "gui"
driver = "OGL"

Geometry

[mydetector]
type = "cmsp1"
position = 0mm 0mm 0mm
orientation = 0deg 0deg 0deg

Could you try again and maybe provide some more information on what the issue is?

/Simon

Hi Simon,
For some reason, I cannot get the visualization on my lxplus/institute cluster having access to CVMFS. Here is what I am doing:

  1. Sourcing the Geant4 setup from CVMFS:

source “/cvmfs/sft.cern.ch/lcg/releases/LCG_97/Geant4/10.06.p01/x86_64-centos7-gcc8-opt/Geant4-env.sh”
cd “/cvmfs/sft.cern.ch/lcg/releases/LCG_97/Geant4/10.06.p01/x86_64-centos7-gcc8-opt/bin/”
source geant4.sh
cd $OLDPWD

  1. Sourcing the allpix:

source /cvmfs/clicdp.cern.ch/software/allpix-squared/1.6.1/x86_64-centos7-gcc10-opt/setup.sh

This is the log of running on lxplus:

>allpix -c tutorial-simulation_2.conf

|12:26:25.033| (STATUS) Welcome to Allpix^2 v1.6.1
|12:26:25.033| (STATUS) Initialized PRNG with system entropy seed 16551362213321667385
|12:26:32.259| (WARNING) Main ROOT file /afs/cern.ch/user/a/asantra/AllPix/output/modules.root exists and will be overwritten.
|12:26:32.284| (STATUS) Loaded 3 modules
|12:26:32.284| (STATUS) Initializing 3 module instantiations
|12:26:32.681| (INFO) [I:GeometryBuilderGeant4] No overlapping volumes detected.
|12:26:32.684| (INFO) [I:DepositionGeant4] Using G4 physics list “QGSP_BERT”
|12:26:32.685| (INFO) [I:DepositionGeant4] Setting G4 production cut to 20um, derived from properties of detector “mydetector”
|12:26:32.781| (INFO) [I:DepositionGeant4] Not depositing charges in mydetector because there is no listener for its output
|12:26:32.781| (ERROR) [I:DepositionGeant4] Not a single listener for deposited charges, module is useless!
Fontconfig warning: ignoring UTF-8: not a valid region tag
|12:26:51.538| (STATUS) Initialized 3 module instantiations
|12:26:57.578| (STATUS) Finished run of 5 events
|12:26:57.578| (WARNING) [F:DepositionGeant4] No charges deposited
|12:26:57.579| (INFO) [F:VisualizationGeant4] Starting visualization session`

This is the running log from my institute’s cluster. It shows an error from libGL

allpix -c tutorial-simulation_2.conf
|13:31:17.782| (STATUS) Welcome to Allpix^2 v1.6.1
|13:31:17.782| (STATUS) Initialized PRNG with system entropy seed 5838251852954104747
|13:31:18.597| (WARNING) Main ROOT file /srv01/agrp/arkas/allPix2/output/modules.root exists and will be overwritten.
|13:31:18.606| (STATUS) Loaded 3 modules
|13:31:18.606| (STATUS) Initializing 3 module instantiations
|13:31:18.679| (INFO) [I:GeometryBuilderGeant4] No overlapping volumes detected.
|13:31:18.680| (INFO) [I:DepositionGeant4] Using G4 physics list “QGSP_BERT”
|13:31:18.680| (INFO) [I:DepositionGeant4] Setting G4 production cut to 20um, derived from properties of detector “mydetector”
|13:31:18.729| (INFO) [I:DepositionGeant4] Not depositing charges in mydetector because there is no listener for its output
|13:31:18.729| (ERROR) [I:DepositionGeant4] Not a single listener for deposited charges, module is useless!
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version
|13:31:19.074| (STATUS) Initialized 3 module instantiations
|13:31:20.442| (STATUS) Finished run of 5 events
|13:31:20.442| (WARNING) [F:DepositionGeant4] No charges deposited
|13:31:20.442| (INFO) [F:VisualizationGeant4] Starting visualization session`

For both cases, I see an empty window (attached). Should I source Geant4 setup from the CVMFS in a different way?

Thank you very much,
Arka

Hi @asantra

you don’t source Geant4 at all, the Allpix Squared environment does that for you. Just source that one and try again - maybe it was a wrong Geant4 version?

/Simon

Hi @simonspa ,
We tried from a Linux machine and indeed the allpix2 setup from CVMFS works perfectly, including the visualization. Digging a bit deeper, we found out that the problem lies with the XQuartz X11 forwarding system of Mac OS, as described here:
Qt viewer: scene tree empty - #3 by allison - Recording, Visualizing and Persisting Data - Geant4 Forum

This is nothing to do with Allpix2. We are trying to find a solution. If we find it, we will update this answer for future users.

Many thanks,
Arka

2 Likes

Dear @asantra

thanks a lot for the update! If you find a solution, we could even add that to the user manual for higher visibility.

Good luck!
Simon