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
0008 R__LOAD_LIBRARY(libonlhcalmon_client.so)
0009
0010 void ohcalDrawInit(const int online = 0)
0011 {
0012 OnlMonClient *cl = OnlMonClient::instance();
0013 OnlMonDraw *hcalmon = new HcalMonDraw("OHCALMONDRAW");
0014
0015 for (int serverid = 0; serverid < 2; serverid++)
0016 {
0017 std::string servername = "OHCALMON_" + 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
0060 CreateSubsysHostlist("hcal_hosts.list", online);
0061
0062
0063 for (auto iter = hcalmon->ServerBegin(); iter != hcalmon->ServerEnd(); ++iter)
0064 {
0065 cl->requestHistoBySubSystem(iter->c_str(), 1);
0066 }
0067
0068 cl->registerDrawer(hcalmon);
0069 }
0070
0071 void ohcalDraw(const char *what = "ALL")
0072 {
0073 OnlMonClient *cl = OnlMonClient::instance();
0074 OnlMonDraw *hcalmon = cl->GetDrawer("OHCALMONDRAW");
0075 for (auto iter = hcalmon->ServerBegin(); iter != hcalmon->ServerEnd(); ++iter)
0076 {
0077 cl->requestHistoBySubSystem(iter->c_str(), 1);
0078 }
0079 cl->Draw("OHCALMONDRAW", what);
0080 }
0081
0082 void ohcalSavePlot()
0083 {
0084 OnlMonClient *cl = OnlMonClient::instance();
0085 cl->SavePlot("OHCALMONDRAW");
0086 return;
0087 }
0088
0089 void ohcalHtml()
0090 {
0091 OnlMonClient *cl = OnlMonClient::instance();
0092 cl->MakeHtml("OHCALMONDRAW");
0093 return;
0094 }