Line | |
---|
1 | void MagicHillas()
|
---|
2 | {
|
---|
3 | //
|
---|
4 | // This is a demonstration program which calculates the Hillas
|
---|
5 | // parameter out of a Magic root file.
|
---|
6 |
|
---|
7 | //
|
---|
8 | // Create a empty Parameter List and an empty Task List
|
---|
9 | // The tasklist is identified in the eventloop by its name
|
---|
10 | //
|
---|
11 | MParList plist;
|
---|
12 |
|
---|
13 | MTaskList tlist;
|
---|
14 | plist->AddToList(&tlist);
|
---|
15 |
|
---|
16 | //
|
---|
17 | // The geometry container must be created by yourself to make sure
|
---|
18 | // that you don't choos a wrong geometry by chance
|
---|
19 | //
|
---|
20 | MGeomCamMagic geomcam;
|
---|
21 | plist->AddToList(&geomcam);
|
---|
22 |
|
---|
23 | MPedestalCam pedest;
|
---|
24 | plist->AddToList(&pedest);
|
---|
25 |
|
---|
26 | //
|
---|
27 | // The Hillas histograms (MHHillas) could be created automatically
|
---|
28 | // but to make sure, that they are not deleted when the macro is
|
---|
29 | // finished you must create them yourself and add it to the list
|
---|
30 | //
|
---|
31 | MHHillas *hists = new MHHillas;
|
---|
32 | plist->AddToList(hists);
|
---|
33 |
|
---|
34 | MHStarMap *smap = new MHStarMap;
|
---|
35 | plist->AddToList(smap);
|
---|
36 |
|
---|
37 | //
|
---|
38 | // Now setup the tasks and tasklist:
|
---|
39 | //
|
---|
40 | // 1) read in the data from a ct1 ascii file
|
---|
41 | // 2) clean the image
|
---|
42 | // 3) calculate hillas
|
---|
43 | // 4) fill the hillas into the histograms
|
---|
44 | //
|
---|
45 | MReadTree read("Events", "oscar_protons.root");
|
---|
46 | read.AddFile("test.root");
|
---|
47 |
|
---|
48 | MCerPhotCalc ncalc;
|
---|
49 | MImgCleanStd clean;
|
---|
50 | MHillasCalc hcalc;
|
---|
51 | MFillHHillas hfill;
|
---|
52 | MFillHStarMap sfill;
|
---|
53 |
|
---|
54 | tlist.AddToList(&read);
|
---|
55 | tlist.AddToList(&ncalc);
|
---|
56 | tlist.AddToList(&clean);
|
---|
57 | tlist.AddToList(&hcalc);
|
---|
58 | tlist.AddToList(&hfill);
|
---|
59 | tlist.AddToList(&sfill);
|
---|
60 |
|
---|
61 | //
|
---|
62 | // Create and setup the eventloop
|
---|
63 | //
|
---|
64 | MEvtLoop evtloop;
|
---|
65 | evtloop.SetParList(&plist);
|
---|
66 |
|
---|
67 | //
|
---|
68 | // Execute your analysis
|
---|
69 | //
|
---|
70 | evtloop.Eventloop();
|
---|
71 |
|
---|
72 | //
|
---|
73 | // After the analysis is finished we can display the histograms
|
---|
74 | //
|
---|
75 | hists->Draw();
|
---|
76 | smap->Draw();
|
---|
77 | }
|
---|
78 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.