source: trunk/MagicSoft/Mars/macros/collarea.C@ 971

Last change on this file since 971 was 971, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.4 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
19!
20! Copyright: MAGIC Software Development, 2000-2001
21!
22!
23\* ======================================================================== */
24
25void collarea(char *filename = "data/camera.root")
26{
27 // FIXME: Harald, you should tell the people what the result of
28 // this macro really is.
29
30 //
31 // first we have to create our empty lists
32 //
33 MParList parlist;
34 MTaskList tasklist;
35
36 //
37 // Setup the parameter list.
38 // - we need to create MCollArea only. The other containers
39 // are created automatically without loss - we don't have to
40 // access them-
41 // - MCollArea must be created by us because we need the pointer
42 // to it and if it would get created automatically it would also be
43 // deleted automatically
44 //
45 parlist.AddToList(&tasklist);
46
47 MHMcCollectionArea *collArea = new MHMcCollectionArea;
48 parlist.AddToList(collArea);
49
50 //
51 // Setup out tasks:
52 // - First we have to read the events
53 // - Then we can fill the efficiency histograms
54 //
55 MReadTree reader("Events", filename);
56 reader.UseLeaf("fImpact");
57 reader.UseLeaf("fEnergy");
58 reader.UseLeaf("fNumFirstLevel");
59 tasklist.AddToList(&reader);
60
61 MMcCollectionAreaCalc effi;
62 tasklist.AddToList(&effi);
63
64 MTask task;
65 tasklist.AddToList(&task);
66
67
68 //
69 // set up the loop for the processing
70 //
71 MEvtLoop magic;
72 magic.SetParList(&parlist);
73
74 //
75 // Start to loop over all events
76 //
77 if (!magic.Eventloop())
78 return;
79
80 tasklist.PrintStatistics();
81
82 //
83 // Now the histogram we wanted to get out of the data is
84 // filled and can be displayd
85 //
86 collArea->Draw();
87}
Note: See TracBrowser for help on using the repository browser.