[Rivet] Question concerning histograms

Andy Buckley andy.buckley at ed.ac.uk
Wed Sep 21 12:33:24 BST 2011


On 21/09/11 12:12, Martin Stoll wrote:
> Dear Rivet,
>
> I'm writing a Rivet analysis right now and want to ask you something
> about histograms.
> I want to fill AIDA::IHistogram1D* _histo (which has non-uniformly
> distributed bins) with data, so for each bin I call fill and pass the
> desired value as weight. But it seems I have to somehow scale the value
> with the bin width instead:
> _histo->fill( _histo->binMean(i), myValue * _histo->axis().binWidth(i) )
> which seems awkward, but does produce the right plot.

Hi Martin,

So you want to make a histogram where the bin widths are not taken into 
account in the plotting? Getting picky on definitions, a "histogram" as 
opposed to a "bar chart" always has to account for the width -- 
otherwise the shape of the resulting distribution will not be invariant 
under changes of binning.

What is the application that needs the bin width to be ignored? In Rivet 
at the moment the only way is to explicitly multiply in the bin width 
like you're doing, but we could add a bar chart datatype to the new 
histogramming coming in Rivet 2.0 if there's a compelling use case.

Thanks for getting in touch,
Andy

-- 
Dr Andy Buckley
SUPA Advanced Research Fellow
Particle Physics Experiment Group, University of Edinburgh

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Rivet mailing list