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 | // The first argument is the tree you want to read.
|
---|
82 | // Events: Cosmic ray events
|
---|
83 | // PedEvents: Pedestal Events
|
---|
84 | // CalEvents: Calibration Events
|
---|
85 | //
|
---|
86 | MReadMarsFile read("Events");
|
---|
87 | read.AddFile("~/data/Gamma_0_7_1011*.root");
|
---|
88 | read.AddFile("~/data/prot_N_0*.root");
|
---|
89 | read.DisableAutoScheme();
|
---|
90 |
|
---|
91 | MMcPedestalCopy pcopy;
|
---|
92 | MMcPedestalNSBAdd pnsb;
|
---|
93 | MCerPhotCalc ncalc;
|
---|
94 | MImgCleanStd clean;
|
---|
95 | MBlindPixelCalc blind;
|
---|
96 | MHillasCalc hcalc;
|
---|
97 | MHillasSrcCalc csrc1("Source", "HillasSource");
|
---|
98 | MHillasSrcCalc csrc2("AntiSrc", "HillasAntiSrc");
|
---|
99 |
|
---|
100 | MWriteRootFile write("star2.root");
|
---|
101 | write.AddContainer("MHillas", "Events");
|
---|
102 | write.AddContainer("HillasSource", "Events");
|
---|
103 | write.AddContainer("HillasAntiSrc", "Events");
|
---|
104 | write.AddContainer("MMcEvt", "Events");
|
---|
105 | write.AddContainer("MRawRunHeader", "RunHeaders");
|
---|
106 | write.AddContainer("MMcRunHeader", "RunHeaders");
|
---|
107 |
|
---|
108 | tlist.AddToList(&read);
|
---|
109 | tlist.AddToList(&pcopy);
|
---|
110 | tlist.AddToList(&pnsb);
|
---|
111 | tlist.AddToList(&ncalc);
|
---|
112 | tlist.AddToList(&clean);
|
---|
113 | tlist.AddToList(&blind);
|
---|
114 | tlist.AddToList(&hcalc);
|
---|
115 | tlist.AddToList(&csrc1);
|
---|
116 | tlist.AddToList(&csrc2);
|
---|
117 | tlist.AddToList(&write);
|
---|
118 |
|
---|
119 | //
|
---|
120 | // Create and setup the eventloop
|
---|
121 | //
|
---|
122 | MEvtLoop evtloop;
|
---|
123 | evtloop.SetParList(&plist);
|
---|
124 |
|
---|
125 | //
|
---|
126 | // Execute your analysis
|
---|
127 | //
|
---|
128 | if (!evtloop.Eventloop())
|
---|
129 | return;
|
---|
130 |
|
---|
131 | tlist.PrintStatistics();
|
---|
132 | }
|
---|