[Rivet] Converting from ROOT to yoda

Andy Buckley andy.buckley at cern.ch
Wed Jul 13 22:15:27 BST 2016


Hi Sal & David,

These scripts are maintained! But they are in YODA rather than Rivet... 
and those Rivet releases you're looking at are *really* old, Sal.

If you get hold of a recent version of YODA, built with ROOT support 
(give --enable-root to the configure script and make sure root-config is 
available), then root2yoda will be installed and should work fine.

Otherwise feel free to write your own PyROOT/YODA script: that's all 
that root2yoda is! 
https://yoda.hepforge.org/hg/yoda/file/tip/bin/root2yoda  (Note that the 
fiddly bit is the ROOT tree walking, which we've abstracted into the 
yoda.root submodule)

And yes, the "flat" format is not designed for robust storage -- I 
didn't know but am not really surprised that it falls over on flat files 
written/read between Rivet versions 1 and 2.

Andy


On 13/07/16 21:57, David Bjergaard wrote:
> 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
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> https://www.hepforge.org/lists/listinfo/rivet
>


-- 
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
Particle Physics Expt Group, University of Glasgow


More information about the Rivet mailing list