|
[Rivet] Two-dimensional histogramsAndy Buckley andy.buckley at cern.chTue Sep 16 18:50:58 BST 2014
On 16/09/14 18:40, James Robinson wrote: > 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? Hi James, What version are you using? These functions should exist in the most recent releases of Rivet and YODA. YODA's 2D histograms are not quite complete, specifically because we want to allow you to do exactly the 2D -> 1D marginalising that you mentioned (only the marginalising function would be built-in rather than need to be done by hand)... and that means also storing "binned" outflow distributions around the boundaries of the 2D in-range rectangle. Coming up with an intuitive interface for that (especially for the "corner" outflows!) has been difficult. But since no-one is used to that functionality (ROOT doesn't do it either) we have been taking our time and trying to get it right! For now I guess the workaround is to use really large axis ranges / a really big final bin on the marginalised axis so that the out-of-range contribution is negligible. But you should be able to create the in-range 2D histos just fine, and do I/O with them. Cheers, Andy -- Dr Andy Buckley, Royal Society University Research Fellow Particle Physics Expt Group, University of Glasgow / PH Dept, CERN
More information about the Rivet mailing list |