This program creates :
- a one dimensional histogram
- a two dimensional histogram
- a profile histogram
- a memory-resident ntuple
These objects are filled with some random numbers and saved on a in-memory file. All objects can be seen in web browser is open url:
void httpserver(
const char* jobname =
"job1",
Long64_t maxcnt = 0)
{
TFile *hfile =
new TMemFile(filename,
"RECREATE",
"Demo ROOT file with histograms");
TH1F *hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
TH2F *hpxpy =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
TProfile *hprof =
new TProfile(
"hprof",
"Profile of pz versus px",100,-4,4,0,20);
TNtuple *ntuple =
new TNtuple(
"ntuple",
"Demo ntuple",
"px:py:pz:random:i");
c1->GetFrame()->SetFillColor(21);
c1->GetFrame()->SetBorderSize(6);
c1->GetFrame()->SetBorderMode(-1);
while (true) {
pz = px*px + py*py;
if (i<25000) ntuple->
Fill(px,py,pz,rnd,i);
}
i++;
if ((maxcnt>0) && (i>=maxcnt)) break;
}
}
- Author
- Sergey Linev
Definition in file httpserver.C.