This is a binning effect due to the different number of bins.
Check teh way you are filling your histogram.
Post the shortest possible running script if you still have a problem.
Thank you for your reply. I am still suffering from the same problem. I will attached one of my other macros with the same error. How can I eliminate this binning effect? Could you please help me to solve this problem.
You are creating your histogram between -2pi to 2pi and 70 bins.
However your data are only between -pi and pi. Your edge bins oare only half filled.
Change your binning to [-pi,pi]
TH1D* hist2b = new TH1D(“histo_two_b”, “charged particles #phi distribution for 900GeV”, 60, -2TMath::Pi(), 2TMath::Pi());
I get correct plot. But if I use
TH1D* hist2b = new TH1D(“histo_two_b”, “charged particles #phi distribution for 900GeV”, 70, -2TMath::Pi(), 2TMath::Pi());
So 20,40,60,80,100 bin numbers produces correct histogram but 30,50,70,90 bins produces wrong histogram which
the first and the last channels are half filled. How can I know which binning is correct.
of course (as I already told you) this is a binning effect. Depending on the edges, the bin containing -pi or +pi will get less statistics because -pi and +pi do not correspond to a bin boundary.