source: tags/Mars-V0.4/macros/getCollArea.C

Last change on this file was 905, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 1.4 KB
Line 
1void getCollArea(char *filename = "data/gamma_15_on.root" )
2{
3 // FIXME: Harald, you should tell the people what the result of
4 // this macro really is.
5
6 //
7 // first we have to create our empty lists
8 //
9 MParList parlist;
10 MTaskList tasklist;
11
12 //
13 // Setup the parameter list.
14 // - we need to create MCollArea only. The other containers
15 // are created automatically without loss - we don't have to
16 // access them-
17 // - MCollArea must be created by us because we need the pointer
18 // to it and if it would get created automatically it would also be
19 // deleted automatically
20 //
21 parlist.AddToList(&tasklist);
22
23 MHMcCollectionArea *collArea = new MHMcCollectionArea();
24 parlist.AddToList(collArea);
25
26 //
27 // Setup out tasks:
28 // - First we have to read the events
29 // - Then we can fill the efficiency histograms
30 //
31 MReadTree reader("Events", filename);
32 tasklist.AddToList(&reader);
33
34 MMcCollectionAreaCalc effi;
35 tasklist.AddToList(&effi);
36
37 //
38 // set up the loop for the processing
39 //
40 MEvtLoop magic;
41 magic.SetParList(&parlist);
42
43 //
44 // Start to loop over all events
45 //
46 if (!magic.Eventloop())
47 return;
48
49 //
50 // Now the histogram we wanted to get out of the data is
51 // filled and can be displayd
52 //
53 collArea->Draw();
54}
Note: See TracBrowser for help on using the repository browser.