The scene has no extent

Hello,
I am using Geant4.10.6.p01 on Windows.

I had an visualisation issue whereby I had the following message:
*** G4Exception : visman0106
issued by : G4VSceneHandler::ProcessScene
The scene has no extent.
*** This is just a warning message. ***

but I was unable to view any of the trajectories and as it was the only message, I presumed that was the reason. I “solved” the issue (without really understanding why) by ensuring that this command:
ui = new G4UIExecutive(argc, argv, “Win32”);

was executed near the start of the main program. This resulted in some text being sent to another window and the trajectories now appearing in the graphics window.

Now that I could see my trajectories, I have included a non-uniform electric field, but the problem with the scene having no extent has returned. Does anyone have a suggestion to a more permanent/better solution to this ?
I can add some code or .mac files in case anyone willing to help would find that useful.

Many thanks in advance.
Chris

It is complaining because there is nothing in the scene to determine where to place and point the camera. Normally, there will be detector elements that determine the extent before you draw any trajectories. Normally people do this with a /vis/drawVolume command - do you not do this? (Trajectories themselves don’t get an extent - how could now know where they going to be?)

If you don’t want to have the detector in the scene you can add your own extent with /vis/scene/add/extent.

Hi John,
Thanks for getting back to me. Yes I did add the commands you suggest. In fact the first warning message says that I need to do this (e.g. below).
-------- WWWW ------- G4Exception-START -------- WWWW ------- *** G4Exception : visman0202 issued by : G4Scene::CalculateExtent Scene has no extent. Please activate or add something. The camera needs to have something to point at! Add a volume. (You may need “/run/initialize”.) Or use “/vis/scene/add/extent”. “/vis/scene/list” to see list of models. *** This is just a warning message. *** -------- WWWW -------- G4Exception-END --------- WWWW -------

In fact at the moment, the problem is that a trajectory is shown, but then it disappears and a little while later another trajectory appears and then disappears, but I also get the “scene has no extent errors” as well.

The current vis.mac file is listed below:
# Macro file for the visualization setting in the initialization phase
# of the B1 example when running in interactive mode
#
#
# Use this open statement to create an OpenGL view:
/vis/open OGLIWin32 600x600-0+0
#/vis/open OGL 600x600-0+0
#
# Draw geometry:
/vis/drawVolume
#
# Specify view angle:
/vis/viewer/set/viewpointThetaPhi 90. 180.
#
# Draw smooth trajectories at end of event, showing trajectory points
# as markers 2 pixels wide:
/vis/scene/add/trajectories smooth
#
# To superimpose all of the events from a given run:
/vis/scene/endOfEventAction accumulate
#
# Re-establish auto refreshing and verbosity:
/vis/viewer/set/autoRefresh true
/vis/verbose warnings
#
# For file-based drivers, use this to create an empty detector view:
#/vis/viewer/flush

but I also tried adding commands at the prompt such as
vis/scene/add/userAction -100 100 -100 100 -100 100 cm
and
/vis/scene/add/extent
and
/vis/viewer/zoom 0.1

(just in case I was zoomed into a region where nothing exists! - I issued the command several times to make sure I was zoomed out quite far.)

The init_vis.mac file is this:
# Macro file for the initialization phase of example B1
# when running in interactive mode with visualization
#
# Set some default verbose
#
/control/verbose 2
/control/saveHistory
/run/verbose 2
#
# Visualization setting
/control/execute vis.mac

I would have thought that the fact that I see trajectories (briefly!) sometimes means that I am pointing in the right direction and there is something there to view…

Best Wishes
Chris

Hi Chris

This is a puzzle. But here are some comments:

/vis/open OGL should default to OGLSWin32. Did you try that?

Have you defined some vis user actions?

But why trajectories should appear just fleetingly is a mystery. Maybe it’s a Windows problem. Make sure your system and, in particular, your graphics drivers are up to date.

Best wishes

John

Hi John,
I had a go with the program on a Linux system over the weekend. This time I get just a small dot in the middle. I have also tried using just /vis/open OGL - but no change. The
/vis/scene/add/userAction -100 100 -100 100 -100 100 cm
command was something that I just tried (just hoping it might do something without really understanding the problem or what the command actually did !).

I still get the usual G4Exception:

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

The first few lines of output are as follows:
.\Release\SEM.exe YieldCurve.gdml YieldSilicon.mac
Available UI session types: [ Win32, GAG, csh ]
/control/saveHistory
/run/verbose 2

Visualization setting

/control/execute vis.mac

Macro file for the visualization setting in the initialization phase

of the B1 example when running in interactive mode

Use this open statement to create an OpenGL view:

#/vis/open OGLIWin32 600x600-0+0
/vis/open OGL
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600
/vis/viewer/refresh
#/vis/open OGL 600x600-0+0

Draw geometry:

/vis/drawVolume
/vis/scene/create
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0

Later there are the following lines, which look rather suspicious, but I would have thought if there are null pointers, then the program would crash…

Region – – appears in <LogWorld_PV> world volume
This region is in the mass world.
Root logical volume(s) : LogWorld
Pointers : G4VUserRegionInformation[0000000000000000], G4UserLimits[0000000000000000], G4FastSimulationManager[0000000000000000], G4UserSteppingAction[0000000000000000]
Materials : Galactic BlackHole
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm

Region – – is not associated to any world.
Root logical volume(s) :
Pointers : G4VUserRegionInformation[0000000000000000], G4UserLimits[0000000000000000], G4FastSimulationManager[0000000000000000], G4UserSteppingAction[0000000000000000]
Materials :
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm

Many thanks
Chris
P.S.

The whole output is below, so if you can spot anything, that would be appreciated.
.\Release\SEM.exe YieldCurve.gdml YieldSilicon.mac
Available UI session types: [ Win32, GAG, csh ]
/control/saveHistory
/run/verbose 2

Visualization setting

/control/execute vis.mac

Macro file for the visualization setting in the initialization phase

of the B1 example when running in interactive mode

Use this open statement to create an OpenGL view:

#/vis/open OGLIWin32 600x600-0+0
/vis/open OGL
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600
/vis/viewer/refresh
#/vis/open OGL 600x600-0+0

Draw geometry:

/vis/drawVolume
/vis/scene/create
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

/vis/sceneHandler/attach

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0106
issued by : G4VSceneHandler::ProcessScene
The scene has no extent.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

Specify view angle:

/vis/viewer/set/viewpointThetaPhi 90. 180.
/vis/viewer/refresh

Draw smooth trajectories at end of event, showing trajectory points

as markers 2 pixels wide:

/vis/scene/add/trajectories smooth
/tracking/storeTrajectory 2
Attributes available for modeling and filtering with
“/vis/modeling/trajectories/create/drawByAttribute” and
“/vis/filtering/trajectories/create/attributeFilter” commands:
G4TrajectoriesModel:
Event ID (EventID): G4int
Run ID (RunID): G4int
G4SmoothTrajectory:
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
G4SmoothTrajectoryPoint:
Auxiliary Point Position (Aux): G4BestUnit (G4ThreeVector)
Step Position (Pos): G4BestUnit (G4ThreeVector)
WARNING: Trajectory storing has been requested. This action may be
reversed with “/tracking/storeTrajectory 0”.
/vis/scene/notifyHandlers

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0106
issued by : G4VSceneHandler::ProcessScene
The scene has no extent.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

To superimpose all of the events from a given run:

/vis/scene/endOfEventAction accumulate
WARNING: The vis manager will keep up to 100 events.
This may use a lot of memory.
It may be changed with, e.g., “/vis/scene/endOfEventAction accumulate 10”.

Re-establish auto refreshing and verbosity:

/vis/viewer/set/autoRefresh true
/vis/viewer/refresh
/vis/verbose warnings
Visualization verbosity changed to warnings (3)

For file-based drivers, use this to create an empty detector view:

#/vis/viewer/flush
/run/beamOn 50

=== Deexcitation model UAtomDeexcitation is activated for 1 region:

      DefaultRegionForTheWorld  1  1  1

=== Auger cascade flag: 1

=== Ignore cuts flag: 0

phot: for gamma SubType=12 BuildTable=0
LambdaPrime table from 200 keV to 10 TeV in 154 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
PenPhotoElec : Emin= 0 eV Emax= 10 TeV Fluo

compt: for gamma SubType=13 BuildTable=1
Lambda table from 100 eV to 1 MeV, 20 bins/decade, spline: 1
LambdaPrime table from 1 MeV to 10 TeV in 140 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
PenCompton : Emin= 0 eV Emax= 10 TeV Fluo

conv: for gamma SubType=14 BuildTable=1
Lambda table from 1.022 MeV to 10 TeV, 20 bins/decade, spline: 1
===== EM models for the G4Region DefaultRegionForTheWorld ======
PenConversion : Emin= 0 eV Emax= 10 TeV

Rayl: for gamma SubType=11 BuildTable=1
Lambda table from 100 eV to 100 keV, 20 bins/decade, spline: 0
LambdaPrime table from 100 keV to 10 TeV in 160 bins
===== EM models for the G4Region DefaultRegionForTheWorld ======
PenRayleigh : Emin= 0 eV Emax= 100 GeV
CADPhysicsSingleScattering::BuildPhysicsTable() for ssc and particle e-
CADPhysicsSingleScattering: Galactic is treated as a gas, with Mott cross sections starting from zero energy.
Trying to open file for element 1… CADPhysicsSingleScattering: BlackHole is treated as a gas, with Mott cross sections starting from zero energy.
Trying to open file for element 1… CADPhysicsDI: Start BuildPhysicsTable
CADPhysicsDI: Start BuildEnrange LowestKineticEnergy(eV) = 0.01HighestKineticEnergy(eV) = 1e+06 1e-06
num Energy
CADPhysicsDI: Start Material Galactic
CADPhysicsDI: Calculate cross sections for Galactic
CADPhysicsDI: Using df file: C:\Users\CATIA\Geant4\geant4_10_06_p01\SEM/df/df_Galactic.dat
CADPhysicsDI: Start Material BlackHole
CADPhysicsDI: Calculate cross sections for BlackHole
CADPhysicsDI: Using df file: C:\Users\CATIA\Geant4\geant4_10_06_p01\SEM/df/df_BlackHole.dat
Failed to create isotope ion with Z=1 and A=1
Failed to create isotope ion with Z=1 and A=2
Failed to create isotope ion with Z=1 and A=1
Failed to create isotope ion with Z=1 and A=2

LowEnergyIoni: Total cross sections from EEDL database.
Gamma energy sampled from a parametrised formula.
Implementation of the continuous dE/dx part.
At present it can be used for electrons in the energy range [250eV,100GeV].
The process must work with G4LowEnergyBremsstrahlung.

LowEnBrem: Total cross sections from EEDL database.
Gamma energy sampled from a parameterised formula.
Implementation of the continuous dE/dx part.
At present it can be used for electrons in the energy range [250eV,100GeV].
The process must work with G4LowEnergyIonisation.

Region – – appears in <LogWorld_PV> world volume
This region is in the mass world.
Root logical volume(s) : LogWorld
Pointers : G4VUserRegionInformation[0000000000000000], G4UserLimits[0000000000000000], G4FastSimulationManager[0000000000000000], G4UserSteppingAction[0000000000000000]
Materials : Galactic BlackHole
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm

Region – – is not associated to any world.
Root logical volume(s) :
Pointers : G4VUserRegionInformation[0000000000000000], G4UserLimits[0000000000000000], G4FastSimulationManager[0000000000000000], G4UserSteppingAction[0000000000000000]
Materials :
Production cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm

========= Table of registered couples ==============================

Index : 0 used in the geometry : Yes
Material : Galactic
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 250 eV e- 250 eV e+ 250 eV proton -1 MeV
Region(s) which use this couple :
DefaultRegionForTheWorld

Index : 1 used in the geometry : Yes
Material : BlackHole
Range cuts : gamma 1 mm e- 1 mm e+ 1 mm proton 1 mm
Energy thresholds : gamma 250 eV e- 250 eV e+ 250 eV proton -1 MeV
Region(s) which use this couple :
DefaultRegionForTheWorld

====================================================================

Start closing geometry.
G4GeometryManager::ReportVoxelStats – Voxel Statistics

Total memory consumed for geometry optimisation:   0 kByte
Total CPU time elapsed for geometry optimisation: 0 seconds

Voxelisation: top CPU users:
Percent   Total CPU    System CPU       Memory  Volume
-------   ----------   ----------     --------  ----------
   0.00         0.00         0.00            0k samplecontainer

Voxelisation: top memory users:
Percent     Memory      Heads    Nodes   Pointers    Total CPU    Volume
-------   --------     ------   ------   --------   ----------    ----------
 100.00          0k         1        4          6         0.00    samplecontainer

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

/vis/scene/notifyHandlers scene-0

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0106
issued by : G4VSceneHandler::ProcessScene
The scene has no extent.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model.
See commands in /vis/modeling/trajectories/ for other options.

Run 0 starts.

Event 0
Event 1
Event 2
Event 3
Event 4
Event 5
Event 6
Event 7
Event 8
Event 9
Event 10
Event 11
Event 12
Event 13
Event 14
Event 15
Event 16
Event 17
Event 18
Event 19
Event 20
Event 21
Event 22
Event 23
Event 24
Event 25
Event 26
Event 27
Event 28
Event 29
Event 30
Event 31
Event 32
Event 33
Event 34
Event 35
Event 36
Event 37
Event 38
Event 39
Event 40
Event 41
Event 42
Event 43
Event 44
Event 45
Event 46
Event 47
Event 48
Event 49
Run terminated.
Run Summary
Number of events processed : 50
User=0.000000s Real=0.027398s Sys=0.000000s
50 events have been kept for refreshing and/or reviewing.

“/vis/reviewKeptEvents” to review them one by one.
“/vis/enable”, then “/vis/viewer/flush” or “/vis/viewer/rebuild” to see them accumulated.

Hi John, I decided to go back to the start, (from the program without visualisation). I am now creating trajectories on the screen, but it still comes up with the messages “The scene has no extent”. As regards the same program, but with the electric field added, I can now see trajectories, which I couldn´t before, but usually the screen turns black after the program finishes (sometimes, one or two trajectories or parts of trajectories remain). At least I think I made some progress.

Best Wishes
Chris

So…at the very first /vis/drawVolume, there is no extent. That’s puzzling. Did you /run/initialize, as it suggests? (You can also runManager->initialize() in your main program.)

Dear John,
I have been looking over some documents, such as the one you wrote with some co-authors on ArXiv (arXiv:1212.6923). Reading this reminded me about the #ifdef G4VIS_USE lines in the main program.
I checked these this morning, and it seems I must have commented them out at some point. I humbly apologise for this. However, it doesn´t solve the overall problem, but it does get me further. The program B1 compiles and runs and produces nice pictures so clearly G4VIS_USE is set correctly here.

My cmake command to build geant4 was:
cmake -DCMAKE_INSTALL_PREFIX=%HOMEPATH%\Geant4\geant4_10_06_p01\geant4_10_06_p01-install -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_OPENGL_WIN32=ON -DXERCESC_ROOT_DIR=C:\Users\CATIA\Xerces\xerces-c-3.2.3\xerces-c-3.2.3-install -DXERCESC_LIBRARY=%HOMEPATH%\Xerces\xerces-c-3.2.3\xerces-c-3.2.3-install\bin\xerces-c_3_2D.dll %HOMEPATH%\Geant4\geant4_10_06_p01\geant4_10_06_p01

However, my program does not output graphics now that the #ifdef G4VIS_USE command is back in place. I think the problem might lie in a CMake error. The output I get when I initially build the program is below:
cmake -DGeant4_DIR=%HOMEPATH%\Geant4\geant4_10_06_p01\geant4_10_06_p01-install\lib\Geant4-10.6.1 %HOMEPATH%\Geant4\geant4_10_06_p01\SEM
– Building for: Visual Studio 16 2019
– The C compiler identification is MSVC 19.25.28614.0
– The CXX compiler identification is MSVC 19.25.28614.0
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
– Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
CMake Error at /Users/CATIA/Geant4/geant4_10_06_p01/geant4_10_06_p01-install/lib/Geant4-10.6.1/Geant4PackageCache.cmake:23 (geant4_set_and_check_package_variable):
geant4_set_and_check_package_variable Macro invoked with incorrect
arguments for macro named: geant4_set_and_check_package_variable
Call Stack (most recent call first):
/Users/CATIA/Geant4/geant4_10_06_p01/geant4_10_06_p01-install/lib/Geant4-10.6.1/Geant4Config.cmake:240 (include)
CMakeLists.txt:14 (find_package)

– Found XercesC: C:/Users/CATIA/Xerces/xerces-c-3.2.3/xerces-c-3.2.3-install/lib/xerces-c_3D.lib (found suitable version “3.2.3”, minimum required is “3.2.3”)
– Found OpenGL: opengl32
– Configuring incomplete, errors occurred!
See also “C:/Users/CATIA/Geant4/geant4_10_06_p01/SEM-build/CMakeFiles/CMakeOutput.log”.

I found on the Geant4 forum, that in order to fix the problem with the statement:
geant4_set_and_check_package_variable Macro invoked with incorrect arguments for macro named: geant4_set_and_check_package_variable

I needed to change one line in Geant4PackageCache.cmake
from
geant4_set_and_check_package_variable(OPENGL_INCLUDE_DIR “” “”)
to
geant4_set_and_check_package_variable(OPENGL_INCLUDE_DIR “” STRING “”)

so thats what I did and then the error was no longer reported.
I suspect that my efforts to correct the error were incorrect, but I am not sure what to do now.

Best Wishes
Chris

Hi Chris

Well done. I’m not familiar with CMake but I will make sure your “fix” is looked over by the experts.

Just a couple of comments:

  • G4VIS_USE and G4UI_USE are no longer set in Geant4 10.6 - see Release Notes - so your comments above are somewhat of a mystery.

  • We have found (certainly on Linux) that it pays to check you have the latest driver for your particular graphics card.

Good luck

John

Dear John,
Since G4VIS_USE is no longer used, then including them will cause a program to fail (since their not set), so that fits with what I see. I have entered the viewer OGL, but its not in the candidate list:
Candidates are: ATree DAWNFILE OGLIWin32 OGLSWin32 RayTracer VRML1FILE VRML2FILE

However, when I run example B1, this does use OGL. Below I list the output from my program up to the point where it fails to find the OGL viewer. I can enter one of the viewers in the candidate list and I get further, but since the OGL viewer is not found, then I guess this is linked to the main problem. I assume it has something to do with the cmake error I found previously. I should say that the program previously worked under Geant4.10.3 and I updated it so that it could compile and build under the latest release. However, it is possible that I missed something in the visualisation side of things. This means that in all other respects everything works - but I messed up somewhere in visualisation…
Best Wishes
Chris

.\Release\SEM.exe YieldCurve.gdml


Geant4 version Name: geant4-10-06-patch-01 (14-February-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/


GDML file name = YieldCurve.gdml
G4GDML: Reading ‘YieldCurve.gdml’…
G4GDML: Reading definitions…
G4GDML: Reading materials…
G4GDML: Reading solids…
G4GDML: Reading structure…
Calling SEMGDMLReader::VolumeRead
G4GDML: Reading module ‘BulkSample.gdml’…
G4GDML: Reading definitions…
G4GDML: Reading materials…
G4Material WARNING: duplicate name of material Galactic
G4Material WARNING: duplicate name of material BlackHole
G4Material WARNING: duplicate name of material Silver
G4Material WARNING: duplicate name of material Aluminum
G4Material WARNING: duplicate name of material Oxygen
G4Material WARNING: duplicate name of material Gold
G4Material WARNING: duplicate name of material GalacticGold
G4Material WARNING: duplicate name of material Epoxy
G4Material WARNING: duplicate name of material BioGold
G4Material WARNING: duplicate name of material Diamond
G4Material WARNING: duplicate name of material GlassyCarbon
G4Material WARNING: duplicate name of material Graphite
G4Material WARNING: duplicate name of material Chromium
G4Material WARNING: duplicate name of material Copper
G4Material WARNING: duplicate name of material Germanium
G4Material WARNING: duplicate name of material Iron
G4Material WARNING: duplicate name of material Molybdenum
G4Material WARNING: duplicate name of material Hydrogengas
G4Material WARNING: duplicate name of material Nickel
G4Material WARNING: duplicate name of material Nitrogen
G4Material WARNING: duplicate name of material Platinum
G4Material WARNING: duplicate name of material Silicon
G4Material WARNING: duplicate name of material Tin
G4Material WARNING: duplicate name of material Tantalum
G4Material WARNING: duplicate name of material Titanium
G4Material WARNING: duplicate name of material Tungsten
G4Material WARNING: duplicate name of material Backgroundgas
G4Material WARNING: duplicate name of material Alumina
G4Material WARNING: duplicate name of material AluminumArsenide
G4Material WARNING: duplicate name of material AluminumNitride
G4Material WARNING: duplicate name of material GalliumArsenide
G4Material WARNING: duplicate name of material GalliumNitride
G4Material WARNING: duplicate name of material IndiumArsenide
G4Material WARNING: duplicate name of material MagnesiumOxide
G4Material WARNING: duplicate name of material NickelSilicide
G4Material WARNING: duplicate name of material PMMA
G4Material WARNING: duplicate name of material Polyimide
G4Material WARNING: duplicate name of material SiliconCarbide
G4Material WARNING: duplicate name of material lowdensSiC
G4Material WARNING: duplicate name of material SiliconNitride
G4Material WARNING: duplicate name of material Silicon7Nitride7amorphous
G4Material WARNING: duplicate name of material Silicon7Nitride7homogeneous
G4Material WARNING: duplicate name of material Silicon7Nitride7cluster
G4Material WARNING: duplicate name of material SiliconOxide
G4Material WARNING: duplicate name of material lowk
G4Material WARNING: duplicate name of material lowk2
G4Material WARNING: duplicate name of material PdopedSiliconOxide
G4Material WARNING: duplicate name of material TantalumNitride
G4Material WARNING: duplicate name of material TitaniumOxide
G4Material WARNING: duplicate name of material Water
G4Material WARNING: duplicate name of material Watervapor
G4GDML: Reading solids…
G4GDML: Reading structure…
G4GDML: Reading setup…
G4GDML: Reading module ‘BulkSample.gdml’ done!
Exiting SEMGDMLReader::VolumeRead
G4GDML: Reading GDML extension…
SEMGDML: Reading detectors …
SEMGDML: Reading detector…
Number of stored detectors = 0
SEMGDML: Reading detector…
Number of stored detectors = 1
SEMGDML: Reading detector…
Number of stored detectors = 2
G4GDML: Reading setup…
G4GDML: Reading ‘YieldCurve.gdml’ done!
Stripping off GDML names of materials, solids and volumes …
Calling CADPhysicsPhysicsList. Version December 2007.

  • Includes Rutherford scattering model above 30keV. September 2010.
    Name of planar detector stored = #PlaneR#
    Name of planar detector stored = #PlaneT#
    Name of planar detector stored = #Sample#

The geometrical trees defined are :

LogWorld_PV[0] LogWorld 1 Galactic Atom density = 0.0598067 1/cm3
samplecontainer_PV[0] samplecontainer 3 Galactic Atom density = 0.0598067 1/cm3
LogSample_PV[0] LogSample 0 BlackHole Atom density = 0.0598067 1/cm3 /Sample
LogPlaneR_PV[0] LogPlaneR 0 Galactic Atom density = 0.0598067 1/cm3 /PlaneR
LogPlaneT_PV[0] LogPlaneT 0 Galactic Atom density = 0.0598067 1/cm3 /PlaneT
G4Transportation: Current values for thresholds related to the killing of looping tracks:
Warning Energy = 100 MeV ( below this tracks are killed without warning )
Important Energy = 250 ( above this tracks are given multiple chances )
Extra Trials = 10 ‘important’ tracks, i.e. those above ‘important’ energy
G4Transportation constructor> set fShortStepOptimisation to false
Visualization Manager instantiating with verbosity “warnings (3)”…
Visualization Manager initialising…
Registering graphics systems…

You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
OpenGLImmediateWin32 (OGLIWin32)
OpenGLStoredWin32 (OGLSWin32)

Registering model factories…

You have successfully registered the following model factories.
Registered model factories:
generic
drawByAttribute
drawByCharge
drawByOriginVolume
drawByParticleID
drawByEncounteredVolume

Registered filter factories:
attributeFilter
chargeFilter
originVolumeFilter
particleFilter
encounteredVolumeFilter

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.
Random number generator seeded with 1589357050
Using G4UIterminal
/control/saveHistory
/run/verbose 2

Visualization setting

/control/execute vis.mac

Macro file for the visualization setting in the initialization phase

of the B1 example when running in interactive mode

Use this open statement to create an OpenGL view:

#/vis/open OGLIWin32 600x600-0+0
#/vis/open OGL
/vis/open OGL 600x600-0+0
/vis/sceneHandler/create OGL
parameter value (OGL) is not listed in the candidate List.
Candidates are: ATree DAWNFILE OGLIWin32 OGLSWin32 RayTracer VRML1FILE VRML2FILE

Hi John,
I just figured why it wasn´t seeing the OGL viewer. The output after the setting up the OGL viewer now reads below. I still have the scene has no extent problem, but the OGL viewer is correctly setup.

Best Wishes
Chris

Use this open statement to create an OpenGL view:

#/vis/open OGLIWin32 600x600-0+0
#/vis/open OGL
/vis/open OGL 600x600-0+0
/vis/sceneHandler/create OGL
/vis/viewer/create ! ! 600x600-0+0
/vis/viewer/refresh

Use this open statement to create a .prim file suitable for

viewing in DAWN:

/vis/open DAWNFILE
/vis/sceneHandler/create DAWNFILE
/vis/viewer/create ! ! 600
Issue /vis/viewer/refresh or flush to see effect.

Use this open statement to create a .heprep file suitable for

viewing in HepRApp:

#/vis/open HepRepFile

Use this open statement to create a .wrl file suitable for

viewing in a VRML viewer:

#/vis/open VRML2FILE

Disable auto refresh and quieten vis messages whilst scene and

trajectories are established:

/vis/viewer/set/autoRefresh false
/vis/verbose errors
Visualization verbosity changed to errors (2)

Draw geometry:

/vis/drawVolume
/vis/scene/create
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

/vis/sceneHandler/attach

Specify view angle:

/vis/viewer/set/viewpointThetaPhi 90. 180.

Draw smooth trajectories at end of event, showing trajectory points

as markers 2 pixels wide:

/vis/scene/add/trajectories smooth
/tracking/storeTrajectory 2
Attributes available for modeling and filtering with
“/vis/modeling/trajectories/create/drawByAttribute” and
“/vis/filtering/trajectories/create/attributeFilter” commands:
G4TrajectoriesModel:
Event ID (EventID): G4int
Run ID (RunID): G4int
G4SmoothTrajectory:
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
G4SmoothTrajectoryPoint:
Auxiliary Point Position (Aux): G4BestUnit (G4ThreeVector)
Step Position (Pos): G4BestUnit (G4ThreeVector)
/vis/scene/notifyHandlers

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

To superimpose all of the events from a given run:

/vis/scene/endOfEventAction accumulate

Re-establish auto refreshing and verbosity:

/vis/viewer/set/autoRefresh true
/vis/verbose warnings
Visualization verbosity changed to warnings (3)

For file-based drivers, use this to create an empty detector view:

#/vis/viewer/flush

Hi John,
I believe I have got a little further with the scene having no extent problem. The original authors of the program had some files SEMVRML2File.cc, SEMVRML2File.hh (based on G4VRML2File), SEMVRML2FileSceneHandler.cc, SEMVRML2FileSceneHandler.hh (based on G4VRML2FileSceneHandler) SEMVRML2FileViewer.cc, SEMVRML2FileViewer.hh (based on G4VRML2FileViewer), SEMVisExecutive.hh and SEMVisExecutive.icc (based on G4VisExecutive)

Currently, I have disabled these files as they were for viewing with VRML only, but I think they are there to solve the Scene Extent problem.

There is a comment in the main program which says this
// This visualisation executive takes care of transparency in the model. Also it allows visualization on nm scale
//#include “SEMVisExecutive.hh”

Currently, I have replaced #include “SEMVisExecutive.hh” with #include “G4VisExecutive.hh”

I am guessing that they only used the VRML viewer and no other.

They seem to have had problems viewing things at the nm scale. Is this still a problem ? Do you think I need to write my own corresponding files for OGL ?

Best Wishes
Chris

Hi Chris

For me, the “no extent” problem is still a puzzle.

How big is your world? Even if it only a few nm, it should be OK. The world does not have to fit closely around your geometry - you can make it bigger, say a 1 cm cube?

I am interested in SEMVRML2. What sort of adaptation is it? If it an improvement on VRML2 we could incorporate the improvements or even provide it as an alternative driver.

Best wishes

John

Dear John,
Attached are the files for the SEMVRML2. Note that 2 files had a .icc extension, but the Geant4 forum didn´t let me upload them, so I changed the extension to .txt.
I have been looking at the scene extents problem today and since the human phantom example uses GDML data, then I was comparing code, trying to see if there was something that was not set in my code that was in the human phantom example. My world volume is supposed to be on the order of cm, although the interaction volume is on the order of nm. Not sure how familiar you are with GDML, but the file for setting up the geometry is below. I assume the point where it says name=“worldBox” is the point where the size is defined.
Some output from my program is:

Idle> /vis/scene/showExtents
/vis/scene/showExtents

Run-duration models:
Active: G4PhysicalVolumeModel LogWorld_PV:0 BasePath: TOP
G4VisExtent (bounding box):
X limits: 0 0
Y limits: 0 0
Z limits: 0 0
End-of-event models:
Active: G4TrajectoriesModel for any type of trajectory
G4VisExtent (bounding box):
X limits: 0 0
Y limits: 0 0
Z limits: 0 0
End-of-run models: none.Overall extent:

so yes, a zero extent !

GDML file follows
Best Wishes
Chris

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE gdml [

]>


&materials;

SEMVRML2File.cc (863 Bytes) SEMVRML2FileSceneHandler.cc (5.7 KB) SEMVRML2FileViewer.cc (6.7 KB)
SEMVisExecutive.hh (298 Bytes) SEMVRML2File.hh (414 Bytes) SEMVRML2FileSceneHandler.hh (3.5 KB) SEMVRML2FileViewer.hh (1.0 KB) SEMVisExecutive.txt (2.2 KB) SEMVRML2FileSceneHandler.txt (20.4 KB)

Thanks for the SEMVRML2 files. I’ll have a look at them.

Just a query…What is LogWorld_PV? Strange name. Is it meant to be a Logical volume or a physical volume? Whatever it is it has a zero extent. Sure the name’s right? Sure it has any daughters? Is it really the name of your world physical volume? What’s the output of

/vis/drawTree

Dear John,
The output of /vis/drawTree is:

Idle> /vis/ASCIITree/verbose 14
/vis/ASCIITree/verbose 14
G4ASCIITree verbosity now 14
Idle> /vis/drawTree
/vis/drawTree
/vis/open ATree
/vis/sceneHandler/create ATree
/vis/sceneHandler/attach
/vis/viewer/create ! ! 600
Issue /vis/viewer/refresh or flush to see effect.
/vis/drawVolume world
/vis/scene/create
/vis/scene/add/volume world -1 -1 none m 0 0 0 0 0 0

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0202
issued by : G4Scene::CalculateExtent
Scene has no extent. Please activate or add something.
The camera needs to have something to point at!
Add a volume. (You may need “/run/initialize”.)
Or use “/vis/scene/add/extent”.
“/vis/scene/list” to see list of models.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

/vis/sceneHandler/attach
/vis/viewer/flush
/vis/viewer/refresh viewer-3

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : visman0106
issued by : G4VSceneHandler::ProcessScene
The scene has no extent.
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

“LogWorld_PV”:0 / “LogWorld” / “worldBox”(G4Box), 5 L , 1.001e-22 kg/m3 (Galactic)
“samplecontainer_PV”:0 / “samplecontainer” / “samplecontainersolid”(G4Polycone), 0.382244 mm3, 1.001e-22 kg/m3 (Galactic)
“LogSample_PV”:0 / “LogSample” (SD=“Sample”) / “sampletube”(G4Polycone), 0.00157267 mm3, 1.001e-22 kg/m3 (BlackHole)
“LogPlaneR_PV”:0 / “LogPlaneR” (SD=“PlaneR”) / “PlaneR”(G4Polycone), 3.17835e-06 mm3, 1.001e-22 kg/m3 (Galactic)
“LogPlaneT_PV”:0 / “LogPlaneT” (SD=“PlaneT”) / “PlaneT”(G4Polycone), 2.94589e-06 mm3, 1.001e-22 kg/m3 (Galactic)
Calculating mass(es)…
Overall volume of “LogWorld_PV”:0, is 5 L and the daughter-included mass to unlimited depth is 5.005e-19 mg
G4ASCIITreeSceneHandler::EndModeling
/vis/viewer/update viewer-3
Reverting to viewer-0 (VRML2FILE)
Idle>

It would seem that the _PV is attached to the name in this piece of code:
void G4GDMLRead::GeneratePhysvolName(const G4String& nameIn,
G4VPhysicalVolume* physvol)
{
G4String nameOut(nameIn);

if (nameIn.empty())
{
std::stringstream stream;
stream << physvol->GetLogicalVolume()->GetName() << “_PV”;
nameOut = stream.str();
}
nameOut = eval.SolveBrackets(nameOut);

physvol->SetName(nameOut);
}

So it is the name of a physical volume and LogWorld seems to be the name picked up from the YieldCurve.gdml file below. I´m not sure about any daughters. I am looking into that now.

Best Wishes
Chris

<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE gdml [

]>


&materials;

OK. This explains it. It looks like LogSample_PV and the others have not been made daughters of the world volume. It looks like they have not been given a mother. Only one volume - the world - is allowed to have no mother.

Have a look at your detector construction code.

John

Hi John,
With regard to the daughters, I note that the program already outputs some information regarding that using this code:
void SEMDetectorConstruction::DumpGeometricalTree(G4VPhysicalVolume* aVolume,ostream& out,G4int depth)
{
for(int isp=0;isp<depth;isp++)
{ out << " “; }
out << aVolume->GetName() << “[” << aVolume->GetCopyNo() << “] "
<< aVolume->GetLogicalVolume()->GetName() << " "
<< aVolume->GetLogicalVolume()->GetNoDaughters() << " "
<< aVolume->GetLogicalVolume()->GetMaterial()->GetName() << " "
<< “Atom density = " << aVolume->GetLogicalVolume()->GetMaterial()->GetTotNbOfAtomsPerVolume()(cmcmcm) << " 1/cm3 ";
if(aVolume->GetLogicalVolume()->GetSensitiveDetector())
{
out << " " << aVolume->GetLogicalVolume()->GetSensitiveDetector()
->GetFullPathName();
}
G4Material
material = aVolume->GetLogicalVolume()->GetMaterial();
G4MaterialPropertiesTable* aMPT = material->GetMaterialPropertiesTable();
if(aMPT && material->GetState()==kStateGas) {
out << " gas fractions”;
char property[10]=””;
G4int gas = 0;
sprintf (property,“FRACTION%d”,gas);
while (aMPT->ConstPropertyExists(property)) {
out << " " << aMPT->GetConstProperty(property);
gas++;
sprintf (property,“FRACTION%d”,gas);
}
}
out << G4endl;
for(int i=0;iGetLogicalVolume()->GetNoDaughters();i++)
{ DumpGeometricalTree(aVolume->GetLogicalVolume()->GetDaughter(i),out,depth+1); }
}
The output is as follows:

The geometrical trees defined are :

LogWorld_PV[0] LogWorld 1 Galactic Atom density = 0.0598067 1/cm3
samplecontainer_PV[0] samplecontainer 3 Galactic Atom density = 0.0598067 1/cm3
LogSample_PV[0] LogSample 0 BlackHole Atom density = 0.0598067 1/cm3 /Sample
LogPlaneR_PV[0] LogPlaneR 0 Galactic Atom density = 0.0598067 1/cm3 /PlaneR
LogPlaneT_PV[0] LogPlaneT 0 Galactic Atom density = 0.0598067 1/cm3 /PlaneT
G4Transportation: Current values for thresholds related to the killing of looping tracks:
Warning Energy = 100 MeV ( below this tracks are killed without warning )
Important Energy = 250 ( above this tracks are given multiple chances )
Extra Trials = 10 ‘important’ tracks, i.e. those above ‘important’ energy
G4Transportation constructor> set fShortStepOptimisation to false

Hence LogWorld has one daughter (samplecontainer) and samplecontainer has 3 daughters LogSample, LogPlaneR and LogPlaneT

I should point out that the program has its own GDMLReader class (SEMGDMLReader) (inherited from G4GDMLReadStructure). I am wondering whether there has been a change to the GDML Reader classes such that the SEMGDMLReader class is now out of date and failing in some way. Is there any way to pickup the extent of the volume at some early stage, just after the GDML file has been read ?.

Best Wishes
Chris

Are you sure the mother-daughter hierarchy is properly established. DumpGeometricalTree doesn’t dump a tree - it just dumps physical volumes.

Hi Chris
Maybe I was too quick to conclude there was no hierarchy. The output of /vis/drawTree indents daughters, but maybe the User Forum strips those away. Can you put the output in a normal text file and attach it?
I’ve not really figured the logic of the recursive DumpGeometricalTree, but I guess it works since it gives output similar to /vis/drawTree.
Another thought…have you checked for overlaps?

/vis/drawLogicalVolume LogWorld
/vis/drawLogicalVolume samplecontainer

or

/geometry/test/run

John