Home

AliRoot

AliEn

Links

Meetings

Getting started with AliRoot

A few simple examples.


Simulation

An example of how to run a simulation:

$ALICE_ROOT/macros/grun.C
.x grun.C
This runs a simulation of a single event based on the options in:
$ALICE_ROOT/macros/Config.C
There are several different Configs in the same directory:
ConfigPPR.C, Config_PDC06.C, ...

  • Some simple modification examples of Config.C

    Use a single particle generator:

        AliGenFixed* gener = new AliGenFixed(1);
        // (momentum in GeV/c, postion in cm)
        gener->SetGun(0, 1.0, 0, 0, 0, -160);
        gener->SetPart(kProton);
        gener->Init();
    
    Use zero magnetic field:
        AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 0, 1., 10., 1);
        field->SetL3ConstField(0); //Using const. field in the barrel  
        gAlice->SetField(field);    
    

  • A simple way to visually display the results of the simulation

    You can use the macro:

    $ALICE_ROOT/macros/display.C
    
    After you have finished your simulation type:
    .x display.C
    
    NB! The bar on top can be used to lower the pT cut which is quite high as default (pT>1.5 GeV/c)


Using the ALICE event display

The ALICE event display classes are located in:

$ALICE_ROOT/EVE
In the same directory where the data is type in a shell:
alieve alieve_init.C
to start the event display.

To display data or geometrical objects go to the EVE directory in the Browser.
From there you can run several macros.
Run e.g. geom_tpc by double clicking on it. Then click on "Camera Home" button in the drawing window to see the full TPC (you can rotate it and zoom in and out with the mouse).
The detail of the TPC drawing can be changed in the Reve window under Geometry/TPC. In that way you can also see what is inside the TPC:-)
Click on the macro tpc_hits to get the TPC hits displayed and so on.


Making a PYTHIA simulation

Here is an example for the creation of a simple PYTHIA simulation :

  • Config.C
  • sim.C
  • In Config.C, you configure the parameters of your simulation (momentum range, angle...) and the set of detectors you want to activate. sim.C is a simple macro which will run the simulation.

    Usage : copy the two files in a directory, and then, in AliRoot :

    root [0] .L sim.C
    root [1] sim(nevents)
    

    The output is a set of root files :

    galice.root              // contains runloader, needed to access the data
    geometry.root            // 
    Kinematics.root          // contains trees with the characteristics of the particles : type, momentum, mother, daughter...
    misaligned_geometry.root // 
    TrackRefs.root           // contains characteristics of the tracks : momentum, angle...
    Trigger.root             // if a trigger is activated
    
    Here is an example of analysis that will read the Kinematics file and print one event (i.e. the particles and, if possible, their relation mother-daughter): print.C
    >aliroot
    
    root [0] .L print.C+
    Info in : creating shared library
    root [1] printevent(2)
    -->proton  -->d       -->d
               -->uu_1    -->pi-    |
                          -->pi0    |
    -->proton  -->u       -->u
               -->ud_0    -->K-     |
                          -->neutron|
    -->d       -->d       -->string
                          -->K+     |
               -->g
    -->u       -->u       -->string
                          -->K*0_bar -->K0_bar  -->K_L0   |
                                     -->pi0    |
               -->g
    
    Last modified: September 14 2007.