Cernlib Manual Installation

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.

Advertisements

MacOSX: Manage Programs that Automatically Launch at Startup

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++

    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

    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/app/releases/ROOT/5.28.00/i686-slc5-gcc43-opt/root
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
    export PATH=$PATH:$ROOTSYS/bin

    2-) Or just source Athena Framework and setup root from Athena: (Note that Athena consists much more than ROOT)

    export AtlasSetup=/afs/cern.ch/atlas/software/releases/16.6.0/AtlasSetup
    alias asetup='source $AtlasSetup/scripts/asetup.sh'
    asetup 16.6.0

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

    Then just write “root” and start your analysis.

    Draw Feynman Diagrams Using ROOT

    It is needless to say that ROOT Data Analysis Framework provides tons of great tools to write a scientific article. But it happened one more time again and i had a great respect for ROOT after i learned that one can also draw Feynman Diagrams as well.

    Although there are alternative ways of drawing the diagrams of your scientific article, why not drawing them using the tool by which you made the analysis ? It’s easier!

    Here i am presenting a little code to modify or to use directly just changing some variables. Actually i have just drown a simple S-Channel scattering and i’m leaving the rest of the work to you.

    USAGE:

  • Copy the code below and paste it on a text file.
  • Click “Save as” and name the file as workDiagram.C (which is a name for ROOT macro)
  • Open your console and run ROOT writing “root” at the directory you saved workDiagram.C file
  • .L workDiagram.C (Load the file)
  • simpleSCh() (Run the function)
  • You will see something like a compton scattering diagram but the labels are wrong. You can change labels right clicking on them.
  • FEATURES:
    After running the script on the canvas that ROOT opened for you;

  • You can change the labels and their positions by right clicking on
  • You can rearrange the size of the picture by dragging the edge of the window
  • You can right click on the line and choose “SetLineAttributes” and at the “shape” tab you can rearrange its direction.
  • By Drag&Dropping you can change any of the elements on the screen
  • Click “File” and choose “Save as”. You will see that you can save your diagram almost any formats: ps, eps, svc, pdf, jpg, gif, xml, tiff, ..etc.
  • TIPS:

  • Drawing Higss Boson: Right Click on the line and choose “SetLineAttributes” and then make the line dashed choosing at combo box options.
  • Drawing Photon, Ws and Zs: Run script using the variables simpleSCh(“zigzag”,”zigzag”,”zigzag”,”zigzag”,”zigzag”). The first and second variables represents the incoming particles. The third one represents middle propagator and the last two one is outgoing particles.
  • Drawing gluons: Run script using the variables simpleSCh(“curly”,”curly”,”curly”,”curly”,”curly”).
  • Drawing fermions: Run script with default variables simpleSCh() or simpleSCH (“”,””,””,””,””)
    void simpleSCh(char *a="",char *b="",char *c="",char *d="",char *e="")
    {
    //Draw Feynman diagrams
    //Open Source ROOT Script Library
    //Author: Sinan Kuday
    
    TCanvas *c1 = new TCanvas("c1", "A canvas", 10,10, 500, 300);
    c1->SetFillColor(0);
    c1->Range(0, 0, 140, 60);
    Int_t linsav = gStyle->GetLineWidth();
    gStyle->SetLineWidth(3);
    TLatex t;
    t.SetTextAlign(20);
    t.SetTextSize(0.1);
    switch(a){
    case "zigzag":
    TCurlyLine *lt = new TCurlyLine(10,50,40,30); lt->SetWavy();
    break;
    case "curly":
    TCurlyLine *lt = new TCurlyLine(10,50,40,30);
    break;
    default:
    lt = new TArrow(10, 50, 40, 30, 0.03,"->|-"); 			break; 	} 	lt->Draw();
    
    switch (b) {
    case "zigzag":
    TCurlyLine *lb = new TCurlyLine(10, 10, 40, 30); lb->SetWavy();
    break;
    case "curly":
    TCurlyLine *lb = new TCurlyLine(10, 10, 40, 30);
    break;
    default:
    TArrow *lb; lb = new TArrow(10, 10, 40, 30, 0.03,"-|>-");
    break;
    }
    lb->Draw();
    
    t.DrawLatex(24,10,"e^{-}");
    t.DrawLatex(24,46,"e^{+}");
    
    switch (c) {
    case "zigzag":
    TCurlyLine *middle = new TCurlyLine(40, 30, 100, 30);
    middle->SetWavy();
    break;
    case "curly":
    TCurlyLine *middle = new TCurlyLine(40, 30, 100, 30);
    break;
    default:
    TArrow *middle; middle = new TArrow(40, 30, 100, 30, 0.03,"-|>-");
    break;
    }
    middle->Draw();
    
    t.DrawLatex(72,36,"#gamma");
    
    switch (d) {
    case "zigzag":
    TCurlyLine *rt = new TCurlyLine(100, 30, 130, 10);
    rt->SetWavy();
    break;
    case "curly":
    TCurlyLine *rt = new TCurlyLine(100, 30, 130, 10);
    break;
    default:
    TArrow *rt; rt = new TArrow(100, 30, 130, 10, 0.03,"-<|-"); 			break; 	} 	rt->Draw();
    
    switch (e) {
    case "zigzag":
    TCurlyLine *rb = new TCurlyLine(100, 30, 130, 50);
    rb->SetWavy();
    break;
    case "curly":
    TCurlyLine *rb = new TCurlyLine(100, 30, 130, 50);
    break;
    default:
    TArrow *rb; rb = new TArrow(100, 30, 130, 50, 0.03,"-<|-"); 			break; 	} 	rb->Draw();
    
    t.DrawLatex(113,10,"#bar{q}");
    t.DrawLatex(113,46,"q");
    
    c1->Update();
    gStyle->SetLineWidth(linsav);
    }
    
  • Abbreviations at CERN

    If you are someone new at CERN, lets say an undergraduate or a Ph.D. student, sooner or later you’ll realize the abbreviation list you have to learn. And this is not an ordinary task to be able to understand while someone is talking about AODs,ESDs,DPDs…etc. So you’d better memorize the list below before losing your mind like “what the hell is going on here!!” I am presenting a short dictionary below, actual list is quite longer. :))

    ACCU: Advisory Committee of CERN Users; High level committee to discuss the projects of member countries and users.

    AFS: Andrew File System; a network file system that allows users to reach datasets and experimental results. AFS is a distributed file system available for UNIX and other operating systems.

    AMI: Atlas Metadata Interface; AMI is the primary physicist web tool that provides physics metadata bookkeeping and access to the Dataset Selection Catalog for ATLAS through an optimized search interface.

    ALICE: A Large Ion Collider Experiment; it is also the name of the corresponding detector which is located outside of CERN facility.

    AOD: Analysis Object Data; This is the file format of reduced datasets from ESD.

    ARDA: A Realization of Distributed Analysis; is an LCG project whose main activity is to enable LHC analysis on the grid.

    ATHENA: is the name of the framework which is a derivative of the Gaudi Common Framework Project.

    ATLAS: A Toroidal LHC ApparatuS; the name of one of the detectors which is 44 meters long and 25 meters in diameter.

    ATLFAST: is the package for fast simulation of ATLAS detector and physics analysis.

    BSM: Beyond Standard Model; generally used for expressing models other than Standard Model like Supersymmetric, extra dimensional, exotic, technicolor…etc.

    CAF: Cern Analysis Facility; is a cluster at CERN running PROOF. It can be used for prompt analysis of pp data as well as selected PbPb data. Furthermore calibration programs can be run on the CAF.

    CASTOR: Cern Advanced STORage Manager; is a hierarchical storage management (HSM) system developed at CERN used to store physics production files and user files.

    CERN: European Organization for Nuclear Research, (Originally French: Organisation Européenne pour la Recherche Nucléaire)

    CDS: Cern Document Server; This is simply the site located at the address http://cdsweb.cern.ch/

    CINT: is an interpreter for C and C++ code. It is useful e.g. for situations where rapid development is more important than execution time.

    CLIC: The Compact Linear Collider; is another planning Cern project which will collide particles at 3 TeV in a linear orbit.

    CMS: The Compact Muon Solenoid Experiment; is also the name of the corresponding detector at Cern.

    COMPHEP: is a stand-alone software to generate events and high energy physics calculations via Matrix Element Monte Carlo method.

    CSC: 1) Cathode Strip Chambers; 2) Cern School of Computing

    DDM: Distributed Data Management; allows user to manage distributed experiment datas to the Tier centers around the world.

    DFS: Data File System;

    DLF: Distributed Logging Facility is a powerful logging facility which allows centralised logging and accounting in CASTOR.

    DPD: Derived Physics Dataset; This is the file format of datasets which is derived from either ESDs or AODs.

    DQM: Data Quality Monitoring; is an experimental online/offline data monitoring system developed by Cern.

    EDM: Event Data Model; is the platform that allows the use of common software between online data processing and offline reconstruction.

    ESD: Event Summary Data; is the file format derived by raw data in collision experiments at Cern.

    EVO: Enabling Virtual Organizations; is a java network messenger and communication tool dominantly used in Cern.

    GANGA: is an easy-to-use frontend for job definition and management with a basic interface, implemented in Python.

    GLIMOS: Group Leader in Matters of Safety for Experiments and Tasks

    LCG: LHC Worldwide Computing Grid; is a global collaboration of more than 170 computing centres in 34 countries. The mission of the WLCG project is to build and maintain a data storage and analysis infrastructure for the entire high energy physics community that will use the Large Hadron Collider at

    LHC: Large Hadron Collider;

    LHCb: Large Hadron Collider b-quark; is an experiment set up to explore what happened after the Big Bang that allowed matter to survive and build the Universe we inhabit today.

    LHCf: Large Hadron Collider Forward experiment; consists of two small calorimeters each one placed 140 meter away from the Atlas interaction point. Their purpose is to study forward production of neutral particles in pp collisions.

    LSF: Local Sharing Facility; This is a batch service by Cern computing department.

    MICROMEGAS: MicroMEsh GAseous Structure; is a detector first developed at CERN in Geneva for high-energy physics charged-particle tracking applications.

    N-Tuple: in set theory, n-tuple is a sequence (or ordered list) of n elements, where n is a positive integer. In high energy physics, n defines separate measurements such as rapidity, missing transverse energy, photon, muon, tau multipicity…etc. versus events.

    NICE: A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the single unix specification. It is also required a NICE account to be able to use the system for users at Cern.

    PANDA: Production and Distributed Analysis system; Job defining and executing system at Grid.

    PLUS: Public Login User Service (LXPLUS)

    PROOF: Parallel ROOT Facility; allows interactive parallel analysis on a local cluster. Interactive means that you see the results right away.

    OSG: Open Science Grid;

    ROOT: An object oriented framework for large scale data analysis.

    Savannah: is the department at Cern which is responsible for development, distribution and maintainance of software.

    SPS: The Super Proton Synchrotron (SPS) is a 6.9 km long particle accelerator at Cern. This is also used for injection the particles to LHC.

    SUSY: Supersymmetry; an extra dimensional model which assumes that fermions or bosons has an extra symmetry with an invisible corresponding boson field or fermion field.

    SM: Standard Model; is the model that unified known 3 interactions (electromagnetic+weak+strong) and its particles excluding the effects of gravitation which is the 4th known interaction field.

    TOTEM: Total Cross Section, Elastic Scattering and Diffraction Dissociation at the LHC; is the experiment studies forward particles to focus on physics that is not accessible to the general-purpose experiments.

    TIER: grid centers that collects the experiment data around the world. They also named according to the data they received such as Tier-0, Tier-1, Tier-2.

    TPC: The Time Projection Chamber (TPC) is the main tracking detector in the central barrel of the ALICE experiment at LHC.

    TSO: Territorial Safety Officer.

    VO: Virtual organization; this is related to the certification at Cern Grid.

    Installing Scientific Packages on Mac OS X

    If you decided to buy a Macbook, the first thing you need to know may be that “It’s not a Big Mac at all but rather it’s a Mac”. Don’t even think you can eat all the Mac Universe that goes around and is almost parallel to our universe. It even may take quite a lot of time to figure out what kind of a trouble you have, especially if you are someone in the scientific era. Don’t forget that some says “People who buy Macs are the same people who said BETA is better than VHS 15 years ago”.

    For an average physicist like me, it may be long term run to build a useful system on Macbook.
    Here is a list of softwares that a scientist may need:

    Compilers:
    gcc, g++, gfortran, g77, f77,Java, …etc.

    Package Managers:

    MacPorts, Fink, Darwin, RPM, Apt-get, …etc.

    Analysis Softwares:

    ROOT, Jas3, Aida, Octave, …etc.

    Computing Softwares:

    Mathematica, Matlab, …etc.

    Physics Phenomenology Softwares:

    Comphep, Calchep, Pythia, Fluka, Geant4, Madx,
    Isajet, Prospino …etc.

    Depended Packages:

    Cernlib, Openmotif, X11, Latex …etc.

    Office Tools:

    Excel, Text Editors, Presentation tools, PDF, DVI, PS viewers, …etc.

    Web Browsers

    Mozilla Firefox, Internet Explorer, Safari, Opera, Netscape, …etc.

    Next the main question comes up! How to install these softwares on Mac Os X 10.5.x ??

    Here is a prescription for beginners:
    (1). First of all, install compilers
    (2). Install some package managers
    (3). Install other software packages using compilers and installed package managers.

    (1)

    GCC Compiler Installation: Use Macbook installation DVD, you will find a package called Xcode in the DVD, if you search for it. Just install Xcode development tool and your gcc compiler will also comes with it. Then open a terminal window and just write “gcc”. If its error turns like “no input file”, it means you successfully installed the gcc compiler.
    Or you can check its location by writing “which gcc” on the command line.

    G77 Compiler Installation: Unfortunately you may not find g77 support combining with any other packages or package managers. So you should install it manually:

    • Download tar file which is most suitable for your computer g77-intel-bin.tar.gz (Intel Mac only) or g77-bin.tar.gz (PowerPC only)
    • Open a terminal window and write “gunzip g77-bin.tar.gz”
    • Write “sudo tar -xvf g77-bin.tar -C /.” for install the spesific files into your usr/bin/ folder.

    Gfortran Compiler Installation: There’s an dmg installation file for gfortran compiler. So you should download and install it by just clicking on it.

    (2)

    MacPorts Installation:

    MacPorts provides an open-source software for managing, compiling, installing, upgrading packages which include libraries, utilities on the Mac Os X operating system. One can easily install MacPorts downloading its dmg file and just click on it. After installation you can open a terminal and learn basic Macport commands writing “man port” . Recently for Mac users, MacPorts seem to be the most powerful package manager with almost 8000 packages. Some useful MacPorts commands are;

    • port list : Get the lists of all packages so that one can choose the package name before installation.
    • port upgrade <pkgname> : Upgrades the specific packages with newest versions.
    • port search <pkgname>: Search the package name (or a part of it) in the complete list of packages. You can make wild card searches like *root* or *X11*..etc.
    • port install <pkgname>: –Most used MacPort command- downloads, compiles, stages and installs the package you entered.
    • port installed: Shows the installed packages on your computer.
    • port uninstall <pkgname>: Deactivate the package.
    • port deps: Shows you the dependencies of a package with other packages.
    For complete list of commands, please read the documentation of MacPorts here.

    FINK Installation:

    Fink automates the process of downloading the binary package, or downloading source package, applying a patch, compling, and installing it. As a package manager, fink is the most advanced unix based software and one can easily find its documentations through web. There is an impressive number of applications you can install via fink. Fink was designed carefully as to not disturb or modify the system. It can be uninstalled with a single command ‘sudo rm -r /sw’ You definitely want f77, imagemagick, ghostscript for X, ispell, xdvi, and gimp if you want to edit graphics or xv to preview them.

    To download Fink visit http://www.finkproject.org and install its dmg file on your Macbook.

    • Open a terminal window and write “fink” to learn its usage and options.
    • Write “apt-get” (Fink also installs apt-get package)
    • Fink downloads packages from mirror servers around the world. So I strictly recommend you to configure mirror settings. Write “fink configure” to configure mirror options. Fink will start to ask you questions about configurations. Press “Enter” for default values. When it asks a question about mirror choose “4- Nearest mirrors from your continent”. Choose your country. And answer all other questions to complete configuration definitions. If you cannot download packages from chosen mirrors while installations, you should reconfigure these settings.
    • Fink supports stable packages as well as the unstable ones which are not tested or has some exceptions during their running process. To see the supported package list write “fink list” on your command line.
    • To be able to install unstable packages write “fink configure” and activate unstable package option when it asks you about stable/unstable packages. Press “Enter” to give default answers to other questions.
    • To download and install a package write “sudo fink install packagename” on the command line. (ex. “sudo fink install cernlib”)
    • WARNING: Fink automatically finds the dependencies of packages and usually downloads a set of package. That may probably extand your installation time. So i do not recommend anyone to download huge packages -ex. ROOT- via fink. Because it may take quite a lot of time with the related other packages like gcc4, X11, openmotif, …etc.

    (3)

    CERNLIB Installation:

    • First, make sure you installed fink and the compilers gcc, g77.
    • Open a terminal window and write “sudo fink install cernlib”
    • Fink will download and install cernlib in a few minutes.
    • Write “cernlib” on terminal window and see related cernlib locations. If you get an error message, make sure you installed fink and the compilers properly.

    OR you may prefer to install Cernlib Manually to avoid non-standard installation.

    COMPHEP Installation:

    • Visit Comphep’s website, be a member and then download its .tar files.
    • Make sure you installed the compilers gcc and g77 properly.
    • Open a terminal window in the folder that comphep’s .tar file exits.
    • Write “sudo tar -xvf comphep-4.5.1.tar”
    • Write “cd comphep-4.5.1”
    • Write “./configure”
    • Follow the commands and write “make” to complete installation.
    • Write “make setup WDIR=calculations” to create a user file called calculations.
    • To run the application write “cd calculations” and “./comphep”

    ROOT Installation:

    • Download ROOT analysis framewok visiting ROOT official web site at CERN. If you’r obsessed to perfection, you should download the latest version for your system. (Mac OS X intel or power pc)
    • To open the related .tar file write “sudo tar -xvf root_v5-1.24.00.macosx105-i386-gcc-4.0.tar” on the command line.
    • Write “cd rroot_v5-1.24.00.macosx105-i386-gcc-4.0”
    • Write “./confgure –help” and “./configure” to make installation settings.
    • Write “make” and complete the installation.

    You can also set environmental variables to run root for anytime you open a terminal window by writing “root” command. To edit bash and add environmental variables;

    • Open a termianl window and write “cd /” to go root directory.
    • Write “sudo nano etc/bashrc” to open a editor to edit bash profile.
    • Add the following lines in to bashrc file, save and exit (CTRL-O and CTRL-X)
      • export ROOTSYS=/usr/local/root
      • export DYLD_LIBRARY_PATH=$ROOTSYS/lib
      • export PATH=$PATH:$ROOTSYS/bin
    • You should change $ROOTSYS variable (first line) if you installed ROOT framework in to another directory.

    General Instructions for Installations:

    • Download the software in tarball.
    • Decompress tarball writing “sudo tar -zxvf <software>.tar”
    • Cd into folder and edit Makefile. DON’T FORGET TO EDIT IT IN COMPATIBLE WITH YOUR PATHS and COMPILERS or UPDATE YOUR COMPILERS.
    • Write “./install” or “./configure” if you have such shell files to run.
    • Write “make” and start compiling.
    • Trace errors if you have any.

    I strongly recommend you to register Apple’s developer website http://developer.apple.com/ for recent updates and development tools.