File indexing completed on 2025-08-03 08:20:54
0001 #include "CommonFuncs.C"
0002 #include <onlmon/tpot/TpotMonDraw.h>
0003 #include <onlmon/OnlMonClient.h>
0004
0005 #include <array>
0006 #include <fstream>
0007
0008
0009 R__LOAD_LIBRARY(libonltpotmon_client.so)
0010
0011 void tpotDrawInit(const int online = 0)
0012 {
0013
0014 auto cl = OnlMonClient::instance();
0015
0016
0017 auto tpotmon = new TpotMonDraw("TPOT");
0018 std::string servername = "TPOTMON_0";
0019 tpotmon->AddServer(servername);
0020
0021
0022 const std::string local_calibration_filename( "TPOT_Pedestal-000.root" );
0023 if( std::ifstream( local_calibration_filename ).good() )
0024 { tpotmon->set_calibration_file( local_calibration_filename ); }
0025
0026 tpotmon->set_sample_window( {0, 50} );
0027 tpotmon->set_sample_window_signal( {3, 18} );
0028 cl->registerDrawer(tpotmon);
0029
0030
0031 const auto detector_names = tpotmon->get_detnames_sphenix();
0032
0033
0034 for( const std::string& hname: { "m_counters", "m_detector_occupancy_phi", "m_detector_occupancy_z", "m_resist_occupancy_phi", "m_resist_occupancy_z" } )
0035 { cl->registerHisto( hname, "TPOTMON_0" ); }
0036
0037 for( const std::string& hname: { "m_adc_sample", "m_adc_channel", "m_sample_channel" , "m_counts_sample", "m_hit_charge", "m_hit_multiplicity", "m_wf_vs_channel", "m_hit_vs_channel", "m_heartbeat_vs_channel" } )
0038 {
0039 for( const auto& detname : detector_names )
0040 { cl->registerHisto( hname+"_"+detname, "TPOTMON_0" ); }
0041 }
0042
0043
0044 CreateSubsysHostlist("tpot_hosts.list", online);
0045
0046
0047
0048 cl->requestHistoBySubSystem("TPOTMON_0", 1);
0049 }
0050
0051 void tpotDraw(const char *what = "ALL")
0052 {
0053 auto cl = OnlMonClient::instance();
0054 cl->requestHistoBySubSystem("TPOTMON_0",1);
0055 cl->Draw("TPOT", what);
0056 }
0057
0058 void tpotSavePlot()
0059 { OnlMonClient::instance()->SavePlot("TPOT"); }
0060
0061 void tpotHtml()
0062 { OnlMonClient::instance()->MakeHtml("TPOT"); }