I have followed all of the steps on the installation guide and have just tried to execute the B1 example after setting the environment variables, but when doing so it says that there is a debug error which doesn’t allow me to retry. I am very new to all of this so any help is appreciated!
Can you post the actual output?
To confirm, you have successfully built/compiled the example, but when you try and run the executable you get the error?
I am now experiencing issues with the initial build of Geant 4 which is now producing errors. I will try all again and get back to you with the B1 example build.
These are the errors that appear when trying to run the executable for the B1 example. I have followed the steps on the installation guide and changed the path and added another environment variable.
It looks like the path to the Geant4 DLLs is missing from the
PATH environment variable for the session.
Thanks for your reply. I have set all the environment variables like it said to do in the setup section and have set the path to the folder that contains G4TREE.dir but I am still shown the same errors.
Did you make any changes to the build/install of geant4 itself? and if so have you re-run the cmake step in the build directory for B1 example since making any those changes? Your copy of the B1 example may be looking for things from the older install.
If you navigate to
C:\Users\????\Documents\Geant4\geant_10_07\geant_4_build\source i.e. the directory you added to
Path, do you see
If not, it looks like you have added the wrong path to the environment variable in the step linked in the post above.
I have made sure that the directory I added to the path leads to the .dll files and I have also re-run the cmake step but I am now having problems running this step as it says the installation prefix for geant4 cannot be found. I think I will try again through all of the steps with all of the advice and hopefully all of the files should be in the correct place to be found by Cmake.
After reinstalling and making sure that all of the files have been saved to the correct places and that all of the directory have been directed correctly, I am encountering the debug problem again.
A couple of things to try:
- When you run the example from the command prompt, what is output in the terminal? This usually prints a bit more than the above window.
- In that same terminal, what does the
setcommand output for the environment variables?
- Did you compile/link the example with the same build mode (e.g. Release)?
- What visualisation drivers, if any, did you enable when installing Geant4 (not the example)?
This is the output that I am recieving once I have changed the build mode to both be release instead of debug. I have also tried setting the environment variable STATEDATA to the correct file but that message still appears
The variable is
G4ENSDFSTATEDATA and looks like you set it here:
Can you check that it (and the other variables listed there) are set in the session you are running in?
PATH at least must be right as the program wouldn’t have run to this point otherwise.
Looks like the macro files have not been copied to your build directory during the cmake step
ERROR: Can not open a macro file <init_vis.mac>. Set macro path with "/control/macroPath" if needed.
Don’t know why they would not have been, but for the moment, you should be able to fix this by copying all files ending
.mac from the source directory into the build directory.
Thank you I will try this.
When trying to run the application, the output seems to show no errors and another window opens which is shown below. However, I cannot interact with the other window as it says that it is not responding every time I try to open it. Is this something to do with my system or is there another issue I need to resolve.
Available UI session types: [ Win32, GAG, csh ]
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** ExceptionHandler is not defined ***
*** G4Exception : UI0002
issued by : G4UIExecutive::G4UIExecutive()
Specified session type is not build in your system,
or no session type is specified.
A fallback session type is used.
*** This is just a warning message. ***
-------- WWWW ------- G4Exception-END -------- WWWW -------
Geant4 version Name: geant4-10-07 (4-December-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/
<<< Reference Physics List QBBC
Visualization Manager instantiating with verbosity “warnings (3)”…
Visualization Manager initialising…
Registering graphics systems…
You have successfully registered the following graphics systems.
Registered graphics systems are:
OpenGLImmediateWin32 (OGLIWin32, OGLI)
OpenGLStoredWin32 (OGLSWin32, OGL, OGLS)
Registering model factories…
You have successfully registered the following model factories.
Registered model factories:
Registered filter factories:
You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none
Some /vis commands (optionally) take a string to specify colour.
“/vis/list” to see available colours.
Change the default number of threads (in multi-threaded mode)
Checking overlaps for volume Envelope (G4Box) … OK!
Checking overlaps for volume Shape1 (G4Cons) … OK!
Checking overlaps for volume Shape2 (G4Trd) … OK!
World is registered to the default region.
HadronInelasticQBBC Construct Process:
Emin(FTFP)= 3 GeV; Emax(FTFP)= 100000 GeV Emin(BERT)= 1 GeV; Emax(BERT)= 6 GeV; Emax(BERTpions)= 12 GeV; Emin(BIC) = 0 GeV; Emax(BIC)= 1.5 GeV.
Adding tracking cuts for neutron TimeCut(ns)= 10000 KinEnergyCut(MeV)= 0
Macro file for the visualization setting in the initialization phase
of the B1 example when running in interactive mode
Use these open statements to open selected visualization
Use this open statement to create an OpenGL view:
/vis/open OGL 600x600-0+0
/vis/viewer/create ! ! 600x600-0+0
Use this open statement to create an OpenInventor view:
Use this open statement to create a .prim file suitable for
viewing in DAWN:
Use this open statement to create a .heprep file suitable for
viewing in HepRApp:
Use this open statement to create a .wrl file suitable for
viewing in a VRML viewer:
Disable auto refresh and quieten vis messages whilst scene and
trajectories are established:
Visualization verbosity changed to errors (2)
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0
Specify view angle:
/vis/viewer/set/viewpointVector -1 0 0
/vis/viewer/set/lightsVector -1 0 0
Specify style (surface, wireframe, auxiliary edges,…)
Draw smooth trajectories at end of event, showing trajectory points
as markers 2 pixels wide:
Attributes available for modeling and filtering with
Event ID (EventID): G4int
Run ID (RunID): G4int
Charge (Ch): unit: e+ (G4double)
Track ID (ID): G4int
Initial kinetic energy (IKE): G4BestUnit (G4double)
Initial momentum magnitude (IMag): G4BestUnit (G4double)
Initial momentum (IMom): G4BestUnit (G4ThreeVector)
No. of points (NTP): G4int
PDG Encoding (PDG): G4int
Parent ID (PID): G4int
Particle Name (PN): G4String
Auxiliary Point Position (Aux): G4BestUnit (G4ThreeVector)
Step Position (Pos): G4BestUnit (G4ThreeVector)
(if too many tracks cause core dump => /tracking/storeTrajectory 0)
Draw hits at end of event:
To draw only gammas:
To invert the above, drawing all particles except gammas,
keep the above two lines but also add:
Many other options are available with /vis/modeling and /vis/filtering.
For example, to select colour by particle ID:
To select or override default colours (note: e+ is blue by default):
#/vis/modeling/trajectories/drawByParticleID-0/set e+ yellow
To superimpose all of the events from a given run:
/vis/scene/add/text2D 0.9 -.9 24 ! ! exampleB1
or, if your system does not support right-adjustment
#/vis/scene/add/text2D 0 -.9 24 ! ! exampleB1
Axes, scale, etc.
Attach text to one edge of Shape1, with a small, fixed offset
/vis/scene/add/text 0 6 -4 cm 18 4 4 Shape1
Attach text to one corner of Shape2, with a small, fixed offset
/vis/scene/add/text 6 7 10 cm 18 4 4 Shape2
To get nice view
Make the “World” box invisible
/vis/geometry/set/visibility World 0 false
“Envelope” is transparent blue to represent water
/vis/geometry/set/colour Envelope 0 0 0 1 .3
/vis/viewer/set/viewpointThetaPhi 120 150
Re-establish auto refreshing and verbosity:
G4OpenGLViewer::DrawText: Not implemented for “viewer-0 (OpenGLStoredWin32)”
Called with G4Text: “exampleB1”
layout right, offset (0,0)
G4VMarker: position: (0.9,-0.9,0), world size: 0, screen size: 24
fill style: no fill
G4VisAttributes: visible, daughters visible, colour: (0,1,0,1) (green)
linestyle: solid, line width: 1, min line segments per circle: 3
drawing style: not forced, auxiliary edge visibility: not forced
line segments per circle: not forced.
time range: (-1e+100,1e+100)
G4AttValue pointer is zero, G4AttDef pointer is zero
Visualization verbosity changed to warnings (3)
For file-based drivers, use this to create an empty detector view:
The simple Win32 window is not interactive. You can change views and styles with vis commands, e.g.,
/vis/viewer/set/viewpointThetaPhi 45 50 deg, but that’s it.
If you want an interactive window on Windows the best option is to install and build with Qt. See Installation Guide.
Thank you for your help.