Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
run_tpot_client.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file run_tpot_client.C
1 #include "CommonFuncs.C"
2 #include <onlmon/tpot/TpotMonDraw.h>
3 #include <onlmon/OnlMonClient.h>
4 
5 #include <array>
6 
7 // cppcheck-suppress unknownMacro
8 R__LOAD_LIBRARY(libonltpotmon_client.so)
9 
10 void tpotDrawInit(const int online = 0)
11 {
12  // client
13  auto cl = OnlMonClient::instance();
14 
15  // create drawing object and register
16  auto tpotmon = new TpotMonDraw("TPOT");
17  cl->registerDrawer(tpotmon);
18 
19  // get detector names
20  const auto detector_names = tpotmon->get_detnames_sphenix();
21 
22  // register histograms
23  for( const std::string& hname: { "m_counters", "m_detector_occupancy_phi", "m_detector_occupancy_z", "m_resist_occupancy_phi", "m_resist_occupancy_z" } )
24  { cl->registerHisto( hname, "TPOTMON_0" ); }
25 
26  for( const std::string& hname: { "m_adc_sample", "m_counts_sample", "m_hit_charge", "m_hit_multiplicity", "m_hit_vs_channel" } )
27  {
28  for( const auto& detname : detector_names )
29  { cl->registerHisto( hname+"_"+detname, "TPOTMON_0" ); }
30  }
31 
32  // list of hosts from where histograms should be retrieved
33  CreateHostList(online);
34 
35  // get my histos from server, the second parameter = 1
36  // says I know they are all on the same node
37  cl->requestHistoBySubSystem("TPOTMON_0", 1);
38 }
39 
40 void tpotDraw(const char *what = "ALL")
41 {
42  auto cl = OnlMonClient::instance();
43  cl->requestHistoBySubSystem("TPOTMON_0",1);
44  cl->Draw("TPOT", what);
45 }
46 
48 { OnlMonClient::instance()->SavePlot("TPOT"); }
49 
50 void tpotHtml()
51 { OnlMonClient::instance()->MakeHtml("TPOT"); }