<div dir="ltr">Thanks Xavier,<div><br></div><div>So I guess the best solution for the first problem is to update yoda; if that's not (easily) possible then maybe you just have to patch the script locally until a yoda 1.6.6 is incorporated into CMSSW.</div><div><br>As for the second issue, I strongly suggest writing a small python script for these sorts of jobs. This allows you to be precise about the format of the inputs, which yoda can only assume. Something along the lines of the python I pasted below below should work for your case if I understand it correctly. Obviously you should double check that the points and errors are really what they ought to be---I can only guess at the meaning of the values in your histogram.</div><div><br></div><div>Chris</div><div><br></div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">from sys import argv</font></div><div><font face="monospace, monospace">import ROOT</font></div><div><font face="monospace, monospace">import yoda</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">f = ROOT.TFile.Open(argv[1])</font></div><div><font face="monospace, monospace">h = f.Get("h2")</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">path = "/h2"</font></div><div><font face="monospace, monospace">title = "h2"</font></div><div><font face="monospace, monospace">s = yoda.Scatter2D(path, title)</font></div><div><font face="monospace, monospace">for iBin in range(1, h.GetNbinsX()+1):</font></div><div><font face="monospace, monospace"> y = h.GetBinContent(iBin)</font></div><div><font face="monospace, monospace"> yerr = h.GetBinError(iBin)</font></div><div><font face="monospace, monospace"> x = h.GetBinCenter(iBin)</font></div><div><font face="monospace, monospace"> xerr = h.GetBinWidth(iBin)/2</font></div><div><font face="monospace, monospace"> s.addPoint(x, y, xerr, yerr)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">yoda.write(s, "output.yoda")</font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 13, 2017 at 7:56 AM, Janssen Xavier <span dir="ltr"><<a href="mailto:xavier.janssen@uantwerpen.be" target="_blank">xavier.janssen@uantwerpen.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>I checked the tarball for YODA 165 and the error is present in there. Indeed it is fixed in 166. </div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="font-size:9px;color:#575757">Sent from Samsung Mobile</div>
</div><div><div class="h5">
<br>
<br>
<div>-------- Original message --------</div>
<div>From: Genius Walia </div>
<div>Date:13/03/2017 08:24 (GMT+01:00) </div>
<div>To: Chris Pollard </div>
<div>Cc: <a href="mailto:rivet@projects.hepforge.org" target="_blank">rivet@projects.hepforge.org</a> </div>
<div>Subject: Re: [Rivet] RIVET scripts </div>
<div><br>
</div>
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Hi Chris,<br>
<br>
Thanks for the reply.<br>
<br>
1.) flat2yoda : I am facing this issue in CMSSW release 8_0_X, which I believe uses the latest RIVET version 2.5.2 and YODA version 1.6.5.<br>
<br>
2.) root2yoda : Yes the entries are already divided by bin width in the input histogram.<br>
<br>
<br>
Regards,<br>
Genius<br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div id="m_-1553804728912926205divRpF339290" style="direction:ltr"><font size="2" face="Tahoma" color="#000000"><b>From:</b> Chris Pollard<br>
<b>Sent:</b> 13 March 2017 04:55<br>
<b>To:</b> Genius Walia<br>
<b>Cc:</b> <a href="mailto:rivet@projects.hepforge.org" target="_blank">rivet@projects.hepforge.org</a><br>
<b>Subject:</b> Re: [Rivet] RIVET scripts<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">Hi Genius,
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="direction:ltr;font-family:tahoma;color:rgb(0,0,0);font-size:10pt">
<pre><font face="Tahoma">1.) flat2yoda : </font><font face="Tahoma"><font face="Tahoma">It gives following error :</font><i><br><br>File "/cvmfs/<a href="http://cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_1_0/external/slc6_amd64_gcc530/bin/flat2yoda" target="_blank">cms.cern.ch/slc6_amd64<wbr>_gcc530/cms/cmssw/CMSSW_8_1_0/<wbr>external/slc6_amd64_gcc530/<wbr>bin/flat2yoda</a>", line 23<br> opts, args = parser.parse_args()<br> ^<br>SyntaxError: invalid syntax<br><br></i></font><br><font face="Tahoma">I looked into the /cvmfs/<a href="http://cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_1_0/external/slc6_amd64_gcc530/bin/flat2yoda" target="_blank">cms.cern.ch/slc6_amd64_<wbr>gcc530/cms/cmssw/CMSSW_8_1_0/e<wbr>xternal/slc6_amd64_gcc530/bin/<wbr>flat2yoda</a> file and found that on line 21, <br>the closing bracket is missing. I think this could be the source of the error.<br><br>I was suggested to write to the authors, to get it fixed in subsequent CMSSW releases. It could be great if you can look into this.</font></pre>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>ok looking at the most up-to-date version of this script, I don't see an (obvious) issue on line 21. Do you know which version of YODA is installed in your particular CMSSW release? Is the latest file different from what you have?</div>
<div><br>
</div>
<div><a href="https://yoda.hepforge.org/trac/browser/bin/flat2yoda" target="_blank">https://yoda.hepforge.org/<wbr>trac/browser/bin/flat2yoda</a> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="direction:ltr;font-family:tahoma;color:rgb(0,0,0);font-size:10pt">
</div>
</blockquote>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="direction:ltr;font-family:tahoma;color:rgb(0,0,0);font-size:10pt">
2.) root2yoda : I tried using this script giving TH1D histogram as input, in the same CMSSW version. But the output yoda file varies my input cross-section numbers and I get different
<br>
cross-sections values . I am using the following command for root 2 yoda conversion :
<br>
<font color="000080"> <i>root2yoda Data_muon.root</i></font><br>
It gives the Data_muon.yoda as output.<br>
<br>
I tried plotting these outputs using<font color="000080"> <i>rivet-mkhtml Data_muon.yoda</i></font> command, but it gives .dat file as output.
<br>
<br>
I even tried comparing this Data_muon.yoda to MC, but the output histogram only shows the MC distribution.<br>
<br>
I am attaching the Data_muon.root and Data_muon.yoda with this mail.<br>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Can you tell me if the entries in the histogram you're trying to convert have been divided by the bin widths? I suspect the YODA converter expects the entries to have been normalized this way.</div>
<div><br>
</div>
<div>Chris</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
<br>______________________________<wbr>_________________<br>
Rivet mailing list<br>
<a href="mailto:Rivet@projects.hepforge.org">Rivet@projects.hepforge.org</a><br>
<a href="https://www.hepforge.org/lists/listinfo/rivet" rel="noreferrer" target="_blank">https://www.hepforge.org/<wbr>lists/listinfo/rivet</a><br></blockquote></div><br></div>