[Rivet] Converting from ROOT to yoda

David Bjergaard david.bjergaard at gmail.com
Wed Jul 13 21:57:07 BST 2016


Hi Sal,

(Remember me!?) Andy and other devs can advise you better, but to my knowledge
the way to do this would be with YODA's python interface and PyROOT.  Loop over
the TH1s and populate the YODA histogram appropriately.  I don't know how
complicated your root file structure is, but you could make it as fancy (or
simple) as needed. ("less `which make-plots`" to get a decent tutorial on how the
yoda interface works, and PyROOT is its own beast)

Python docs are here: http://yoda.hepforge.org/pydoc/ I'm pretty sure the x2yoda
and yoda2x scripts are not being maintained, but again the authorities know better.

I don't think there is a "off the shelf" solution since the whole Rivet stack is
intended to stand separately from ROOT.

    David
    

Salvatore Rappoccio <rappoccio at gmail.com> writes:

> Hi, Andy, All,
>
> I am trying to convert a file full of histograms from ROOT to yoda. I
> tried to do "root2flat" and then "flat2yoda". I got "root2flat" from
> here:
>
> http://rivet.hepforge.org/svn/tags/rivet-1.6.0/bin/root2flat
>
> I didn't see any root2flat in this SVN area : 
>
> http://rivet.hepforge.org/svn/tags/rivet-2.0.0b1/bin/
>
> Then tried "flat2yoda" but it looks like the schema for the data
> format is not backwards compatible, I get:
>
> cmslpc32:$ flat2yoda CMS_SMP_16_010_data_ptbin0.dat
> Traceback (most recent call last):
> File
> "/cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_10/external/slc6_amd64_gcc530/bin/flat2yoda",
> line 25, in <module>
> analysisobjects = yoda.readFLAT(i)
> File "yoda/include/IO.pyx", line 150, in yoda.core.readFLAT
> (yoda/core.cpp:72398)
> yoda.ReadError: Unexpected line in YODA format parsing when BEGIN
> expected
>
> Any ideas? What should I do here? Where are the most up to date
> instructions?
>
> Cheers,
> Sal
>
>
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> https://www.hepforge.org/lists/listinfo/rivet


More information about the Rivet mailing list