<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
<div class="">Hi Chris,</div>
<div class=""><br class="">
</div>
<div class="">Propagating a YODA release take 1-3 weeks depending how our CMSSW release train is going and patching is not easy as well has the release is managed centrally. So I was waiting for next Rivet release to update as well YODA but are you planning
 to update yoda this time and is 1.6.5 cpmapatible with Rivet 2..5.2.</div>
<div class="">In case I could already update start updating YODA … anyway I advised Genius to use his own modified version of the script last week and this worked ...</div>
<div class=""><br class="">
</div>
<div class="">Xavier.</div>
<div class=""><br class="">
</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 13 Mar 2017, at 09:18, Chris Pollard <<a href="mailto:chris.pollard@cern.ch" class="">chris.pollard@cern.ch</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Thanks Xavier,
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
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 class=""><br class="">
</div>
<div class="">Chris</div>
<div class=""><br class="">
</div>
<div class=""><font face="monospace, monospace" class=""><br class="">
</font></div>
<div class="">
<div class=""><font face="monospace, monospace" class="">from sys import argv</font></div>
<div class=""><font face="monospace, monospace" class="">import ROOT</font></div>
<div class=""><font face="monospace, monospace" class="">import yoda</font></div>
<div class=""><font face="monospace, monospace" class=""><br class="">
</font></div>
<div class=""><font face="monospace, monospace" class="">f = ROOT.TFile.Open(argv[1])</font></div>
<div class=""><font face="monospace, monospace" class="">h = f.Get("h2")</font></div>
<div class=""><font face="monospace, monospace" class=""><br class="">
</font></div>
<div class=""><font face="monospace, monospace" class="">path = "/h2"</font></div>
<div class=""><font face="monospace, monospace" class="">title = "h2"</font></div>
<div class=""><font face="monospace, monospace" class="">s = yoda.Scatter2D(path, title)</font></div>
<div class=""><font face="monospace, monospace" class="">for iBin in range(1, h.GetNbinsX()+1):</font></div>
<div class=""><font face="monospace, monospace" class="">    y = h.GetBinContent(iBin)</font></div>
<div class=""><font face="monospace, monospace" class="">    yerr = h.GetBinError(iBin)</font></div>
<div class=""><font face="monospace, monospace" class="">    x = h.GetBinCenter(iBin)</font></div>
<div class=""><font face="monospace, monospace" class="">    xerr = h.GetBinWidth(iBin)/2</font></div>
<div class=""><font face="monospace, monospace" class="">    s.addPoint(x, y, xerr, yerr)</font></div>
<div class=""><font face="monospace, monospace" class=""><br class="">
</font></div>
<div class=""><font face="monospace, monospace" class="">yoda.write(s, "output.yoda")</font></div>
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Mon, Mar 13, 2017 at 7:56 AM, Janssen Xavier <span dir="ltr" class="">
<<a href="mailto:xavier.janssen@uantwerpen.be" target="_blank" class="">xavier.janssen@uantwerpen.be</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">
<div class="">I checked the tarball for YODA 165 and the error is present in there. Indeed it is fixed in 166. </div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="font-size:9px;color:#575757" class="">Sent from Samsung Mobile</div>
</div>
<div class="">
<div class="h5"><br class="">
<br class="">
<div class="">-------- Original message --------</div>
<div class="">From: Genius Walia </div>
<div class="">Date:13/03/2017 08:24 (GMT+01:00) </div>
<div class="">To: Chris Pollard </div>
<div class="">Cc: <a href="mailto:rivet@projects.hepforge.org" target="_blank" class="">
rivet@projects.hepforge.org</a> </div>
<div class="">Subject: Re: [Rivet] RIVET scripts </div>
<div class=""><br class="">
</div>
<div class="">
<div style="direction: ltr; font-family: Tahoma; font-size: 10pt;" class="">Hi Chris,<br class="">
<br class="">
   Thanks for the reply.<br class="">
<br class="">
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 class="">
<br class="">
2.) root2yoda :  Yes the entries are already divided by bin width in the input histogram.<br class="">
<br class="">
<br class="">
Regards,<br class="">
Genius<br class="">
<div style="font-family: 'Times New Roman'; font-size: 16px;" class="">
<hr class="">
<div id="m_-1553804728912926205divRpF339290" style="direction:ltr" class=""><font size="2" face="Tahoma" class=""><b class="">From:</b> Chris Pollard<br class="">
<b class="">Sent:</b> 13 March 2017 04:55<br class="">
<b class="">To:</b> Genius Walia<br class="">
<b class="">Cc:</b> <a href="mailto:rivet@projects.hepforge.org" target="_blank" class="">
rivet@projects.hepforge.org</a><br class="">
<b class="">Subject:</b> Re: [Rivet] RIVET scripts<br class="">
</font><br class="">
</div>
<div class=""></div>
<div class="">
<div dir="ltr" class="">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 class="">
<div style="direction: ltr; font-family: tahoma; font-size: 10pt;" class="">
<pre class=""><font face="Tahoma" class="">1.) flat2yoda : </font><font face="Tahoma" class=""><font face="Tahoma" class="">It gives following error :</font><i class=""><br class=""><br class="">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" class="">cms.cern.ch/slc6_amd64<wbr class="">_gcc530/cms/cmssw/CMSSW_8_1_0/<wbr class="">external/slc6_amd64_gcc530/<wbr class="">bin/flat2yoda</a>", line 23<br class="">    opts, args = parser.parse_args()<br class="">       ^<br class="">SyntaxError: invalid syntax<br class=""><br class=""></i></font><br class=""><font face="Tahoma" class="">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" class="">cms.cern.ch/slc6_amd64_<wbr class="">gcc530/cms/cmssw/CMSSW_8_1_0/e<wbr class="">xternal/slc6_amd64_gcc530/bin/<wbr class="">flat2yoda</a> file and found that on line 21, <br class="">the closing bracket is missing. I think this could be the source of the error.<br class=""><br class="">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 class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class=""><a href="https://yoda.hepforge.org/trac/browser/bin/flat2yoda" target="_blank" class="">https://yoda.hepforge.org/<wbr class="">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; font-size: 10pt;" class=""></div>
</blockquote>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div style="direction: ltr; font-family: tahoma; font-size: 10pt;" class="">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 class="">
cross-sections values .  I am using the following command for root 2 yoda conversion :
<br class="">
<font color="000080" class=""> <i class="">root2yoda Data_muon.root</i></font><br class="">
It gives the Data_muon.yoda as output.<br class="">
<br class="">
I tried plotting these outputs using<font color="000080" class=""> <i class="">rivet-mkhtml Data_muon.yoda</i></font> command, but it gives .dat file as output.
<br class="">
<br class="">
I even tried comparing this Data_muon.yoda to MC, but the output histogram only shows the MC distribution.<br class="">
<br class="">
I am attaching the Data_muon.root and Data_muon.yoda  with this mail.<br class="">
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Chris</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
Rivet mailing list<br class="">
<a href="mailto:Rivet@projects.hepforge.org" class="">Rivet@projects.hepforge.org</a><br class="">
<a href="https://www.hepforge.org/lists/listinfo/rivet" rel="noreferrer" target="_blank" class="">https://www.hepforge.org/<wbr class="">lists/listinfo/rivet</a><br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>