G4SiPM Visualization GUI window

Hi,

I am currently new to Geant4 and Linux. I am currently trying to recreate a sample simulation of G4Sipm (external software package) after having installed Geant4 (version geant4.10.06.p02). It does run the command however no GUI window for graphical representation of the simulation is shown as suggested by this documentation https://g4sipm.readthedocs.io/en/latest/sample.html instead it gives me this

G4SiPM SampleSim Copyright (C) 2012 Tim Tim Niggemann, III Phys. Inst. A, RWTH Aachen University et. al.
This program comes with ABSOLUTELY NO WARRANTY; for details type show w'. This is free software, and you are welcome to redistribute it under certain conditions; type show c’ for details.


Geant4 version Name: geant4-10-06-patch-02 (29-May-2020)
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/


G4SipmUiMessenger::initRandomEngine(): CLHEP::MTwistEngine with seed 1596551731446814

Birks coefficients used in run time

Any help or advice is greatly appreciated (I tried both enabling both open GL and QT options for the software package as I installed them in Geant4 but to no avail).

1 Like

I have the exact same problem, is there a solution for this?

G4SiPM was made to work with Geant4 version ~10.0 (and not updated since then), so using Geant4 10.6 might be causing the GUI and other issues you’re seeing. You could try running it in a SLC6 container with Geant4 10.0, which might work…

There is also a fork of G4SiPM on GitHub that includes some updates to work with Geant4 11: GitHub - c-dilks/g4sipm at geant11-fixes. I guess that this version might work better with newer Geant4 versions…

Just my five cents!

1 Like

Thank you very much for your response… Yes, in the GitHub submitted proposal, there are no errors regarding the absence of some members comparing the last version. However, CMAKeLists must be modified to the version used.
But unfortunately even with no errors the same window appears " I use geant4- V11.2.1"

Capture d’écran du 2024-11-13 11-05-21

Is there any other input beyond the “Birks coefficients…” line? There’s usually something about registered graphics drivers etc. Please also see How to post code snippets on how to post that info rather than screenshots.

Hi,
Thanks for the clarification, I’m a beginner so I’ll give you some general information about what I did:

  • I am using geant4- V11.2.1, In order to use the g4sipm toolkits , I followed the recommendations listed on the web page: 1. Getting started — G4SiPM 1.0.0 documentation.
  • when renning “ccmake …/source” I encountered problems with the cmake-minimum-required compatibility, but the errors disappeared after modifying it by our version in CMAKelist.txt.
  • then , in order to run the sample I did run the build, by “make” commande , which was built normal at the end
  • and finaly ./sample to creates a GUI window in which we should see a graphical representation of the simulation.( but no GUI window appears ).
*chergui@chergui:~/Software/geant4/g4sipm-geant11-fixes/build/sample$* **make**
[ 14%] Built target jansson
[ 64%] Built target g4sipm
[ 90%] Built target g4sipm_sample
[ 92%] Built target sample
[ 94%] Built target gtest
[ 97%] Built target gtest_main
[100%] Built target sampleTest
*chergui@chergui:~/Software/geant4/g4sipm-geant11-fixes/build/sample$* **./sample**
G4SiPM SampleSim Copyright (C) 2012 Tim Tim Niggemann, III Phys. Inst. A, RWTH Aachen University et. al.
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

**************************************************************
 Geant4 version Name: geant4-11-02-patch-01    (16-February-2024)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

G4SipmUiMessenger::initRandomEngine(): CLHEP::MTwistEngine with seed 1731576158561819
### Birks coefficients used in run time
*chergui@chergui:~/Software/geant4/g4sipm-geant11-fixes/build/sample$* 

Hey @ cherifchergui

The code uses macros G4VIS_USE.

In Geant4, the macros G4VIS_USE was traditionally used to conditionally compile visualization and user interface components. However, starting from Geant4 version 10.6, this macro has been deprecated and are no longer defined by default.

See: G4UI_USE and G4VIS_USE retired in 4.10.06?

Please take a look at examples/documentation on how to properly define the GUI.

Hello Dmitry,
Thanks for the help …The problem was really in the conditionals compile visualization used on the sample.cc program page.

1 Like

Hello everyone.
After I was able to run the example "sample " and display the graphical interface and was able to change the types of detectors…I am now facing a problem in how to record data and plot curves.
I have install both Root, Sqlite and Python libraries but I did not understand how to extract the data and draw it.

chergui@chergui:~/Software/geant4/g4sipm/build/sample$ python plots/sqlite/pde.py
Traceback (most recent call last):
  File "/home/chergui/Software/geant4/g4sipm/build/sample/plots/sqlite/pde.py", line 114, in <module>
    name, pitch, cellPitch, numberOfCells = cur.execute("SELECT name, pitch, cellPitch, numberOfCells FROM sipmModel;").fetchone()
                                            ^^^
NameError: name 'cur' is not defined. Did you mean: 'chr'?

Looking at the pde.py script my only guess would be that it’s not picked up any files as a result of the line:

If that’s empty the loop won’t execute and the cur variable never created, so check if files is actually picking up the output files.

Thanks for your quick response.
The results file is not empty, it contains results with a “.txt” extension, which contain different run results. Can you tell me how can I check if files is actually picking up the output files?

If they are “.txt” files, then they are almost certainly not (unless the application does something very odd) in sqlite format and so not suitable for use with that script. Note that line 19 is only searching for files with a .sqlite extension.

Consult the applications documentation for how to analyse txt output, or how to get it to output proper sqlite files.

I believe it is difficult to provide advice based solely on our knowledge of geant4…

G4SimPM is an external geant4 application with limited and not very detailed documentation.
To give you a reasonable answer, someone would need to deeply explore the application, which is rather unlikely. It might be faster for you to dedicate some time to understanding the logic of the application yourself…

Hi @cherifchergui

Thank for posting in the Geant4 forum.

In my experience, one usually starts the work by simulating the energy deposited in the sensitive material (which is the main purpose of Geant4), and then comparing the simulation with the experimental readout data. Including optics simulation in the first step may be an overkill.

In addition, performing optics simulation may be unnecessary, and it may be enough to include a parametric response of the signal readout. In case of SiPM, a more simple and maintained library [1] can perform the digitization step after simulation.

Another alternative is to use that library that you mentioned only for digitization (if you can understand what is doing), and develop your own scoring mechanism that allow you to extract the required information from the Geant4 simulation.

Finally, I would like to mention that the beginners course [2] show how to develop a Geant4 application from scratch.

Best,
Alvaro

[1] GitHub - EdoPro98/SimSiPM: Library for SiPM simulation
[2] First steps with Geant4 (15-19 April 2024): Timetable · Indico