<div dir="ltr">Thanks Andy,<div><br></div><div>So just to completely clarify, we should not use the "root2flat" macro anymore?</div><div><br></div><div>Cheers,</div><div>Sal</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 13, 2016 at 5:15 PM, 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">Hi Sal & David,<br>
<br>
These scripts are maintained! But they are in YODA rather than Rivet... and those Rivet releases you're looking at are *really* old, Sal.<br>
<br>
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.<br>
<br>
Otherwise feel free to write your own PyROOT/YODA script: that's all that root2yoda is! <a href="https://yoda.hepforge.org/hg/yoda/file/tip/bin/root2yoda" rel="noreferrer" target="_blank">https://yoda.hepforge.org/hg/yoda/file/tip/bin/root2yoda</a>  (Note that the fiddly bit is the ROOT tree walking, which we've abstracted into the yoda.root submodule)<br>
<br>
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.<br>
<br>
Andy<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 13/07/16 21:57, David Bjergaard wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Sal,<br>
<br>
(Remember me!?) Andy and other devs can advise you better, but to my knowledge<br>
the way to do this would be with YODA's python interface and PyROOT.  Loop over<br>
the TH1s and populate the YODA histogram appropriately.  I don't know how<br>
complicated your root file structure is, but you could make it as fancy (or<br>
simple) as needed. ("less `which make-plots`" to get a decent tutorial on how the<br>
yoda interface works, and PyROOT is its own beast)<br>
<br>
Python docs are here: <a href="http://yoda.hepforge.org/pydoc/" rel="noreferrer" target="_blank">http://yoda.hepforge.org/pydoc/</a> I'm pretty sure the x2yoda<br>
and yoda2x scripts are not being maintained, but again the authorities know better.<br>
<br>
I don't think there is a "off the shelf" solution since the whole Rivet stack is<br>
intended to stand separately from ROOT.<br>
<br>
     David<br>
<br>
<br>
Salvatore Rappoccio <<a href="mailto:rappoccio@gmail.com" target="_blank">rappoccio@gmail.com</a>> writes:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, Andy, All,<br>
<br>
I am trying to convert a file full of histograms from ROOT to yoda. I<br>
tried to do "root2flat" and then "flat2yoda". I got "root2flat" from<br>
here:<br>
<br>
<a href="http://rivet.hepforge.org/svn/tags/rivet-1.6.0/bin/root2flat" rel="noreferrer" target="_blank">http://rivet.hepforge.org/svn/tags/rivet-1.6.0/bin/root2flat</a><br>
<br>
I didn't see any root2flat in this SVN area :<br>
<br>
<a href="http://rivet.hepforge.org/svn/tags/rivet-2.0.0b1/bin/" rel="noreferrer" target="_blank">http://rivet.hepforge.org/svn/tags/rivet-2.0.0b1/bin/</a><br>
<br>
Then tried "flat2yoda" but it looks like the schema for the data<br>
format is not backwards compatible, I get:<br>
<br>
cmslpc32:$ flat2yoda CMS_SMP_16_010_data_ptbin0.dat<br>
Traceback (most recent call last):<br>
File<br>
"/cvmfs/<a href="http://cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_10/external/slc6_amd64_gcc530/bin/flat2yoda" rel="noreferrer" target="_blank">cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_10/external/slc6_amd64_gcc530/bin/flat2yoda</a>",<br>
line 25, in <module><br>
analysisobjects = yoda.readFLAT(i)<br>
File "yoda/include/IO.pyx", line 150, in yoda.core.readFLAT<br>
(yoda/core.cpp:72398)<br>
yoda.ReadError: Unexpected line in YODA format parsing when BEGIN<br>
expected<br>
<br>
Any ideas? What should I do here? Where are the most up to date<br>
instructions?<br>
<br>
Cheers,<br>
Sal<br>
<br>
<br>
_______________________________________________<br>
Rivet mailing list<br>
<a href="mailto:Rivet@projects.hepforge.org" target="_blank">Rivet@projects.hepforge.org</a><br>
<a href="https://www.hepforge.org/lists/listinfo/rivet" rel="noreferrer" target="_blank">https://www.hepforge.org/lists/listinfo/rivet</a><br>
</blockquote>
_______________________________________________<br>
Rivet mailing list<br>
<a href="mailto:Rivet@projects.hepforge.org" target="_blank">Rivet@projects.hepforge.org</a><br>
<a href="https://www.hepforge.org/lists/listinfo/rivet" rel="noreferrer" target="_blank">https://www.hepforge.org/lists/listinfo/rivet</a><br>
<br>
</blockquote>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
--Â <br>
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow<br>
Particle Physics Expt Group, University of Glasgow<br>
</font></span></blockquote></div><br></div>