source: trunk/MagicSoft/Mars/mtemp/mucm/classes/MMySuperCuts.cc@ 6724

Last change on this file since 6724 was 6310, checked in by marcos, 20 years ago
*** empty log message ***
File size: 9.6 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): Wolfgang Wittek, 08/2003 <mailto:wittek@mppmu.mpg.de>
19! Author(s): Thomas Bretz, 08/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
20! Author(s): Marcos Lopez, 05/2004 <mailto:marcos@gae.ucm.es>
21!
22! Copyright: MAGIC Software Development, 2000-2003
23!
24!
25\* ======================================================================== */
26
27/////////////////////////////////////////////////////////////////////////////
28// //
29// MMySuperCuts //
30// //
31// this is the container for the parameters of the supercuts //
32// //
33/////////////////////////////////////////////////////////////////////////////
34#include "MMySuperCuts.h"
35
36#include <math.h>
37#include <fstream>
38
39#include "MParList.h"
40
41#include "MLog.h"
42#include "MLogManip.h"
43
44ClassImp(MMySuperCuts);
45
46using namespace std;
47
48// --------------------------------------------------------------------------
49//
50// constructor
51//
52// MMySuperCuts::MMySuperCuts(const char *name, const char *title)
53// : fParameters(18), fStepsizes(18),
54// fLengthUp(fParameters.GetArray()), fLengthLo(fParameters.GetArray()+3),
55// fWidthUp(fParameters.GetArray()+6), fWidthLo(fParameters.GetArray()+9),
56// fDistUp(fParameters.GetArray()+12), fDistLo(fParameters.GetArray()+15)
57// {
58MMySuperCuts::MMySuperCuts(const char *name, const char *title)
59 : fParameters(48), fStepsizes(48),
60 fLengthUp(fParameters.GetArray()), fLengthLo(fParameters.GetArray()+4),
61 fWidthUp(fParameters.GetArray()+4*2), fWidthLo(fParameters.GetArray()+4*3),
62 fDistUp(fParameters.GetArray()+4*4), fDistLo(fParameters.GetArray()+4*5),
63 fAsymUp(fParameters.GetArray()+4*6), fAsymLo(fParameters.GetArray()+4*7),
64 fConcUp(fParameters.GetArray()+4*8), fConcLo(fParameters.GetArray()+4*9),
65 fLeakage1Up(fParameters.GetArray()+4*10), fLeakage1Lo(fParameters.GetArray()+4*11)
66
67{
68
69 fName = name ? name : "MMySuperCuts";
70 fTitle = title ? title : "Container for the supercut parameters";
71
72 // set supercut parameters to their default values
73 InitParameters();
74}
75
76
77// --------------------------------------------------------------------------
78//
79// set default values for the supercut parameters
80//
81void MMySuperCuts::InitParameters()
82{
83 //---------------------------------------------------
84 // these are the default values
85 //
86 fLengthUp[0] = 0.302;
87 fLengthUp[1] = 0.0;//0.03;
88 fLengthUp[2] = 0.0;
89 fLengthUp[3] = 0.0;
90// fLengthUp[4] = 0.0;
91// fLengthUp[5] = 0.0;
92// fLengthUp[6] = 0.0;
93// fLengthUp[7] = 0.0;
94
95 fLengthLo[0] = 0.052;
96 fLengthLo[1] = 0.;
97 fLengthLo[2] = 0.;
98 fLengthLo[3] = 0.;
99// fLengthLo[4] = 0.;
100// fLengthLo[5] = 0.;
101// fLengthLo[6] = 0.;
102// fLengthLo[7] = 0.;
103
104 fWidthUp[0] = 0.121;
105 fWidthUp[1] = 0.0;
106 fWidthUp[2] = 0.0;
107 fWidthUp[3] = 0.0;
108// fWidthUp[4] = 0.0;
109// fWidthUp[5] = 0.0;
110// fWidthUp[6] = 0.0;
111// fWidthUp[7] = 0.0;
112
113 fWidthLo[0] = 0.057;
114 fWidthLo[1] = 0.;
115 fWidthLo[2] = 0.;
116 fWidthLo[3] = 0.;
117// fWidthLo[4] = 0.;
118// fWidthLo[5] = 0.;
119// fWidthLo[6] = 0.;
120// fWidthLo[7] = 0.;
121
122 fDistUp[0] = 1.;
123 fDistUp[1] = 0.0;
124 fDistUp[2] = 0.0;
125 fDistUp[3] = 0.0;
126// fDistUp[4] = 0.0;
127// fDistUp[5] = 0.0;
128// fDistUp[6] = 0.0;
129// fDistUp[7] = 0.0;
130
131 fDistLo[0] = 0.3;
132 fDistLo[1] = 0.0;
133 fDistLo[2] = 0.0;
134 fDistLo[3] = 0.0;
135// fDistLo[4] = 0.0;
136// fDistLo[5] = 0.0;
137// fDistLo[6] = 0.0;
138// fDistLo[7] = 0.0;
139
140 // dummy values
141
142 fAsymUp[0] = 100;
143 fAsymUp[1] = 0.0;
144 fAsymUp[2] = 0.0;
145 fAsymUp[3] = 0.0;
146
147 fAsymLo[0] = -100;
148 fAsymLo[1] = 0.0;
149 fAsymLo[2] = 0.0;
150 fAsymLo[3] = 0.0;
151
152
153 fConcUp[0] = 1.;
154 fConcUp[1] = 0.0;
155 fConcUp[2] = 0.0;
156 fConcUp[3] = 0.0;
157
158 fConcLo[0] = 0;
159 fConcLo[1] = 0.0;
160 fConcLo[2] = 0.0;
161 fConcLo[3] = 0.0;
162
163 fLeakage1Up[0] = 1.;
164 fLeakage1Up[1] = 0.0;
165 fLeakage1Up[2] = 0.0;
166 fLeakage1Up[3] = 0.0;
167 // fLeakage1Up[4] = 0.0;
168// fLeakage1Up[5] = 0.0;
169// fLeakage1Up[6] = 0.0;
170// fLeakage1Up[7] = 0.0;
171
172 fLeakage1Lo[0] = -1.e10;
173 fLeakage1Lo[1] = 0.0;
174 fLeakage1Lo[2] = 0.0;
175 fLeakage1Lo[3] = 0.0;
176 // fLeakage1Lo[4] = 0.0;
177// fLeakage1Lo[5] = 0.0;
178// fLeakage1Lo[6] = 0.0;
179// fLeakage1Lo[7] = 0.0;
180
181
182 //---------------------------------------------------
183 // fStepsizes
184 // if == 0.0 the parameter will be fixed in the minimization
185 // != 0.0 initial step sizes for the parameters
186
187 // LengthUp
188 fStepsizes[0] = 0.01;
189 fStepsizes[1] = 0.01;
190 fStepsizes[2] = 0.1;
191 fStepsizes[3] = 0.1;
192// fStepsizes[4] = 0.0;
193// fStepsizes[5] = 0.0;
194// fStepsizes[6] = 0.0;
195// fStepsizes[7] = 0.0;
196
197 // LengthLo
198 fStepsizes[4] = 0.01;
199 fStepsizes[5] = 0.01;
200 fStepsizes[6] = 0.1;
201 fStepsizes[7] = 0.1;
202// fStepsizes[12] = 0.0;
203// fStepsizes[13] = 0.0;
204// fStepsizes[14] = 0.0;
205// fStepsizes[15] = 0.0;
206
207 // WidthUp
208 fStepsizes[8] = 0.01;
209 fStepsizes[9] = 0.01;
210 fStepsizes[10] = 0.1;
211 fStepsizes[11] = 0.1;
212// fStepsizes[20] = 0.0;
213// fStepsizes[21] = 0.0;
214// fStepsizes[22] = 0.0;
215// fStepsizes[23] = 0.0;
216
217 // WidthLo
218 fStepsizes[12] = 0.01;
219 fStepsizes[13] = 0.01;
220 fStepsizes[14] = 0.1;
221 fStepsizes[15] = 0.1;
222// fStepsizes[28] = 0.0;
223// fStepsizes[29] = 0.0;
224// fStepsizes[30] = 0.0;
225// fStepsizes[31] = 0.0;
226
227 // DistUp
228 fStepsizes[16] = 0.1;
229 fStepsizes[17] = 0.1;
230 fStepsizes[18] = 0.1;
231 fStepsizes[19] = 0.1;
232// fStepsizes[36] = 0.0;
233// fStepsizes[37] = 0.0;
234// fStepsizes[38] = 0.0;
235// fStepsizes[39] = 0.0;
236
237 // DistLo
238 fStepsizes[20] = 0.1;
239 fStepsizes[21] = 0.1;
240 fStepsizes[22] = 0.1;
241 fStepsizes[23] = 0.1;
242// fStepsizes[44] = 0.0;
243// fStepsizes[45] = 0.0;
244// fStepsizes[46] = 0.0;
245// fStepsizes[47] = 0.0;
246
247 for(int i=24;i<48;i++)
248 fStepsizes[i] = .1;
249
250}
251
252
253// --------------------------------------------------------------------------
254//
255// Set the parameter values from the array 'd'
256//
257//
258Bool_t MMySuperCuts::SetParameters(const TArrayD &d)
259{
260 if (d.GetSize() != fParameters.GetSize())
261 {
262 *fLog << err << "Sizes of d and of fParameters are different : "
263 << d.GetSize() << ", " << fParameters.GetSize() << endl;
264 return kFALSE;
265 }
266
267 fParameters = d;
268
269 return kTRUE;
270}
271
272// --------------------------------------------------------------------------
273//
274// Set the step sizes from the array 'd'
275//
276//
277Bool_t MMySuperCuts::SetStepsizes(const TArrayD &d)
278{
279 if (d.GetSize() != fStepsizes.GetSize())
280 {
281 *fLog << err << "Sizes of d and of fStepsizes are different : "
282 << d.GetSize() << ", " << fStepsizes.GetSize() << endl;
283 return kFALSE;
284 }
285
286 fStepsizes = d;
287
288 return kTRUE;
289}
290
291
292
293void MMySuperCuts::Print(const Option_t* opt) const
294{
295 // for(Int_t i=0; i<48; i++)
296 // cout << i << " " << fParameters[i] << endl;
297
298 printf("Hillas_up/lo = A + B*log(SIZE) + C*log^2(SIZE) + D*DIST^2\n");
299 printf(" A B C D\n");
300 printf("Length_Up [0-3]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[0],fParameters[1],fParameters[2],fParameters[3]);
301 printf("Length_Lo [4-7]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[4],fParameters[5],fParameters[6],fParameters[7]);
302
303 printf("Width_Up [8-11]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[8],fParameters[9],fParameters[10],fParameters[11]);
304 printf("Width_Lo [12-15]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[12],fParameters[13],fParameters[14],fParameters[15]);
305
306 printf("Dist_Up [16-19]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[16],fParameters[17],fParameters[18],fParameters[19]);
307 printf("Dist_Lo [20-23]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[20],fParameters[21],fParameters[22],fParameters[23]);
308
309 printf("Asym_Up [24-27]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[24],fParameters[25],fParameters[26],fParameters[27]);
310 printf("Asym_Lo [28-31]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[28],fParameters[29],fParameters[30],fParameters[31]);
311
312 printf("Conc_Up [32-35]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[32],fParameters[33],fParameters[34],fParameters[35]);
313 printf("Conc_Lo [36-39]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[36],fParameters[37],fParameters[38],fParameters[39]);
314
315 printf("Leak_Up [40-43]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[40],fParameters[41],fParameters[42],fParameters[43]);
316 printf("Leak_Lo [44-47]: %7.3f %7.3f %7.3f %7.3f\n",fParameters[44],fParameters[45],fParameters[46],fParameters[47]);
317}
318
319
320
321
322
323
324
325
Note: See TracBrowser for help on using the repository browser.