Rebin and Error in <TAxis::TAxis::Set>: bins must be in incr

Hi,

I am having problems trying to rebin a histogram. I keep getting the error-message [quote]Error in TAxis::TAxis::Set: bins must be in increasing order[/quote]

This is a pseudo-code of how I am doing things:


 hist_orig = TH1F("hist","",400,0,400)
#Do some filling
#....

#define the new bins-low edges:
           x_mll = array([   0.,    5.,   10.,   15.,   20.,   25.,   30.,   35.,   40.,
         45.,   50.,   55.,   60.,   65.,   70.,   75.,   80.,   85.,
         90.,   95.,  100.,  105.,  110.,  115.,  110.,  120.,  130.,
        140.,  150.,  170.,  190.,  210.,  230.,  250.,  270.,  300.,
        330.,  360.,  400.])


#rebin 
hist_rebinned = hist_orig.Rebin(len(x_mll)-1,"rebinned",x_mll)

I have tried various ngroup values, but keep getting the error-message above. What am I doing wrong?

Thank you very much,

Maiken

Yes, and there I found my own mistake. And that the ROOT error message made perfect sense. I had a repeating entry 110 after entry 115. So that did not make sense!

Problem solved!
Maiken