Fixing a bug in RooArgSet::readFromFile

Dear developers,

I finally decided to fix a bug that annoyed me for so long in RooArgSet::readFromFile.

RooArgSet allows to create a file with the information from the arguments stored in the set with the method RooArgSet::writeToFile(…).
Unfortunately, when using the corresponding RooArgSet::readFromFile function, there is a parsing problems for numbers in the form Xe+YZ, and the information gets lost in the import. The following error is produced:

[#0] ERROR:InputArguments -- RooRealVar::readFromStream(x): parse error, cannot convert '1e' to double precision

You can test yourself with the attached script (root-prob.py) run on v6-08-02.

I’ve tracked the problem down to a forgotten case in RooStreamParser::readToken(). And after fixing it I made the script work as expected (see after.txt).

Please let me know how this could be implemented in future releases of the software.

Cheers,

Maurizio
before.txt (546 Bytes)
after.txt (442 Bytes)
root-prob.py (498 Bytes)

Hi Maurizio,

very nice initiative: thanks!
I have a proposal: why don’t you formulate your contribution in terms of a pull request for our github repository?

github.com/root-mirror/root

Your name will stay as “contributor” to the root framework and the whole procedure will be much more streamlined.

Cheers,
Danilo

Done: https://github.com/root-mirror/root/pull/352

Thanks!

Maurizio

Saw that, thanks!