Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-05 08:16:03

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