Import Geant4 5.0.0 source tree
This commit is contained in:
@@ -20,16 +20,23 @@ technically. They don't intend to produce physical correct results.
|
||||
|
||||
General remark to scoring
|
||||
-------------------------
|
||||
A interface G4VPScorer is provided for the user. The user may create his
|
||||
A interface G4VScorer is provided for the user. The user may create his
|
||||
own class to perform the desired scoring. The user defined class
|
||||
therefore should inherit from the interface G4VPScorer.
|
||||
There are two example scorers G4PScorer and G4PIScorer provided.
|
||||
therefore should inherit from the interface G4VScorer.
|
||||
An example of an implementation of a scorer is G4Scorer
|
||||
which may be found in source/event.
|
||||
The scoring in these examples is done with a G4Scorer.
|
||||
Importance sampling and scoring does not support all options of the
|
||||
Geant4 geometry. It only supports physical volumes and simple replicas.
|
||||
To identify a physical volume (or replica) objects of the class
|
||||
G4GeometryCell are used. Scoring is done according to these
|
||||
cells and importance values may be assigned to them.
|
||||
When scoring is done in a "scoring" or in a "importance" geometry
|
||||
special action has to be taken to prevent counting of
|
||||
"collisions" with boundaries of the tracking geometry as interactions.
|
||||
This is differently handled when scoring is done in the tracking geometry.
|
||||
The scorers B01Scorer and B02Scorer show the difference in that case.
|
||||
The Scorer B06Scorer checks for consistency of importance and weight.
|
||||
|
||||
--> G4GeometryCell must not share boundaries with the world volume! <--
|
||||
|
||||
Known problems
|
||||
--------------
|
||||
@@ -44,111 +51,99 @@ former volume the biasing won't be invoked.
|
||||
This will produce particles with weights that do not correspondent to the
|
||||
importance of the current volumes.
|
||||
|
||||
Further information:
|
||||
--------------------
|
||||
Short description of importance sampling and scoring:
|
||||
http://dressel.home.cern.ch/dressel/biasscore/Sampling.html
|
||||
|
||||
I. Examples for scoring without biasing
|
||||
=======================================
|
||||
Example B01
|
||||
===========
|
||||
|
||||
I. 1. Example B01
|
||||
-----------------
|
||||
This example shows how to use scoring in the "tracking" geometry.
|
||||
It scores several values for neutrons for every physical volume
|
||||
in the tracking geometry.
|
||||
All scored values are printed after the running. In addition a more
|
||||
exclusive output of selected values is printed. The way the
|
||||
last output is produced shows how to extract certain values from all
|
||||
scored values.
|
||||
The example uses importance sampling and scoring. Importance values are
|
||||
defined according to the mass geometry. Scoring is also done in according
|
||||
to the mass geometry.
|
||||
|
||||
|
||||
I. 2. Example B02
|
||||
-----------------
|
||||
This example shows how to use scoring in a "parallel" or "scoring"
|
||||
geometry. In this example a tracking and a scoring geometry is
|
||||
constructed. Gammas are scored in the scoring geometry. The scored values
|
||||
are dumped to the screen after the run. How to access the score values
|
||||
more exclusively is shown in example B01.
|
||||
Example B02
|
||||
===========
|
||||
|
||||
This example uses a parallel geometry to define G4GeometryCell objects
|
||||
for scoring and importance sampling. In addition it customizes
|
||||
the scoring. In this example one scorer creates a histogram.
|
||||
|
||||
Compiling and running
|
||||
---------------------
|
||||
To compile this example you need AIDA 3.0 installed. To link
|
||||
and run it you need a AIDA compliant analysis package. The
|
||||
GNUmakefile of this example shows how to use Anaphe as analysis
|
||||
package.
|
||||
The following list shows what to do if you are at CERN using rehat61
|
||||
and gcc-2.95.2:
|
||||
use the shell /bin/sh
|
||||
1) set the following variables (for example):
|
||||
ANAPHETOP=/afs/cern.ch/sw/lhcxx
|
||||
(or if installed in opt: /opt/Anaphe/5.0.1)
|
||||
AIDA_DIR=/afs/cern.ch/sw/contrib/AIDA/3.0/src/cpp
|
||||
(or if installed in opt: /opt/AIDA/3.0.0/3.0.0/AIDA/3.0/src/cpp)
|
||||
export ANAPHETOP AIDA_DIR
|
||||
|
||||
2) Source the script:
|
||||
. $ANAPHETOP/share/LHCXX/5.0.1/scripts/setupAnaphe
|
||||
|
||||
3) and add to lirary path the following directories:
|
||||
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}:${G4WORKDIR}/tmp/${G4SYSTEM}/exampleB02
|
||||
|
||||
Now you should be able to run gmake and to run exampleB02.
|
||||
|
||||
The example stores the plot in the file b02.hbook.
|
||||
To look at the histogram using lizard you also may use Anaphe 5.0.1
|
||||
http://anaphe.web.cern.ch/anaphe/index2.html.
|
||||
|
||||
Files in B02:
|
||||
B02plot.py: a simple script that may be executed from a lizzard session
|
||||
to show the plot created by running the exampleB02.
|
||||
|
||||
|
||||
II. Examples for biasing without scoring
|
||||
========================================
|
||||
Example B03
|
||||
===========
|
||||
|
||||
II. 1. Example B03
|
||||
------------------
|
||||
This example shows how to use biasing in the "tracking" geometry.
|
||||
It does not do scoring. The importances are setup during the
|
||||
mass detector construction in the file:
|
||||
B03/src/B03DetectorConstruction.cc.
|
||||
This example uses Geant4 and in particular importance sampling and
|
||||
scoring through python. It also creates a histogram.
|
||||
|
||||
Compiling and running
|
||||
---------------------
|
||||
To compile and run this example you need a python2.2 installation
|
||||
see http://www.python.org.
|
||||
Please set the environment variable "PYTHON_DIR" to your python2.2
|
||||
installation e.g:
|
||||
using afs:
|
||||
to /afs/cern.ch/sw/lhcxx/specific/redhat61/gcc-2.95.2/PublicDomainPackages/2.0.0
|
||||
or if Anaphe is installed in opt /opt/Anaphe/5.0.1/specific/redhat72/gcc-2.95.2/PublicDomainPackages/2.0.0.
|
||||
|
||||
II. 2. Example B04
|
||||
------------------
|
||||
This example shows how to use biasing according to a "parallel"
|
||||
or "importance" geometry. The importances are setup during the
|
||||
construction of the parallel geometry in the file:
|
||||
B04/src/B04ImportanceDetectorConstruction.cc.
|
||||
Please add to your environment variables
|
||||
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${G4WORKDIR}/lib/${G4SYSTEM}:${G4WORKDIR}/tmp/${G4SYSTEM}/exampleB03
|
||||
and setenv PYTHONPATH $LD_LIBRARY_PATH.
|
||||
|
||||
You may run gmake now.
|
||||
You should be able to execute the file B03RunApplication.py from your
|
||||
shell now.
|
||||
|
||||
If you have Anaphe 5.0.1 installed you may also execute the file
|
||||
B03RunApplication.py from a lizard session. This will create a
|
||||
histogram. Therefore you may follow the steps 1 and two
|
||||
in the above exampleB02.
|
||||
See http://anaphe.web.cern.ch/anaphe/index2.html.
|
||||
|
||||
III. Examples for biasing and scoring
|
||||
=====================================
|
||||
|
||||
III. 1. Example B05
|
||||
-------------------
|
||||
Biasing and Scoring in the "tracking" geometry.
|
||||
The importances are setup during the mass detector construction
|
||||
in the file: B05/src/B05DetectorConstruction.cc.
|
||||
Scoring is done with G4PIScorer from transportation. G4PIScorer
|
||||
scores several values for all the physical volumes of a geometry.
|
||||
It also checks that the importance value times track weight = 1,
|
||||
which should hold in "simple" cases.
|
||||
|
||||
|
||||
III. 2. Example B06
|
||||
-------------------
|
||||
Biasing and scoring in a "parallel" geometry.
|
||||
The importances are setup during the construction of the parallel geometry
|
||||
in the file B06/src/B06ImportanceDetectorConstruction.cc.
|
||||
Customised scorer B06Scorer and printer B06ScorePrinter are used.
|
||||
|
||||
|
||||
|
||||
III. 3. Example B07
|
||||
-------------------
|
||||
Biasing neutrons and gammas in a "parallel" geometry.
|
||||
The physics list used in this example creates only processes for
|
||||
gammas and neutrons. Other particles that my be produced
|
||||
will have no processes and can therefore not produce
|
||||
any particles.
|
||||
The idea is to have the simulation performing somewhat like a
|
||||
transportation Monte Carlo that only knows about neutrons and gammas and
|
||||
is only used in a limited energy range.
|
||||
|
||||
|
||||
IV. Example for weight window sampling
|
||||
-------------------------------------
|
||||
|
||||
|
||||
IV.1 Example B08
|
||||
----------------
|
||||
This is an example using importance sampling and weight window biasing
|
||||
together with scoring in a parallel geometry. Only the sampler
|
||||
for importance, weight window sampling and scoring in a parallel geometry
|
||||
exists at the moment.
|
||||
The example setup:
|
||||
A 180 cm long concrete shield is divided into 18 cells of 10 cm each.
|
||||
The cells are created in a parallel geometry. Importance values
|
||||
can be applied via an init.mac file. Scoring is done according to the
|
||||
cells for neutrons and gammas.
|
||||
Since this example intents to show the weight window sampling
|
||||
the primary neutrons are created with the relatively high
|
||||
energy of 300 MeV. Neutrons with this energy
|
||||
penetrate the concrete (according to the chosen physics list)
|
||||
relatively easy. So no importance sampling would be necessary.
|
||||
The high energy is selected to show the effect of the weight window
|
||||
sampling. High energetic secondaries which are not importance sampled
|
||||
may create neutrons which have a weight different from the inverse of
|
||||
the importance in the cell. If a finite weight window is chosen this
|
||||
results in relative average weights of the tracks in a given cell not
|
||||
equal to one.
|
||||
If the upper and lower limit of the weight window is set to 1
|
||||
the relative weights are 1.
|
||||
|
||||
Files in B03;
|
||||
env.csh: Is an example script to set the environment. It should work
|
||||
if you are at CERN and if you are on a redhat6.1 system.
|
||||
buildit.sh: You don't need to use this file. Only if you want to
|
||||
make changes to the python interface defined in B03App.i you may need
|
||||
to use it.
|
||||
B03Application.py: Is a example class utilizing importance sampling
|
||||
and scoring using python.
|
||||
B03RunApplication.py: Is a python script running the example.
|
||||
It may be executed from the shell or in a python or lizard
|
||||
session. In case it is executed from lizard it creates a plot
|
||||
with a histogram.
|
||||
B03App.py: Is created by swig using the buildit.sh script.
|
||||
|
||||
Reference in New Issue
Block a user