00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE 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 "TYYYParameter.h" 00017 00018 #include "Riostream.h" 00019 00020 #include "TGo4Fitter.h" 00021 00022 //*********************************************************** 00023 TYYYParameter::TYYYParameter() 00024 : TGo4Parameter("YYYParameter") 00025 { 00026 frP1=0; 00027 frP2=0; 00028 00029 for(Int_t ix=0;ix<__ARRAYSIZE__;++ix) 00030 { 00031 fiDataArray[ix]=0; 00032 fxFitArray[ix]=0; 00033 } 00034 } 00035 00036 //*********************************************************** 00037 TYYYParameter::TYYYParameter(const char* name) 00038 : TGo4Parameter(name) 00039 { 00040 frP1=10; 00041 frP2=20; 00042 for(Int_t ix=0;ix<__ARRAYSIZE__;++ix) 00043 { 00044 fiDataArray[ix]=ix+30; 00045 fxFitArray[ix]=new TGo4Fitter(); 00046 } 00047 } 00048 //*********************************************************** 00049 TYYYParameter::~TYYYParameter() 00050 { 00051 for(Int_t ix=0;ix<__ARRAYSIZE__;++ix) 00052 { 00053 if(fxFitArray[ix]) delete fxFitArray[ix]; 00054 } 00055 } 00056 //*********************************************************** 00057 00058 //----------------------------------------------------------- 00059 Int_t TYYYParameter::PrintParameter(Text_t * n, Int_t){ 00060 return 0; 00061 cout << "Parameter " << GetName()<<":" <<endl; 00062 cout << " P1="<<frP1<<endl; 00063 cout << " P2="<<frP2<< endl; 00064 for(Int_t ix=0;ix<__ARRAYSIZE__;++ix) 00065 { 00066 cout << "fiDataArray["<<ix<<"]="<<fiDataArray[ix]<<endl; 00067 fxFitArray[ix]->PrintLines(); 00068 } 00069 return 0; 00070 } 00071 //----------------------------------------------------------- 00072 Bool_t TYYYParameter::UpdateFrom(TGo4Parameter *pp){ 00073 if(pp->InheritsFrom("TYYYParameter")) 00074 { 00075 TYYYParameter * from; 00076 from = (TYYYParameter *) pp; 00077 cout << "Parameter " << GetName() << ": P1=" << frP1 << " P2="<< frP2 << endl; 00078 frP1=from->frP1; 00079 frP2=from->frP2; 00080 for(Int_t ix=0;ix<__ARRAYSIZE__;++ix) 00081 { 00082 fiDataArray[ix]=from->fiDataArray[ix]; 00083 // replace old fitters by copy of source fitter: 00084 if(fxFitArray[ix]) delete fxFitArray[ix]; 00085 fxFitArray[ix]=(TGo4Fitter*) from->fxFitArray[ix]->Clone(); 00086 } 00087 cout <<"Updated Parameter:" << endl; 00088 //PrintParameter(0,0); 00089 } 00090 else 00091 cout << "Wrong parameter object: " << pp->ClassName() << endl; 00092 return kTRUE; 00093 } 00094 00095 //----------------------------END OF GO4 SOURCE FILE ---------------------