00001 // $Id: MainGo4AnalysisClient.cxx 932 2013-01-29 13:32:22Z 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 <stdlib.h> 00015 00016 #include "Riostream.h" 00017 #include "TApplication.h" 00018 00019 #include "TGo4Log.h" 00020 #include "TGo4AnalysisClient.h" 00021 00022 void usage() 00023 { 00024 std::cout << "usage: MainGo4AnalysisClient clientname serverhostname connectorport"<<std::endl; 00025 } 00026 00027 00028 int main(int argc, char **argv) 00029 { 00030 TApplication theApp("App", &argc, argv); 00031 // define debug output section: 00032 TGo4Log::Instance(); // init logger object 00033 TGo4Log::SetIgnoreLevel(0); // set this to 1 to suppress detailed debug output 00034 // set this to 2 to get warnings and errors only 00035 // set this to 3 to get errors only 00036 TGo4Log::LogfileEnable(kFALSE); // will enable or disable logging all messages to file 00037 00038 00039 if(argc<4) 00040 { 00041 usage(); 00042 00043 } 00044 else 00045 { 00046 const char* name=argv[1]; 00047 const char* hostname=argv[2]; 00048 const char* connector=argv[3]; 00049 UInt_t con=atoi(connector); 00050 std::cout << "Client:"<<name<<",\tHost:"<<hostname<<",\tConnector:"<<con<<std::endl; 00051 00052 // variant 1: use demo with internal plain analysis base class 00053 TGo4AnalysisClient* myclient = new TGo4AnalysisClient(name,0,hostname,con); 00054 00055 // variant 2: create user analysis and pass it to client, client adopts it 00056 // TEbAnalysis* myanalysis= new TEbAnalysis; 00057 // myanalysis->SetAutoSaveFile("EbAutoSave"); 00058 // myanalysis->SetAutoSaveInterval(200000); 00059 // TGo4AnalysisClient* myclient = new TGo4AnalysisClient(name,myanalysis,hostname,con); 00060 00061 00062 std::cout << "Created AnalysisClient Instance: "<<myclient->GetName()<<std::endl; // dummy action for warnings 00063 theApp.Run(); 00064 00065 return 0; 00066 00067 } // if(argc<4) 00068 00069 //} // if (rev) 00070 00071 }