# How to use RooDataSet.read when file is in scientific notation?

**URL:** <https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715>\
**Category:** Newbie\
**Created:** [May 3, 2023, 4:19pm UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715 "2023-05-03T16:19:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![troppapolvere](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/troppapolvere/32/27991_2.png) [@troppapolvere](https://root-forum.cern.ch/u/troppapolvere)\
**Post date:** [May 3, 2023, 4:19pm UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715/1 "2023-05-03T16:19:40Z")

</div>

Hi there,  
I haven’t been using ROOT for a long time, and can’t find how to read a dataset  
from file when it contains numbers like 0.1234e-05.  
Reproducing the file take a longish time, and convert it is a drag.  
I am sure there is an option somewhere, but cannot find it.  
Thanks!  
[#0] ERROR:InputArguments – RooRealVar::readFromStream(dPt): parse error, cannot convert ‘7.38095e’ to double precision  
[#0] ERROR:InputArguments – RooRealVar::readFromStream(dPz): parse error, cannot convert ‘-9.74365e’ to double precision  
[#0] ERROR:DataHandling – RooDataSet::read(static): read error at line 47945  
[#1] INFO:DataHandling – RooDataSet::read: read 1049 events (ignored 46895 out of range events)

\_ROOT 5.34/36  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 3, 2023, 4:29pm UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715/2 "2023-05-03T16:29:13Z")

</div>

“`0.1234e-05`” is a proper [floating-point literal (a double)](https://en.cppreference.com/w/cpp/language/floating_literal).

Attach your “dataset” (several lines) for inspection.  
And maybe check what happens around line 47945 (assuming this number is related to your file, and, if not, try to find “7.38095e” and “-9.74365e” in it).

---

<div class="post-metadata">

**Author:** ![troppapolvere](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/troppapolvere/32/27991_2.png) [@troppapolvere](https://root-forum.cern.ch/u/troppapolvere)\
**Post date:** [May 3, 2023, 7:07pm UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715/3 "2023-05-03T19:07:10Z")

</div>

Can’t upload, am notified “Sorry new users can’t post links” Trying to post inline code

---

<div class="post-metadata">

**Author:** ![troppapolvere](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/troppapolvere/32/27991_2.png) [@troppapolvere](https://root-forum.cern.ch/u/troppapolvere)\
**Post date:** [May 3, 2023, 7:07pm UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715/4 "2023-05-03T19:07:47Z")

</div>

```auto
Can't upload ("Sorry, new users cant put links in posts"). Here's my M(N)WE:
=============here's the macro====================
void fitTT3() {
  RooRealVar dPz("dPz","dPz",-0.100,0.100);
  RooRealVar dPt("dPt","dPt",-0.100,0.100);
  RooDataSet RSds("RSds","RSds",RooArgSet(dPz,dPt));
  RSds.read("file.txt",RooArgList(dPz,dPt));
}
============here's one line =============================
-0.00472572 7.38095e-05
============here's the ROOT session============================
root [0] 
Processing fitTT3.C...

RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby 
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

[#1] INFO:DataHandling -- RooDataSet::read: reading file file.txt
[#0] ERROR:InputArguments -- RooRealVar::readFromStream(dPt): parse error, cannot convert '7.38095e' to double precision
[#0] ERROR:DataHandling -- RooDataSet::read(static): read error at line 2
[#1] INFO:DataHandling -- RooDataSet::read: read 0 events (ignored 1 out of range events)
root [1] .q
==================================================

```

---

<div class="post-metadata">

**Author:** ![troppapolvere](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/troppapolvere/32/27991_2.png) [@troppapolvere](https://root-forum.cern.ch/u/troppapolvere)\
**Post date:** [May 3, 2023, 7:16pm UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715/5 "2023-05-03T19:16:04Z")

</div>

On the other side, it works with ROOT 6.24 (same identical RooFIt 3.60 though…strange)  
I guess I will just change computer. Thanks anyhow!

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [May 4, 2023, 7:21am UTC](https://root-forum.cern.ch/t/how-to-use-roodataset-read-when-file-is-in-scientific-notation/54715/6 "2023-05-04T07:21:44Z")

</div>

It looks like RooFit(Core) in ROOT 5 (including the current head of the “[`v5-34-00-patches`](https://github.com/root-project/root/tree/v5-34-00-patches)” branch) cannot correctly parse scientific notation.
