Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4Fit/TGo4FitDependency.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4FitDependency.h"
00017 #include <iostream.h>
00018 
00019 TGo4FitDependency::TGo4FitDependency() :
00020     TObject(), fxParameter(), fxExpression(), fdInitValue(0.), fiNumPar(0), fxFormula(0)  {
00021 }
00022 
00023 
00024 TGo4FitDependency::TGo4FitDependency(const char* iParameter, const char* iExpression) :
00025     TObject(), fxParameter(iParameter), fxExpression(iExpression), fdInitValue(0.), fiNumPar(0), fxFormula(0) {
00026 }
00027 
00028 TGo4FitDependency::TGo4FitDependency(const char* iParameter, Double_t InitValue) :
00029     TObject(), fxParameter(iParameter), fxExpression(), fdInitValue(InitValue), fiNumPar(0), fxFormula(0) {
00030 }
00031 
00032 TGo4FitDependency::~TGo4FitDependency() {
00033     if (fxFormula) delete fxFormula;
00034 }
00035 
00036 void TGo4FitDependency::SetParameter(const char* iParameter) {
00037   fxParameter = iParameter;
00038 }
00039 
00040 void TGo4FitDependency::SetInitValue(Double_t InitValue) {
00041   fxExpression.Remove(0);
00042   fdInitValue = InitValue;
00043 
00044 }
00045 void TGo4FitDependency::SetExpression(const char* iExpression) {
00046   fxExpression = iExpression;
00047 }
00048 
00049 void TGo4FitDependency::Initialize(Int_t iNumPar, const char* iFormula) {
00050     fiNumPar = iNumPar;
00051     if (iFormula) {
00052        if (fxFormula) delete fxFormula;
00053        fxFormula = new TFormula("", iFormula);
00054     } else fxFormula=0;
00055 }
00056 
00057 Double_t TGo4FitDependency::Execute(Double_t* Params) {
00058     Double_t res = (fxFormula!=0) ? fxFormula->EvalPar(0,Params) : fdInitValue;
00059     if (fiNumPar>=0) Params[fiNumPar] = res;
00060     return res;
00061 }
00062 
00063 void TGo4FitDependency::Finalize() {
00064     if (fxFormula) { delete fxFormula; fxFormula=0; }
00065 }
00066 
00067 void TGo4FitDependency::Print(Option_t* option) const {
00068   cout << "Pars dependency:   " << fxParameter << "  =  ";
00069   if (fxExpression.Length()>0) cout << fxExpression << endl;
00070                           else cout << fdInitValue << endl;
00071  }
00072 
00073 
00074 
00075 ClassImp(TGo4FitDependency)
00076 
00077 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:56 2005 for Go4-v2.10-5 by doxygen1.2.15