[Rivet] rivet2 for genser validation.

Andy Buckley andy.buckley at cern.ch
Fri Nov 15 20:19:26 GMT 2013


On 13/11/13 17:15, Dmitri Konstantinov wrote:
> Hi Andy,
> 
> We would like to start using rivet2 for GENSER regression tests.
> First idea is to use simple rivet analyses like MC_XS, MC_WJETS,
> MC_ZJETS etc. It least it looks like a good way.
> And therefore I have a question: what is a best way to analyze/parse
> yoda files?
> It can be done by some regexp parsing...But I don't really like it.
> Is there any way to open them with yoda(python) and access/dump
> observables to some formatted file?
> If yes then could you provide an example?

Hi Dmitri,

Sounds good: let us know if we can help.

Yes, YODA has its own parser and Python interface: definitely use that
rather than trying to write your own! If you have a .yoda file, you can
read it like this (if I remember correctly):

>>> import yoda
>>> histos = yoda.read("myfile.yoda")
>>> for h in histos: print h.path
>>> b = histos[0].bins[0]
>>> print b.width, b.height, b.heightErr, b.sumW

YODA can also do conversion to ROOT objects/files if you want, or plot
using our own plotter (which produces nicer-looking output (we think)
but is less familiar and could benefit from finishing some work which we
began to speed it up and make it more powerful.

Hope that helps,
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