Illustrates the advantages of a TH1K histogram.
More...
Go to the source code of this file.
Illustrates the advantages of a TH1K histogram.
void padRefresh(
TPad *pad,
int flag=0);
void hksimple()
{
c1 =
new TCanvas(
"c1",
"Dynamic Filling Example",200,10,600,900);
hpx[0] =
new TH1F(
"hp0",
"Normal histogram",1000,-4,4);
hpx[1] =
new TH1K(
"hk1",
"Nearest Neighbour of order 3",1000,-4,4);
hpx[2] =
new TH1K(
"hk2",
"Nearest Neighbour of order 16",1000,-4,4,16);
for (j=0;j<3;j++) {
gPad->SetFrameFillColor(33);
}
const Int_t kUPDATE = 10;
for (
Int_t i = 0; i <= 300; i++) {
for (j=0;j<3;j++) {hpx[j]->
Fill(px);}
if (i && (i%kUPDATE) == 0) {
padRefresh(c1);
}
}
for (j=0;j<3;j++) hpx[j]->
Fit(
"gaus");
padRefresh(c1);
}
void padRefresh(
TPad *pad,
int flag)
{
if (!pad) return;
if (!tl) return;
if (flag) return;
}
- Author
- Victor Perevovchikov
Definition in file hksimple.C.