00001 // $Id: TGo4FitterOutput.cxx 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "TGo4FitterOutput.h" 00015 00016 #include "Riostream.h" 00017 00018 #include "TVirtualPad.h" 00019 00020 #include "TGo4FitterAbstract.h" 00021 00022 TGo4FitterOutput::TGo4FitterOutput() : TGo4FitterAction(), fxCommand(), fxOptions(), fxPad(0) { 00023 } 00024 00025 TGo4FitterOutput::TGo4FitterOutput(const char* Command, const char* Options) : 00026 TGo4FitterAction(Command,"Output action for fitter"), fxCommand(Command), fxOptions(Options), fxPad(0) { 00027 } 00028 00029 TGo4FitterOutput::~TGo4FitterOutput() { 00030 } 00031 00032 void TGo4FitterOutput::DoAction(TGo4FitterAbstract* Fitter) { 00033 if (Fitter==0) return; 00034 if (fxCommand=="Print") Fitter->Print(fxOptions.Data()); else 00035 if (fxCommand=="Draw") { 00036 TVirtualPad* old = gPad; 00037 if (fxPad!=0) fxPad->cd(); 00038 Fitter->Draw(fxOptions.Data()); 00039 if (fxPad) fxPad->Update(); 00040 if (old!=0) old->cd(); 00041 } 00042 } 00043 00044 void TGo4FitterOutput::Print(Option_t* option) const { 00045 TGo4FitterAction::Print(option); 00046 cout << " command: " << fxCommand; 00047 if (fxOptions.Length()>0) cout << " options: " << fxOptions << endl; 00048 else cout << endl; 00049 }