Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
run_example_client.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file run_example_client.C
1 //
2 // You need to run 2 servers by executing (in 2 separate root sessions)
3 // .x run_example_server0.C
4 // .x run_example_server1.C
5 // and then start the client
6 // if you only start one server only one set of histograms will be displayed
7 
8 #include "CommonFuncs.C"
9 
10 #include <onlmon/example/MyMonDraw.h>
11 
12 #include <onlmon/OnlMonClient.h>
13 
14 // cppcheck-suppress unknownMacro
15 R__LOAD_LIBRARY(libonlmymon_client.so)
16 
17 void exampleDrawInit(const int online = 0)
18 {
20  // register histos we want with monitor name
21  cl->registerHisto("mymon_hist1", "MYMON_0");
22  cl->registerHisto("mymon_hist2", "MYMON_0");
23  cl->registerHisto("mymon_hist1", "MYMON_1");
24  cl->registerHisto("mymon_hist2", "MYMON_1");
25  cl->AddServerHost("localhost"); // check local host first
26  CreateHostList(online);
27  // get my histos from server, the second parameter = 1
28  // says I know they are all on the same node
29  cl->requestHistoBySubSystem("MYMON_0", 1);
30  cl->requestHistoBySubSystem("MYMON_1", 1);
31  OnlMonDraw *mymon = new MyMonDraw("MYMONDRAW"); // create Drawing Object
32  cl->registerDrawer(mymon); // register with client framework
33 }
34 
35 void exampleDraw(const char *what = "ALL")
36 {
37  OnlMonClient *cl = OnlMonClient::instance(); // get pointer to framewrk
38  cl->requestHistoBySubSystem("MYMON_1",1); // update histos
39  cl->requestHistoBySubSystem("MYMON_0",1); // update histos
40  cl->Draw("MYMONDRAW", what); // Draw Histos of registered Drawers
41 }
42 
44 {
45  OnlMonClient *cl = OnlMonClient::instance(); // get pointer to framewrk
46  cl->SavePlot("MYMONDRAW"); // Save Plots
47  return;
48 }
49 
51 {
52  OnlMonClient *cl = OnlMonClient::instance(); // get pointer to framewrk
53  cl->MakeHtml("MYMONDRAW"); // Create html output
54  return;
55 }