[Rivet] 2D Histograms in Rivet

Hendrik Hoeth hendrik.hoeth at cern.ch
Tue Jul 31 21:48:43 BST 2012


Hi Sercan,

> However, the color coding does not represent the number of events. As
> you know rivet normalize the histograms to the bin sizes by default.
> Therefore, what we see on the color scale is the values divided by
> binsize_x * binsize_y . It depends what you want to show but would be
> more meaningful if this 'by default' bin size normalization don't be
> applied for 2D histograms.

A basic property of a histogram (in contrast to a bar chart) is that its
values are invariant under changes of the binning. Your suggestion to
count entries would destroy this property. What you would then get is
not a histogram anymore. I am aware that this is not what you are used
from ROOT.

If, for a specifiy use case, you need the sum of weights ("number of
events"), you'll have to do what you did: Scale with the bin size.
Either in the weight, or after the fact in the finalize() method.

> Anyway. I've tried a few tricks to get rid of this blue background in
> Rivet 2D histograms, however, couldn't find an easy solution yet.
> Before digging the codes I would like to ask you, if there is any
> simple way to remove this blue background ?
> 
> ( btw, it's easy to understand from the histogram but let me tell you
> that myValues are always > 0. and this blue region does not
> corresponds to the 0 on the color scale. )

Oh yes, the blue area *does* correspond to the 0 on the color scale.
You've never filled those bins, so the bin content *is* zero, and
according to the color scale this means blue.

If you don't want to plot empty bins, you can delete them from the .dat
file and then replot with make-plots. To do this, the easiest way is
sed, i.e. something like

sed -i "/\t0.000000e+00\t0.000000e+00$/d" yourplotfile.dat

Cheers,

    Hendrik

-- 
Journalist: "Can you explain 5 sigma as 99.999something percent?"
Fabiola G.: "Sure, that's 3*10^-7."
(after the CERN Higgs seminar, 4 July 2012)


More information about the Rivet mailing list