00001 // $Id: TGo4FitterOutput.cxx 933 2013-01-29 15:27:58Z 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 #include "TVirtualPad.h" 00018 00019 #include "TGo4FitterAbstract.h" 00020 00021 TGo4FitterOutput::TGo4FitterOutput() : TGo4FitterAction(), fxCommand(), fxOptions(), fxPad(0) { 00022 } 00023 00024 TGo4FitterOutput::TGo4FitterOutput(const char* Command, const char* Options) : 00025 TGo4FitterAction(Command,"Output action for fitter"), fxCommand(Command), fxOptions(Options), fxPad(0) { 00026 } 00027 00028 TGo4FitterOutput::~TGo4FitterOutput() { 00029 } 00030 00031 void TGo4FitterOutput::DoAction(TGo4FitterAbstract* Fitter) { 00032 if (Fitter==0) return; 00033 if (fxCommand=="Print") Fitter->Print(fxOptions.Data()); else 00034 if (fxCommand=="Draw") { 00035 TVirtualPad* old = gPad; 00036 if (fxPad!=0) fxPad->cd(); 00037 Fitter->Draw(fxOptions.Data()); 00038 if (fxPad) fxPad->Update(); 00039 if (old!=0) old->cd(); 00040 } 00041 } 00042 00043 void TGo4FitterOutput::Print(Option_t* option) const { 00044 TGo4FitterAction::Print(option); 00045 std::cout << " command: " << fxCommand; 00046 if (fxOptions.Length()>0) std::cout << " options: " << fxOptions; 00047 std::cout << std::endl; 00048 }