|
[Rivet] Two-dimensional histogramsAndy Buckley andy.buckley at cern.chWed Sep 17 10:26:43 BST 2014
On 16/09/14 22:53, James Robinson wrote: > Dear Andy and David, > > On 16 September 2014 20:58, Andy Buckley <andy.buckley at cern.ch > <mailto:andy.buckley at cern.ch>> wrote: > > In fact, there is even an efficiency(pass, tot) function that takes 1D > histos and returns a Scatter2D with appropriate binomial statistics > treatment! > > Andy > > > I think this is exactly what I want! The binomial error treatment is > important for this analysis as the efficiencies tend towards 1.0 in some > parts of phase space. What is the appropriate class called? It's a function rather than a bound method (so call it as above): https://yoda.hepforge.org/trac/browser/include/YODA/Histo1D.h#L426 We don't yet have the equivalent for 2D histos, but it should be trivial to put together from the 1D version. I'll add that to my TODO list, but maybe someone else fancies doing it? ;-) > On 16/09/14 19:00, David Bjergaard wrote: > > 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 > > > This is also fine, but I was trying to minimise the number of > extraneous histograms that the code booked (that I would then need to > remove). I'll just mention a virtually unknown feature (added with a view to future plans for "advanced histogram handling") which is that booking a histogram with a "/TMP/" element in its path will automatically *not* be written into the output YODA file. So if you know that you only want some histograms to exist in memory, not be written out, book them with something like bookHisto1D("TMP/foo", refData(1,1,1)) which will make a temporary, auto-deleting histogram with the same binning as a permanent bookHisto1D(1,1,1) corresponding to the d01-x01-y01 HepData histo. Hope that's useful. > As far as Andy's other questions/suggestions go. I'm using the ATLAS > packaged version of Rivet. I'm not sure which Rivet version this is, but > the athena version is 19.0.2.1. Perhaps you'd recommend a newer release, > Andy? I always recommend using the latest production releases. They are listed here (scroll down to the "patch releases" section): http://atlas-computing.web.cern.ch/atlas-computing/links/buildDirectory/www/ and the latest is 19.1.3.2. Checking against the base releases, 19.0.2 contains Rivet 2.1.1 and 19.1.3 contains Rivet 2.1.2, so you should upgrade. Rivet 2.2.0 should be coming out very soon, which will presumably require ATLAS 19.1.4 or a later release. 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 |