<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Dear Peter (and Rivet developers),<br>
    <br>
    No, I don't think this is something that Joanne (or Keith) could
    help with.<br>
    <br>
    <a class="moz-txt-link-freetext"
href="https://github.com/HEPData/miscellaneous/blob/master/scripts/rivet-diffhepdata-all">https://github.com/HEPData/miscellaneous/blob/master/scripts/rivet-diffhepdata-all</a><br>
    <br>
    I wrote another script "rivet-diffhepdata-all" that loops over all
    Rivet analyses listed in <a class="moz-txt-link-freetext"
      href="http://rivet.hepforge.org/analyses.json">http://rivet.hepforge.org/analyses.json</a>
    and compares each Rivet .yoda file with the HEPData download.  It
    calls functions from the previous "rivet-diffhepdata" script which
    in turn calls "yodadiff".<br>
    <br>
    I added the URL option to pass the Rivet analysis name to HEPData
    when requesting a YODA conversion, e.g.<br>
    <br>
    <a class="moz-txt-link-freetext"
href="https://hepdata.net/record/ins319520?format=yoda&rivet=ALEPH_1991_S2435284">https://hepdata.net/record/ins319520?format=yoda&rivet=ALEPH_1991_S2435284</a><br>
    <br>
    This is necessary, for example, for Rivet analysis names containing
    the SPIRES ID rather than the INSPIRE ID.  The "rivet-mkanalysis"
    script could be modified accordingly:<br>
    <br>
    <a class="moz-txt-link-freetext"
      href="https://rivet.hepforge.org/trac/browser/bin/rivet-mkanalysis#L139">https://rivet.hepforge.org/trac/browser/bin/rivet-mkanalysis#L139</a><br>
    hdurl = <a class="moz-txt-link-rfc2396E"
      href="http://www.hepdata.net/record/ins%s?format=yoda&rivet=%s"><font color="red"><b>MailScanner has detected a possible fraud attempt from "www.hepdata.net" claiming to be</b></font> "http://www.hepdata.net/record/ins%s?format=yoda&rivet=%s"</a>
    % (ANAINSPIREID, ANANAME)<br>
    <br>
    The web directory <a class="moz-txt-link-freetext"
      href="http://ippp.dur.ac.uk/%7Ewatt/RivetDiffHEPData/Rivet-2.6.0/">http://ippp.dur.ac.uk/~watt/RivetDiffHEPData/Rivet-2.6.0/</a>
    contains the output of running:<br>
    <br>
    rivet-diffhepdata-all -r ../Rivet-2.6.0/analyses -d HEPDataYoda -o
    YodaDiffOutput > rivet-diffhepdata-all.txt<br>
    <br>
    The summary line doesn't look too promising:<br>
    <br>
    "Of 359 Rivet analyses in ../Rivet-2.6.0/analyses, 66 (18.4%) were
    compatible and 293 (81.6%) were incompatible."<br>
    <br>
    Here, compatibility is defined as a zero exit status returned by
    "yodadiff".  Only 31 of these 293 incompatible analyses are missing
    a HEPData record.<br>
    <br>
    Note that the "yodadiff" script gives a ZeroDivisionError in the
    function "eq(a, b)" when "a" and "b" have opposite sign due to the
    return value:<br>
    <br>
    return abs(float(a) - float(b))/(float(a) + float(b)) < opts.TOL<br>
    <br>
    For example, d01-x01-y01 of ATLAS_2013_I1190187.yoda distributed
    with Rivet has yerr- = 6.8 and yerr+ = -6.8.  The HEPData table ( <a
      class="moz-txt-link-freetext"
href="http://www.hepdata.net/record/ins1190187?version=1&table=Table1">http://www.hepdata.net/record/ins1190187?version=1&table=Table1</a>
    ) gives both yerr- and yerr+ as 1.212930e+01, so it seems that the
    Rivet .yoda file contains only the statistical error (with a wrong
    sign for yerr+).  The Rivet .yoda file also assigns an artificial
    bin width of 1 for sqrt(s), whereas the HEPData table does not
    assign a bin width for sqrt(s).  Looking at the YODA export from the
    old HepData site:<br>
    <br>
    <a class="moz-txt-link-freetext"
      href="http://hepdata.cedar.ac.uk/view/ins1190187/d1/yoda">http://hepdata.cedar.ac.uk/view/ins1190187/d1/yoda</a><br>
    <br>
    again there are zero xerr- and xerr+ values, but the AIDA export:<br>
    <br>
    <a class="moz-txt-link-freetext"
      href="http://hepdata.cedar.ac.uk/view/ins1190187/d1/aida">http://hepdata.cedar.ac.uk/view/ins1190187/d1/aida</a><br>
    <br>
    has a unit bin width written by "AidaFormatter.java" with a comment
    (by Andy?):<br>
    <br>
    // If there's only one bin and it has no width, give<br>
    // it unit width so that it can be filled and the height<br>
    // doesn't go mad when Rivet tries to use it.<br>
    <br>
    I would argue that any construction of artificial bin widths would
    be better handled on the Rivet side rather than in the HEPData
    export of the data.  Removing artificial bin widths from the Scatter
    objects in the Rivet .yoda files would resolve some of the
    incompatibilities between HEPData and Rivet, but many more would
    remain.  I don't propose a universal solution for now, but just want
    to start by identifying where the differences lie.  It will be
    interesting to monitor whether the degree of incompatibility, now
    easily quantified by my new "rivet-diffhepdata-all" script, improves
    for subsequent Rivet releases.<br>
    <br>
    Best regards,<br>
    Graeme Watt (HEPData)<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 25/05/18 23:17, Peter Skands wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFggDmjrc5QrWYyBvVr9Zka=SBt3tAtodap3yQVhOFbMBrEiCg@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style>body{font-family:Helvetica,Arial;font-size:13px}</style>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Hi
        All,</div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br>
      </div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Agree
        it sounds like it could make sense as part of Rivet, and could
        make a real difference by making the step to check consistency
        almost trivial; easy to run when developing / releasing
        analyses. In the latter case, feedback could go back to the
        people submitting a new analysis if there is a discrepancy,
        which would then put the burden of ensuring consistency mainly
        on the people who contribute the analyses, without adding
        significantly to the Rivet / HepData authors. Regarding the
        existing / old analyses, Graeme, any chance you think of the
        person in Durham having a go at the backlog of old analyses, or
        would that be too challenging for her? It might be worth
        preparing an example, show it to Keith, and see what he thinks?</div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br>
      </div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Cheers,</div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">Peter</div>
      <div id="bloop_customfont"
style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br>
      </div>
      <div id="bloop_sign_1527285803272752896" class="bloop_sign"><font
          style="font-size:14px" face="Helvetica"><span
            style="font-size:11px">—</span></font><span
          style="font-family:'helvetica Neue',helvetica;font-size:14px"></span>
        <div style="font-size:14px;font-family:Helvetica,Arial"><b
            style="font-family:Helvetica;font-size:11px">PETER SKANDS<br>
          </b><span style="font-family:Helvetica;font-size:11px">Associate
            Professor</span><br
            style="font-family:Helvetica;font-size:11px">
          <br style="font-family:Helvetica;font-size:11px">
          <b style="font-family:Helvetica;font-size:11px">School of
            Physics and Astronomy<br>
          </b><span style="font-family:Helvetica;font-size:11px">Monash
            University </span><br
            style="font-family:Helvetica;font-size:11px">
          <span style="font-family:Helvetica;font-size:11px">10 College
            Walk, Clayton Campus</span><br
            style="font-family:Helvetica;font-size:11px">
          <span style="font-family:Helvetica;font-size:11px">Melbourne,
            VIC 3800</span><br
            style="font-family:Helvetica;font-size:11px">
          <span style="font-family:Helvetica;font-size:11px">Australia</span><br
            style="font-family:Helvetica;font-size:11px">
          <br style="font-family:Helvetica;font-size:11px">
          <span style="font-family:Helvetica;font-size:11px">T: </span><a
            href="tel://+61%203%20990%2053692"
            style="font-family:Helvetica;font-size:11px"
            moz-do-not-send="true">+61 3 990 53692</a><br
            style="font-family:Helvetica;font-size:11px">
          <span style="font-family:Helvetica;font-size:11px">E: </span><a
            href="mailto:peter.skands@monash.edu"
            style="font-family:Helvetica;font-size:11px"
            moz-do-not-send="true">peter.skands@monash.edu</a><br
            style="font-family:Helvetica;font-size:11px">
          <span style="font-family:Helvetica;font-size:11px">W: </span><a
            href="http://skands.physics.monash.edu/"
            style="font-family:Helvetica;font-size:11px"
            moz-do-not-send="true">skands.physics.monash.edu</a><br>
        </div>
      </div>
      <br>
      <p class="airmail_on">On 26 May 2018 at 2:52:23 am, Graeme Watt (<a
          href="mailto:graeme.watt@durham.ac.uk" moz-do-not-send="true">graeme.watt@durham.ac.uk</a>)
        wrote:</p>
      <blockquote type="cite" class="clean_bq"><span>
          <div>
            <div>Dear David, <br>
              <br>
              OK, here's another much simpler Python script that
              downloads the YODA <br>
              file from HEPData and then calls yodadiff: <br>
              <br>
              <a
href="https://github.com/HEPData/miscellaneous/blob/master/scripts/rivet-diffhepdata"
                moz-do-not-send="true">https://github.com/HEPData/miscellaneous/blob/master/scripts/rivet-diffhepdata</a>
              <br>
              <br>
              I'm not sure if this even warrants a script, given that
              the <br>
              functionality of: <br>
              <br>
                rivet-diffhepdata ATLAS_2017_I1614149.yoda -i 1614149 <br>
              <br>
              could be obtained with two commands, e.g. <br>
              <br>
                curl -L <a
                href="https://hepdata.net/record/ins1614149?format=yoda"
                moz-do-not-send="true">https://hepdata.net/record/ins1614149?format=yoda</a>
              | tar zx <br>
                yodadiff ATLAS_2017_I1614149.yoda
              HEPData-ins1614149-v2-yoda.yoda <br>
              <br>
              The yodadiff script gives more detailed output of
              differences than my <br>
              previous script, but it does not compare annotations
              (maybe this <br>
              functionality could be added to yodadiff as an option?). 
              Also, the <br>
              yodadiff script flags additional analysis objects (like
              covariance <br>
              matrices) that are present in the HEPData YODA file but
              not in the Rivet <br>
              YODA file (as is the case for ATLAS_2017_I1614149),
              whereas my previous <br>
              script was specifically written to ignore these
              differences.  I suppose <br>
              this is OK if the user just ignores the warnings from
              yodadiff about <br>
              additional analysis objects in the HEPData YODA file. <br>
              <br>
              Best regards, <br>
              Graeme <br>
              <br>
              <br>
              On 25/05/18 11:01, David Grellscheid wrote: <br>
              > Hi Graeme, <br>
              > <br>
              > Yes, I did mean yodadiff, sorry! There's no way it
              will start to include <br>
              > a Hepdata download option, it is meant to do one job
              of comparing two <br>
              > yoda files, which may have nothing at all to do with
              HEP or Rivet. <br>
              > <br>
              > The download option could be provided (in rivet/bin,
              not yoda/bin!) by a <br>
              > thin layer over the top of yoadiff, though. If you'd
              like to adapt your <br>
              > script in that way, we'd be happy to include it in
              the rivet distribution. <br>
              > <br>
              > See you, <br>
              > <br>
              > David <br>
              > <br>
              > <br>
              > On 22/05/2018 12:20, Graeme Watt wrote: <br>
              >> Dear David, <br>
              >> <br>
              >> Thanks, I think you mean yodadiff (not yodacmp). 
              You're right, it looks <br>
              >> like yodadiff does much the same as my script,
              other than the HEPData <br>
              >> download and optional comparison of annotations. 
              Maybe these features <br>
              >> could be added to yodadiff?  In any case, it
              would be good to make such <br>
              >> comparisons part of the validation and release
              procedure of each new <br>
              >> Rivet analysis, which is apparently not happening
              at the moment (other <br>
              >> than possibly for ATLAS analyses). <br>
              >> <br>
              >> Best regards, <br>
              >> Graeme <br>
              >> <br>
              >> <br>
              >> On 22/05/18 09:54, David Grellscheid wrote: <br>
              >>> Hi Graeme, <br>
              >>> <br>
              >>> thanks for your email, we have started
              discussing it. Just one technical <br>
              >>> point, YODA comes with a yodacmp script
              already, which addresses many of <br>
              >>> your technical issues with comparisons. Maybe
              you can use that <br>
              >>> internally in your script? <br>
              >>> <br>
              >>> See you, <br>
              >>> <br>
              >>>   David <br>
              >>> <br>
              >>> <br>
              >>> On 21/05/2018 20:16, Graeme Watt wrote: <br>
              >>>> Dear Rivet developers, <br>
              >>>> <br>
              >>>> I wrote a Python script to compare a YODA
              reference data file, intended <br>
              >>>> for inclusion in Rivet, with the
              corresponding YODA file downloaded from <br>
              >>>> HEPData: <br>
              >>>> <br>
              >>>> <a
href="https://github.com/HEPData/miscellaneous/blob/master/scripts/yoda_compare_hepdata.py"
                moz-do-not-send="true">https://github.com/HEPData/miscellaneous/blob/master/scripts/yoda_compare_hepdata.py</a>
              <br>
              >>>> <br>
              >>>> <br>
              >>>>    Example usage: 
              ./yoda_compare_hepdata.py ATLAS_2017_I1614149.yoda -i <br>
              >>>> 1614149 -a <br>
              >>>> <br>
              >>>> This means: compare a local YODA file
              "ATLAS_2017_I1614149.yoda" with a <br>
              >>>> YODA file downloaded from the HEPData
              record with INSPIRE ID "1614149" <br>
              >>>> and also compare YODA annotations "-a". 
              Since the HEPData YODA file <br>
              >>>> might contain additional analysis objects
              compared to the Rivet YODA <br>
              >>>> file, and since there might be
              inconsequential rounding errors or <br>
              >>>> differences in number formats, comparison
              using a simple "diff" of .yoda <br>
              >>>> files is not always adequate. <br>
              >>>> <br>
              >>>> I had a few problems with the YODA 1.7.0
              software when writing the <br>
              >>>> Python script, which could perhaps be
              improved in future: <br>
              >>>> <br>
              >>>> * Calling dump() on Scatter objects does
              not output the same format as <br>
              >>>> in the input .yoda files, e.g. dumping a
              Scatter2D gives "HISTO1D" in <br>
              >>>> the output and the central value of the x
              bin is not output.  This might <br>
              >>>> be due to deficiencies in <br>
              >>>> <a
                href="https://yoda.hepforge.org/trac/browser/src/WriterFLAT.cc"
                moz-do-not-send="true">https://yoda.hepforge.org/trac/browser/src/WriterFLAT.cc</a>
              . <br>
              >>>> * I expected to be able to check (fuzzy)
              equality of two Scatter objects <br>
              >>>> using "s == s1", which seems to be
              implemented in C++ but not in Python. <br>
              >>>> * Checking (fuzzy) equality of two
              Point2D objects using "p == p1" is <br>
              >>>> implemented in Python, but it only
              compares the x axes and not the y <br>
              >>>> axes.  Similarly, for Point3D objects,
              the (fuzzy) equality operator <br>
              >>>> "==" only compares the x and y axes, but
              not the z axes. <br>
              >>>> * In the end, I just copied the
              definition of "fuzzyEquals" from the C++ <br>
              >>>> code into my script and did my own
              comparisons, without relying on the <br>
              >>>> "==" operator for Point or Scatter
              objects. <br>
              >>>> <br>
              >>>> Recall that Holger Schulz made some
              similar comparisons in 2016 between <br>
              >>>> YODA reference data files from Rivet and
              from the old HepData, where he <br>
              >>>> found significant inconsistencies: <br>
              >>>> <br>
              >>>> <a
href="https://www.hepforge.org/lists-archive/rivet/2016-October/007318.html"
                moz-do-not-send="true">https://www.hepforge.org/lists-archive/rivet/2016-October/007318.html</a>
              <br>
              >>>> <a
href="https://rivet.hepforge.org/trac/browser/contrib/devscripts/HepDataConsistency"
                moz-do-not-send="true">https://rivet.hepforge.org/trac/browser/contrib/devscripts/HepDataConsistency</a>
              <br>
              >>>> <br>
              >>>> <br>
              >>>> <br>
              >>>> While fixing all Rivet/HEPData
              inconsistencies is probably unrealistic <br>
              >>>> for now, we could at least start by
              ensuring that analyses added to new <br>
              >>>> Rivet releases include a YODA file that's
              compatible with the YODA <br>
              >>>> download given by HEPData.  My new script
              should be useful for these <br>
              >>>> purposes.  (This work was prompted by a
              conversation with Peter Skands <br>
              >>>> and Jon Butterworth last month in
              Durham.)  You're welcome to modify my <br>
              >>>> script as you need and include it in a
              future Rivet release.  The script <br>
              >>>> could be run by the experiment contact
              persons before they upload new <br>
              >>>> analyses to the Rivet "contrib" area.  It
              could also be run (perhaps in <br>
              >>>> a more automated way) by the Rivet
              developers when moving analyses from <br>
              >>>> the "contrib" area to a new Rivet
              release.  I just ran the script for <br>
              >>>> all the new analyses in the current Rivet
              "contrib" area ( <br>
              >>>> <a
                href="https://www.hepforge.org/archive/rivet/contrib/"
                moz-do-not-send="true">https://www.hepforge.org/archive/rivet/contrib/</a>
              ) and it already turned <br>
              >>>> up some useful information: <br>
              >>>> <br>
              >>>> * ATLAS_2014_I1310835,
              ATLAS_2017_I1614149, and ATLAS_2017_I1624693, are <br>
              >>>> all compatible with HEPData. <br>
              >>>> * ATLAS_2016_I1502620 has multiple .yoda
              files which can't be handled by <br>
              >>>> my script. <br>
              >>>> * ATLAS_2017_I1625109 showed some
              apparent inconsistencies but the <br>
              >>>> problem looks to be on the HEPData side. 
              The dataset index starts at 0 <br>
              >>>> (instead of 1) due to a bug in the
              hepdata-converter package (which I'll <br>
              >>>> fix) and the year in the analysis name is
              2018 (instead of 2017) taken <br>
              >>>> from the journal publication. <br>
              >>>> * ALICE_2017_I1620477 is incompatible
              with HEPData. <br>
              >>>> * CMS_2016_I1487277 is compatible with
              HEPData. <br>
              >>>> * CMS_2012_I1111014 and CMS_2016_I1491950
              are incompatible with HEPData. <br>
              >>>> * CMS_2017_I1499471, CMS_2017_I1635889,
              CMS_2018_I1662081 and <br>
              >>>> CMS_2018_I1663958 are all missing from
              HEPData. <br>
              >>>> * CMS_2017_I1605749 has a HEPData record,
              but the YODA conversion fails <br>
              >>>> due to a problem with the original
              HEPData submission. <br>
              >>>> * LHCF_2015_I1351909 is compatible with
              HEPData, but the annotations <br>
              >>>> differ. <br>
              >>>> * LHCF_2016_I1385877 is incompatible with
              HEPData. <br>
              >>>> <br>
              >>>> I hope this gives you something to
              discuss at this week's Rivet <br>
              >>>> workshop! :-) <br>
              >>>> <br>
              >>>> Best regards, <br>
              >>>> Graeme Watt (HEPData) <br>
              >>>> <br>
              >>>> <br>
              >>>> <br>
              >>>> <br>
              >>>>
              _______________________________________________ <br>
              >>>> Rivet mailing list <br>
              >>>> <a
                href="mailto:Rivet@projects.hepforge.org"
                moz-do-not-send="true">Rivet@projects.hepforge.org</a> <br>
              >>>> <a
                href="https://www.hepforge.org/lists/listinfo/rivet"
                moz-do-not-send="true">https://www.hepforge.org/lists/listinfo/rivet</a>
              <br>
              >>>> <br>
              <br>
            </div>
          </div>
        </span></blockquote>
    </blockquote>
    <br>
  </body>
</html>