1 |
pam-fi |
1.1 |
This directory contains some very simple macros, just to show how to use the PamLevel2 class. |
2 |
pam-fi |
1.2 |
The macros need as input the name of a Level2 .root file produced by DarthVader |
3 |
|
|
(example1 and example2) or a list of files (see example3). |
4 |
|
|
|
5 |
|
|
example1 - Example to integrate all detector info and solve the y-view tracks ambiguity |
6 |
|
|
example2 - Example to get pamela tracks and integrate the trajectory in the apparatus |
7 |
|
|
example3 - Example to loop over events, reading more than one file |
8 |
pam-fi |
1.4 |
Loop - Example to loop over events, apply some selection cuts (My-Selection.cpp) and filling an |
9 |
pam-fi |
1.3 |
output file with histograms (My-Histos.cpp) and/or trees. |
10 |
pam-fi |
1.5 |
Loop-1 - Example to loop over events, retrieve level0 data (only tracker... for the moment) and |
11 |
|
|
reprocess the event (Histo-test.cpp) |
12 |
pam-fi |
1.1 |
|
13 |
|
|
In order to run the scripts: |
14 |
|
|
|
15 |
|
|
1) Copy the magnetic field maps into the magnetic-field/ directory. |
16 |
|
|
You can find them in the CVS repository, inside DarthVader/param/trk-param/field_param-0/ |
17 |
|
|
|
18 |
|
|
2) Add the path of the directory containing the DarthVader libraries and the PamLevel2 library to the |
19 |
|
|
shell variable LD_LIBRARY_PATH |
20 |
|
|
|
21 |
|
|
3) Open a root session and execute the following commands: |
22 |
|
|
|
23 |
|
|
[] .x load.C |
24 |
|
|
[] .L example1.C |
25 |
pam-fi |
1.4 |
[] example1("level2-data-path/level2-file, execute the command.root") |
26 |
pam-fi |
1.1 |
Tracker : set branch address TrkLevel2 |
27 |
|
|
Calorimeter : set branch address CaloLevel2 |
28 |
|
|
ToF : set branch address ToFLevel2 |
29 |
|
|
Trigger : set branch address TrigLevel2 |
30 |
|
|
S4 : set branch address S4Level2 |
31 |
|
|
NeutronD : set branch address NDLevel2 |
32 |
|
|
Anticounter : set branch address AcLevel2 |
33 |
|
|
|
34 |
|
|
Start loop over events |
35 |
|
|
|
36 |
|
|
Done |
37 |
|
|
|
38 |
pam-fi |
1.2 |
4) Macros example1 and example2 produce some histograms. Example3 just loop over events and tracks and |
39 |
|
|
counts time. It is usefull to check processing time. |
40 |
pam-fi |
1.3 |
|
41 |
|
|
|
42 |
pam-fi |
1.4 |
5) To create Loop.exe execute the command (you need the PAMELA environment variables): |
43 |
|
|
|
44 |
|
|
> make Loop.exe |
45 |
|
|
|
46 |
|
|
The executable is create by compiling and linking the files: |
47 |
|
|
|
48 |
|
|
Loop.cpp |
49 |
|
|
My-Selection.cpp |
50 |
|
|
My-Histos.cpp |
51 |
|
|
|
52 |
|
|
You can use My-Selection.cpp and My-Histos.cpp as a template to inplement your own |
53 |
|
|
selection cuts and analysis. |
54 |
|
|
More generally, you can compile and link Loop.cpp with your own source files (you need |
55 |
|
|
to edit also the Makefile), where you should implement at least the following functions: |
56 |
|
|
|
57 |
|
|
bool Select(PamLevel2*); |
58 |
pam-fi |
1.5 |
void CreateHistos(PamLevel2*,TFile*); |
59 |
pam-fi |
1.4 |
void FillHistos(PamLevel2*); |
60 |
|
|
void SaveHistos(TFile*); |
61 |
|
|
|
62 |
|
|
To know how to use Loop.exe, issue: |
63 |
pam-fi |
1.3 |
./Loop.exe --help |
64 |
pam-fi |
1.4 |
|
65 |
|
|
(If you execute "make Loop-0.exe" the old example code, previously posted on the cvs, |
66 |
|
|
is compiled and linked. This is not a very general example, better use the new one) |
67 |
pam-fi |
1.5 |
|