Hands On 2: Confirming Your Geant4 Installation
Set up
- Set up a work directory parallel to your copy of the Geant4 toolkit:
- Copy to it two directories from the novice examples area of your copy of Geant4
- cp -r geant4/examples/novice/N03
- cp -r geant4/examples/novice/N07
- Check that the following environment variables are set properly
- G4INSTALL must point to the head of your copy of Geant4
- G4WORKDIR should point to the work directory you just created
- G4SYSTEM should be the system name (for Linux it is Linux-g++)
- CLHEP_BASE_DIR must point to your installation of CLHEP
- One of the visualization drivers that you built into the toolkit must be chosen.
In this test we will choose OPENGL
- G4VIS_USE_OPENGLX should be set to 1
Example N03
- Go to the N03 directory
- Build the executable:
- There should now be an executable file in mytestdir/bin/$G4SYSTEM/ named exampleN03
- Go back to the N03 directory and run the executable
- ../bin/$G4SYSTEM/exampleN03
- A graphics window should open and you should see an Idle> prompt.
- at the Idle> prompt enter /vis/viewer/set/viewpointThetaPhi 30 30 deg and return
- next enter /run/beamOn 1 and return
- You should now see something like this in the graphics window:
- Enter exit to end the program.
Example N07
- Go to the N07 directory
- Build the executable:
- There should now be an executable file in mytestdir/bin/$G4SYSTEM/ named exampleN07
- Go back to the N03 directory and run the executable
- ../bin/$G4SYSTEM/exampleN07
- A graphics window should open and you should see an Idle> prompt.
- next enter /run/beamOn 1 and return
- You should now see something like this in the graphics window:
- Enter exit to end the program.