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 Hillas
|
---|
38 | // parameter out of a Magic 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 | //
|
---|
50 | // Uncomment this two line if you want to use MHillasExt instead
|
---|
51 | // of MHillas
|
---|
52 | //
|
---|
53 | MHillasExt hext;
|
---|
54 | plist.AddToList(&hext);
|
---|
55 |
|
---|
56 | //
|
---|
57 | // The geometry container must be created by yourself to make sure
|
---|
58 | // that you don't choos a wrong geometry by chance
|
---|
59 | //
|
---|
60 | MGeomCamMagic geomcam;
|
---|
61 | plist.AddToList(&geomcam);
|
---|
62 |
|
---|
63 | //
|
---|
64 | // Craete the object which hlods the source positions in the camera
|
---|
65 | // plain in respect to which the image parameters will be calculated.
|
---|
66 | // For real data the containers will be filled by a task.
|
---|
67 | //
|
---|
68 | MSrcPosCam source("Source")
|
---|
69 | source.SetXY(0, 0);
|
---|
70 |
|
---|
71 | MSrcPosCam antisrc("AntiSrc");
|
---|
72 | antisrc.SetXY(240, 0);
|
---|
73 |
|
---|
74 | plist.AddToList(&source);
|
---|
75 | plist.AddToList(&antisrc);
|
---|
76 |
|
---|
77 | //
|
---|
78 | // Now setup the tasks and tasklist:
|
---|
79 | // ---------------------------------
|
---|
80 | //
|
---|
81 | MReadMarsFile read("Events");
|
---|
82 | read.AddFile("Gammas*.root");
|
---|
83 | read.DisableAutoScheme();
|
---|
84 |
|
---|
85 | MMcPedestalCopy pcopy;
|
---|
86 | MMcPedestalNSBAdd pnsb;
|
---|
87 | MCerPhotCalc ncalc;
|
---|
88 |
|
---|
89 | MBlindPixelCalc blind;
|
---|
90 | blind.SetUseInterpolation();
|
---|
91 |
|
---|
92 | MImgCleanStd clean;
|
---|
93 | MHillasCalc hcalc;
|
---|
94 | MHillasSrcCalc csrc1("Source", "HillasSource");
|
---|
95 | MHillasSrcCalc csrc2("AntiSrc", "HillasAntiSrc");
|
---|
96 |
|
---|
97 | MWriteRootFile write("star.root");
|
---|
98 | write.AddContainer("MHillas", "Events");
|
---|
99 | write.AddContainer("HillasSource", "Events");
|
---|
100 | write.AddContainer("HillasAntiSrc", "Events");
|
---|
101 | write.AddContainer("MMcEvt", "Events");
|
---|
102 | write.AddContainer("MRawRunHeader", "RunHeaders");
|
---|
103 | write.AddContainer("MMcRunHeader", "RunHeaders");
|
---|
104 | write.AddContainer("Source", "RunHeaders");
|
---|
105 | write.AddContainer("AntiSource", "RunHeaders");
|
---|
106 |
|
---|
107 | tlist.AddToList(&read);
|
---|
108 | tlist.AddToList(&pcopy);
|
---|
109 | tlist.AddToList(&pnsb);
|
---|
110 | tlist.AddToList(&ncalc);
|
---|
111 | tlist.AddToList(&blind);
|
---|
112 | tlist.AddToList(&clean);
|
---|
113 | tlist.AddToList(&hcalc);
|
---|
114 | tlist.AddToList(&csrc1);
|
---|
115 | tlist.AddToList(&csrc2);
|
---|
116 | tlist.AddToList(&write);
|
---|
117 |
|
---|
118 | //
|
---|
119 | // Create and setup the eventloop
|
---|
120 | //
|
---|
121 | MEvtLoop evtloop;
|
---|
122 | evtloop.SetParList(&plist);
|
---|
123 |
|
---|
124 | //
|
---|
125 | // Execute your analysis
|
---|
126 | //
|
---|
127 | if (!evtloop.Eventloop())
|
---|
128 | return;
|
---|
129 |
|
---|
130 | tlist.PrintStatistics();
|
---|
131 | }
|
---|