Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
run_mvtx_client.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file run_mvtx_client.C
1 #include "CommonFuncs.C"
2 
3 #include <onlmon/mvtx/MvtxMonDraw.h>
4 
5 #include <onlmon/OnlMonClient.h>
6 
7 // cppcheck-suppress unknownMacro
8 R__LOAD_LIBRARY(libonlmvtxmon_client.so)
9 
10 void mvtxDrawInit(const int online = 0)
11 {
13  // register histos we want with monitor name
14  //cl->registerHisto("mvtxmon_hist1", "MVTXMON");
15  //cl->registerHisto("mvtxmon_hist2", "MVTXMON");
16  std::string mLaneStatusFlag[3] = { "WARNING", "ERROR", "FAULT" };
17  const int NStaves[3] = { 12, 16, 20 };
18 
19  for(int iflx = 0; iflx < 6; iflx++){
20  std::string instanceName = "MVTXMON_" + std::to_string(iflx);
21  std::cout<<instanceName<<std::endl;
22  cl->registerHisto("MVTXMON_RawData_ChipStaveOcc", instanceName);
23  cl->registerHisto("MVTXMON_RawData_ChipStave1D", instanceName);
24  cl->registerHisto("MVTXMON_RawData_ChipFiredHis", instanceName);
25  cl->registerHisto("MVTXMON_RawData_EvtHitChip", instanceName);
26  cl->registerHisto("MVTXMON_RawData_EvtHitDis", instanceName);
27  cl->registerHisto("MVTXMON_General_Occupancy", instanceName);
28  cl->registerHisto("MVTXMON_LaneStatus_laneStatusOverviewFlagWARNING", instanceName);
29  cl->registerHisto("MVTXMON_LaneStatus_laneStatusOverviewFlagERROR", instanceName);
30  cl->registerHisto("MVTXMON_LaneStatus_laneStatusOverviewFlagFAULT", instanceName);
31 
32  cl->registerHisto("hChipStrobes", instanceName);
33  cl->registerHisto("hChipL1", instanceName);
34 
35  //FEE
36  cl->registerHisto("MVTXMON_FEE_TriggerVsFeeid", instanceName);
37  cl->registerHisto("MVTXMON_FEE_TriggerFlag", instanceName);
38  //cl->registerHisto("MVTXMON/FEE/LaneInfo", instanceName);
39 
40  for (int i = 0; i < MvtxMonDraw::NFlags; i++) {
41  cl->registerHisto(Form("MVTXMON_LaneStatus_laneStatusFlag%s", mLaneStatusFlag[i].c_str()), instanceName);
42  cl->registerHisto(Form("MVTXMON_LaneStatus_laneStatusFlagCumulative%s", mLaneStatusFlag[i].c_str()), instanceName);
43  }
44 
45  for(int i = 0; i < 3; i++){
46  cl->registerHisto(Form("MVTXMON_LaneStatusSummary_LaneStatusSummaryL%i", i), instanceName);
47  }
48 
49  cl->registerHisto("MVTXMON_LaneStatusSummary_LaneStatusSummary", instanceName);
50 
51  //raw task
52  cl->registerHisto("MVTXMON_General_ErrorPlots", instanceName);
53  cl->registerHisto("MVTXMON_General_ErrorFile", instanceName);
54 
55  for (int aLayer = 0; aLayer < 3; aLayer++) {
56  cl->registerHisto(Form("MVTXMON_Occupancy_Layer%dOccupancy", aLayer), instanceName);
57  cl->registerHisto(Form("MVTXMON_Occupancy_Layer%d_Layer%dChipStave", aLayer, aLayer), instanceName);
58  cl->registerHisto(Form("MVTXMON_Noisy_Layer%d_ChipStave", aLayer), instanceName);
59  }
60 
61 
62  //fhr
63  cl->registerHisto("MVTXMON_General_ErrorVsFeeid", instanceName);
64  //cl->registerHisto("MVTXMON_General_Occupancy", instanceName);
65  cl->registerHisto("MVTXMON_General_Noisy_Pixel", instanceName);
66  cl->registerHisto("RCDAQ_evt", instanceName);
67 
68  for (int mLayer = 0; mLayer < 3; mLayer++) {
69  cl->registerHisto(Form("MVTXMON_Occupancy_Layer%d_Layer%dDeadChipPos", mLayer, mLayer), instanceName);
70  cl->registerHisto(Form("MVTXMON_Occupancy_Layer%d_Layer%dAliveChipPos", mLayer, mLayer), instanceName);
71  //cl->registerHisto(Form("MVTXMON/Occupancy/Layer%d/Layer%dChipStaveC", mLayer, mLayer), instanceName);
72  cl->registerHisto(Form("MVTXMON_Occupancy_Layer%dOccupancy_LOG", mLayer), instanceName);
73  }
74 
75  cl->registerHisto("MVTXMON_Occupancy_TotalDeadChipPos", instanceName);
76  cl->registerHisto("MVTXMON_Occupancy_TotalAliveChipPos", instanceName);
77 
78  cl->registerHisto(Form("MVTXMON_chipHitmapFLX%d", iflx), instanceName);
79  }
80 
81 
82 
83 
84  //cl->AddServerHost("localhost"); // check local host first
85  CreateHostList(online);
86  // get my histos from server, the second parameter = 1
87  // says I know they are all on the same node
88 
89  cl->requestHistoBySubSystem("MVTXMON_0", 1);
90  cl->requestHistoBySubSystem("MVTXMON_1", 1);
91  cl->requestHistoBySubSystem("MVTXMON_2", 1);
92  cl->requestHistoBySubSystem("MVTXMON_3", 1);
93  cl->requestHistoBySubSystem("MVTXMON_4", 1);
94  cl->requestHistoBySubSystem("MVTXMON_5", 1);
95  OnlMonDraw *mvtxmon = new MvtxMonDraw("MVTXMONDRAW"); // create Drawing Object
96  cl->registerDrawer(mvtxmon); // register with client framework
97 }
98 
99 void mvtxDraw(const char *what = "ALL")
100 {
101  OnlMonClient *cl = OnlMonClient::instance(); // get pointer to framewrk
102  cl->requestHistoBySubSystem("MVTXMON_0", 1);
103  cl->requestHistoBySubSystem("MVTXMON_1", 1);
104  cl->requestHistoBySubSystem("MVTXMON_2", 1);
105  cl->requestHistoBySubSystem("MVTXMON_3", 1);
106  cl->requestHistoBySubSystem("MVTXMON_4", 1);
107  cl->requestHistoBySubSystem("MVTXMON_5", 1);
108  cl->Draw("MVTXMONDRAW", what); // Draw Histos of registered Drawers
109 }
110 
112 {
113  OnlMonClient *cl = OnlMonClient::instance(); // get pointer to framewrk
114  cl->SavePlot("MVTXMONDRAW"); // Save Plots
115  return;
116 }
117 
118 void mvtxHtml()
119 {
120  OnlMonClient *cl = OnlMonClient::instance(); // get pointer to framewrk
121  cl->MakeHtml("MVTXMONDRAW"); // Create html output
122  return;
123 }