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 et al, 08/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2002
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 |
|
---|
26 | void starplot(const char *filename="Gamma_*.root")
|
---|
27 | {
|
---|
28 | //
|
---|
29 | // This is a demonstration program which plots the Hillas
|
---|
30 | // parameter from a file created with star.C
|
---|
31 | //
|
---|
32 |
|
---|
33 | //
|
---|
34 | // Create a empty Parameter List and an empty Task List
|
---|
35 | // The tasklist is identified in the eventloop by its name
|
---|
36 | //
|
---|
37 | MParList plist;
|
---|
38 |
|
---|
39 |
|
---|
40 | MTaskList tlist;
|
---|
41 | plist.AddToList(&tlist);
|
---|
42 |
|
---|
43 | //
|
---|
44 | // The geometry container must be created by yourself to make sure
|
---|
45 | // that you don't choos a wrong geometry by chance
|
---|
46 | //
|
---|
47 | MGeomCamMagic geomcam;
|
---|
48 | plist.AddToList(&geomcam);
|
---|
49 |
|
---|
50 | //
|
---|
51 | // Use this if you want to change the binning of one of
|
---|
52 | // the histograms. You can use:
|
---|
53 | // BinningConc, BinningConc1, BinningAsym, BinningM3Long,
|
---|
54 | // BinningM3Trans, BinningWidth, BinningLength, BinningDist,
|
---|
55 | // BinningHeadTail, BinningAlpha, BinningSize, BinningDelta,
|
---|
56 | // BinningPixels and BinningCamera
|
---|
57 | //
|
---|
58 | // For more information see MBinning and the corresponding
|
---|
59 | // histograms
|
---|
60 | //
|
---|
61 | // MBinning binsalpha("BinningAlpha");
|
---|
62 | // binsalpha.SetEdges(90, 0, 90); // 90 bins from 0 to 90 deg
|
---|
63 | // plist.AddToList(&binsalpha);
|
---|
64 |
|
---|
65 | // MBinning binssize("BinningSize");
|
---|
66 | // binssize.SetEdgesLog(50, 1, 1e7);
|
---|
67 | // plist.AddToList(&binssize);
|
---|
68 |
|
---|
69 | //
|
---|
70 | // Now setup the tasks and tasklist:
|
---|
71 | // ---------------------------------
|
---|
72 | //
|
---|
73 | // The first argument is the tree you want to read.
|
---|
74 | // Events: Cosmic ray events
|
---|
75 | // PedEvents: Pedestal Events
|
---|
76 | // CalEvents: Calibration Events
|
---|
77 | //
|
---|
78 | MReadMarsFile read("Events", filename);
|
---|
79 | read.DisableAutoScheme();
|
---|
80 |
|
---|
81 | MFillH hfill1("MHHillas", "MHillas");
|
---|
82 | MFillH hfill2("MHHillasExt");
|
---|
83 | MFillH hfill3("MHStarMap", "MHillas");
|
---|
84 | MFillH hfill4("HistExtSource [MHHillasExt]", "HillasSource");
|
---|
85 | MFillH hfill5("HistExtAntiSource [MHHillasExt]", "HillasAntiSource");
|
---|
86 | MFillH hfill6("HistSource [MHHillasSrc]", "HillasSource");
|
---|
87 | MFillH hfill7("HistAntiSrc [MHHillasSrc]", "HillasAntiSrc");
|
---|
88 |
|
---|
89 | tlist.AddToList(&read);
|
---|
90 | tlist.AddToList(&hfill1);
|
---|
91 | tlist.AddToList(&hfill2);
|
---|
92 | tlist.AddToList(&hfill3);
|
---|
93 | tlist.AddToList(&hfill4);
|
---|
94 | tlist.AddToList(&hfill5);
|
---|
95 | tlist.AddToList(&hfill6);
|
---|
96 | tlist.AddToList(&hfill7);
|
---|
97 |
|
---|
98 | //
|
---|
99 | // Create and setup the eventloop
|
---|
100 | //
|
---|
101 | MEvtLoop evtloop;
|
---|
102 | evtloop.SetParList(&plist);
|
---|
103 |
|
---|
104 | //
|
---|
105 | // Execute your analysis
|
---|
106 | //
|
---|
107 | MProgressBar bar;
|
---|
108 | evtloop.SetProgressBar(&bar);
|
---|
109 | if (!evtloop.Eventloop())
|
---|
110 | return;
|
---|
111 |
|
---|
112 | tlist.PrintStatistics();
|
---|
113 |
|
---|
114 | //
|
---|
115 | // After the analysis is finished we can display the histograms
|
---|
116 | //
|
---|
117 | plist.FindObject("MHHillas")->DrawClone();
|
---|
118 | plist.FindObject("MHHillasExt")->DrawClone();
|
---|
119 | plist.FindObject("MHStarMap")->DrawClone();
|
---|
120 | plist.FindObject("HistSource")->DrawClone();
|
---|
121 | plist.FindObject("HistAntiSource")->DrawClone();
|
---|
122 | plist.FindObject("HistExtSource")->DrawClone();
|
---|
123 | plist.FindObject("HistExtAntiSource")->DrawClone();
|
---|
124 | }
|
---|
125 |
|
---|