Content
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:
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 thealieve
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/
How to run
Running the visual scanning application
To run it directly from a directory:
alieve visscan_init.C'("
Alternatively, you can specify the directory on the command-line:
To open file from AliEn (usually takes a while, so copying root_archive.zip might be faster):
alieve visscan_init.C'("
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.
-
Initialize ALICE environment.
-
Spawn 'alieve' executable and invoke the alieve_init.C macro, for example:
To load first event from current directory:
alieve alieve_init.CTo 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") -
Execute macros from
EVE/alice-macros/
-
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.
-
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 asmacro(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.
-
-
To navigate the events use macros
event_next.C
andevent_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() -
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:
-
Retrieve data-handle from the event-manager.
- Standard data accessible via
AliRunLoader
-
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; n
GetNumberOfTracks(); ++n) {
AliESDtrack* at = esd->GetTrack(n);
...
} - Raw-data
- AliRawReader *raw = AliEveEventManager::AssertRawReader();
- Standard data accessible via
-
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; iq->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-
andAliEve-
classes in the online documentation. -
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:
Create GUI Editor class skeleton:
Create GL-renderer class skeleton:
Remember to add all three classes to appropriate LinkDef.h
.