00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4FitParameter.h"
00015
00016 #include "Riostream.h"
00017
00018 #include "TGo4FitParsList.h"
00019
00020 TGo4FitParameter::TGo4FitParameter() : TGo4FitNamed() {
00021 Reset();
00022 }
00023
00024 TGo4FitParameter::TGo4FitParameter(const char* name, const char* title, Double_t iValue) : TGo4FitNamed(name,title) {
00025 Reset();
00026 fdValue = iValue;
00027 }
00028
00029 TGo4FitParameter::TGo4FitParameter(const char* name, const char* title, Double_t iValue, Double_t iRangeMin, Double_t iRangeMax) : TGo4FitNamed(name,title) {
00030 Reset();
00031 fdValue = iValue;
00032 SetRange(iRangeMin,iRangeMax);
00033 }
00034
00035 TGo4FitParameter::TGo4FitParameter(const char* name, const char* title, Double_t iValue, Double_t iEpsilon) : TGo4FitNamed(name,title) {
00036 Reset();
00037 fdValue = iValue;
00038 SetEpsilon(iEpsilon);
00039 }
00040
00041 TGo4FitParameter::TGo4FitParameter(const char* name, const char* title, Double_t iValue, Double_t iRangeMin, Double_t iRangeMax, Double_t iEpsilon) : TGo4FitNamed(name,title) {
00042 Reset();
00043 fdValue = iValue;
00044 SetRange(iRangeMin,iRangeMax);
00045 SetEpsilon(iEpsilon);
00046 }
00047
00048 void TGo4FitParameter::SetRange(Double_t iRangeMin, Double_t iRangeMax) {
00049 fbRange=kTRUE;
00050 fdRangeMin = iRangeMin;
00051 fdRangeMax = iRangeMax;
00052 if (fdRangeMin==fdRangeMax) { fdValue = fdRangeMin; fbFixed = kTRUE; } else
00053 if (fdValue<fdRangeMin) fdValue = fdRangeMin; else
00054 if (fdValue>fdRangeMax) fdValue = fdRangeMax;
00055 }
00056
00057 TGo4FitParameter::~TGo4FitParameter() {
00058 }
00059
00060 void TGo4FitParameter::Print(Option_t* option) const {
00061 cout << " Name: " << ((TGo4FitParameter*) this) -> GetFullName();
00062 cout << " value=" << fdValue << " error = " << fdError;
00063 if (GetFixed()) cout << " fixed";
00064 if (fbRange) cout << " range=[" << fdRangeMin << "," << fdRangeMax << "]";
00065 if (fbEpsilon) cout << " epsilon=" << fdEpsilon;
00066 cout << endl;
00067
00068 }
00069
00070 void TGo4FitParameter::Reset() {
00071 fdValue = 0.;
00072 fdError = 0.;
00073 fbFixed = kFALSE;
00074 fbEpsilon = kFALSE;
00075 fdEpsilon = .000001;
00076 fbRange = kFALSE;
00077 fdRangeMin = 0.;
00078 fdRangeMax = 0.;
00079 fbBlocked = kFALSE;
00080 fdRememberedValue = 0.;
00081 }