Hands-on 6: Event Biasing with Bremsstrahlung Splitting

 


¤       Introduction

¤       Installation

¤       Interactive commands

¤       Installing Bremsstrahlung Splitting Process

¤       Examples

 

Important:

Every time you open a new shell you need to make sure your environment variables are set correctly.

 


Introduction

 

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.

 


Installation

 

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

 

 


Interactive Commands

 

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 ) :

 

 

 


Installing Bremsstrahlung Splitting Process

 

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.

 

 


Example

 

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

0.00125

0.000778

0.000317

0.000297

0.000154

0.00014

0.000121

9.68E-05

5.09E-05

7.43E-05

0.000203

0.000165

4.11E-05

2.97E-05

2.34E-05

1.95E-05

4.83E-06

4.30E-06

0

1.81E-06

0.000203

9.72E-05

3.52E-05

8.49E-06

3.35E-06

2.79E-06

0

0

5.87E-06

0

0.000116

1.94E-05

1.76E-05

1.27E-05

3.35E-06

0

2.42E-06

0

1.96E-06

0

5.81E-05

2.92E-05

0

8.49E-06

0

0

0

0

0

0

2.91E-05

1.94E-05

5.87E-06

4.24E-06

0

0

0

0

0

0

2.91E-05

9.72E-06

0

0

0

0

0

0

0

0

0

0

0

4.24E-06

3.35E-06

0

2.42E-06

0

0

0

2.91E-05

0

5.87E-06

0

0

0

0

0

0

0

2.91E-05

9.72E-06

0

0

0

0

0

0

0

0

 

 

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

0.00138

0.000676

0.000403

0.000255

0.000167

0.000126

0.000103

9.00E-05

7.68E-05

7.14E-05

0.000312

0.000129

6.29E-05

3.40E-05

1.79E-05

1.10E-05

8.01E-06

4.67E-06

3.27E-06

1.78E-06

0.000173

6.96E-05

3.03E-05

1.55E-05

7.31E-06

3.16E-06

2.03E-06

1.44E-06

9.40E-07

7.07E-07

0.000121

4.06E-05

1.98E-05

8.19E-06

3.25E-06

1.23E-06

1.02E-06

8.61E-07

3.13E-07

2.36E-07

8.57E-05

2.75E-05

1.38E-05

5.14E-06

1.98E-06

5.86E-07

5.80E-07

1.94E-07

1.76E-07

5.44E-08

5.55E-05

1.89E-05

9.40E-06

2.59E-06

1.17E-06

3.07E-07

2.66E-07

8.60E-08

5.87E-08

5.44E-08

4.42E-05

1.19E-05

4.47E-06

1.40E-06

5.69E-07

1.95E-07

1.21E-07

0

0

1.81E-08

2.93E-05

8.94E-06

3.00E-06

6.37E-07

3.35E-08

1.12E-07

7.25E-08

0

0

0

2.15E-05

7.19E-06

1.64E-06

5.52E-07

3.35E-08

0

2.42E-08

0

1.96E-08

0

1.89E-05

5.15E-06

8.22E-07

1.27E-07

6.70E-08

0

0

0

0

0

 

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