Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8173

RooStreamParser not working for float number with negative exponent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 6.06/04
    • Fix Version/s: 6.24/00, 6.22/04
    • Component/s: RooFit/RooStats
    • Labels:
      None
    • Environment:

      linux, ubuntu 14.04, g++ 5.3

      Description

      The function for reading a ASCII file for RooDataSet, RooDataSet::read, which uses the RooStreamParser class for parsing, does not properly read the float number with a negative exponent :
      some example of error message :
      0 ERROR:InputArguments – RooRealVar::readFromStream: parse error, cannot convert '4.52562e' to double precision
      0 ERROR:InputArguments – RooRealVar::readFromStream: parse error, cannot convert '7.18401e' to double precision

      The problem is coming from the readToken() function of RooStreamParser. I think that it is in line 230 of RooStreamParser.cxx . The - and + sign after the exponent is not properly considered and a split is performed at the + or - sign. When there is no + or - sign the parsing is fine.

      It is easy to reproduce the bug, running the attached script will show the problem :
      test 1:
      3.4532e
      +12

      test 2:
      3.4532e
      -12

      test 3:
      3.4532e12

        Attachments

          Activity

            People

            Assignee:
            shageboe Stephan Hageboeck
            Reporter:
            abb97424a0355ab5d837 Christophe Rappold
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: