source: trunk/MagicSoft/Mars/status.cc@ 2503

Last change on this file since 2503 was 2486, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 5.2 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, 4/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2003
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// Status - Example how to use the MStatusDisplay
28//
29// Use a camera file as input
30//
31/////////////////////////////////////////////////////////////////////////////
32
33#include "MStatusDisplay.h"
34#include "MLog.h"
35#include "MParList.h"
36#include "MTaskList.h"
37#include "MReadMarsFile.h"
38#include "MGeomApply.h"
39#include "MMcPedestalCopy.h"
40#include "MMcPedestalNSBAdd.h"
41#include "MCerPhotAnal2.h"
42//#include "MBlindPixelCalc.h"
43#include "MSigmabarCalc.h"
44#include "MImgCleanStd.h"
45#include "MHillasCalc.h"
46#include "MHillasSrcCalc.h"
47#include "MCT1SupercutsCalc.h"
48#include "MHCamEvent.h"
49#include "MFillH.h"
50#include "MEvtLoop.h"
51
52#include <TApplication.h>
53
54
55int main(int argc, char **argv)
56{
57 TApplication app("Status", &argc, argv);
58
59
60 //
61 // Update frequency by default = 1Hz
62 //
63 MStatusDisplay *d = new MStatusDisplay;
64
65 // Set update time to 5s
66 // d->SetUpdateTime(5000);
67
68 // Disable online update
69 // d->SetUpdateTime(-1);
70
71 d->SetLogStream(&gLog, kTRUE); // Disables output to stdout
72 gLog.SetOutputFile("status.log", kTRUE); // Enable output to file
73 //gLog.EnableOutputDevice(MLog::eStdout); // Enable output to stdout again
74
75 //
76 // Create a empty Parameter List and an empty Task List
77 // The tasklist is identified in the eventloop by its name
78 //
79 MParList plist;
80
81 MTaskList tlist;
82 plist.AddToList(&tlist);
83
84 /*
85 MSrcPosCam src;
86 src.SetXY(1./geomcam.GetConvMm2Deg(), 0);
87 plist.AddToList(&src);
88 */
89
90 //
91 // Now setup the tasks and tasklist:
92 // ---------------------------------
93 //
94 MReadMarsFile read("Events");
95 read.DisableAutoScheme();
96
97 // ------------- user change -----------------
98 read.AddFile("/home/tbretz/cosmics.root");
99
100 MGeomApply geomapl;
101
102 MMcPedestalCopy pcopy;
103 MMcPedestalNSBAdd pnsb;
104 MCerPhotAnal2 ncalc;
105/*
106 TArrayS blinds(6);
107 blinds[0] = 0;
108 blinds[1] = 195;
109 blinds[2] = 227;
110 blinds[3] = 248;
111 blinds[4] = 271;
112 blinds[5] = 291;
113 /*
114 blinds[3] = 51;
115 blinds[4] = 56;
116 blinds[5] = 112;//*
117 blinds[6] = 31;//*
118 blinds[7] = 116;
119 blinds[8] = 507;
120 blinds[9] = 559;
121 blinds[10]= 291; // 311, 119, 54, 85, 125, 92, 133, 224*/
122/*
123 MBlindPixelCalc blind;
124 blind.SetPixelIndices(blinds);
125 //blind.SetUseInterpolation();
126*/
127 MSigmabarCalc sgcal;
128 MImgCleanStd clean;
129 MHillasCalc hcalc;
130 MHillasSrcCalc scalc; // !!Preliminary!! Will be removed later!
131 MCT1SupercutsCalc calc1;
132
133 MHCamEvent hist("PedestalRms");
134 hist.SetType(1);
135 plist.AddToList(&hist);
136
137 // -------------------------------------------
138 MFillH hfill0("Uncleaned [MHCamEvent]", "MCerPhotEvt");
139 MFillH hfill1("Pedestals [MHCamEvent]", "MPedestalCam");
140 MFillH hfill2("PedestalRms", "MPedestalCam");
141 MFillH hfill3("MHHillas", "MHillas");
142 MFillH hfill4("MHHillasExt");
143 MFillH hfill5("MHHillasExtSrc [MHHillasExt]", "MHillasSrc");
144 MFillH hfill6("MHHillasSrc","MHillasSrc");
145 MFillH hfill7("MHNewImagePar","MNewImagePar");
146 MFillH hfill8a("MHStarMap", "MHillas");
147 MFillH hfill8b("MHStarMap2", "MHillas");
148 MFillH hfill9("Cleaned [MHCamEvent]", "MCerPhotEvt");
149 MFillH hfill10("MHHadronness", "MHadronness");
150 MFillH hfill11("MHSigmaTheta");
151
152 tlist.AddToList(&read);
153 tlist.AddToList(&geomapl);
154 tlist.AddToList(&pcopy);
155 tlist.AddToList(&pnsb);
156 tlist.AddToList(&ncalc);
157 //tlist.AddToList(&blind);
158 tlist.AddToList(&hfill0);
159 //tlist.AddToList(&sgcal);
160 tlist.AddToList(&clean);
161 tlist.AddToList(&hcalc);
162 tlist.AddToList(&scalc);
163 //tlist.AddToList(&calc1);
164 tlist.AddToList(&hfill1);
165 tlist.AddToList(&hfill2);
166 tlist.AddToList(&hfill3);
167 tlist.AddToList(&hfill4);
168 tlist.AddToList(&hfill5);
169 tlist.AddToList(&hfill6);
170 tlist.AddToList(&hfill7);
171 //tlist.AddToList(&hfill8a);
172 //tlist.AddToList(&hfill8b);
173 tlist.AddToList(&hfill9);
174 //tlist.AddToList(&hfill10);
175
176 MEvtLoop evtloop;
177 evtloop.SetParList(&plist);
178 evtloop.SetDisplay(d);
179
180 //
181 // Execute your analysis
182 //
183 if (!evtloop.Eventloop())
184 return 1;
185
186 tlist.PrintStatistics();
187
188 return 0;
189}
Note: See TracBrowser for help on using the repository browser.