source: trunk/MagicSoft/Mars/manalysis/MSupercuts.cc@ 6922

Last change on this file since 6922 was 3140, checked in by wittek, 21 years ago
*** empty log message ***
File size: 9.3 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!
21! Copyright: MAGIC Software Development, 2000-2003
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MSupercuts //
29// //
30// this is the container for the parameters of the supercuts //
31// //
32/////////////////////////////////////////////////////////////////////////////
33#include "MSupercuts.h"
34
35#include <math.h>
36#include <fstream>
37
38#include "MParList.h"
39
40#include "MLog.h"
41#include "MLogManip.h"
42
43ClassImp(MSupercuts);
44
45using namespace std;
46
47// --------------------------------------------------------------------------
48//
49// constructor
50//
51MSupercuts::MSupercuts(const char *name, const char *title)
52 : fParameters(104), fStepsizes(104),
53 fLengthUp(fParameters.GetArray()), fLengthLo(fParameters.GetArray()+8),
54 fWidthUp(fParameters.GetArray()+16), fWidthLo(fParameters.GetArray()+24),
55 fDistUp(fParameters.GetArray()+32), fDistLo(fParameters.GetArray()+40),
56 fAsymUp(fParameters.GetArray()+48), fAsymLo(fParameters.GetArray()+56),
57 fConcUp(fParameters.GetArray()+64), fConcLo(fParameters.GetArray()+72),
58 fLeakage1Up(fParameters.GetArray()+80), fLeakage1Lo(fParameters.GetArray()+88),
59 fAlphaUp(fParameters.GetArray()+96)
60{
61 fName = name ? name : "MSupercuts";
62 fTitle = title ? title : "Container for the supercut parameters";
63
64 // set supercut parameters to their default values
65 InitParameters();
66}
67
68
69// --------------------------------------------------------------------------
70//
71// set default values for the supercut parameters
72//
73void MSupercuts::InitParameters()
74{
75 //---------------------------------------------------
76 // these are the default values
77
78 fLengthUp[0] = 0.2;
79 fLengthUp[1] = 0.0;
80 fLengthUp[2] = 0.0;
81 fLengthUp[3] = 0.0;
82 fLengthUp[4] = 0.0;
83 fLengthUp[5] = 0.0;
84 fLengthUp[6] = 0.0;
85 fLengthUp[7] = 0.0;
86
87 fLengthLo[0] = 0.;
88 fLengthLo[1] = 0.;
89 fLengthLo[2] = 0.;
90 fLengthLo[3] = 0.;
91 fLengthLo[4] = 0.;
92 fLengthLo[5] = 0.;
93 fLengthLo[6] = 0.;
94 fLengthLo[7] = 0.;
95
96 fWidthUp[0] = 0.1;
97 fWidthUp[1] = 0.0;
98 fWidthUp[2] = 0.0;
99 fWidthUp[3] = 0.0;
100 fWidthUp[4] = 0.0;
101 fWidthUp[5] = 0.0;
102 fWidthUp[6] = 0.0;
103 fWidthUp[7] = 0.0;
104
105 fWidthLo[0] = 0.;
106 fWidthLo[1] = 0.;
107 fWidthLo[2] = 0.;
108 fWidthLo[3] = 0.;
109 fWidthLo[4] = 0.;
110 fWidthLo[5] = 0.;
111 fWidthLo[6] = 0.;
112 fWidthLo[7] = 0.;
113
114 fDistUp[0] = 1.e10;
115 fDistUp[1] = 0.0;
116 fDistUp[2] = 0.0;
117 fDistUp[3] = 0.0;
118 fDistUp[4] = 0.0;
119 fDistUp[5] = 0.0;
120 fDistUp[6] = 0.0;
121 fDistUp[7] = 0.0;
122
123 fDistLo[0] = 0.0;
124 fDistLo[1] = 0.0;
125 fDistLo[2] = 0.0;
126 fDistLo[3] = 0.0;
127 fDistLo[4] = 0.0;
128 fDistLo[5] = 0.0;
129 fDistLo[6] = 0.0;
130 fDistLo[7] = 0.0;
131
132
133 // dummy values
134
135 fAsymUp[0] = 1.e10;
136 fAsymUp[1] = 0.0;
137 fAsymUp[2] = 0.0;
138 fAsymUp[3] = 0.0;
139 fAsymUp[4] = 0.0;
140 fAsymUp[5] = 0.0;
141 fAsymUp[6] = 0.0;
142 fAsymUp[7] = 0.0;
143
144 fAsymLo[0] = -1.e10;
145 fAsymLo[1] = 0.0;
146 fAsymLo[2] = 0.0;
147 fAsymLo[3] = 0.0;
148 fAsymLo[4] = 0.0;
149 fAsymLo[5] = 0.0;
150 fAsymLo[6] = 0.0;
151 fAsymLo[7] = 0.0;
152
153 fConcUp[0] = 1.e10;
154 fConcUp[1] = 0.0;
155 fConcUp[2] = 0.0;
156 fConcUp[3] = 0.0;
157 fConcUp[4] = 0.0;
158 fConcUp[5] = 0.0;
159 fConcUp[6] = 0.0;
160 fConcUp[7] = 0.0;
161
162 fConcLo[0] = -1.e10;
163 fConcLo[1] = 0.0;
164 fConcLo[2] = 0.0;
165 fConcLo[3] = 0.0;
166 fConcLo[4] = 0.0;
167 fConcLo[5] = 0.0;
168 fConcLo[6] = 0.0;
169 fConcLo[7] = 0.0;
170
171 fLeakage1Up[0] = 1.e10;
172 fLeakage1Up[1] = 0.0;
173 fLeakage1Up[2] = 0.0;
174 fLeakage1Up[3] = 0.0;
175 fLeakage1Up[4] = 0.0;
176 fLeakage1Up[5] = 0.0;
177 fLeakage1Up[6] = 0.0;
178 fLeakage1Up[7] = 0.0;
179
180 fLeakage1Lo[0] = -1.e10;
181 fLeakage1Lo[1] = 0.0;
182 fLeakage1Lo[2] = 0.0;
183 fLeakage1Lo[3] = 0.0;
184 fLeakage1Lo[4] = 0.0;
185 fLeakage1Lo[5] = 0.0;
186 fLeakage1Lo[6] = 0.0;
187 fLeakage1Lo[7] = 0.0;
188
189 fAlphaUp[0] = 13.123440;
190 fAlphaUp[1] = 0;
191 fAlphaUp[2] = 0;
192 fAlphaUp[3] = 0;
193 fAlphaUp[4] = 0;
194 fAlphaUp[5] = 0;
195 fAlphaUp[6] = 0;
196 fAlphaUp[7] = 0;
197
198 //---------------------------------------------------
199 // fStepsizes
200 // if == 0.0 the parameter will be fixed in the minimization
201 // != 0.0 initial step sizes for the parameters
202
203 // LengthUp
204 fStepsizes[0] = 0.02;
205 fStepsizes[1] = 0.0;
206 fStepsizes[2] = 0.0;
207 fStepsizes[3] = 0.0;
208 fStepsizes[4] = 0.0;
209 fStepsizes[5] = 0.0;
210 fStepsizes[6] = 0.0;
211 fStepsizes[7] = 0.0;
212
213 // LengthLo
214 fStepsizes[8] = 0.0;
215 fStepsizes[9] = 0.0;
216 fStepsizes[10] = 0.0;
217 fStepsizes[11] = 0.0;
218 fStepsizes[12] = 0.0;
219 fStepsizes[13] = 0.0;
220 fStepsizes[14] = 0.0;
221 fStepsizes[15] = 0.0;
222
223 // WidthUp
224 fStepsizes[16] = 0.01;
225 fStepsizes[17] = 0.0;
226 fStepsizes[18] = 0.0;
227 fStepsizes[19] = 0.0;
228 fStepsizes[20] = 0.0;
229 fStepsizes[21] = 0.0;
230 fStepsizes[22] = 0.0;
231 fStepsizes[23] = 0.0;
232
233 // WidthLo
234 fStepsizes[24] = 0.0;
235 fStepsizes[25] = 0.0;
236 fStepsizes[26] = 0.0;
237 fStepsizes[27] = 0.0;
238 fStepsizes[28] = 0.0;
239 fStepsizes[29] = 0.0;
240 fStepsizes[30] = 0.0;
241 fStepsizes[31] = 0.0;
242
243 // DistUp
244 fStepsizes[32] = 0.0;
245 fStepsizes[33] = 0.0;
246 fStepsizes[34] = 0.0;
247 fStepsizes[35] = 0.0;
248 fStepsizes[36] = 0.0;
249 fStepsizes[37] = 0.0;
250 fStepsizes[38] = 0.0;
251 fStepsizes[39] = 0.0;
252
253 // DistLo
254 fStepsizes[40] = 0.0;
255 fStepsizes[41] = 0.0;
256 fStepsizes[42] = 0.0;
257 fStepsizes[43] = 0.0;
258 fStepsizes[44] = 0.0;
259 fStepsizes[45] = 0.0;
260 fStepsizes[46] = 0.0;
261 fStepsizes[47] = 0.0;
262
263 // AsymUp
264 fStepsizes[48] = 0.0;
265 fStepsizes[49] = 0.0;
266 fStepsizes[50] = 0.0;
267 fStepsizes[51] = 0.0;
268 fStepsizes[52] = 0.0;
269 fStepsizes[53] = 0.0;
270 fStepsizes[54] = 0.0;
271 fStepsizes[55] = 0.0;
272
273 // AsymLo
274 fStepsizes[56] = 0.0;
275 fStepsizes[57] = 0.0;
276 fStepsizes[58] = 0.0;
277 fStepsizes[59] = 0.0;
278 fStepsizes[60] = 0.0;
279 fStepsizes[61] = 0.0;
280 fStepsizes[62] = 0.0;
281 fStepsizes[63] = 0.0;
282
283 // ConcUp
284 fStepsizes[64] = 0.0;
285 fStepsizes[65] = 0.0;
286 fStepsizes[66] = 0.0;
287 fStepsizes[67] = 0.0;
288 fStepsizes[68] = 0.0;
289 fStepsizes[69] = 0.0;
290 fStepsizes[70] = 0.0;
291 fStepsizes[71] = 0.0;
292
293 // ConcLo
294 fStepsizes[72] = 0.0;
295 fStepsizes[73] = 0.0;
296 fStepsizes[74] = 0.0;
297 fStepsizes[75] = 0.0;
298 fStepsizes[76] = 0.0;
299 fStepsizes[77] = 0.0;
300 fStepsizes[78] = 0.0;
301 fStepsizes[79] = 0.0;
302
303 // Leakage1Up
304 fStepsizes[80] = 0.0;
305 fStepsizes[81] = 0.0;
306 fStepsizes[82] = 0.0;
307 fStepsizes[83] = 0.0;
308 fStepsizes[84] = 0.0;
309 fStepsizes[85] = 0.0;
310 fStepsizes[86] = 0.0;
311 fStepsizes[87] = 0.0;
312
313 // Leakage1Lo
314 fStepsizes[88] = 0.0;
315 fStepsizes[89] = 0.0;
316 fStepsizes[90] = 0.0;
317 fStepsizes[91] = 0.0;
318 fStepsizes[92] = 0.0;
319 fStepsizes[93] = 0.0;
320 fStepsizes[94] = 0.0;
321 fStepsizes[95] = 0.0;
322
323 // AlphaUp
324 fStepsizes[96] = 0.0;
325 fStepsizes[97] = 0.0;
326 fStepsizes[98] = 0.0;
327 fStepsizes[99] = 0.0;
328 fStepsizes[100] = 0.0;
329 fStepsizes[101] = 0.0;
330 fStepsizes[102] = 0.0;
331 fStepsizes[103] = 0.0;
332}
333
334
335// --------------------------------------------------------------------------
336//
337// Set the parameter values from the array 'd'
338//
339//
340Bool_t MSupercuts::SetParameters(const TArrayD &d)
341{
342 if (d.GetSize() != fParameters.GetSize())
343 {
344 *fLog << err << "Sizes of d and of fParameters are different : "
345 << d.GetSize() << ", " << fParameters.GetSize() << endl;
346 return kFALSE;
347 }
348
349 fParameters = d;
350
351 return kTRUE;
352}
353
354// --------------------------------------------------------------------------
355//
356// Set the step sizes from the array 'd'
357//
358//
359Bool_t MSupercuts::SetStepsizes(const TArrayD &d)
360{
361 if (d.GetSize() != fStepsizes.GetSize())
362 {
363 *fLog << err << "Sizes of d and of fStepsizes are different : "
364 << d.GetSize() << ", " << fStepsizes.GetSize() << endl;
365 return kFALSE;
366 }
367
368 fStepsizes = d;
369
370 return kTRUE;
371}
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
Note: See TracBrowser for help on using the repository browser.