[Rivet] Two-dimensional histograms

David Bjergaard david.bjergaard at gmail.com
Tue Sep 16 19:00:06 BST 2014


Hi James,

Why can't you hold two histos:
hist_pass and hist_fail?

Then the 1D (operator+= ) methods for adding and dividing would work (under the
assumptions imposed by dividing). Then you can do:
hist_denom+=hist_pass;
hist_denom+=hist_fail;
divide(hist_pass,hist_denom);

I (personally) keep a std::map<std::string,Histo1DPtr> container indexed
by string for bookkeeping.   

    Dave

James Robinson <james.robinson at cern.ch> writes:

> Dear experts,
>
> I would like to fill a 2D histogram in Rivet's analyze() function,
> which I then turn into a 1D histogram during finalize(). This would be
> done by iterating along the x-axis and calculating y_bin[0] / (y_bin
> [0] + y_bin[1]). It's basically an efficiency histogram, but there
> doesn't seem to be an existing class that can handle this natively.
> However, naively using bookHisto2D and Histo2DPtr analogously to
> Histo1D doesn't work: these types don't seem to exist.
>
> How would you suggest I go about making the histogram that I need
> using Rivet 2?
>
> Thanks,
> James
>
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> https://www.hepforge.org/lists/listinfo/rivet


More information about the Rivet mailing list