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-2002
|
---|
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 |
|
---|
34 | void 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 | plist.AddToList(&src);
|
---|
51 |
|
---|
52 | //
|
---|
53 | // Uncomment this two line if you want to use MHillasExt instead
|
---|
54 | // of MHillas
|
---|
55 | //
|
---|
56 | MHillasExt hext;
|
---|
57 | plist.AddToList(&hext);
|
---|
58 |
|
---|
59 | //
|
---|
60 | // The geometry container must be created by yourself to make sure
|
---|
61 | // that you don't choose a wrong geometry by mistake
|
---|
62 | //
|
---|
63 | MGeomCamMagic geomcam;
|
---|
64 | plist.AddToList(&geomcam);
|
---|
65 |
|
---|
66 | //
|
---|
67 | // Now setup the tasks and tasklist:
|
---|
68 | // ---------------------------------
|
---|
69 | //
|
---|
70 | MReadMarsFile read("Events");
|
---|
71 | read.DisableAutoScheme();
|
---|
72 |
|
---|
73 | // ------------- user change -----------------
|
---|
74 | read.AddFile("Pro*.root");
|
---|
75 | //read.AddFile("Gam*.root");
|
---|
76 |
|
---|
77 | MMcPedestalCopy pcopy;
|
---|
78 | MMcPedestalNSBAdd pnsb;
|
---|
79 | MCerPhotCalc ncalc;
|
---|
80 |
|
---|
81 | MBlindPixelCalc blind;
|
---|
82 | blind.SetUseInterpolation();
|
---|
83 |
|
---|
84 | MImgCleanStd clean;
|
---|
85 | MHillasCalc hcalc;
|
---|
86 | MHillasSrcCalc scalc; // !!Preliminary!! Will be removed later!
|
---|
87 |
|
---|
88 | // ------------- user change -----------------
|
---|
89 | MWriteRootFile write("data/star_protons.root");
|
---|
90 | write.AddContainer("MHillas", "Events");
|
---|
91 | write.AddContainer("HillasSource", "Events");
|
---|
92 | write.AddContainer("MMcEvt", "Events");
|
---|
93 | write.AddContainer("MHillasSrc", "Events");
|
---|
94 | write.AddContainer("MRawRunHeader", "RunHeaders");
|
---|
95 | write.AddContainer("MMcRunHeader", "RunHeaders");
|
---|
96 |
|
---|
97 | tlist.AddToList(&read);
|
---|
98 | tlist.AddToList(&pcopy);
|
---|
99 | tlist.AddToList(&pnsb);
|
---|
100 | tlist.AddToList(&ncalc);
|
---|
101 | tlist.AddToList(&blind);
|
---|
102 | tlist.AddToList(&clean);
|
---|
103 | tlist.AddToList(&hcalc);
|
---|
104 | tlist.AddToList(&scalc);
|
---|
105 | tlist.AddToList(&write);
|
---|
106 |
|
---|
107 | //
|
---|
108 | // Create and set up the eventloop
|
---|
109 | //
|
---|
110 | MProgressBar bar;
|
---|
111 |
|
---|
112 | MEvtLoop evtloop;
|
---|
113 | evtloop.SetProgressBar(&bar);
|
---|
114 | evtloop.SetParList(&plist);
|
---|
115 |
|
---|
116 | //
|
---|
117 | // Execute your analysis
|
---|
118 | //
|
---|
119 | if (!evtloop.Eventloop())
|
---|
120 | return;
|
---|
121 |
|
---|
122 | tlist.PrintStatistics();
|
---|
123 | }
|
---|