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);
hpx->SetFillColor(48);
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;
hpx->Fill(px);
if (i < 25000) ntuple->Fill(px,py,pz,rnd,i);
if (
gSystem->ProcessEvents())
break;
}
i++;
if ((maxcnt>0) && (i>=maxcnt)) break;
}
}
int Int_t
Signed integer 4 bytes (int).
long long Long64_t
Portable signed long integer 8 bytes.
float Float_t
Float 4 bytes (float).
externTBenchmark * gBenchmark
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsize=0) override
Write memory objects to this file.
1-D histogram with a float per channel (see TH1 documentation)
2-D histogram with a float per channel (see TH1 documentation)
Int_t Fill(Double_t) override
Invalid Fill method.
Online http server for arbitrary ROOT application.
void SetReadOnly(Bool_t readonly=kTRUE)
Set read-only mode for the server (default on).
A TMemFile is like a normal TFile except that it reads and writes only from memory.
A simple TTree restricted to a list of float variables only.
Int_t Fill(const Double_t *v)
Random number generator class based on M.
Double_t Rndm() override
Machine independent random number generator.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.