TGraphAsymmErrors

HI everybody :slight_smile:

I have a problem with a TGraphAsymmErrors…
The purpose it is very easy, I have a data file with 6 columns: x , y, elowX, ehighX , elowY, ehighY

And I have to plot this point, the macro is:

{
TCanvas *canvas = new TCanvas(“canvas”,“canvas”);
TGraphAsymmErrors *gr = new TGraphAsymmErrors (“Data.txt”)
gr->Draw(“apl”);
return canvas;
}

But don’t work, and the error is:

Error: Can’t call TGraphAsymmErrors::TGraphAsymmErrors(“Data.txt”) in current scope root.cpp:6:
Possible candidates are…
(in TGraphAsymmErrors)
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(void);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(Int_t n);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(Int_t n,const Float_t* x,const Float_t* y,const Float_t* exl=0,const Float_t* exh=0,const Float_t* eyl=0,const Float_t* eyh=0);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(Int_t n,const Double_t* x,const Double_t* y,const Double_t* exl=0,const Double_t* exh=0,const Double_t* eyl=0,const Double_t* eyh=0);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TVectorF& vx,const TVectorF& vy,const TVectorF& vexl,const TVectorF& vexh,const TVectorF& veyl,const TVectorF& veyh);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TVectorD& vx,const TVectorD& vy,const TVectorD& vexl,const TVectorD& vexh,const TVectorD& veyl,const TVectorD& veyh);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TGraphAsymmErrors& gr);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TH1* h);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TH1* pass,const TH1* total,Option_t* option="");
(in TGraph)
*** Interpreter error recovered ***

Why??

Thank you in advance for the help :wink:

Creating a TGraphAsymmErrors directly from a file is not implemented.

as I feared :frowning:

How can I do?

Actually, you have to get the content of your file first into vectors for example and then use these vectors to construct your TGraphAsymmErrors object.
BTW, I open a request on JIRA for asking such feature.

ok, thank you!! :wink:
I hope I hope they will create a method…

Done

Really?? It is fantastic!!! thank you very much =D> =D> =D>

How can I do to use the new method? :slight_smile:

In ROOT 6… see the Jira report

ROOT “master” even…

Sorry me but I don’t understand, How can i watch the Jira report? I have watched here:
sft.its.cern.ch/jira/browse/ROOT-7975
but i don’t found the solution or report

To be able to use such constructor, you have to install the lastest ROOT version, I mean the latest version of the master branch

To download the root-master I have click on DOWNLOAD ZIP in the pagne that you have told me:
github.com/root-mirror/root

than the installation it is same to the normal ROOT? and I have to remove the normal ROOT version before?

thank you a lot :wink:

It depends what you call “normal installation”… here you will need to recompile .
May be that’s what you did … and yes, in that case it is the same…

Work!!! Fantastic!! =D> =D> =D> =D> =D> =D>

Thank you a lot :wink:

Hi rooters!!

The last time I can’t draw a TGraphAsymmErrors directly from data file, and then with from jira the problem was solved. But now, I had to reinstall ubuntu, so also ROOT. I have downloaded the root-master from here github.com/root-mirror/root

and the I obtain the same error:

Error: Can’t call TGraphAsymmErrors::TGraphAsymmErrors(“Data.txt”) in current scope root.cpp:6:
Possible candidates are…
(in TGraphAsymmErrors)
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(void);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(Int_t n);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(Int_t n,const Float_t* x,const Float_t* y,const Float_t* exl=0,const Float_t* exh=0,const Float_t* eyl=0,const Float_t* eyh=0);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(Int_t n,const Double_t* x,const Double_t* y,const Double_t* exl=0,const Double_t* exh=0,const Double_t* eyl=0,const Double_t* eyh=0);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TVectorF& vx,const TVectorF& vy,const TVectorF& vexl,const TVectorF& vexh,const TVectorF& veyl,const TVectorF& veyh);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TVectorD& vx,const TVectorD& vy,const TVectorD& vexl,const TVectorD& vexh,const TVectorD& veyl,const TVectorD& veyh);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TGraphAsymmErrors& gr);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TH1* h);
/usr/lib/x86_64-linux-gnu/root5.34/libHist.so -1:-1 0 public: TGraphAsymmErrors TGraphAsymmErrors::TGraphAsymmErrors(const TH1* pass,const TH1* total,Option_t* option="");
(in TGraph)
*** Interpreter error recovered ***

why this??

version problem ? which version have you installed ?

The version it is: ROOT 5.34

I think it is because the modify it is done for the version 6, but I have downloaded directly from github.com/root-mirror/root , I have click on dowload zip like the last time.

yes the fix was done on 6 master.

Can you tell me please how can I download the root-master 6?
thank you

Here:

TGraphAsymmErrors

it seems you managed to make it work ? … no ? what has changed ?