Drawing histograms and stacked histgrams in batch

Hi,

I am running a macro which draws several histograms, both histograms, filled, stacked, and with markers into the same plot. When running normally the histograms look like they should. When running in batch not all histograms are drawn correctly. It seems like it is the stacked histogram that does not make it. See attached files.

Any way of fixing this?

Thanks,
Maiken




Do you have a small macro reproducing this problem ?

I am afraid that is not so easy. I have one macro which manages to plot correctly in batch mode, and another that does not. And they don’t really do very different things. In case you spot a problem with the actual macros I use, I attach them, however, they are not so simple and straightforward, and you cannot run them, since they rely on other files. If it is too difficult to spot the problem, then just don’t worry. I thought maybe this had been a known issue.

Thanks,
Maiken
iterator.py (13.5 KB)
get_and_plot_evts_frac_qcd.py (11.5 KB)

Which root version are you using ?

maikenp@helicity$ root
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version  5.26/00d    24 August 2010   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.26/00d (tags/v5-26-00d@34963, Aug 24 2010, 13:30:22 on linux)

CINT/ROOT C/C++ Interpreter version 5.17.00, Dec 21, 2008
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.

Applying ATLAS style settings...

That’s not the most recent version. May be you can give a try with the latest version to see if
the problem is still there ?

Thanks, yes I can try that.

Maiken

Looks to me as if the “Non QCD-MC” histogram has a white fill and is simply covering you THStack.

Hi,

thank you for that tip. It seems this is the case. although it is curious that the white-filled histogram only covers the others when I run in batch mode. But it worked fine setting the fill to 0, before drawing it.

This is the sequence I used and worked fine when running in non-batch-mode:

 hStack.Draw("hist same")
 h['mc'].DrawCopy("hist same")
 h['mc'].SetFillStyle(3018)
 h['mc'].SetFillColor(12)
 h['mc'].Draw("e2same")

But in batch mode I need to do this, and that is ok, it is not a big problem to add one line!

 hStack.Draw("hist same")
 h['mc'].SetFillStyle(0) //====> Sett fill to 0 otherwise in batch mode this histogram will cover the stack
 h['mc'].DrawCopy("hist same")
 h['mc'].SetFillStyle(3018)
 h['mc'].SetFillColor(12)
 h['mc'].Draw("e2same")

Thanks a lot!
Maiken

I did a recent fix in the THStack drawing. May be it fixes your problem.