TH1F rebin (with editor) problem

I would like to be able to interactively change the binning on a TH1F and see the results change in real time. I didn’t know this was actually possible, until I played with the “Editor” feature in the “View” menu. Somehow, I’ve made it so that for some histograms, I can interactively change the binning (as in the attachment CanEdit.png), but on other histograms, I can’t (see attachment CantEdit.png) I’m trying to figure out what is different about the histograms. I didn’t attach any code, since my analysis code is many many many lines long. I fill the histos with standard draw commands, ah-la:

TH1F *h0 = new TH1F(“h0”,“h0”,10,0,100);
myTree->Draw(“a>>h0”,myCut);

any idea on why I can edit some, but not others?



You do not describe what is precisely your problem. However, may be some guess:
-When doing tree.Draw(“var>>h”), all the entries filling h are still in memory. You can use all the features of the rebinner (offsets, etc).
-if you do
tree.Draw(“var>>h1”), followed by
tree.Draw(“var>>h2”), the original entries with all the details for h1 have been replaced by the ones for h2. In this case you can only rebin by steps of 2, 3, etc, but you cannot change the offsets.

Rene

ah, yes, that is the answer. The last histogram that I draw using TTree::Draw() has the data in memory, and so lets me resize it.

Wow, you guys are very responsive, as always!

Thanks

jesse