This directory contains some very simple macros, just to show how to use the PamLevel2 class.
The macros need as input the name of a Level2 .root file produced by DarthVader.

Class implementation is under development and some problems still need to be fixed.
However this simple examples should allow to start working with Pamela data and to test the 
general environment.

In order to run the scripts:

1) Copy the magnetic field maps into the magnetic-field/ directory.
   You can find them in the CVS repository, inside DarthVader/param/trk-param/field_param-0/

2) Add the path of the directory containing the DarthVader libraries and the PamLevel2 library to the 
   shell variable LD_LIBRARY_PATH

3) Open a root session and execute the following commands:

[] .x load.C
[] .L example1.C
[] example1("level2-data-path/level2-file.root")
Tracker      : set branch address TrkLevel2
Calorimeter  : set branch address CaloLevel2
ToF          : set branch address ToFLevel2
Trigger      : set branch address TrigLevel2
S4           : set branch address S4Level2
NeutronD     : set branch address NDLevel2
Anticounter  : set branch address AcLevel2

 Start loop over events
 
 Done

4) The macro creates some histograms, which you can list and plot as follows:

[].ls
TROOT*          Rint    The ROOT of EVERYTHING
 OBJ: TH1F      qtot    Total energy in the calorimeter : 0 at: 0xb3f7400
 OBJ: TH1F      npaddle Total number of hit ToF paddles : 0 at: 0xb3f8768
 OBJ: TH1F      ntr     Number of fitted tracks : 0 at: 0xb3f8b60
 OBJ: TH1F      rig     Particle rigidity : 0 at: 0xb3f8f30
 OBJ: TH1F      resxs   Spatial residual (X) on the 1^ calo plane (sorted tracks) : 0 at: 0xb3f94a0
 OBJ: TH1F      resys   Spatial residual (Y) on the 1^ calo plane (sorted tracks) : 0 at: 0xb3f9a00
 OBJ: TH1F      resxi   Spatial residual (X) on the 1^ calo plane (image tracks) : 0 at: 0xb3f9f70
 OBJ: TH1F      resyi   Spatial residual (Y) on the 1^ calo plane (image tracks) : 0 at: 0xb3fa4e0
[]rig->Draw()
