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

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

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