A FLUKA simulation that records the energy deposited in a single layer of polysterene from an ion beam. HTCondor submission scripts are included.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Blake Leverington 917dd9b698 added some headings 3 years ago
carbon the code now compiles and runs. Fixed the .inp file. 3 years ago
helium the code now compiles and runs. Fixed the .inp file. 3 years ago
oxygen the code now compiles and runs. Fixed the .inp file. 3 years ago
pion first push 3 years ago
proton the code now compiles and runs. Fixed the .inp file. 3 years ago
.gitignore the code now compiles and runs. Fixed the .inp file. 3 years ago
README.md added some headings 3 years ago

README.md

fluka_gfortran7_hit

Enironment setup

  • Setup the LHCb environment (compile and run with this consistantly)

Check which platforms (slc6, centos7, ubuntu, etc) are available on the server you logged in to:

on the Heidelberg PI D0 cluster:

lb-describe-platform

On sigma0:

source /cvmfs/sft.cern.ch/lcg/views/LCG_98/x86_64-slc6-gcc8-opt/setup.sh 

provides gfortran 8.3

On lhcba1:

source /cvmfs/sft.cern.ch/lcg/views/LCG_98/x86_64-centos7-gcc9-opt/setup.sh

provides gfortran 9.2

FLUKA Installation instructions

  • Download and compile FLUKA that has a compatible version of gFortran 8,9,10 with your system. You will need to register. They will send you a username and password.
http://www.fluka.org/fluka.php 

Follow the README instructions to compile. Also run the script

$FLUPRO/flutil/ldpmqmd 

You also need to download the DATA file and untar it in the $FLUPRO folder.

wget --user=fuid-XXX --password=<yourpassword> https://www.fluka.org/packages/fluka2021.2-data.tar.gz
tar -xzvf fluka2021.2-data.tar.gz 

A Beginners guid can be found here: http://www.fluka.org/fluka.php?id=man_onl&sub=4 And the tutorial online is here: https://indico.cern.ch/event/956531/timetable/#20201005.detailed

This code

  • Clone this repository in the fluka folder (probabily not needed to be in the folder, but it is for now)
 git clone https://git.physi.uni-heidelberg.de/leverington/fluka_gfortran7_hit.git

This contains an example.inp file with a simple geometry (a single sheet of polystyrene in vacuum) and a 60 MeV proton beam with a FWHM width of 1.9mm. The proton, helium, carbon, and oxygen folders contain scripts that submit jobs (currently qsub, only from sigma0) for different beam energies and sheet thickness. The purpose is to study the energy deposited in thin sheets and compare it to the stopping power in the NIST p-star, m-star databases.

FLAIR gui for FLUKA

It is not needed to run FLUKA, but it helps.

Download flair and flair-geoviewer. http://www.fluka.org/flair/download.html Compile and run.

make DESTDIR=$FLUPRO/flair/ install
$FLUPRO/flair/flair

You can open any .inp and edit it from here via the menu. You can also visualize the geometry here. A common error in tutorial .inp files USRYIELD with Polar theta lab, should be Polar theta lab deg. Otherwise it complains of invalid limits.

You can run the example.inp code from Flair or from the command line.

$FLUPRO/flutil/rfluka -e $FLUPRO/flukadpm3 -N0 -M1 example.inp

readfluka

Untar the the readfluka.120216.tar.bz2 folder. This is a tool found on https://code.google.com/archive/p/readfluka/ that is no longer maintained. It will help us convert the file to a ROOT file. It may fail partway through compiling, but the eventdat2root is the important binary we need.

tar -xjvf readfluka.120216.tar.bz2 
cd readfluka
source env.sh
make

Then run the tool. It will create a file example001_eventdata.root

./readfluka/tools/eventdat2root example001_eventdata

eventdatroot

There is a second c++ script similarly named eventdatroot.c which will process the root file produced by eventdat2root and produce some relevant histograms needed for the analysis. Compile and run the tool in each folder, as there is some differences in the script depending on ion type. It will create a file example001_eventdata_out.root which contains several histograms of the energy deposited in the plastic sheet.

The last parameter is the "jobs" folder that will look in and the thickness of the material for that folder for scaling the LET values.

cd eventdatroot
make
cd ..
./eventdatroot example001_eventdata 0

This will scale the LET values in job0 folder by thickness[0].

Condor Scripts

In the folders /proton, /helium, /carbon, and /oxygen are files and .inp templates for running jobs with multiple material thickness and beam energies.

The following will remove the old jobs and setup the submission scripts and produce a list of scripts to be run, condorjoblist.txt.

./runCondorJobsetup.sh
condor_submit jobcondor.sub

ROOT Scripts

langaus.C will fit a landau convoluted with a gaussian to the LET/Stopping power distributions to determine the MPV of the distributions of the 25 different energies for the thickness (job# folder) specified in the script: int j = 1;.

plots.C will also determine the Mean and Median and plot this with the MPV value. This is complete in /proton, but the code is incomplete in the other folders.