source: trunk/MagicSoft/Mars/macros/MagicHillas.C@ 1032

Last change on this file since 1032 was 1023, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 3.1 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 MagicHillas(const char *filename="data/camera.root")
27{
28 //
29 // This is a demonstration program which calculates the Hillas
30 // parameter out of a Magic root file.
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 MGeomCamMagic geomcam;
46 plist.AddToList(&geomcam);
47
48 MPedestalCam pedest;
49 plist.AddToList(&pedest);
50
51 //
52 // Now setup the tasks and tasklist:
53 //
54 // 1) read in the data from a magic root file MReadTree
55 // 2) calculate number of cerenkov photons MCerPhotCalc
56 // 3) clean the image MImgCleanStd
57 // 4) calculate hillas MHillasCalc
58 // 5) fill the hillas into the histograms MFillH
59 //
60
61 //
62 // The first argument is the tree you want to read.
63 // Events: Cosmic ray events
64 // PedEvents: Pedestal Events
65 // CalEvents: Calibration Events
66 //
67 MReadTree read("Events", filename);
68 // read.AddFile("data/cer000019.root");
69
70 MCerPhotCalc ncalc;
71 MImgCleanStd clean;
72 MHillasCalc hcalc;
73 MFillH hfill("MHillas", "MHHillas");
74 MFillH sfill("MHillas", "MHStarMap");
75
76 //
77 // Crete and setup Tasklist
78 //
79 MWriteRootFile write("hillas.root");
80 write.AddContainer("MHillas");
81 write.AddContainer("MHStarMap");
82
83 tlist.AddToList(&read);
84 tlist.AddToList(&ncalc);
85 tlist.AddToList(&clean);
86 tlist.AddToList(&hcalc);
87 tlist.AddToList(&hfill);
88 tlist.AddToList(&sfill);
89 tlist.AddToList(&write);
90
91 //
92 // Create and setup the eventloop
93 //
94 MEvtLoop evtloop;
95 evtloop.SetParList(&plist);
96
97 //
98 // Execute your analysis
99 //
100 if (!evtloop.Eventloop())
101 return;
102
103 //
104 // After the analysis is finished we can display the histograms
105 //
106 plist.FindObject("MHHillas")->DrawClone();
107 plist.FindObject("MHStarMap")->DrawClone();
108}
109
Note: See TracBrowser for help on using the repository browser.