I have data which I want to represent by a histogram.
Two notes before question:
I do not know the range in that data in advance. So I would like to not specify ranges of a histogram.
In order to further analysis, for example, to compare this data with other which is also represented by a similar histogram, I want histograms to have the same bin width. And I know this value of desired width in advance.
All histograms are TH1I integer type.
Taking into account the first note I create a histogram as follows:
TH1I hist = new TH1I( name, title, Nbins, 0, 0);
On the other hand it fixes bin width implicitly (by specifying number of bins) which is not desired.
Question: How to set fixed bin width without knowing range of a histogram in advance? If possible.
It is in separate files. Actually it is .dat files from CAEN ADC. Few lines of such a file are (in this case 2nd column is ADC channel, 3rd - base line):
0 1115 1100
1 1116 1100
2 1116 1100
...
I.e. I read these files line by line in a loop and fill histograms each iteration.