Home | News | Documentation | Download

Asimmetric tgraph error

Hello, I’ve a Multi-graph. One of the graphs has asymmetric errors, then I used TGraphAsymmErrors but it looks like that I don’t get the errors even if, to try the macro, I wrote very large errors

This is the macro
partscint.cpp (3.0 KB)
The data files are

Partscintdatagam.txt (134 Bytes)
Partscintdatatot.txt (133 Bytes)
Partscintdataele.txt (134 Bytes)

And this one that is the file to use for asymmetric error (this is the file where I wrote large errors just to try the macro)
Partscintdatapos.txt (123 Bytes)

but you see…I don’t get the errors

Notice that the errors are only for the y-axis

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

If I draw graph2 alone it does not have errors either:

Your graph is not properly defined.Errors are 0:

root [1] TGraphAsymmErrors *graph2 = new TGraphAsymmErrors("Partscintdatapos.txt","%lg %lg 0 0 %lg %lg");
root [2] graph2->Print()
x[0]=0.5, y[0]=0, exl[0]=0, exh[0]=0, eyl[0]=0, eyh[0]=0
x[1]=0.7, y[1]=2.33e-08, exl[1]=0, exh[1]=0, eyl[1]=0, eyh[1]=0
x[2]=0.9, y[2]=3e-08, exl[2]=0, exh[2]=0, eyl[2]=0, eyh[2]=0
x[3]=1.1, y[3]=3e-08, exl[3]=0, exh[3]=0, eyl[3]=0, eyh[3]=0
x[4]=1.3, y[4]=1e-07, exl[4]=0, exh[4]=0, eyl[4]=0, eyh[4]=0
root [3] 

Hello @couet thank you.
This is the data file with big errors to try

0.5	0		0	0
0.7	2.33E-08	1.3E-08	0.87
0.9	0.00000003	1.4E-8	0.97
1.1	0.00000003	1.4E-8	0.97
1.3	0.0000001	0.21E-7	0.18

as you see I’ve the lower and higher errors on y-axis (i.e. third and fourth culomns)…in particular, you see the fourth culomn has big errors to try the macro

You need 6 columns for TGraphAsymmErrors

Thank you @couet, it works now writing two columns with “0”, but I knew that writing, for example,
TGraphAsymmErrors *graph2 = new TGraphAsymmErrors(datapos,"%lg %lg 0 0 %lg %lg");
it means that the third and fourth culomns are all “0”

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.