33 void httpserver(
const char* jobname =
"job1", Long64_t maxcnt = 0)
35 TString filename = Form(
"%s.root", jobname);
36 TFile *hfile =
new TMemFile(filename,
"RECREATE",
"Demo ROOT file with histograms");
39 TH1F *hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
40 hpx->SetFillColor(48);
41 TH2F *hpxpy =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
42 TProfile *hprof =
new TProfile(
"hprof",
"Profile of pz versus px",100,-4,4,0,20);
43 TNtuple *ntuple =
new TNtuple(
"ntuple",
"Demo ntuple",
"px:py:pz:random:i");
48 THttpServer* serv =
new THttpServer(Form(
"http:8080?top=%s", jobname));
57 serv->SetReadOnly(kFALSE);
63 gBenchmark->Start(jobname);
66 TCanvas *c1 =
new TCanvas(
"c1",
"Dynamic Filling Example",200,10,700,500);
68 c1->GetFrame()->SetFillColor(21);
69 c1->GetFrame()->SetBorderSize(6);
70 c1->GetFrame()->SetBorderMode(-1);
76 const Int_t kUPDATE = 1000;
82 Float_t rnd = random.Rndm(1);
87 if (i<25000) ntuple->Fill(px,py,pz,rnd,i);
88 if (i && (i%kUPDATE) == 0) {
89 if (i == kUPDATE) hpx->Draw();
92 if (i == kUPDATE) hfile->Write();
94 if (gSystem->ProcessEvents())
break;
97 if ((maxcnt>0) && (i>=maxcnt))
break;
100 gBenchmark->Show(jobname);