source: trunk/MagicSoft/Mars/macros/star.C@ 2445

Last change on this file since 2445 was 2423, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.4 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, 5/2002 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// STAR - STandard Analysis and Reconstruction
28//
29// This macro is the standard converter to convert raw data into image
30// parameters
31//
32/////////////////////////////////////////////////////////////////////////////
33
34void star()
35{
36 //
37 // This is a demonstration program which calculates the image
38 // parameters from a Magic raw data root file.
39
40 //
41 // Create a empty Parameter List and an empty Task List
42 // The tasklist is identified in the eventloop by its name
43 //
44 MParList plist;
45
46 MTaskList tlist;
47 plist.AddToList(&tlist);
48
49 MSrcPosCam src;
50 src.SetReadyToSave();
51 plist.AddToList(&src);
52
53 //
54 // Now setup the tasks and tasklist:
55 // ---------------------------------
56 //
57 MReadMarsFile read("Events");
58 read.DisableAutoScheme();
59
60 // ------------- user change -----------------
61 read.AddFile("~/MC/test_sample/Gamma_zbin0_0_*.root");
62
63 MGeomApply apply;
64 MMcPedestalCopy pcopy;
65 MMcPedestalNSBAdd pnsb;
66 MCerPhotCalc ncalc;
67
68 MBlindPixelCalc blind;
69 blind.SetUseInterpolation();
70
71 MSigmabarCalc sgcal;
72 MImgCleanStd clean;
73 MHillasCalc hcalc;
74 MHillasSrcCalc scalc; // !!Preliminary!! Will be removed later!
75
76 // ------------- user change -----------------
77 MWriteRootFile write("starfile.root");
78 write.AddContainer("MMcEvt", "Events");
79 write.AddContainer("MSigmabar", "Events");
80 write.AddContainer("MHillas", "Events");
81 write.AddContainer("MHillasExt", "Events");
82 write.AddContainer("MHillasSrc", "Events");
83 write.AddContainer("MNewImagePar", "Events");
84 write.AddContainer("MRawRunHeader", "RunHeaders");
85 write.AddContainer("MMcRunHeader", "RunHeaders");
86 write.AddContainer("MSrcPosCam", "RunHeaders");
87
88 tlist.AddToList(&read);
89 tlist.AddToList(&apply);
90 tlist.AddToList(&pcopy);
91 tlist.AddToList(&pnsb);
92 tlist.AddToList(&ncalc);
93 tlist.AddToList(&blind);
94 tlist.AddToList(&sgcal);
95 tlist.AddToList(&clean);
96 tlist.AddToList(&hcalc);
97 tlist.AddToList(&scalc);
98 tlist.AddToList(&write);
99
100 //
101 // Create and set up the eventloop
102 //
103 MProgressBar bar;
104
105 MEvtLoop evtloop;
106 evtloop.SetProgressBar(&bar);
107 evtloop.SetParList(&plist);
108
109 //
110 // Execute your analysis
111 //
112 if (!evtloop.Eventloop())
113 return;
114
115 tlist.PrintStatistics();
116}
Note: See TracBrowser for help on using the repository browser.