Showing posts with label Physics. Show all posts
Showing posts with label Physics. Show all posts

How to install Pythia 8 and Fastjet on Linux

on Sunday, June 12, 2011
This is a tutorial about how to install Pythia 8 and Fastjet. After that i have explained two methods to link pythia8 to fastjet. I have tried to keep it simple and easy so that first time linux users can also understand it.


First of all you need to install g++ if you don't have yet.
For Ubuntu, Debian, Mint :


sudo apt-get install g++


For Redhat, Scientific Linux, Fedora:


yum install g++ 


You can also install that using source file or rpm. 


Now we will install Pythia8 and Fastjet.


Pythia 8 :


1. Download the file pythia8150.tgz (or pythia81xx.tgz) to a suitable location from its website .
2. Now to extract it open your terminal. Move to the directory where you have placed the pythia81xx.tgz after downloading. If you have placed that in your "software" (/home/username/software/ ) folder, then you can do this by :


 cd software


After moving to that directory excract that file with


tar xvfz pythia8150.tgz

Then it will create a directory. Now move to the directory by the command


cd pythia8150


Now type these commands (and press enter) step by step:


 ./configure
 make  


You have installed Pythia8 !


Fastjet


At first visit Fastjet website and download the source file which looks like " fastjet-x.x.x.tar.gz " where x.x.x represents version number.  Now follow the earlier steps to like Pythia8 to extract the source file. Rename it as "fastjet". Now move into the folder fastjet. The type the following commands(and press enter) step by step.


./configure
make
make install


You have installed fastjet !


Linking Pythia 8 to Fastjet :


Open your holy terminal once again. Move to the Pythia directory as you did earlier. Now move to the directory " examples " with command " cd examples". Then type the command and hit enter:


./configure --with-fastjet=/your-fastjet-directory-path/


Generaly the directory path is like : /home/username/something-or-not/fastjet/


If its successful then in terminal you will see something like " found fastjet version 2.4.3 " .


Done ! Now, from you from your pythia directory open pythia worksheet (a pdf file ) and it will guide you to the compilation process. But if you follow this process you may have to keep your source file in the examples folder and in the terminal you need to move to the "examples" directory with "cd" command to run and compile those programs. But there is another way. Check out the method below.


MakeFile :


If you want to keep your cpp source files, compile and run from some other folders then you need a Makefile in the directory where you want to compile and run. Download the file below .


 Makefile


Then follow the three steps below.


1. Change the value of  PYTHIADIR and FASTJETDIR . Set your own directory path of pythia and fastjet.


2. At the end of the file you will find a code


g++  -o  jet  jet.cc  


Replace those red colored names with your source file's name.


3. In your source file instead of  " Pythia pythia; " you need to type
 Pythia pythia("/home/mushfiq/collider/pythia8150/xmldoc") ;
You need to change the red colored path as your own.


Now from the terminal move to the directory where you have placed the source file (say jet.cc) and the Makefile. Now type "make" and hit enter.  Done !  To get the output  of  jet.cc we can use :




./jet > jet.out 


Now output is saved in jet.out . You can click on the file to open or simply type in terminal "gedit jet.out " and hit enter. BTW, if you use this method with Makefile then you don't even need to link pythia to fastjet with ./configure --with-blah-blah ... !


Ahh! We are done ! 
N.B.  I am not an expert of these stuffs. There may be better ways. But this is just how i fixed mine.

Accepted !!!

on Monday, May 9, 2011
A good news! I have been accepted in Theoretical Physics Department masters program. I wrote a post earlier where i said about my low possibility of getting accepted. But i have been accepted. So i am happy!

It's Time To Fix Up Broken Dreams

on Saturday, April 23, 2011
Now i am walking on the boulevard of broken dreams. When i came to the physics department on 2006 i had a great dream to become a great physicist. I wanted that so much it came to me at immense speed and just passed me. I could not catch it. Now i have turned around and trying to catch it again.


The story is, i was too crazy. I hardly cared about courses and exams and now paying up for that mistake. I realized about that in the middle of my undergraduate studies and then worked on that problem. But could not recover totally. Just fell short of the targeted GPA.  So i may even miss the opportunity to get into the Masters program of  Theoretical Physics department at University of Dhaka. I really wanted to get into that Department. This year there is a good competition going on there. 


So its hard time for me. But i have not prostrated myself with frustration. Because the game is not over yet. Still there are ways to reach my goal or dream whatever you say. Right now i have to do good in the GRE exams. That's the first and most important task now. A good score should fix up my broken dreams quite well.


These twists are the interesting moments of life. These makes life challenging and alive. Remember one thing, if  you really want to achieve something in life then don't be crazy, work in a systemic way and try not to go against the system. Accept it and work hard. Cheers!


Update 9/5/2011: I have been accepted in that masters program.