When I try to read branches from a root file, and plot variables, the histogram I plot is much different from that TBrowser plots .
I think the problem lies in the TH* constructor, in which I failed to give the right xbins, xmin, xmax.
I wonder is there any way to get the “right” parameters, which can give the same plot TBrowser does.
Thanks for your time.
simply specify xmin=xmax=0 and the binning will be automatic
[quote=“brun”]simply specify xmin=xmax=0 and the binning will be automatic
TH2F* f2 = new TH2F("hello","hello",100,0,0,100,0,0);?
I think I have to use the stupid way. Use TBrowser to plot the branch, then “inspect” the plot to get the bin number Xbin and Xmin, Xmax.
TH1F* f1 = new TH2F("hello","hello",Xbin,Xmin,Xmax);