Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "CommonFuncs.C"
0002 
0003 #include <onlmon/hcal/HcalMonDraw.h>
0004 
0005 #include <onlmon/OnlMonClient.h>
0006 
0007 // cppcheck-suppress unknownMacro
0008 R__LOAD_LIBRARY(libonlhcalmon_client.so)
0009 
0010 void ihcalDrawInit(const int online = 0)
0011 {
0012   OnlMonClient *cl = OnlMonClient::instance();
0013   OnlMonDraw *hcalmon = new HcalMonDraw("IHCALMONDRAW");  // create Drawing Object
0014   // register histos we want with monitor name
0015   for (int serverid = 0; serverid < 2; serverid++)
0016   {
0017     std::string servername = "IHCALMON_" + std::to_string(serverid);
0018     hcalmon->AddServer(servername);
0019     cl->registerHisto("h2_hcal_hits", servername);
0020     cl->registerHisto("h2_hcal_rm", servername);
0021     cl->registerHisto("h2_hcal_rm_alltrig", servername);
0022     cl->registerHisto("h2_hcal_mean", servername);
0023     cl->registerHisto("h2_hcal_time", servername);
0024     cl->registerHisto("h2_hcal_waveform", servername);
0025     cl->registerHisto("h2_hcal_correlation", servername);
0026     cl->registerHisto("h_event", servername);
0027     cl->registerHisto("h_sectorAvg_total", servername);
0028     cl->registerHisto("h_waveform_twrAvg", servername);
0029     cl->registerHisto("h_waveform_time", servername);
0030     cl->registerHisto("h_waveform_pedestal", servername);
0031     cl->registerHisto("h_ntower", servername);
0032     cl->registerHisto("h1_packet_chans", servername);
0033     cl->registerHisto("h1_packet_length", servername);
0034     cl->registerHisto("h1_packet_number", servername);
0035     cl->registerHisto("h1_packet_event", servername);
0036     cl->registerHisto("h_evtRec", servername);
0037     cl->registerHisto("p2_pre_post",servername);
0038     for (int itrig = 0; itrig < 64; itrig++)
0039     {
0040       cl->registerHisto(Form("h2_hcal_hits_trig_%d", itrig), servername);
0041     }
0042     cl->registerHisto("h_hcal_trig", servername);
0043     cl->registerHisto("pr_zsFrac_etaphi", servername);
0044     cl->registerHisto("pr_zsFrac_etaphi_all", servername);
0045 
0046     for (int ih = 0; ih < 32; ih++)
0047     {
0048       cl->registerHisto(Form("h_rm_sectorAvg_s%d", ih), servername);
0049     }
0050     for (int ieta = 0; ieta < 24; ieta++)
0051     {
0052       for (int iphi = 0; iphi < 64; iphi++)
0053       {
0054         cl->registerHisto(Form("h_rm_tower_%d_%d", ieta, iphi), servername);
0055       }
0056     }
0057   }
0058 
0059   // for local host, just call ihcalDrawInit(2)
0060   CreateSubsysHostlist("hcal_hosts.list", online);
0061   // get my histos from server, the second parameter = 1
0062   // says I know they are all on the same node
0063   for (auto iter = hcalmon->ServerBegin(); iter != hcalmon->ServerEnd(); ++iter)
0064   {
0065     cl->requestHistoBySubSystem(iter->c_str(), 1);
0066   }
0067 
0068   cl->registerDrawer(hcalmon);  // register with client framework
0069 }
0070 
0071 void ihcalDraw(const char *what = "ALL")
0072 {
0073   OnlMonClient *cl = OnlMonClient::instance();          // get pointer to framewrk
0074   OnlMonDraw *hcalmon = cl->GetDrawer("IHCALMONDRAW");  // get pointer to this drawer
0075   for (auto iter = hcalmon->ServerBegin(); iter != hcalmon->ServerEnd(); ++iter)
0076   {
0077     cl->requestHistoBySubSystem(iter->c_str(), 1);
0078   }
0079   cl->Draw("IHCALMONDRAW", what);  // Draw Histos of registered Drawers
0080 }
0081 
0082 void ihcalSavePlot()
0083 {
0084   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0085   cl->SavePlot("IHCALMONDRAW");                 // Save Plots
0086   return;
0087 }
0088 
0089 void ihcalHtml()
0090 {
0091   OnlMonClient *cl = OnlMonClient::instance();  // get pointer to framewrk
0092   cl->MakeHtml("IHCALMONDRAW");                 // Create html output
0093   return;
0094 }