iThemba LABS 1 - 8 August 2016

I had been invited to hold the FLUKA Monte Carlo Software training workshop at iThemba Laboratories, Cape Town (SA). Here you can find a script to install Fluka, the slides I prepared and some examples

Some usefull links for Fluka

The exercises of this workshop (some of them are adapted from the last Fluka course):

Some tips:

To change the space on the sides of the plot you can edit the commands that Flair uses with gnuplot. In the Flair tab click on "Config", once the "Preferences" window appear click on the gnuplot part and then in the "Global Commands" space add:

set rmargin at screen 0.82
set lmargin at screen 0.10
set cbtics format '%.0e'

The last line will set exponential notation for the color bar scale

The advanced exercise are zipped folder, once you unzipped them to see what whe added to the code you can check the differences with the default user routine you have in the Fluka directory, for istance:

cd adv1
sdiff source.f $FLUPRO/usermvax/source.f | less

The particles id in fluka are on this web page

Some ROOT basic commands

To launch the root interpreter just type

root
in the terminal

To read the data from a txt file with 3 columns of data istantiate a TTre:

root [0] TTree* outPart = new TTree("outPart","outPart")
and then, to read the file:
root [1] outPart->ReadFile("adv4001_fort.53","pid:E:Cz") 

Now you can do an histogram of the energy of the outcoming alpha particle:

root [2] outPart->Draw("E*1000.","pid==-6")

or do a scatter plot of the energy of the alpha particle as a function of their angle:

root [4] outPart->Draw("E*1000.:TMath::ACos(Cz)","pid==-6","colz")

If you want to save the TTree in a root file:

root [6] TFile* out=new TFile("test.root","RECREATE")
root [7] outPart->Write()
(Int_t)524 root [8] out->Write() (Int_t)0 root [9] out->Close() root [10] .q


Subsequently, you can load the root file typing from the terminal:

root test.root
and browse it:
root [1] TBrowser tb
or do, again, some other histogram:
root [4] outPart->Draw("E*1000.","pid==-6 && Cz<0.99")