Real random numbers or a binning limit?

Hello Rooters,

I have developed an GUI applications that is going to perform a serie of on-line functions. I’m testing a simple version for a long-term running using gRoot random numbers. After half a billion of samples, it appears a “plateau” in my self-refreshed test canvas like this:

I think that the plateau of the “theorical” gauss-shaped THs is due to a limit in the bin content, but I want to be sure
:open_mouth:

These are my histograms:

 //histos
    fHpx   = new TH1F("hpx","px distribution",100,-4,4);
    fHpy   = new TH1F("hpy","py distribution",100,-4,4);
    fHpxpy = new TH2F("hpxpy","py vs px",40,-4,4,40,-4,4); [/code]

And here the way that I use to fill it (it's a function)

[code] {

    samples++;
    xmain = gRandom->Gaus(-1,1.5);  //mean, sigma
    xs1   = gRandom->Gaus(-0.5,0.5);
    xs2   = gRandom->Gaus(1,0.3);
    //fHpx->SetBinContent(i,xs1);
    fHpx->Fill(xs1);
    fHpy->Fill(xs2);
    fHpxpy->Fill(xs1,xs2);

}//---------------------------

and the way to refresh the canvas (another function):

[code]Refresh(int i){

const Int_t kUPDATE = 500; //refreshing rate

if (!(i % kUPDATE)) {
if (i == kUPDATE) {
    c1->cd();
    fHpx->Draw();
    c2->cd();
    fHpxpy->Draw("cont");
    c3->cd();
    fHpy->Draw();
	}
c1->Modified();
c1->Update();
c2->Modified();
c2->Update();
c3->Modified();
c3->Update();
}

}//-----------------------------
[/code]

So… am I right?
The plateau is because there is a limit filling the bins?
If you want the whole code, just ask

:unamused:

Regards,

Physlock

Yes, with a TH1F (a float per bin) adding 1 to a bin with a bin content
of 0.4 billion is like a noop (max 7 significative digits).
Simply replace TH1F by TH1D

Rene

Thanks !

I did not realized that difference.
Sometimes an image is better that a thousand of experiments, sometimes not :blush:

Best regards,

Juan.