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