Disable histogram display with TProofDrawHist

Hello,

I am doing a series of tchain->Draw(…) calls, with proof enabled. Each one is set to redirect the contents to a histogram I create in the current directory. The TProofDrawHist selector that gets run creates a new histogram in the gDirectory that gets continually updated as the query runs. But the subsequent queries give me lots of annoying errors about merging not possible, because I am drawing with different binning each time, for example.

Is it possible to disable the TProofDrawHist’s automatic canvas? Or do I have to try cleaning up the gDirectory myself before each Draw call?

Thanks,
Will

Hi,
Sorry for the late reply.
I am not sure to understand exactly what the problem is, but using option “goff” prevents the canvas to be created

root [] chain.Draw("<var>", "<sel>", "goff")

If this does not help, please provide the simplest code showing the problem and what you would like to achieve.

G. Ganis

The problem is that even with “goff”, I still get a canvas appearing that is updated as the query runs. I want to stop this canvas and associated histogram from being created in the first place. Or is the only option to try cleaning it up afterwards? But how do I know the name of the canvas, since something may already exist with the canvas “c1” name?

Hi,

Really? This may only be the case if you enabled the feedback, which is not enabled by default.

This is only the case if you do not give it an existing histogram to fill, “myvar>>myhist” .

G. Ganis

Ps:
I am not sure that using Draw is the best way to fill histograms, especially if you do not want to have them displayed. A selector where you have all the direct control on what you want to fill and how, possibly in one go, may be a better choice.

How do I disable the feedback? It seems to be enabled by default for me.

I am happy doing multiple Draw calls at the moment, because I do not necessarily want to draw the same histogram each time, which is what a tselector would restrict me to (without adequate customizing with input parameters etc etc). I also like that my code easily works with and without proof then… tselectors seem a pain to get working identically with and without proof (in terms of passing input parameters etc).

[quote=“will_cern”]How do I disable the feedback? It seems to be enabled by default for me.
[/quote]
The temporary histograms are only drawn if you have TDrawFeedback object created somewhere. But even if these are drawn, they should really interfere with your final result, they are completely decoupled when it comes to your client session.

Does this create any graphics:

root [] TProof *p = TProof::Open("")
root [] TChain chain("h42")
root [] chain.Add("http://root.cern.ch/files/h1/dstarmb.root")
root [] chain.SetProof()
root [] chain.Draw("md0_d", "", "goff")

G. Ganis

No that doesn’t produce anything, but it didn’t run for very long. The feedback canvas appears after a couple of seconds normally - if the query finishes before that then I don’t get any canvas.

I honestly haven’t (to my knowledge) done anything to enable feedback, and it is quite annoying because the feedback histogram produces a stack of “Merge” errors as it gets updated. Yes, it doesn’t interfere with the end result, but it’s just getting in the way of my other output info.

Yes, but the feedback canvas is only plotted if a something catches the signal emitted when receiving the feedback objects.

Anyhow, you can set the feedback period to a very long value and see if it helps, e.g.

proof->SetParameter("PROOF_FeedbackPeriod", (Long_t)14400000)  // 4 h in millisecs

But again, you should not get any merging error from the feedback objects.
Can you produce the simplest code reproducing the problem?
Otherwise, from my side, it will be impossible to give you any additional advise.

G. Ganis

Ps: please also mention the ROOT version that you are using …

The following code, in version 5.32.00, causes a feedback canvas to appear for me:

  TFile f1("/tmp/tree.root","RECREATE");
  TTree* t = new TTree("myTree","myTree");

  Double_t var = 0;
  t->Branch("var",&var);
  TRandom3 rand;

  for(int i=0;i<20000000;i++) {
    var = rand.Uniform();
    t->Fill();
  }
  f1.Write();

  f1.Close();

  TChain c("myTree");
  c.Add("/tmp/tree.root");

  TProof::Open("workers=2");
  c.SetProof(true);

  c.Draw("var","","goff");

I can try using that feedback period feature, but it would be nice to understand why this feedback appears when you say it shouldn’t.

Hi,

The reason why I wan not seeing the problem with the trunk is that it was in fact fixed a few weeks ago.
(TProofChain was creating the TDrawFeedback object automatically).
I have just ported the fix back to 5.30-patches and 5.32-patches so that it gets included in the next tags on those branches.

The only workaround is to increase the feedback period.

G. Ganis

OK Thanks.

Ignore what I previously wrote on this post. If I continue to have problems I’ll write a minimal code example.

Actually… my problems are now related to why when I do a tchain->Draw(“var>>+myHist”) I end up with multiple copies of the histogram in the gDirectory.

E.g. I created a histogram (myHist), left it in the gDirectory, and then called:

chain->Draw(“var>>+myHist”,"",“goff”);

after which I find the gDirectory has 3 TH1D in it, all called “myHist”.

Can you explain why multiple copies are getting made by the proof mechanism?

Thanks!

P.S. Increasing the feedback period doesn’t seem to stop the feedback hists appearing, and my attempts to cleanup the gDirectory after each chain->Draw(…) (with a simple while loop to delete all objects called myHist) seems to be causing proof to crash!