26 Bool_t bFillHist = kTRUE;
31 TH1D *hpx =
new TH1D(
"hpx",
"This is the px distribution",100,-4,4);
32 hpx->SetFillColor(48);
34 TH2D *hpxpy =
new TH2D(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
35 hpxpy->SetDirectory(0);
38 THttpServer* serv =
new THttpServer(
"http:8080");
45 serv->Register(
"/", hpx);
46 serv->Register(
"/", hpxpy);
50 serv->SetItemField(
"/",
"_monitoring",
"5000");
51 serv->SetItemField(
"/",
"_layout",
"grid2x2");
52 serv->SetItemField(
"/",
"_drawitem",
"[hpxpy,hpx,Debug]");
53 serv->SetItemField(
"/",
"_drawopt",
"col");
56 serv->RegisterCommand(
"/Start",
"bFillHist=kTRUE;",
"button;rootsys/icons/ed_execute.png");
57 serv->RegisterCommand(
"/Stop",
"bFillHist=kFALSE;",
"button;rootsys/icons/ed_interrupt.png");
64 serv->RegisterCommand(
"/ResetHPX",
"/hpx/->Reset()",
"button;rootsys/icons/ed_delete.png");
65 serv->RegisterCommand(
"/ResetHPXPY",
"/hpxpy/->Reset()",
"button;rootsys/icons/bld_delete.png");
69 serv->CreateItem(
"/Debug",
"debug output");
70 serv->SetItemField(
"/Debug",
"_kind",
"Text");
71 serv->SetItemField(
"/Debug",
"value",
"\\(\\displaystyle{x+1\\over y-1}\\)");
72 serv->SetItemField(
"/Debug",
"mathjax",
"true");
77 const Long_t kUPDATE = 1000;
89 if ((cnt % kUPDATE==0) || !bFillHist) {
93 serv->SetItemField(
"/Debug",
"value", Form(
"\\(\\displaystyle{x+1\\over y-1}\\) Loop:%ld", cnt/kUPDATE));
95 if (gSystem->ProcessEvents())
break;