source: trunk/MagicSoft/Mars/macros/CT1Hillas.C@ 1008

Last change on this file since 1008 was 967, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 2.7 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
25
26void CT1Hillas()
27{
28 //
29 // This is a demonstration program which calculates the Hillas
30 // parameter out of a CT1 dataset.
31
32 //
33 // Create a empty Parameter List and an empty Task List
34 // The tasklist is identified in the eventloop by its name
35 //
36 MParList plist;
37
38 MTaskList tlist;
39 plist.AddToList(&tlist);
40
41 //
42 // The geometry container must be created by yourself to make sure
43 // that you don't choos a wrong geometry by chance
44 //
45 MGeomCamCT1 geomcam;
46 plist.AddToList(&geomcam);
47
48 //
49 // The Hillas histograms (MHHillas) could be created automatically
50 // but to make sure, that they are not deleted when the macro is
51 // finished you must create them yourself and add it to the list
52 //
53 MHHillas *hists = new MHHillas;
54 plist.AddToList(hists);
55
56 MHStarMap *smap = new MHStarMap;
57 plist.AddToList(smap);
58
59 //
60 // Now setup the tasks and tasklist:
61 //
62 // 1) read in the data from a ct1 ascii file MCTReadAscii
63 // 2) clean the image MImgCleanStd
64 // 3) calculate hillas MHillasCalc
65 // 4) fill the hillas into the histograms MFillHHillas
66 //
67 MCT1ReadAscii read("data/MCCT1_97_ga45.dat");
68 // read.AddFile("data/MCCT1_97_ga20.dat");
69
70 MImgCleanStd clean;
71 MHillasCalc hcalc;
72 MFillHHillas hfill;
73 MFillHStarMap sfill;
74
75 tlist.AddToList(&read);
76 tlist.AddToList(&clean);
77 tlist.AddToList(&hcalc);
78 tlist.AddToList(&hfill);
79 tlist.AddToList(&sfill);
80
81 //
82 // Create and setup the eventloop
83 //
84 MEvtLoop evtloop;
85 evtloop.SetParList(&plist)
86
87 //
88 // Execute your analysis
89 //
90 if (!evtloop.Eventloop())
91 return;
92
93 //
94 // After the analysis is finished we can display the histograms
95 //
96 hists->Draw();
97 smap->Draw();
98}
Note: See TracBrowser for help on using the repository browser.