Top 10 Theoretical Physicists Alive

January 9, 2012

Here is my list of top 10 theoretical physicists alive:
1.Stephen Hawking

S. Hawking

2.Steven Weinberg

S. Weinberg

3.Sir Roger Penrose

R. Penrose

4.Edward Witten

E. Witten

5.Peter Higgs

P. Higgs

6.Murray Gell-man

M. Gellman

7.Gerard ‘t Hooft

G. 't Hooft

8.Martinus Veltman

M. Veltman

9.Makoto Kobayashi

M. Kobayashi

10.Toshihide Maskawa

T. Maskawa


Synchronized Code Developing Using GIT and DROPBOX

May 1, 2011

Simplify your life, if you have too much troubles in code developing with your staff. One of the usual ways is to use a common server and install a Concurrent Versions System (CVS). If you don’t have such facilities around you, you can get a free common server which always readily serve for your interests using DROPBOX. This is a great service! Subscribe to site, invite your staff and start sharing your code or documents through it now.

When it comes to use a CVS, i can suggest you to make the best of using GIT. It is an free & open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. If your code is in a <code_folder> and you installed GIT successfully, use below steps to be synchronized with your staff using DROPBOX now.

If you are the first person who will share your code with your staff through DROPBOX:

  • Open terminal and cd into your code folder.
  • Write “git init”
  • Write “cd .git” and you’ll see branches, objects and config files here.
  • Edit your git config file writing “nano config”. Your config file should be like that in order to stay synchronized through DROPBOX:


[core]

repositoryformatversion = 0

filemode = true

bare = false

logallrefupdates = true

[user]

        name = <USER NAME>

        email = <EMAIL ADDRESS>

[remote "origin"]

url = /Users/kuday/Dropbox/git-archive/.git

fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]

remote = origin

merge = refs/heads/master

  • Save your config file and come back to terminal, then write “git add . ” This will add all of the files in to git repository.
  • Move <codefolder>.git into your DROPBOX and send invitation to your staff to share this code.
  • You’ll see your code repository in sharing after you open your dropbox as <codefolder>.git
If you are not the first person who creates the git repository for your code and you can reach <codefolder>.git file through DROPBOX, things are even easier to clone it into your computer:
  • Open terminal in DROPBOX and copy your <codefolder>.git (–> its behaviour is like a zip file) in to a proper location.
  • Go to this location and write “git clone <codefolder>.git” .This will create back your entire code.
  • Write “cd <codefolder>”
  • Edit your config file in .git folder as above.
  • Write “git add .” on your terminal.
  • Start developing!
SOME USEFUL GIT COMMANDS:

git pull origin master
This command gets the latest changes from your staff. Don’t forget to do it often.
git commit -m “Here will be written some messages after editing the code”
After you decide to share the new version of your code with your staff, this command will search for changed files in the repository and updates DROPBOX. You’ll see a spinning wheel near DROPBOX icon which means that you started sharing you new code.
git log
This will show you the entire history of code developing with users, comments and dates.
gitk 
This command opens a useful interface to trace user activities and changes.
git merge origin
This will merge the separate branches which bear different users developments. Use this command if you believe that your code branching too much.


Fastest Way to Calculate Hadronic Cross Sections

October 27, 2010

Many of the particle physicists may think that CompHEP is not a proper way of making hadronic calculations. Since in numerical calculations CompHEP treats each subprocess separately, calculation of a process with lots of subprocesses (as it happens usually in calculations for hadron colliders) can be a laborious task. In order to make the task simpler and enable non-GUI calculations both symbolic and numerical programs in CompHEP are equipped with the batch PERL scripts symb batch.pl and num batch.pl correspondingly.

Here’s an example how you can use these scripts:

1 -) Open CompHEP in your working directory as ./comphep

2 -) Enter a scattering process like pb,pb -> t,T.

3 -) Enter C-compiler and complete symbolic calculation.

4 -) You will get the numerical session GUI and see Process, SubProcess, Monte Carlo seesion…etc. Notice that you can only calculate subprocess cross sections here.

5 -) Open a new terminal but don’t close CompHEP numerical session window.

6 -) Open your CompHEP working directory where num_batch.pl and sym_batch.pl are located.

7 -) Write ‘./num_batch.pl -run vegas’

8 -) Write ‘./num_batch.pl -show cs’ and you’ll get the total cross section through all subprocesses.

OR edit process.dat to enter your process and use sym_batch.pl in terminal window to complete symbolic calculations.

Reference: http://arxiv4.library.cornell.edu/pdf/0901.4757v1


MacOSX: Solution to PYTHIA / HBOOK Problem in Cernlib

July 23, 2010

Last month, I was trying to compile some pythia codes to calculate snutau (scalar tau) cross section, Pt and eta distributions. But unfortunately my trusted g77 compiler insistently rejected to compile my code with the following errors:


Undefined symbols:
"_pylist_", referenced from:
_MAIN__ in ccJ7qu36.o
"_pyevnt_", referenced from:
_MAIN__ in ccJ7qu36.o
"_pyinit_", referenced from:
_MAIN__ in ccJ7qu36.o
"_hropen_", referenced from:
_MAIN__ in ccJ7qu36.o
"_hlimit_", referenced from:
_MAIN__ in ccJ7qu36.o
"_pystat_", referenced from:
_MAIN__ in ccJ7qu36.o
_MAIN__ in ccJ7qu36.o
"_pydata_", referenced from:
___g77_forceload_0.0 in ccJ7qu36.o
"_hfill_", referenced from:
_MAIN__ in ccJ7qu36.o
_MAIN__ in ccJ7qu36.o
_MAIN__ in ccJ7qu36.o
"_hrout_", referenced from:
_MAIN__ in ccJ7qu36.o
"_hbook1_", referenced from:
_MAIN__ in ccJ7qu36.o
_MAIN__ in ccJ7qu36.o
_MAIN__ in ccJ7qu36.o
"_hrend_", referenced from:
_MAIN__ in ccJ7qu36.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

After a little research about HBOOK technology, i discovered that it’s a quite old component even before Fortran 77 and the only way to make it run in this way is to include Cernlib components while compiling. But that didn’t work either for MacOsX because probably MacosX version of Cernlib doesn’t support HBOOK libraries although it’s possible for Linux.

Anyway why do we have to use HBOOK? At the end of the day, we just want to have some data files to draw using Paw or Root and it’s possible using Pythia’s own components. So the principle must be “Use Pythia Commands to get an Output file because that’s the easiest way!” Here is my solution: I changed all HBOOK commands to PY..s in my code below and it worked perfect.

Write “g77 -o mycode.x -w mycode.f libpythia6421.a” to compile.

C...All real arithmetic in double precision.
      IMPLICIT DOUBLE PRECISION(A-H, O-Z)
      IMPLICIT INTEGER(I-N)
C...Three Pythia functions return integers, so need declaring.
      INTEGER PYK,PYCHGE,PYCOMP
C...Parameter statement to help give large particle numbers
C...(left- and righthanded SUSY, technicolor, excited fermions,
C...extra dimensions).
      PARAMETER (KSUSY1=1000000,KSUSY2=2000000,KTECHN=3000000,
     &KEXCIT=4000000,KDIMEN=5000000)
C...EXTERNAL statement links PYDATA on most machines.
      EXTERNAL PYDATA
      DIMENSION IHI(10)
C...Commonblocks.
C...The event record.
      COMMON/PYJETS/N,NPAD,K(4000,5),P(4000,5),V(4000,5)
C...Parameters.
      COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
C...Particle properties + some flavour parameters.
      COMMON/PYDAT2/KCHG(500,4),PMAS(500,4),PARF(2000),VCKM(4,4)
C...Decay information.
      COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
C...Selection of hard scattering subprocesses.
      COMMON/PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
C...Parameters.
      COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
C...Supersymmetry parameters.
      COMMON/PYMSSM/IMSS(0:99),RMSS(0:99)

C....Real definitions...
      REAL CTETM,CTETP,ETAUP,ETAUM,PTAUP,PTAUP2,PTAUM,PTAUM2
      REAL PTAUMX, PTAUMY, PTAUMZ
      REAL PTAUPX, PTAUPY, PTAUPZ
      REAL PTX, ETAX, XMTAU
C ....rapidity: YX
C--------------------------------------------

C...First section: initialization.
      NEV=10000

C...Select generic SUSY generation.
C...39:all MSSM processes except Higgs prod.
C...41:stop pair(ISUB=261-265), 42:slepton pair(201-214), 45:sbottom(281-296)
C...ISUB=210,211,212 for slepton+sneutrino
      MSEL=0
      MSUB(214)=1

C...Set SUSY parameters in SUGRA scenario.
      IMSS(1)=2		!mSUGRA parameters given to PYTHIA
      RMSS(8)=230D0	!m_0
      RMSS(1)=360D0	!m_1/2
      RMSS(5)=10D0	!tan(beta)
      RMSS(4)=1D0	!sign(mu)
      RMSS(16)=0D0	!A_0

C...Channels
      do kk=1949,1974
      MDME(kk,1)=0
      enddo
      MDME(1950,1)=1

C...Channels for W boson
      do kw=206,208
      MDME(kw,1)=0
      enddo

C...If interested only in cross sections and resonance decays:
C...switch on/off initial and final state radiation,
C...multiple interactions and hadronization.
      MSTP(11)=0	! 1:QED radiation
      MSTP(61)=0	! 2:ISR
      MSTP(71)=0	! 1:FSR
      MSTP(81)=0	! 1:multiple int.
      MSTP(111)=0 	! 1:hadronization

C...Initialization for the LHC.
       CALL PYINIT('CMS','e-','e+',3000D0)

C...List resonance data: decay channels, widths etc.
       CALL PYSTAT(2)

C...Book Histograms
	CALL PYBOOK(10,'PT',100,0D0,1000D0)
	CALL PYBOOK(20,'ETA',100,-5D0,5D0)
	CALL PYBOOK(30,'MTAUTAU',100,0D0,2000D0)

C--------------------------------------------------

C...Second section: event loop.

C...Loop over the number of events.
       DO 200 IEV=1,NEV
        IF(MOD(IEV,500).EQ.0) WRITE(6,*)
     &  'Now at event number',IEV

C...Event generation.
         CALL PYEVNT

C...List first few events.
          IF(IEV.LE.5) CALL PYLIST(1)

C...Fill the masses of interesting (s)particles.
C...Fill pt of particle
       DO I=1,N
C...Catch tau- lepton
       IF((K(I,2).EQ.15).AND.(K(I,1).EQ.1)) THEN
       PTX=SQRT(P(I,1)**2+P(I,2)**2)
       CTETM=P(I,3)/SQRT(P(I,1)**2+P(I,2)**2+P(I,3)**2)
       ETAX=-LOG(TAN(ACOS(CTETM)/2.))
       etaum=P(I,4)
       ptaum2=P(I,1)**2+P(I,2)**2+P(I,3)**2
       ptaum=SQRT(P(I,1)**2+P(I,2)**2+P(I,3)**2)
       ptaumx=P(I,1)
       ptaumy=P(I,2)
       ptaumz=P(I,3)

       CALL PYFILL(10,DBLE(PTX),1D0)
       CALL PYFILL(20,DBLE(ETAX),1D0)
C......       CALL HFILL(10,PTX,0.,1.)
C......       CALL HFILL(20,ETAX,0.,1.)
       ENDIF
C...Catch tau+ lepton
       IF((K(I,2).EQ.-15).AND.(K(I,1).EQ.1)) THEN
       etaup=P(I,4)
       ptaup2=P(I,1)**2+P(I,2)**2+P(I,3)**2
       ptaup=SQRT(P(I,1)**2+P(I,2)**2+P(I,3)**2)
       ptaupx=P(I,1)
       ptaupy=P(I,2)
       ptaupz=P(I,3)
       ENDIF
       XMTAU=SQRT((ETAUP+ETAUM)**2-(ptaup2+ptaum2
     .   +2.0*(ptaupx*ptaumx+ptaupy*ptaumy+ptaupz*ptaumz)))
C...       CALL HFILL(30,XMTAU,0.,1.)
       CALL PYFILL(30,DBLE(XMTAU),1D0)
       ENDDO

C...End of documentation and event loops.
200    CONTINUE

C--------------------------------------------

C...Third section: produce output and end.

C...Cross section table.
       CALL PYSTAT(1)

C...Histogram close
C...       CALL HROUT(0,ICYCLE,' ')
C...       CALL HREND('SUSY')

C...Histograms.

       OPEN(11,file='pt.dat',STATUS='unknown')
       IHI(1)=10
       CALL PYDUMP(3,11,1,IHI)
       CLOSE(11)
       OPEN(22,file='eta.dat',STATUS='unknown')
       IHI(1)=20
       CALL PYDUMP(3,22,1,IHI)
       CLOSE(22)
       OPEN(33,file='MTau.dat',STATUS='unknown')
       IHI(1)=30
       CALL PYDUMP(3,33,1,IHI)
       CLOSE(33)
       CALL PYHIST
       END


A Simple C++ Simulation For Beginners

May 14, 2010

Phenomenology in physics, mostly deals with the simulation of events and obtaining data from simulations to compare it with real time event datas. Obviously during event processing, it’s not necessary to give extra effort to visuality. So one should not confuse it with visual simulations. We’r just making event based calculations. Therefore you can ask what exactly do we simulate? or can any calculation be a simulation? Notice that in scientific experiments, you always need a satisfactory amount of statistics. So basically you should have a scenario for gathering statistics in simulations. Here i’d like to present a calculation of “Pi” number as a simulation sample. Here we are collecting statistics via producing random numbers which is included a circle with r=1.

Calculation: Pi number
The method: Monte Carlo Simulation
Fundamental Formulas: (pi)r 2 and x2+y2 = 1 (Note that radius of circle is unit 1.)

1-) Write below code and compile it writing “g++ pi.cpp -o pi.x”

#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<time.h>

using namespace std;
int main(){
	int jmax=1000; // maximum value of HIT number. (Length of output file)
	int imax=1000; // maximum value of random numbers for producing HITs.
	double x,y;    // Coordinates
	int hit;       // storage variable of number of HITs
	srand(time(0));
	for (int j=0;j<jmax;j++){
		hit=0;
		x=0; y=0;
		for(int i=0;i<imax;i++){
			x=double(rand())/double(RAND_MAX);
			y=double(rand())/double(RAND_MAX);
		if(y<=sqrt(1-pow(x,2))) hit+=1; }          //Choosing HITs according to analytic formula of circle
	cout<<""<<4*double(hit)/double(imax)<<endl; }  // Print out Pi number
}

2-) To understand the code: We have just 2 loops here. The inner loop produce random number (<1) and uses these numbers for coordinates x,y. “If” condition increases hit number if this (x,y) point locates in the area of quarter circle (Look at the figure below.)

Hit Production Area

The outer loop resets our variables and print out Pi number according to formula: Area of Quarter Circle/ Area of Square = (1/4)πr2/r2 = (1/4)π= accepted hits / total hits = hits / imax.

3-) Run it as “./pi.x > pi.dat”

4-) Draw output file.

Pi Graph

I used below “root macro” to read and convert it to a .root file.

{
	gROOT->Reset();
	ifstream in;
	in.open("pi.dat");
	Float_t x; Int_t nlines = 0;
	TFile *f = new TFile("pi1.root","RECREATE");
	TH1F *h1 = new TH1F("h1","pi_grafik",100,2.5,4.0);
	TNtuple *ntuple = new TNtuple("ntuple","pi","x");
	for (nlines=0; nlines<10000; nlines++) {
		in >> x;
		if (!in.good()) {break;}
		if (nlines < 5) {printf("x=%5f\n",x);}
		h1->Fill(x);
		ntuple->Fill(x);
		nlines++;
	}
	in.close();
	f->Write();
	printf("%d deger bulundu\n",nlines);
	h1->SetXTitle("pi");
	h1->SetYTitle("Olay");
	h1->Draw();
}

  • Paste above root macro in a C file and name it as “pintuple.c”
  • Open your root analysis program in the same directory you saved pintuple.c : “root”
  • Execute the file: “root> .x pintuple.c”
  • You’ll get an ntuple file called “pi1.root”
  • Write “TBrowser g” in root.
  • Open pi1.root file and you’ll get the above histogram. Congratulations :)

MacOSX: TurboC Installation

February 26, 2010

If you’d like to use C++ graphic features which is provided by “graphics.h” and “conio.h” , you should install several packages more to your MacBook. I assume that you already installed C compilers and X11 by Fink or other ways (Make sure “cc” command is working!) . You will also need ncurses package which you can easily install by fink as well. Then continue with the followings:

  1. Download TurboC binaries for MacOSx into your working directory.
  2. tar -xvf TurboC-dev.tar.gz
  3. cd TurboC-source
  4. Before running “make” command you may need to edit Makefile. (I remember that i’ve just added a space at the line starting with “hex2h:” as “-o $@” (not  -o$@)
  5. make

If your system is proper, you won’t get any warnings or error messages after installation. It is important to have “libTurboC.a” in your directory after installation. You have to include this file during compiling c++ files you created.

Now if you look at the structure it’s quite simple. If you locate your programs in the Programs directory which is created after installation, it will be easier for you to show the path.

I’m adding a simple code for you to test.


/*
*  circle.c
*
*
*  Created by Sinan Kuday on 26.02.2010.
*  Copyright 2010. All rights reserved.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include "../graphics.h"
#include "graphics.h"
#include "conio.h"

main(void)
{

int gd=DETECT, gm;
int poly[12]={350,450, 350,410, 430,400, 350,350, 300,430, 350,450 };
initgraph(&gd, &gm, "");
setcolor(3);
setfillstyle(SOLID_FILL,WHITE);
circle(100,100,50);
outtextxy(75,170, "Circle");
rectangle(200,50,350,150);
outtextxy(240, 170, "Rectangle");
ellipse(500, 100,0,360, 100,50);
outtextxy(480, 170, "Ellipse");
line(100,250,540,250);
outtextxy(300,260,"Line");
sector(150, 400, 30, 300, 100,50);
outtextxy(120, 460, "Sector");
drawpoly(6, poly);
outtextxy(340, 460, "Polygon");
getch();
closegraph();

}

You add this code in “circle.c” and compile it with the following command:
cd ..

cc -O0 -g -DWITH_X -I/usr/X11R6/include -o circle -I. Programs/circle.c -L. -L/usr/X11R6/lib -lTurboC -lncurses -lX11 -lm -lpthread

Then run it as usual way:
./circle

If you can see circles, polygons, …etc. in your X11 window, you are done!! Congrats.


Cernlib Manual Installation

January 16, 2010

If you are using Unix/Linux based operating system and having difficulties for installing CERNLIB, the best way is to try the simplest way: manual installation.

1- ) Go to http://cernlib.web.cern.ch/cernlib/version.html and click “compressed tar files” link which is proper with your system.

2-) cd / (open your root folder)

3-) mkdir cern

4-) copy 3 tar files that you’ve already downloaded (cernlib.tar.gz, cernbin.tar.gz, include.tar.gz)  into cern folder you created.

5-) Go into your Cern folder you’ve already created and write the command:
tar -xvf cernlib.tar
tar -xvf cernbin.tar
tar -xvf include.tar
6-) Create symbolic links in this folder:
ln -s 2006 pro
ln -s 2006 new
(If you don’t have a folder 2006, change it with the name you have exp: 2004,2005,2007…etc)

7-) Now you should set some system variables: write “export” on the command line to see all fixed system variables and their values which has been declared in the past.

8 ) You must change the variables related to CERN. So either write following commands on the command line or add them into your /etc/bashrc file (for unix). If you add them into your /etc/baschrc file, you won’t need to set these variables everytime you open your computer.

export CERN=<Your Cern Directory>
export CERN_ROOT=<Your Cern Directory>
export CERNLIB=$CERN/pro/lib
export CERNBIN=$CERN/pro/bin
export PATH=$PATH:$CERNBIN

IMPORTANT: Please check your environmental variables by writing “export” in your command line. If you installed Cernlib by Fink or apt-get before, you may not get correct CERN_ROOT, CERNLIB or CERNBIN variables. In this case, open corresponding bashrc/profile files and edit your CERN variables. For fink, edit cernlib… csh, sh files under /sw/etc/profile.d folder.


MacOSX: Manage Programs that Automatically Launch at Startup

December 26, 2009

Mac Os X operating system has different options to manage startup items. If you have already installed skype, some messengers, orb or some agents, you may not want to use them at the startup of your computer. To inactivate these processes, actually you should remove your login accounts related to corresponding process. So;

  • Open System Preferences (if it’s not in your Dock, you can go to Apple > System Preferences at the top of the screen)
  • From the System Preferences screen, click the “Accounts” icon under the “System” settings.
  • For each account, there is a “Login Items” tab where you can add and remove programs to automatically launch at startup. If you cannot edit your Login Items there it is one of two things:
    • You do not have proper access to edit the person’s account you are looking at.
    • You have proper access, but you need to “Click the lock to make changes.” Just look at the padlock icon at the bottom-left corner of the page. If it’s locked, that’s what you need to do.

  • MacOSX: Installing PAW and PAW++

    November 13, 2009

    Normally, PAW and PAW++ comes after your cernlib installation. If you didn’t install cernlib before, all you need to do is writing the following command in your terminal window

    $ fink install cernlib

    Click here to learn how you can install package manager ‘FINK’ on your Macbook.

    As a more advanced version of PAW, you can use PAW++ only if you also have the right components installed. Otherwise you will get an error like;

    dyld: Library not loaded: /sw/lib/libXm.2.dylib
    Referenced from: /usr/bin/paw++
    Reason: image not found
    Trace/BPT trap

    SW is your fink folder. So the error prompts that you have a missing library file related with lesstif package. So write the following;

    $ fink install lesstif

    In a few minutes later, fink will download and install your missing library files and you can run paw++ writing it in your terminal window.


    Running ROOT on Lxplus Server of CERN

    October 27, 2009

    Mac OsX terminal window has powerful features than any other operating systems but if you are working on a remote server you need to know a little more about it.

    If you are using MacOSX and if you are connecting lxplus@cern using regular command ssh, the first thing you will observe is that your system cannot open X11 window which is needed by ROOT. To overcome this problem, you should connect using either

    ssh -X username@lxplus.cern.ch
    or
    ssh -Y username@lxplus.cern.ch

    X option, provides you a ssh connection forwarding X11. And Y option, provides a ssh connection Forwarding trusted X11.

    After you logged in using your user name and password, you have 2 options to run ROOT.

    1 -) Entering ROOT variables below:

    export ROOTSYS=/afs/cern.ch/sw/lcg/external
    /root/5.14.00/slc4_ia32_gcc34/root/
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
    export PATH=$PATH:$ROOTSYS/bin

    2-) Or just source Athena Framework as: (It actually consists much more than ROOT)

    source cmthome/setup.sh -tag=15.6.4,setup,32

    –Recently this procedure has been changed and became eaiser. Please google for sourcing Athena framework–

    Then just write “root” and start your analysis.


    Follow

    Get every new post delivered to your Inbox.