Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:54

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 // cppcheck-suppress unknownMacro
0015 R__LOAD_LIBRARY(libonlmymon_client.so)
0016 
0017 void exampleDrawInit(const int online = 0)
0018 {
0019   OnlMonClient *cl = OnlMonClient::instance();
0020   // register histos we want with monitor name
0021   cl->registerHisto("mymon_hist1", "MYMON_0");
0022   cl->registerHisto("mymon_hist2", "MYMON_0");
0023   cl->registerHisto("mymon_hist1", "MYMON_1");
0024   cl->registerHisto("mymon_hist2", "MYMON_1");
0025   cl->AddServerHost("localhost");  // check local host first
0026   CreateHostList(online);
0027   // get my histos from server, the second parameter = 1
0028   // says I know they are all on the same node
0029   cl->requestHistoBySubSystem("MYMON_0", 1);
0030   cl->requestHistoBySubSystem("MYMON_1", 1);
0031   OnlMonDraw *mymon = new MyMonDraw("MYMONDRAW");  // create Drawing Object
0032   cl->registerDrawer(mymon);            // register with client framework
0033 }
0034 
0035 void exampleDraw(const char *what = "ALL")
0036 {
0037   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0038   cl->requestHistoBySubSystem("MYMON_1",1);         // update histos
0039   cl->requestHistoBySubSystem("MYMON_0",1);         // update histos
0040   cl->Draw("MYMONDRAW", what);                      // Draw Histos of registered Drawers
0041 }
0042 
0043 void exampleSavePlot()
0044 {
0045   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0046   cl->SavePlot("MYMONDRAW");                          // Save Plots
0047   return;
0048 }
0049 
0050 void exampleHtml()
0051 {
0052   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0053   cl->MakeHtml("MYMONDRAW");                        // Create html output
0054   return;
0055 }