source: trunk/MagicSoft/Mars/macros/sumcurrents.C@ 2157

Last change on this file since 2157 was 2157, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 2.6 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, 6/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25// -------------------------------------------------------------------------
26//
27// plot.C
28//
29// This macro shows how to fill and display a histogram using Mars
30//
31void sumcurrents(const char *fname="../currents/dcs_vega.dat")
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 MTaskList tlist;
40 plist.AddToList(&tlist);
41
42 //
43 // Now setup the tasks and tasklist:
44 // ---------------------------------
45 //
46
47 MGeomCamMagic geom;
48 plist.AddToList(&geom);
49
50 // First Task: Read file with image parameters
51 // (created with the star.C macro)
52 MReadCurrents read(fname);
53 /*
54 read.AddFile("../currents/dcs_arcturus2.dat");
55 read.AddFile("../currents/dcs_arcturus3.dat");
56 read.AddFile("../currents/dcs_arcturus4.dat");
57 read.AddFile("../currents/dcs_arcturus5.dat");
58 read.AddFile("../currents/dcs_arcturus6.dat");
59 read.AddFile("../currents/dcs_arcturus7.dat");
60 read.AddFile("../currents/dcs_arcturus8.dat");
61 read.AddFile("../currents/dcs_arcturus9.dat");
62 read.AddFile("../currents/dcs_arcturus10.dat");
63 */
64 tlist.AddToList(&read);
65
66 MFillH fill("MHCurrents");
67 tlist.AddToList(&fill);
68
69 //
70 // Create and setup the eventloop
71 //
72 MEvtLoop evtloop;
73 evtloop.SetParList(&plist);
74
75 //
76 // Execute your analysis
77 //
78 if (!evtloop.Eventloop())
79 return;
80
81 tlist.PrintStatistics();
82
83 MHCurrents &h = *(MHCurrents*)plist->FindObject("MHCurrents");
84
85 MCamDisplay *disp = new MCamDisplay(&geom);
86 disp->FillCurrents(h.GetSum());
87 disp->Draw();
88}
Note: See TracBrowser for help on using the repository browser.