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

Last change on this file since 1381 was 1281, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 3.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 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 // Setup binning for your histograms.
50 //
51 MBinning binswidth("BinningWidth");
52 binswidth.SetEdges(100, 0, 1); // 100 bins from 0 to 1 deg
53
54 MBinning binslength("BinningLength");
55 binslength.SetEdges(100, 0, 1); // 100 bins from 0 to 1 deg
56
57 MBinning binsalpha("BinningAlpha");
58 binsalpha.SetEdges(90, 0, 90); // 90 bins from 0 to 90 deg
59
60 MBinning binsdist("BinningDist");
61 binsdist.SetEdges(100, 0, 2); // 100 bins from 0 to 2 deg
62
63 plist.AddToList(&binswidth);
64 plist.AddToList(&binslength);
65 plist.AddToList(&binsalpha);
66 plist.AddToList(&binsdist);
67
68 //
69 // Craete the object which hlods the source positions in the camera
70 // plain in respect to which the image parameters will be calculated.
71 // For real data the containers will be filled by a task.
72 //
73 MSrcPosCam source("Source")
74 source.SetXY(0, 0);
75
76 plist.AddToList(&source);
77
78 //
79 // Now setup the tasks and tasklist:
80 //
81 // 1) read in the data from a ct1 ascii file MCTReadAscii
82 // 2) clean the image MImgCleanStd
83 // 3) calculate hillas MHillasCalc
84 // 4) fill the hillas into the histograms MFillHHillas
85 //
86 MCT1ReadAscii read("../data/CT1_97_on1.dat");
87 //read.AddFile("../data/CT1_97_off1.dat");
88
89 MImgCleanStd clean;
90 MHillasCalc hcalc;
91 MHillasSrcCalc csrc1("Source", "HillasSource");
92
93 MFillH hfill("MHHillas", "MHillas");
94 MFillH sfill("MHStarMap", "MHillas");
95 MFillH hfill2s("HistSource [MHHillasSrc]", "HillasSource");
96
97 tlist.AddToList(&read);
98 tlist.AddToList(&clean);
99 tlist.AddToList(&hcalc);
100 tlist.AddToList(&csrc1);
101 tlist.AddToList(&hfill);
102 tlist.AddToList(&sfill);
103 tlist.AddToList(&hfill2s);
104
105 //
106 // Create and setup the eventloop
107 //
108 MEvtLoop evtloop;
109 evtloop.SetParList(&plist);
110
111 //
112 // Execute your analysis
113 //
114 if (!evtloop.Eventloop())
115 return;
116
117 //
118 // After the analysis is finished we can display the histograms
119 //
120 plist.FindObject("MHHillas")->DrawClone();
121 plist.FindObject("HistSource")->DrawClone();
122 plist.FindObject("MHStarMap")->DrawClone();
123}
Note: See TracBrowser for help on using the repository browser.