Re: PROOF: TTree::Draw() strangeness with canvas handling

From: Thiemo Nagel <thiemo.nagel_at_ph.tum.de>
Date: Mon, 2 Feb 2009 15:10:11 +0100


Dear Gerardo,

> The small statistics problem should have been fixed in the trunk.

Fine.

> In the trunk, I have also fixed a problem preventing
>
> hnew = new TH1F("hnew", "hnew", 100, 0, 10.);
> t->Draw("var>>hnew", "", "", 100);
>
> to work.

Perfect! This already had bothered me in the past...

> The problem with the duplicated entries in the feedback list should
> also be fixed.
>
> Please let me know if you try.

Great! I can confirm that it's fixed in r27275.

However I'm still not happy with the canvas handling.

Two examples:

  1. Starting a fresh ROOT session with

chain->Draw("bla>>(100, 0, 100)")

will create a canvas called htemp that is both used for feedback and to plot the final histogram. That's fine.

Calling the same again

chain->Draw("bla>>(100, 0, 100)")

will reuse the same canvas for feedback and also for the final histogram. That's fine.

B) If I start a fresh ROOT session and call

chain->Draw("bla>>histo1(100, 0, 100)")

I will get a canvas called histo1_canvas which again is both used for feedback and for the final histogram, which is fine again.

But if I now start another

chain->Draw("bla>>histo2(100, 0, 100)")

this will create a new canvas called histo2_canvas (for feedback) but also will overwrite the existing histo1_canvas with the final result, which I find rather counter-intuitive.

I think it would be more consistent, if
1) either both the feedback and final histograms would be plotted to the existing histo1_canvas (honoring that it is the "active" canvas) 2) or both feedback and final histogram would be plotted in the new histo2_canvas (avoiding to clobber the existing canvas)

The current "mixed" way writes to two different canvases, clobbering my previous result for no apparent reason. I managed to arrive at case 2) by middle-clicking into the feedback canvas while the Draw() was still running, however I have no idea how to achieve this by means of a script.

Any ideas?

Thank you,

Thiemo

-- 
+-----------------------------------+--------------------------+
| Dipl.-Phys. Thiemo Nagel          |                          |
| Technische Universitaet Muenchen  | Room    PH1 3276         |
| Physik-Department E18             |                          |
| James-Franck-Strasse              | Phone  +49 89 289-12379  |
| D-85747 Garching                  | Fax    +49 89 289-12570  |
+-----------------------------------+--------------------------+
Received on Mon Feb 02 2009 - 15:10:16 CET

This archive was generated by hypermail 2.2.0 : Tue Feb 03 2009 - 17:50:01 CET