the code now compiles and runs. Fixed the .inp file.

This commit is contained in:
Blake Leverington 2021-09-03 14:30:47 +02:00
parent 090051977b
commit fecb04658d
23 changed files with 252 additions and 142 deletions

4
.gitignore vendored
View File

@ -73,3 +73,7 @@
**/*.tgz
**/*~
**/*.root
ranexample*
example*
!example.inp
**/readfluka/*

127
README.md
View File

@ -1,2 +1,129 @@
# fluka_gfortran7_hit
## Running the code
* 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
## 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
* 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.
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
```
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
```
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.

View File

@ -1,26 +1,26 @@
0 0.987199
1 0.981107
2 0.976363
3 0.971173
4 0.96674
5 0.962492
6 0.960485
7 0.956097
8 0.9526
9 0.95099
10 0.947653
11 0.945952
12 0.943821
13 0.941682
14 0.940207
15 0.939598
16 0.937827
17 0.935669
18 0.934759
19 0.933702
20 0.932179
21 0.930267
22 0.931688
23 0.930076
24 0.928356
25 0.927973
0 0.97962
1 0.97429
2 0.966294
3 0.96114
4 0.953799
5 0.95219
6 0.945448
7 0.941958
8 0.942562
9 0.935311
10 0.933818
11 0.933284
12 0.930363
13 0.93027
14 0.926641
15 0.922613
16 0.923843
17 0.926586
18 0.91891
19 0.918083
20 0.922184
21 0.913647
22 0.913825
23 0.915273
24 0.913263
25 0.915256

Binary file not shown.

Binary file not shown.

View File

@ -111,7 +111,7 @@ void eventdatroot::Loop(Float_t scale)
int main(int argc, const char* argv[])
{
Int_t thickkey = atoi(argv[2]);
Float_t THICKNESS[6] = {0.025, 0.050, 0.100, 0.150, 0.500, 1.000}; //#cm
Float_t THICKNESS[7] = {0.025, 0.035, 0.050, 0.100, 0.125, 0.15, 0.20}; //#cm
// Float_t THICKNESS[5] = {0.050, 0.100, 0.150, 1.000, 10.00}; //#cm
///open the input and output root files

View File

@ -7,10 +7,10 @@ DEFAULTS HADROTHE
*
* beam definitions
BEAM ENERGYIN 0.0 -1.7 -0.8 -0.8 TYPE
HI-PROPE ZED ATN
*HI-PROPE ZED ATN
BEAMPOS -0.1
DELTARAY 1E-06 0.0 0.0 HYDROGEN @LASTMAT NOPRINT
PART-THR -0.00001 PROTON PROTON 0.0
*PART-THR -0.00001 PROTON PROTON 0.0
*
* Geometry
* --------
@ -76,20 +76,20 @@ ASSIGNMA VACUUM INAIR
* --------------------
*
* charge spectrum of ions
USRYIELD 1422. HEAVYION -68. TARGS1 TARGS2 1.FragZ1
USRYIELD 2422. HEAVYION -68. TARGS1 TARGS2 1.FragZ1
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
USRYIELD 1422. HEAVYION -68. TARGS2 TARGS3 1.FragZ2
USRYIELD 2422. HEAVYION -68. TARGS2 TARGS3 1.FragZ2
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
USRYIELD 1422. HEAVYION -68. TARGS3 TARGS4 1.FragZ3
USRYIELD 2422. HEAVYION -68. TARGS3 TARGS4 1.FragZ3
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
*
* LET in water of ions and charged particles
USRYIELD 2223. HEAVYION -69. TARGS3 TARGS4 1.LETHI
USRYIELD 2323. HEAVYION -69. TARGS1 TARGS2 1.LETHI
USRYIELD 20. 0.0 200. 9.5 2.5 2703. &
USRYIELD 2223. ALL-CHAR -69. TARGS3 TARGS4 1.LETCh
USRYIELD 2323. ALL-CHAR -69. TARGS1 TARGS2 1.LETCh
USRYIELD 20. 0.0 200. 9.5 -2.5 2703. &
EVENTDAT -21. eventdata
*
RANDOMIZ 1.
START 100000. 0.0
START 10000. 0.0
STOP

Binary file not shown.

View File

@ -1,26 +1,26 @@
0 1.03895
1 1.02252
2 1.01559
3 1.01178
4 1.00999
5 1.00774
6 1.00678
7 1.00476
8 1.00382
9 1.0028
10 1.00133
11 1.00115
12 0.999925
13 0.999349
14 0.997534
15 0.996118
16 0.99561
17 0.995045
18 0.992608
19 0.991975
20 0.991158
21 0.990081
22 0.988478
23 0.986514
24 0.985795
25 0.984543
0 0.70979
1 0.704377
2 0.701678
3 0.700516
4 0.700449
5 0.698697
6 0.698727
7 0.699421
8 0.69635
9 0.697728
10 0.697732
11 0.697822
12 0.69451
13 0.694614
14 0.694115
15 0.694395
16 0.693648
17 0.694336
18 0.69255
19 0.687652
20 0.688819
21 0.688489
22 0.687569
23 0.687016
24 0.682183
25 0.685038

Binary file not shown.

View File

@ -116,7 +116,8 @@ int main(int argc, const char* argv[])
{
Int_t thickkey = atoi(argv[2]);
// Float_t THICKNESS[6] = {0.025, 0.050, 0.075, 0.100, 0.0125, 0.150, 0.2500, 0.500}; //#cm
Float_t THICKNESS[6] = {0.025, 0.050, 0.100, 0.150, 0.500, 0.125 }; //#cm
// Float_t THICKNESS[6] = {0.025, 0.050, 0.100, 0.150, 0.500, 0.125 }; //#cm
Float_t THICKNESS[7] = {0.025, 0.050, 0.100, 0.150, 0.500, 1.000, 0.035};// #cm
// Float_t THICKNESS[5] = {0.050, 0.100, 0.150, 1.000, 10.00}; //#cm

View File

@ -134,26 +134,26 @@ void eventdatroot::Init(TTree *tree)
fChain->SetBranchAddress("SEEDS", SEEDS, &b_seed);
fChain->SetBranchAddress("ENDIST", ENDIST, &b_endist);
h_endist_0 = new TH1F("h_endist_0","edep by ionisation",400,0.0,0.05);
h_endist_1 = new TH1F("h_endist_1","edep by pi0, e-, e+ and #gamma",400,0.0,0.03);
h_endist_2 = new TH1F("h_endist_2","edep by nuclear recoils and heavy fragments",400,0.0,0.001);
h_endist_3 = new TH1F("h_endist_3","edep by part. #lt threshold",200,0.0,0.001);
h_endist_0 = new TH1F("h_endist_0","edep by ionisation",400,0.0,0.1);
h_endist_1 = new TH1F("h_endist_1","edep by pi0, e-, e+ and #gamma",400,0.0,0.06);
h_endist_2 = new TH1F("h_endist_2","edep by nuclear recoils and heavy fragments",400,0.0,0.002);
h_endist_3 = new TH1F("h_endist_3","edep by part. #lt threshold",200,0.0,0.002);
h_endist_4 = new TH1F("h_endist_4","E leaving the system",200,0.0,1.1);
h_endist_5 = new TH1F("h_endist_5","E carried by discarded particles",200,0.0,0.1);
h_endist_6 = new TH1F("h_endist_6","resid, excit. E after evap.",200,0.0,0.1);
h_endist_7 = new TH1F("h_endist_7","edep by low-energy neutrons",200,0.0,0.1);
h_endist_8 = new TH1F("h_endist_8","E of part. #gt time limit",200,0.0,0.1);
h_endist_9 = new TH1F("h_endist_9","E lost in endothermic nuclear reactions",200,0.0,0.1);
h_endist_10 = new TH1F("h_endist_10","E lost in endothermic low-E n-reactions",200,0.0,0.1);
h_endist_5 = new TH1F("h_endist_5","E carried by discarded particles",200,0.0,0.2);
h_endist_6 = new TH1F("h_endist_6","resid, excit. E after evap.",200,0.0,0.2);
h_endist_7 = new TH1F("h_endist_7","edep by low-energy neutrons",200,0.0,0.2);
h_endist_8 = new TH1F("h_endist_8","E of part. #gt time limit",200,0.0,0.2);
h_endist_9 = new TH1F("h_endist_9","E lost in endothermic nuclear reactions",200,0.0,0.2);
h_endist_10 = new TH1F("h_endist_10","E lost in endothermic low-E n-reactions",200,0.0,0.2);
h_endist_11 = new TH1F("h_endist_11","missing E",400,0.0,0.01);
h_ratio_e = new TH1F("h_ratio_e","fraction of edep by pi0, e-, e+ and #gamma ",400,0.0,1.0);
h_ratio_p = new TH1F("h_ratio_p","fraction of edep by ionisation",400,0.0,1.0);
h_sum_ep = new TH1F("h_sum_ep","sum of edep by ion, pi0, e-, e+ and #gamma,",400,0.0,0.1);
h_sum_ep = new TH1F("h_sum_ep","sum of edep by ion, pi0, e-, e+ and #gamma,",400,0.0,0.4);
h_let_ep = new TH1F("h_let_ep","LET/Z^{2} (GeV/cm) by ion, pi0, e-, e+ and #gamma,",200,0.0,0.05);
h_let_e = new TH1F("h_let_e","LET/Z^{2} (GeV/cm) by pi0, e-, e+ and #gamma,",200,0.0,0.02);
h_let_p = new TH1F("h_let_p","LET/Z^{2} (GeV/cm) by ion",200,0.0,0.02);
h_let_ep = new TH1F("h_let_ep","LET/Z^{2} (GeV/cm) by ion, pi0, e-, e+ and #gamma,",200,0.0,0.2);
h_let_e = new TH1F("h_let_e","LET/Z^{2} (GeV/cm) by pi0, e-, e+ and #gamma,",200,0.0,0.1);
h_let_p = new TH1F("h_let_p","LET/Z^{2} (GeV/cm) by ion",200,0.0,0.1);
h_spratio = new TH1F("h_spratio","total LET/SP (MeV/cm/#rho)/SP(MeVcm2/g)",200,0.5,3.0);

View File

@ -1,9 +1,9 @@
#!/bin/bash
HOME=/work/leverington/fluka_gfortran7/project/helium
HOME=/work/leverington/fluka_gfortran8/fluka_gfortran7_hit/helium
for j in {0..5}
for j in {0..6}
do
JOB_HOME=$HOME/jobs$j
cd $JOB_HOME

View File

@ -76,20 +76,20 @@ ASSIGNMA VACUUM INAIR
* --------------------
*
* charge spectrum of ions
USRYIELD 1422. HEAVYION -68. TARGS1 TARGS2 1.FragZ1
USRYIELD 2422. HEAVYION -68. TARGS1 TARGS2 1.FragZ1
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
USRYIELD 1422. HEAVYION -68. TARGS2 TARGS3 1.FragZ2
USRYIELD 2422. HEAVYION -68. TARGS2 TARGS3 1.FragZ2
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
USRYIELD 1422. HEAVYION -68. TARGS3 TARGS4 1.FragZ3
USRYIELD 2422. HEAVYION -68. TARGS3 TARGS4 1.FragZ3
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
*
* LET in water of ions and charged particles
USRYIELD 2223. HEAVYION -69. TARGS3 TARGS4 1.LETHI
USRYIELD 2323. HEAVYION -69. TARGS1 TARGS2 1.LETHI
USRYIELD 20. 0.0 200. 9.5 2.5 2703. &
USRYIELD 2223. ALL-CHAR -69. TARGS3 TARGS4 1.LETCh
USRYIELD 2323. ALL-CHAR -69. TARGS1 TARGS2 1.LETCh
USRYIELD 20. 0.0 200. 9.5 -2.5 2703. &
EVENTDAT -21. eventdata
*
RANDOMIZ 1.
START 100000. 0.0
START 10000. 0.0
STOP

View File

@ -1,25 +0,0 @@
0 0.986872
1 0.97926
2 0.975462
3 0.969715
4 0.964747
5 0.961425
6 0.957963
7 0.955564
8 0.954657
9 0.951364
11 0.948485
12 0.946011
13 0.944629
14 0.944191
15 0.941793
16 0.941145
17 0.940926
18 0.940841
19 0.938605
20 0.94052
21 0.938271
22 0.936244
23 0.939211
24 0.936627
25 0.935963

Binary file not shown.

View File

@ -113,7 +113,7 @@ f_o16sp_ps->SetParameters(26465.6, -0.928309,88.6728); //oxygen between 80 and
int main(int argc, const char* argv[])
{
Int_t thickkey = atoi(argv[2]);
Float_t THICKNESS[6] = {0.025, 0.050, 0.100, 0.150, 0.500, 1.000}; //#cm
Float_t THICKNESS[7] = {0.025,0.035, 0.050, 0.100, 0.125, 0.150, 0.2}; //#cm
// Float_t THICKNESS[5] = {0.050, 0.100, 0.150, 1.000, 10.00}; //#cm
///open the input and output root files

Binary file not shown.

Binary file not shown.

View File

@ -1,26 +1,26 @@
0 0.939261
1 0.923705
2 0.908651
3 0.897928
4 0.888853
5 0.881592
6 0.876172
7 0.869721
8 0.862654
9 0.858657
10 0.854603
11 0.851932
12 0.849187
13 0.845096
14 0.843032
15 0.839206
16 0.834533
17 0.835875
18 0.833985
19 0.82905
20 0.828067
21 0.825095
22 0.821344
23 0.819369
24 0.817124
25 0.816329
0 0.92161
1 0.906306
2 0.89046
3 0.877592
4 0.870525
5 0.861839
6 0.855087
7 0.849157
8 0.841828
9 0.84137
10 0.833239
11 0.830897
12 0.826563
13 0.822922
14 0.819715
15 0.822083
16 0.816396
17 0.815284
18 0.809868
19 0.811383
20 0.808595
21 0.804393
22 0.801861
23 0.801676
24 0.794789
25 0.795978

Binary file not shown.

View File

@ -109,8 +109,11 @@ void eventdatroot::Loop(Float_t scale)
int main(int argc, const char* argv[])
{
Int_t thickkey = atoi(argv[2]);
Float_t THICKNESS[6] = {0.025, 0.050, 0.100, 0.150, 0.500, 1.000}; //#cm
// Float_t THICKNESS[6] = {0.025, 0.050, 0.100, 0.150, 0.500, 1.000}; //#cm
// Float_t THICKNESS[5] = {0.050, 0.100, 0.150, 1.000, 10.00}; //#cm
Float_t THICKNESS[7] = {0.025,0.035, 0.05, 0.1, 0.125, 0.15, 0.2};// #cm
///open the input and output root files
char finname[50];

View File

@ -76,17 +76,17 @@ ASSIGNMA VACUUM INAIR
* --------------------
*
* charge spectrum of ions
USRYIELD 1422. HEAVYION -68. TARGS1 TARGS2 1.FragZ1
USRYIELD 2422. HEAVYION -68. TARGS1 TARGS2 1.FragZ1
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
USRYIELD 1422. HEAVYION -68. TARGS2 TARGS3 1.FragZ2
USRYIELD 2422. HEAVYION -68. TARGS2 TARGS3 1.FragZ2
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
USRYIELD 1422. HEAVYION -68. TARGS3 TARGS4 1.FragZ3
USRYIELD 2422. HEAVYION -68. TARGS3 TARGS4 1.FragZ3
USRYIELD 9.5 2.5 7. 90. 0.0 3. &
*
* LET in water of ions and charged particles
USRYIELD 2223. HEAVYION -69. TARGS3 TARGS4 1.LETHI
USRYIELD 2323. HEAVYION -69. TARGS1 TARGS2 1.LETHI
USRYIELD 20. 0.0 200. 9.5 2.5 2703. &
USRYIELD 2223. ALL-CHAR -69. TARGS3 TARGS4 1.LETCh
USRYIELD 2323. ALL-CHAR -69. TARGS1 TARGS2 1.LETCh
USRYIELD 20. 0.0 200. 9.5 -2.5 2703. &
EVENTDAT -21. eventdata
*