How to use Monte-Carlo GEANT4 BOREXINO code. Igor Machulin, Kurchatov Institute, Moscow,

How to use Monte-Carlo GEANT4
BOREXINO code.
Igor Machulin, Kurchatov Institute, Moscow,
[email protected]
Paolo Saggese, INFN, Milano,
[email protected]
Chapter 1.
Introduction.
The Borexino Geant4 Monte-Carlo code is based on Geant4 release 5.2.
Installations of this version of Geant4 are available on both the Borexino data analysis
cluster (logins via bxmaster.lngs.infn.it) and on pcbx(nn).lngs.infn.it workstations1.
The official version of the Borexino code can be obtained from from the CVS2
server on the Borexino data analysis cluster.
To get the code, first of all you need to have an account on that cluster (ask for it to
Alessandro Razeto, e-mail: [email protected]).
Once you have got the account, you can use the CVS repository either directly from
a login on a machine of the Borexino cluster, or from any networked machine which
can have SSH access to bxmaster.lngs.infn.it.
If you log in to one of the Borexino data analysis cluster hosts (e.g. bxmaster) or on
one of the Borexino LNGS workstations pcbx(nn).lngs.infn.it, all of the required
environment for Borexino CVS should be already set up automatically by default3,
and you should be able to start using cvs without need for any other set up.
Otherwise, on any other host you will likely have to set up a few environment
variables with commands like the following:4,5
export [email protected]:/home/cvs
export CVS_RSH=ssh
export CVSEDITOR=vim6
1
2
3
4
Not all of them. Only on those whose hardware is powerful enough.
For more info on CVS, please refer to http://www.cvshome.org
Only if you use the default shell (bash).
The command listed here are valid assuming that you are using a Bourne type shell like bash, zsh,
etc.; if you are using csh or tcsh (unsupported and NOT recommended!) use “setenv” instead and
change the syntax accordingly.
5 To avoid the need to re-enter these commands every time you start a new shell, you may add them
to your shell login script (e.g. ~/.bashrc).
6 Of course, the variable “CVSEDITOR” does not need to be set to “vim”, but should be set to
whatever is your preferred text editor (e.g. you may set it to emacs, jed, nano, ...).
Once the CVS environment is properly set-up, the command:
cvs checkout offline/geant4
will download the latest version of the code to a directory tree under your present
working directory. Please try the commands “man cvs” and/or “info cvs” or “pinfo
cvs”, and/or refer to the CVS home page on the WWW (http://www.cvshome.org)
to learn more about the use of CVS.
Chapter 2.
How to set up Geant4 on bxmaster.
In order to use Geant4, each user should set up a number of environment variables.
The easiest way to do this is to use the (bash) shell login scripts which have been
prepared for you by the system administrator. Just copy the two files “bashrc” and
“bash_profile” from the directory /home to your own home directory with the new
names of .bashrc and .bash_profile.
Once so done, the Geant4 environment variables will be automatically loaded in
each new (bash) shell started on any of the Borexino cluster nodes (bxmaster, etc).
Otherwise, if you know what you're doing you can have a look at those two files
and use them as templates for your own personal setup.
Chapter 3.
How to set up Geant4 on pcbx(nn).lngs.infn.it workstations.
Since Nov 16, 20047 the required environment for Geant4 should be set up
automatically by default on all the pcbx(nn).lngs.infn.it workstations where Geant4 is
installed8. Thus, you should be able to use Geant4 without the need for any other setup
on your side. Of course, you may override the default settings in order to customize
your own Geant4 environment9.
In case of any problem with the default setup, please contact Paolo Saggese.
Chapter 4.
How to build an executable from Geant4 Borexino code.
To build an executable go to the directory geant4/offline/ and give the commands:
make clean
make
The executable called “borlight” will be placed in offline/geant4/Linux-g++
directory.
7 If you have used Geant4 on one of the pcbx0(nn).lngs.infn.it before this date, now you may remove
any Geant4 related change that you have done to your own login scripts.
8 Only if you use the default shell (bash).
9 Please make sure that you know what you're doing before doing it!
Chapter 5.
How to simulate particles inside Borexino.
Input files.
In order to simulate particles inside the Borexino detector you should specify two
input files:
a) geometry file
b) macro file to run the simulation
a) The geometry file BorexGeometry.dat is in the /offline/geant4/data/borex/
directory and contains the information about Borexino inner vessel filling and
calibration sources. It is possible to simulate Borexino with either air, water or
scintillator inside.
To choose the required geometry, one should comment or uncomment the
corresponding lines in the file BorexGeometry.dat
b) The macro files to run the simulations are in the /offline/geant4/Linux-g++/
directory. The available macro files are:
•
run.mac
to simulate electrons or alpha particles (the simplest one);
•
RealParticle.mac
to simulate e-, e+, alpha, neutron and gamma particles;
•
geneb.mac
to simulate photons, using the output file from GENEB code (the code
devoted for radioactive background simulations);
•
laser.mac
to simulate the laser beam runs.
•
vis.mac
to draw the picture of Borexino and particles trajectories
As an example, the file run.mac looks as follows:
/run/initialize
#Here you put the Energy of the Particle
/gun/energy 7.688 MeV
#Here you put the particle type - Alpha or Beta
/Borex/particle Alpha
#Here you put the paricle position:
#Center - in the center of Borexino
#/Borex/source/position Center
#Uniform - distributed uniformly in Scintillator vessel
#/Borex/source/position Uniform
#gun - some point inside Borexino
/Borex/source/position gun
/gun/position 500. 500. 500.0 mm
#Here you put the number of simulated particles
/run/beamOn 1000
Any line beginning with the “#” character is a comment.
Start of simulation:
To start the simulation go to the offline/geant4/Linux-g++ directory and type
the command:
./borlight run.mac
(you can replace run.mac with some other macrofile such as vis.mac, geneb.mac, etc.)
Output files:
The program produces 3 output files:
1. bin.fil
a binary file, which can be read by the “bx_elec” program which simulates
the Borexino electronics;
2. borexinoSMALL.txt
text file with short information about each simulated particle with the
following format:
Event
number
Particle
energy
Number of
emitted photons
Number of detected
photoelectrons
0
5.4897
1092
260
1
5.4897
1092
231
2
5.4897
1092
247
...
...
...
...
3. borexino.txt
text file with the full information about each detected photoelectron with the
following format:
Event
number
Photoelectron
number
PMT number
Photoelectron
time (ns)
0
0
647
22.5983
1
1
1568
61.0049
2
2
2060
25.6600
...
...
...
...
Chapter 6.
How to simulate the Cherenkov light from Muons
going through the Outer Muon Veto detector and/or
Inner Part of water-filled Borexino Detector.
To build the executable go to the geant4/offline/mug4/ directory and give the
following commands:
make clean
make
This will build an executable called “muonveto” which will be saved in the directory
offline/geant4/mug4/Linux-g++/.
Input files:
In order to simulate the Cherenkov light in Borexino detector you should specify
one input file:
run.mac
which looks as follows:
/run/initialize
#Here you put the Energy of the Particle
/gun/energy 300.0 GeV
#Here you put the Position of the Particle (cm)
/gun/position 0.0 0.0 1000.0 cm
#Here you put the real particle type
#like: mu-, mu+, e-, e+, opticalphoton
/gun/particle mu#Here you put the Direction of the Particle
/gun/direction 0.0 0.0 -1.0
#Here you put the Number of
/run/beamOn 100
Particles to be simulated.
Any line beginning with the “#” character is a comment.
The macro file vis.mac can be used for detector and particles visualization.
Start of simulation:
To start the simulation go to the offline/geant4/mug4/Linux-g++/ directory
and type the command:
./muonveto run.mac
(or replace run.mac with vis.mac.)
Output files:
The program produces 3 output files:
1. bin.fil
the binary file, which can be read by bx_elec programm (this code simulates the
Borexino electronics)
2. muon.txt
a text file with short information about each simulated particle with the following
format:
Particle energy
(MeV)
Distance from
detector center
(cm)
Number of detected
photoelectrons in inner
part
Number of detected
photoelectrons in
outer veto
300000
0
15678
317
300000
0
16736
122
300000
0
13405
164
...
...
...
...
3. muonbig.txt
text file with the full information about each detected photoelectron with the
following format:
Event Photoelectron
number
number
PMT number
in inner part
PMT number
in outer veto
Photoelectron Number of photon
time (ns)
reflections
0
0
-1
4
37.2324
0
1
1
-1
0
39.4505
0
2
2
-1
25
50.5902
2
...
...
...
...
...
...
In case of any question, don't hesitate to contact:
Igor Machulin - [email protected]
or
Paolo Saggese - [email protected]