Visualisation

Visualisation logo -- Artwork by G.Galli CarminatiContent

 


Introduction

AliEve is ALICE Event Visualization Environment. It is located in module EVE/ of AliRoot source-tree. AliEve is built on top of ROOT's EVE module which in turn uses ROOT's GUI and OpenGL functionality.

Under the EVE/ directory one can find the following directories:

EveBase/

Classes needed for visualization of ESD's and AOD's, interface to basic AliRoot functionality. The idea is that it only depneds on STEER/.

EveDet/

Classes needed for visualization of raw data and digits as well as for interface to detector-specific operations. Depends on all detector libraries.

EveHLT/

Classes needed for interface to the HLT data-sources. Depends on all detector and HLT libraries.

alieve_main/

Source code for the main() function of the alieve executable. It is linked against all of the EVE libraries and their dependencies. On start-up it initializes eve and sets up the macro and include paths of ROOT. [ alieve is obsolete, it was really needed to properly catch exceptions from EVE and resume execution.]

alice-data/

Data files related to ALICE visualization, like fall-back geometry, simplified geometry and icons.

alice-macros/

CINT macros for AliEve configuration and for loading of data from the event into the event-display.

hlt-macros/

CINT macros, data-files and code-fragments needed for running AliEve with HLT.

macros/

CINT macros needed for low-level initialization or for specific modes of operation.

test-macros/

Exchange area for experimental CINT macros.


How to run

 

Running the visual scanning application

To run it directly from a directory:

cd
alieve visscan_init.C'("")'

Alternatively, you can specify the directory on the command-line:

alieve visscan_init.C'("", "some-directory")'

To open file from AliEn (usually takes a while, so copying root_archive.zip might be faster):

# initialize AliEn environment
alieve visscan_init.C'("", "alien:///alice/data/2009/LHC09c/and-so-on/")'

This provides GUI interface for choosing which data you want to see displayed.

To select which data to show for every event, select the DataSelection tab and activate the desired macros. The selection will be activated on next event (or click on "Reload event" in the upper-left corner).

The "Macros" tab on the left pane allows you to execute a macro for current event only. The projected views are not updated automatically. One has to select the new object and the middle-click (as in mouse paste) on the projection-manager entry (RhoZ and RPhi Manager).

For usage of GL viewer, see builtin help (top-right of each view).

Specifying OCDB path

To help you specify standard OCDB paths, several wrappers for visscan_init.C are provided:

Wrapper macro OCDB-path argument OCDB command
visscan_raw.C "raw://" SetDefaultStorage("raw://")
visscan_mcideal.C "mcideal://" SetDefaultStorage("MC, "Ideal")
visscan_mcresidual.C "mcresidual://" SetDefaultStorage("MC, "Residual")
visscan_mcfull.C "mcfull://" SetDefaultStorage("MC, "Full")
visscan_mc.C "mcideal://" --- just a shorthand ---
visscan_local.C "local://" SetDefaultStorage("local://$ALICE_ROOT/OCDB")

 

 

You can also use the second column strings as the first argument to visscan_init.C or alieve_init.C directly.

Showing data from AliEn

For simulated data:

alieve visscan_mc.C'("alien:///alice/cern.ch/user/a/aliprod/LHC09d1/output/1234323/007")'

For reconstructed data:

alieve visscan_raw.C'("alien:///alice/data/2009/LHC09c/000101134/ESDs/pass1/09000101134018.10")'

For reconstructed and raw data (enable raw from "Data Selection" tab):

alieve visscan_raw_raw.C'("alien:///alice/data/2009/LHC09c/000101134/ESDs/pass1/09000101134018.10")'

Note: real data begins with empty "Start of run" events from all LDCs -- this is also seen in the first

Low-level expert operation

This is meant for experts -- no data is loaded automatically. You have to execute all visualization macros manually.

  1. Initialize ALICE environment.

  2. Spawn 'alieve' executable and invoke the alieve_init.C macro, for example:

    To load first event from current directory:

    alieve alieve_init.C

    To load 5th event from directory /data/my-pp-run:

    alieve 'alieve_init.C("", "/data/my-pp-run", 5)'

    Interactively:

    alieve
    root[0] .L alieve_init.C
    root[1] alieve_init("", "/somedir")
  3. Execute macros from EVE/alice-macros/

    1. From the ROOT browser

      The macros are shown in the dedicated tab on the left of the application window. They will be run with their default arguments.

    2. From the command-line

      Use .x macro.C to load the macro and execute it at the same time with default arguments, .L to just load the macro. After that you can call it as macro(arg1, arg2), allowing you to specify arbitrary arguments.

    These macros provide a default view of a given data-type and also serve as examples that user's should reuse end extend to suit more specific needs. Contributions of new macros and extensions of existing ones are welcome.

  4. To navigate the events use macros event_next.C and event_prev.C. These are equivalent to the command-line invocations:

    root[x] AliEveEventManager::GetMaster()->NextEvent()
    root[x] AliEveEventManager::GetMaster()->PrevEvent()

    The general form to go to event via its number is:

    root[x] AliEveEventManager::GetMaster()->GotoEvent()
  5. Automatic execution of macros on every event

    AliEveEventManager can execute a set of macros whenever a new event is loaded. For example, to load ESD tracks on every event, do:

    .L esd_tracks.C
    AliEveEventManager::GetMaster()->AddNewEventCommand("esd_tracks();")

Visualization of raw-data

Raw-data visualization macros are available for almost all detectors (see macros ending with _raw or _digits). Some of them take arguments that can significantly change the behaviour, so read them for more information. For details please consult the experts from the detector in question.


Resources for developers

ROOT's GUI classes and basics of it's OpenGL interface are described in ROOT User's Guide.

ROOT documentation with links to papers describing EVE and GL modules.

Architecture of Eve and AliEve is described in Raw-data display and visual reconstruction validation in ALICE. In this paper Eve is still called REVE — ROOT Event Visualization Environment.

Writing visualization macros

In principle macros consist of three main parts:

  1. Retrieve data-handle from the event-manager.

    Standard data accessible viaAliRunLoader
    AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
    rl->LoadHits("ITS");
    TTree* ht = rl->GetTreeH("ITS", kFALSE);
    ESD and ESDfriend
    AliESDEvent *esd = AliEveEventManager::AssertESD();
    AliESDfriend *esd_friend = AliEveEventManager::AssertESDfriend();

    for (Int_t n=0; nGetNumberOfTracks(); ++n) {
       AliESDtrack* at = esd->GetTrack(n);
        ...
    }

    Raw-data
    AliRawReader *raw = AliEveEventManager::AssertRawReader();
  2. Create and fill (Ali)Eve objects (example from $ROOTSYS/tutorials/eve/quad_test.C)

    TRandom r(0);
    gStyle->SetPalette(1, 0);

    TEveRGBAPalette* pal = new TEveRGBAPalette(0, 130);
    // Creation of object
    TEveQuadSet* q = new TEveQuadSet("RectangleXY");

    q->SetPalette(pal);
    q->Reset(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);

    // Fill with random data
    for (Int_t i=0; i     q->AddQuad(r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(-10, 10),
              r.Uniform(0.2, 1), r.Uniform(0.2, 1));
        q->QuadValue(r.Uniform(0, 130));
    }
    q->RefitPlex();

    // Place on given position.
    TEveTrans& t = q->RefMainTrans();
    t.SetPos(x, y, z);

    For details see descriptions of TEve- and AliEve- classes in the online documentation.

  3. Register the Eve objects

    gEve->AddElement(q);
    gEve->Redraw3D();

    This will add the object into the list-tree view (under Event) and if this scene is shown in the GL viewer it will also appear in 3D view.

See macros in $ALICE_ROOT/EVE/alice-macros/ and $ROOTSYS/tutorials/eve/ for inspiration.

How to add a class

Most visualization classes in Eve are actually made of three classes. Ideally, one should reuse existing classes or propose their extension.

  • Central/base class, e.g. TEveQuadSet. This class either holds the data to be visualized or provides an interface to it.

  • GUI class, TEveQuadSetEditor. This is implementation of a GUI frame that is shown when an object is selected and allows setting of visualization parameters. This follows ROOT's GED naming convention first used for GUI within ROOT canvas.

    See examples in $ROOTSYS/ged/, $ROOTSYS/eve/ and in $ALICE_ROOT/EVE/ directories.

  • OpenGL rendering class, TEveQuadSetGL. This class does the actual rendering by directly calling OpenGL. Several functions required by the ROOT's OpenGL interface need to be implemented.

Often one can get by just sub-classing one of the existing base classes and providing an editor for it. A lot of the raw-data visualization classes in AliEve actually just extends the TEveQuadSet class for with specific functionality.

Automatic generation of skeleton code

The simplest way to start is to download a skeleton-class generation utility eve-genclass. You'll need perl to run it.

Create central/base class skeleton:

/eve-genclass/alieve-genclass.pl base MyClass

Create GUI Editor class skeleton:

/eve-genclass/alieve-genclass.pl ged MyClass

Create GL-renderer class skeleton:

/eve-genclass/alieve-genclass.pl gl MyClass

Remember to add all three classes to appropriate LinkDef.h.