Basic question on Histograms

Hi everyone,
Sorry I have to ask this question which may seems basic to you.

My question concern the histograms! So, I know there is TH1,TH2,TH3
1/
But if I would like to add a signal into an histogram (for example (t,y) ) then, should I use :

-TH1 : hisot->Fill(t,y) (FFT.C example)
-TH2 :histo->Fill(t,y)

Ps:My signal is not a math expression to evaluate, but a set of data points I read from an ASCII file.

I think that the 2 solutions are right, but if so! what’s the difference then between TH2 and TH1 :blush:

2/
When I create a TH2D histogram, with:
for(expression)
{
for(i=0,i<N;i++)
{
histo->fill(index,t[i],y[i]);
}
index++;
}
I’m using this solution when I have millions of data lines in y, so I take sub signals of y with the length N.
What should then number of xbins and ybins at that case?

Thank you in advance! :slight_smile:

Hi,

See the users guide:
root.cern.ch/drupal/content/users-guide
And more specifically about histograms:
root.cern.ch/download/doc/Histograms.html
And this one could also be very useful:
root.cern.ch/download/doc/primer/ROOTPrimer.html

Cheers, Bertrand.

Thank you Mr.Bertrand! very interesting websites!:slight_smile: