Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-07 08:16:10

0001 //
0002 // You need to run 2 servers by executing (in 2 separate root sessions)
0003 // .x run_example_server0.C
0004 // .x run_example_server1.C
0005 // and then start the client
0006 // if you only start one server only one set of histograms will be displayed
0007 
0008 #include "CommonFuncs.C"
0009 
0010 #include <onlmon/example/MyMonDraw.h>
0011 
0012 #include <onlmon/OnlMonClient.h>
0013 
0014 R__LOAD_LIBRARY(libonlmymon_client.so)
0015 
0016 void exampleDrawInit(const int online = 0)
0017 {
0018   OnlMonClient *cl = OnlMonClient::instance();
0019   // register histos we want with monitor name
0020   cl->registerHisto("mymon_hist1", "MYMON_0");
0021   cl->registerHisto("mymon_hist2", "MYMON_0");
0022   cl->registerHisto("mymon_hist1", "MYMON_1");
0023   cl->registerHisto("mymon_hist2", "MYMON_1");
0024   cl->AddServerHost("localhost");  // check local host first
0025   CreateHostList(online);
0026   // get my histos from server, the second parameter = 1
0027   // says I know they are all on the same node
0028   cl->requestHistoBySubSystem("MYMON_0", 1);
0029   cl->requestHistoBySubSystem("MYMON_1", 1);
0030   OnlMonDraw *mymon = new MyMonDraw("MYMONDRAW");  // create Drawing Object
0031   cl->registerDrawer(mymon);            // register with client framework
0032 }
0033 
0034 void exampleDraw(const char *what = "ALL")
0035 {
0036   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0037   cl->requestHistoBySubSystem("MYMON_1",1);         // update histos
0038   cl->requestHistoBySubSystem("MYMON_0",1);         // update histos
0039   cl->Draw("MYMONDRAW", what);                      // Draw Histos of registered Drawers
0040 }
0041 
0042 void exampleSavePlot()
0043 {
0044   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0045   cl->SavePlot("MYMONDRAW");                          // Save Plots
0046   return;
0047 }
0048 
0049 void exampleHtml()
0050 {
0051   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0052   cl->MakeHtml("MYMONDRAW");                        // Create html output
0053   return;
0054 }