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