source: trunk/MagicSoft/Mars/mtemp/mifae/library/MDispParameters.cc@ 6186

Last change on this file since 6186 was 5922, checked in by domingo, 20 years ago
*** empty log message ***
File size: 3.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): Eva Domingo, 12/2004 <mailto:domingo@ifae.es>
19! Wolfgang Wittek, 12/2004 <mailto:wittek@mppmu.mpg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2005
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MDispParameters //
29// //
30// this is the container for the Disp parameters //
31// //
32/////////////////////////////////////////////////////////////////////////////
33#include "MDispParameters.h"
34
35#include <math.h>
36#include <fstream>
37
38#include <TArrayD.h>
39
40#include "MImageParDisp.h"
41
42#include "MParList.h"
43
44#include "MLog.h"
45#include "MLogManip.h"
46
47
48ClassImp(MDispParameters);
49
50using namespace std;
51
52// --------------------------------------------------------------------------
53//
54// constructor
55//
56MDispParameters::MDispParameters(const char *name, const char *title)
57{
58 fName = name ? name : "MDispParameters";
59 fTitle = title ? title : "Container for the Disp parameters";
60}
61
62
63// --------------------------------------------------------------------------
64//
65// set default values for the Disp parameters
66//
67void MDispParameters::InitParameters()
68{
69 //---------------------------------------------------
70 // these are the default values
71
72 fParameters[0] = 1.0;
73 fParameters[1] = 0.6;
74 fParameters[2] = -0.8;
75 fParameters[3] = -0.8;
76 fParameters[4] = -1.2;
77
78
79 //---------------------------------------------------
80 // fStepsizes
81 // if == 0.0 the parameter will be fixed in the minimization
82 // != 0.0 initial step sizes for the parameters
83
84 fStepsizes[0] = 0.010;
85 fStepsizes[1] = 0.006;
86 fStepsizes[2] = 0.008;
87 fStepsizes[3] = 0.008;
88 fStepsizes[4] = 0.012;
89}
90
91
92// --------------------------------------------------------------------------
93//
94// Set the parameter values from the array 'd'
95//
96//
97Bool_t MDispParameters::SetParameters(const TArrayD &d)
98{
99 if (d.GetSize() != fParameters.GetSize())
100 {
101 *fLog << err << "Sizes of d and of fParameters are different : "
102 << d.GetSize() << ", " << fParameters.GetSize() << endl;
103 return kFALSE;
104 }
105
106 fParameters = d;
107
108 return kTRUE;
109}
110
111
112// --------------------------------------------------------------------------
113//
114// Set the step sizes from the array 'd'
115//
116//
117Bool_t MDispParameters::SetStepsizes(const TArrayD &d)
118{
119 if (d.GetSize() != fStepsizes.GetSize())
120 {
121 *fLog << err << "Sizes of d and of fStepsizes are different : "
122 << d.GetSize() << ", " << fStepsizes.GetSize() << endl;
123 return kFALSE;
124 }
125
126 fStepsizes = d;
127
128 return kTRUE;
129}
Note: See TracBrowser for help on using the repository browser.