3 #include <onlmon/OnlMonClient.h>
4 #include <onlmon/OnlMonDB.h>
9 #include <TGraphErrors.h>
39 if (name ==
"ZdcMon1")
42 TC[0] =
new TCanvas(name.c_str(),
"ZdcMon Example Monitor", -1, 0, xsize / 2, ysize);
47 gSystem->ProcessEvents();
48 Pad[0] =
new TPad(
"zdcpad1",
"who needs this?", 0.1, 0.5, 0.9, 0.9, 0);
49 Pad[1] =
new TPad(
"zdcpad2",
"who needs this?", 0.1, 0.05, 0.9, 0.45, 0);
53 transparent[0] =
new TPad(
"transparent0",
"this does not show", 0, 0, 1, 1);
56 TC[0]->SetEditable(
false);
58 else if (name ==
"ZdcMon2")
61 TC[1] =
new TCanvas(name.c_str(),
"ZdcMon2 Example Monitor", -xsize / 2, 0, xsize / 2, ysize);
62 gSystem->ProcessEvents();
63 Pad[2] =
new TPad(
"zdcpad3",
"who needs this?", 0.1, 0.5, 0.9, 0.9, 0);
64 Pad[3] =
new TPad(
"zdcpad4",
"who needs this?", 0.1, 0.05, 0.9, 0.45, 0);
68 transparent[1] =
new TPad(
"transparent1",
"this does not show", 0, 0, 1, 1);
71 TC[1]->SetEditable(
false);
80 if (what ==
"ALL" || what ==
"FIRST")
85 if (what ==
"ALL" || what ==
"SECOND")
92 std::cout << __PRETTY_FUNCTION__ <<
" Unimplemented Drawing option: " << what << std::endl;
101 TH1 *zdc_adc_south = cl->
getHisto(
"ZDCMON_0",
"zdc_adc_south");
102 TH1 *zdc_adc_north = cl->
getHisto(
"ZDCMON_0",
"zdc_adc_north");
103 if (!gROOT->FindObject(
"ZdcMon1"))
107 TC[0]->SetEditable(
true);
114 zdc_adc_south->Scale(1/zdc_adc_south->Integral(),
"width");
115 zdc_adc_south->DrawCopy();
120 TC[0]->SetEditable(
false);
128 zdc_adc_north->Scale(1/zdc_adc_north->Integral(),
"width");
129 zdc_adc_north->DrawCopy();
132 PrintRun.SetTextFont(62);
133 PrintRun.SetTextSize(0.04);
135 PrintRun.SetTextAlign(23);
136 std::ostringstream runnostream;
138 time_t evttime = cl->
EventTime(
"CURRENT");
141 <<
", Time: " << ctime(&evttime);
142 runstring = runnostream.str();
144 PrintRun.DrawText(0.5, 1., runstring.c_str());
147 TC[0]->SetEditable(
false);
154 TH1 *zdc_adc_south = cl->
getHisto(
"ZDCMON_0",
"zdc_adc_south");
155 TH1 *zdc_adc_north = cl->
getHisto(
"ZDCMON_0",
"zdc_adc_north");
156 if (!gROOT->FindObject(
"ZdcMon2"))
160 TC[1]->SetEditable(
true);
165 zdc_adc_south->DrawCopy();
170 TC[1]->SetEditable(
false);
176 zdc_adc_north->DrawCopy();
179 PrintRun.SetTextFont(62);
180 PrintRun.SetTextSize(0.04);
182 PrintRun.SetTextAlign(23);
183 std::ostringstream runnostream;
185 time_t evttime = cl->
EventTime(
"CURRENT");
188 <<
", Time: " << ctime(&evttime);
189 runstring = runnostream.str();
191 PrintRun.DrawText(0.5, 1., runstring.c_str());
194 TC[1]->SetEditable(
false);
202 int iret =
Draw(what);
208 for (TCanvas *canvas :
TC)
210 if (canvas ==
nullptr)
224 int iret =
Draw(what);
242 std::ofstream
out(logfile.c_str());
243 out <<
"<HTML><HEAD><TITLE>Log file for run " << cl->
RunNumber()
244 <<
"</TITLE></HEAD>" << std::endl;
245 out <<
"<P>Some log file output would go here." << std::endl;
249 std::ofstream out2(status.c_str());
250 out2 <<
"<HTML><HEAD><TITLE>Status file for run " << cl->
RunNumber()
251 <<
"</TITLE></HEAD>" << std::endl;
252 out2 <<
"<P>Some status output would go here." << std::endl;