GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
MainGo4AnalysisClient.cxx
Go to the documentation of this file.
1 // $Id$
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include <cstdlib>
15 #include <iostream>
16 
17 #include "TApplication.h"
18 
19 #include "TGo4Log.h"
20 #include "TGo4AnalysisClient.h"
21 
22 int main(int argc, char **argv)
23 {
24  TApplication theApp("App", &argc, argv);
25  // define debug output section:
26  TGo4Log::Instance(); // init logger object
27  TGo4Log::SetIgnoreLevel(0); // set this to 1 to suppress detailed debug output
28  // set this to 2 to get warnings and errors only
29  // set this to 3 to get errors only
30  TGo4Log::LogfileEnable(kFALSE); // will enable or disable logging all messages to file
31 
32  if (argc < 4) {
33  std::cout << "usage: MainGo4AnalysisClient clientname serverhostname connectorport" << std::endl;
34  return 0;
35  }
36 
37  const char *name = argv[1];
38  const char *hostname = argv[2];
39  const char *connector = argv[3];
40  UInt_t con = atoi(connector);
41  std::cout << "Client:" << name << ",\tHost:" << hostname << ",\tConnector:" << con << std::endl;
42 
43  // variant 1: use demo with internal plain analysis base class
44  TGo4AnalysisClient *myclient = new TGo4AnalysisClient(name, 0, hostname, con);
45 
46  // variant 2: create user analysis and pass it to client, client adopts it
47  // TEbAnalysis* myanalysis= new TEbAnalysis;
48  // myanalysis->SetAutoSaveFile("EbAutoSave");
49  // myanalysis->SetAutoSaveInterval(200000);
50  // TGo4AnalysisClient *myclient = new TGo4AnalysisClient(name,myanalysis,hostname,con);
51 
52  std::cout << "Created AnalysisClient Instance: " << myclient->GetName() << std::endl; // dummy action for warnings
53  theApp.Run();
54 
55  return 0;
56 }
const char * GetName() const
static TGo4Log * Instance()
Definition: TGo4Log.cxx:85
int main(int argc, char **argv)
static void SetIgnoreLevel(Int_t level)
Definition: TGo4Log.cxx:332
static void LogfileEnable(Bool_t on=kTRUE)
Definition: TGo4Log.cxx:363