¤
Installing Bremsstrahlung
Splitting Process
¤
Examples
|
Important: Every time you open a new shell you need to make sure your environment
variables are set correctly. |
By the end of this Hands-on you should be
able to run simple job employing uniform bremsstrahlung splitting.
The exercise is based on the HandsOn_4
example, with these modifications:
1) The low energy physics
list is used by default
2) Solid angle and energy
binning have each been reduced to 10 bins
3) Scoring output and other
information is reformatted and directed to output files following this naming
convention:
¤
output_nosplitting_<nevent>.dat #no splitting
¤
output_splitting_<nevent>_<nsplit>.dat #with splitting
where nevents is the
number of events processed, and nsplit the bremsstrahlung splitting parameter
4) The output file will
have a 10*10 grid of data showing current in each solid angle/energy bin. Solid
angle binning is along x axis, energy binning is along Y.
These additional classes are provided:
1) BeamTestLowEnergyMessenger
¤
Messenger class for BeamTestPhysicsListLowEnergy
¤
Allows you to configure bremsstrahlung splitting interactively
¤
Installed by default
2) BremSplittingProcess
¤
Bremsstrahlung splitting wrapper process
¤
Not installed by default
Bremsstrahlung splitting is not activated
by default.
To
setup this exercise:
1) WeÕre going to be using
the low energy processes which require the G4EMLOW.3.0 data files to be
installed.
a) If youÕve not done so
already, download Òdata files for low energy electromagnetic processes (version 3.0)Ó from http://geant4.web.cern.ch/geant4/support/download.shtml
b) Once youÕve unpacked
G4EmLow.3.0.tar.gz, set the environment variable G4LEDATA to point to that
location, for example:
setenv G4LEDATA
$G4INSTALL/data/G4EMLOW3.0
Where G4INSTALL is the
Geant4 installation directory.
2) Unpack HandsOn_6.tgz
to your working directory
3) Replace the source
version of G4WrapperProcess.hh with the version supplied in the HandsOn:
HandsOn_6/processes/management/include/G4WrapperProcess.hh
If you have chosen to
copy all Geant4 headers into one directory, copy the above G4WrapperProcess.hh
to that directory. Otherwise, replace the version in
source/processes/management/include/, for example,
cp
HandsOn_6/source/processes/management/include/G4WrapperProcess.hh $G4INSTALL/source/processes/management/include/G4WrapperProcess.hh
You do not need to recompile any of
the Geant4 code.
This new version of
G4WrapperProcess.hh should be provided by default in releases newer than
v8.0.p1
4) Compile and link the
program
cd HandsOn_6
make
5) Execute a test run:
./bin/$G4SYSTEM/beamTest run.mac
6) This should output a
file called G4Data0.heprep, which shows the geometry setup. You can use Wired
to view this setup:
wired -file G4Data0.heprep
Commands to configure the bremsstrahlung
splitting are provided by default. Check that you are able to see the commands
using the interactive help. To do this, run the beamTest executable and type
ÒhelpÓ at the prompt, ie:
./bin/$G4SYSTEM/beamTest
É
Idle>help
|
Interactive help |
|
Idle> help Command directory path : / Sub-directories : 1) /control/
UI control commands. 2) /units/
Available units. 3) /geometry/
Geometry control commands. 4) /tracking/
TrackingManager and SteppingManager control commands. 5) /event/ EventManager control commands. 6) /run/
Run control commands. 7) /random/
Random number status control commands. 8) /particle/
Particle control commands. 9) /process/
Process Table control commands. 10) /BeamTest/
...Title not available... 11) /BremSplitting/ ...Title not available... 12) /vis/
Visualization commands. 13) /gun/
Particle Gun control commands. 14) /material/
Commands for Materials 15) /hits/
Sensitive detectors and Hits Commands : Type the number ( 0:end, -n:n level back ) : 11 Command directory path : /BremSplitting/ Guidance : Sub-directories : Commands : 1) nSplit * Splitting parameter - how many photons produced 2) active * Activate or deactivate brem splitting Type the number ( 0:end, -n:n level back ) : |
Next we need to modify
BeamTestPhysicsListLowEnergy.cc so that the BremSplittingProcess is registered
with theprocess manager in place of the G4LowEnergyBremsstrahlung process:
|
BeamTestPhysicsListLowEnergy.cc |
|
} else if (particleName == "e-") { //electron pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1); pmanager->AddProcess(new G4LowEnergyIonisation, -1, 2, 2);
//
pmanager->AddProcess(new G4LowEnergyBremsstrahlung,-1,-1, 3);
G4LowEnergyBremsstrahlung* bremProcess = new
G4LowEnergyBremsstrahlung();
bremSplitting = new BremSplittingProcess();
bremSplitting->RegisterProcess(bremProcess);
pmanager->AddProcess(bremSplitting,-1,-1, 3); } else if (particleName == "e+") { ---- snipped ---- |
Implement the above and compile and link
the program. It should now be possible to run a job employing bremsstrahlung
splitting.
As an example, weÕre going to run two
jobs and compare the output. Since weÕre able to control the splitting through
interactive commands, we will not have to recompile any code. Configuration
will be controlled using dedicated macros.
Job A
This job will generate 1000 events with
bremsstrahlung splitting turned off. Splitting is explicitly disabled in this
job, through the /BremSplitting/active command. We will be using the
run_nosplitting_1000.mac macro supplied with the example:
|
run_nosplitting_1000.mac |
|
# ---------------- # Verbose settings # ---------------- /control/verbose 2 /run/verbose 2 /BremSplitting/active false /run/beamOn 1000 |
Run the job:
./bin/$G4SYSTEM/beamTest run_nosplitting_1000.mac
Check that you get an output file called output_nosplitting_1000.dat
Job B
This job will generate 1000 events with
bremsstrahlung splitting turned on. The splitting parameter is set to 100
through the /BremSplitting/nSplit command. We will be using the run_splitting_1000_100.mac
macro supplied with the example:
|
run_splitting_1000_100.mac |
|
# Verbose settings # ---------------- /control/verbose 2 /run/verbose 2 /BremSplitting/active true /BremSplitting/nSplit 100 /run/beamOn 1000 |
Run the job:
./bin/$G4SYSTEM/beamTest
run_splitting_1000_100.mac
It may take a minute or so for the job to
finish. Check that you get an output file called output_splitting_1000_100.dat
The data files produced from the two jobs
should look something like:
|
output_nosplitting_1000.dat |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nevents
: 1000 BremSplitting active ?: 0 # Secondaries : 1641 Timing
: User=1.63s Real=1.77s Sys=0.02s #secondaries/real time: 927 |
|
output_splitting_1000_100.dat |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nevents
: 1000 BremSplitting active ?: 1 nSplit
: 100 # Secondaries : 217200 Timing
: User=43s Real=49.8s Sys=0.49s #secondaries/real time: 4.36e+03 |
Points
to note:
You can download the complete source of this exercise from HandsOn_6.complete.tgz.
Geant4 v8.0p01
March 2006
Jane Tinslay