<div dir="ltr">Dear Andy,<br><br>I'm getting an error from Rivet complaining about an invalid efficiency calculation:<br><br><span style="font-family:'courier new',monospace">Rivet_i INFO Rivet_i finalizing</span><br style="font-family:'courier new',monospace"><span style="font-family:'courier new',monospace">Rivet.Analysis.Handler: INFO Finalising analyses</span><br style="font-family:'courier new',monospace"><font face="courier new, monospace">Rivet_i FATAL Standard std::exception is caught<br>Rivet_i ERROR Attempt to calculate an efficiency when the numerator is not a subset of the denominator<br></font><br>However, if I get the code to print out the individual histograms, bin-by-bin, I can't see any bin where the numerator is larger than the denominator:<br><br><font face="courier new, monospace">Rivet.Analysis.ATLAS_STDM_2012_17: INFO There are 263 / 393 entri<div class="gmail_default" style="display:inline">es in the histograms</div><div class="gmail_default" style="display:inline"></div><div class="gmail_default" style="display:inline"> </div><br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 1.1726e+17, total: 1.23204e+17<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 1.01373e+17, total: 1.23149e+17<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 6.85239e+16, total: 1.2764e+17<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 8.20248e+16, total: 1.4139e+17<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"></div><br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 1.65158e+16, total: 4.2562e+16<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 7.17599e+15, total: 1.69049e+16<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 7.2618e+14, total: 2.16647e+16<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 9.2832e+15, total: 2.75894e+16<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 2.69685e+14, total: 3.10438e+14<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 9.55894e+14, total: 9.55894e+14<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 0, total: 1.66588e+15<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 0, total: 0<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 0, total: 0<br>Rivet.Analysis.ATLAS_STDM_2012_17: INFO dy accepted: 0, total: 0<br></font><br>Any idea what I'm doing wrong?<br><br>Thanks,<br>James</div><div class="gmail_extra"><br><div class="gmail_quote">On 17 September 2014 11:13, Andy Buckley <span dir="ltr"><<a href="mailto:andy.buckley@cern.ch" target="_blank">andy.buckley@cern.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 17/09/14 10:38, James Robinson wrote:<br>
><br>
><br>
> On 17 September 2014 11:26, Andy Buckley <<a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a><br>
</span><span class="">> <mailto:<a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a>>> wrote:<br>
><br>
> On 16/09/14 22:53, James Robinson wrote:<br>
> > Dear Andy and David,<br>
> ><br>
> > On 16 September 2014 20:58, Andy Buckley <<a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a> <mailto:<a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a>><br>
</span><span class="">> > <mailto:<a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a> <mailto:<a href="mailto:andy.buckley@cern.ch">andy.buckley@cern.ch</a>>>> wrote:<br>
> ><br>
> > In fact, there is even an efficiency(pass, tot) function that takes 1D<br>
> > histos and returns a Scatter2D with appropriate binomial statistics<br>
> > treatment!<br>
> ><br>
> > Andy<br>
> ><br>
> ><br>
> > I think this is exactly what I want! The binomial error treatment is<br>
> > important for this analysis as the efficiencies tend towards 1.0 in some<br>
> > parts of phase space. What is the appropriate class called?<br>
><br>
> It's a function rather than a bound method (so call it as above):<br>
><br>
> <a href="https://yoda.hepforge.org/trac/browser/include/YODA/Histo1D.h#L426" target="_blank">https://yoda.hepforge.org/trac/browser/include/YODA/Histo1D.h#L426</a><br>
><br>
> We don't yet have the equivalent for 2D histos, but it should be trivial<br>
> to put together from the 1D version. I'll add that to my TODO list, but<br>
> maybe someone else fancies doing it? ;-)<br>
><br>
><br>
> Ah OK. That makes sense. Presumably I still need to book it somehow to<br>
> get it written out? Is there another method to register existing YODA<br>
> objects? Or can the bookScatter2D() function accept an existing<br>
> Scatter2D as it's argument (instead of a bin descriptor)?<br>
<br>
</span>Good points -- I should provide helper methods for doing this in Rivet,<br>
with automatic registration of the output Scatter, like we have for<br>
YODA's divide(h_a,h_b) -> Rivet's divide(h_a,h_b,s_out). I'll add those<br>
to the 2.2.0 release candidate.<br>
<br>
For now I think you can use addAnalysisObject(aoptr) to register any<br>
YODA analysis object. But it's made a little fiddly because YODA returns<br>
a stack-allocated object and what is needed is a new'd heap object. You<br>
might need to do<br>
<br>
Scatter2D s = efficiency(*tmph1, *tmph2);<br>
s.setPath(histoPath("foo"));<br>
addAnalysisObject(s.newclone());<br>
<br>
or similar. It's not very pretty, which is why I should provide the<br>
cosmetic wrapper functions.<br>
<span class="HOEnZb"><font color="#888888"><br>
Andy<br>
<br>
--<br>
Dr Andy Buckley, Royal Society University Research Fellow<br>
Particle Physics Expt Group, University of Glasgow / PH Dept, CERN<br>
</font></span></blockquote></div><br></div>