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

readFromStream() parser fails with negative exponents in scientific notation

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • High
    • Resolution: Fixed
    • 5.34/00
    • 6.10/10
    • RooFit/RooStats
    • None
    • GNU/Linux

    Description

      Dear ROOT support,

      In ROOT version 5.34.03, the readFromStream() ASCII parser in RooFit seems to no longer be able to handle scientific notation with negative exponents -- in fact, the negative sign is interpreted as a token separator and the value cannot be cast into a floating variable. I was using 5.32 ROOT versions to parse text-based files that set up a RooFit model, and noticed that a compilation against 5.34 would now fail. I include an example script below. Please advise as to whether this will be fixed in a newer release -- converting many PDF parameters to decimal notation is obviously a hack fix, but not desirable in the long term in many numerical contexts.

      Best regards,
      Jed Biesiada

      Example:

      RooRealVar v("v", "", 0);
      ifstream is("test.dat"
      RooArgSet(v).readFromStream(is,0);

      If test.dat contains the line

      v = 3E-9 L(0 - 5)

      One gets:

      0 ERROR:InputArguments -- RooRealVar::readFromStream(v): parse error, cannot convert '3E' to double precision

      Attachments

        Activity

          People

            rembserj Jonas Rembser
            biesiada Jed Biesiada (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: