I am trying to run the program with TGraphAsymmErrors. The data file has no error in x but unsymmetrical errors in y. So in the data file I put 0 0 for x errors and ……
…… for y errors (two columns). the data file structure is x,y, errx+ errx-, erry+, erry-…
The program does not work, although it works with TGraphErrors.
Can any one point out the mistakes.
Thanks
The program code;
#include "TCanvas.h"
#include "TROOT.h"
#include "TMath.h"
#include "TGraphErrors.h"
#include "TGraphAsymmErrors.h"
#include "TF1.h"
#include "TLegend.h"
#include "TArrow.h"
#include "TLatex.h"
using namespace std;
void A()
{
//TGraphErrors graph2("A.txt");
TGraphAsymmErrors graph2("A.txt");
graph2.SetTitle(" Charged Multiplicity");
graph2.SetMarkerStyle(kOpenCircle);
graph2.SetMarkerColor(kBlue);
graph2.SetLineColor(kBlue);
TCanvas* mycanvas = new TCanvas();
graph2.DrawClone("APE");
TF1 f("f","[0]*([1]*TMath::Exp(-[1]*x) * TMath::Exp(-[2]*TMath::Exp(-[1]*x))) * (1 + [2]*(1-TMath::Exp(-[1]*x)))",10,30);
f.SetParNames("c","b","eta");
f.SetParameter(0, 0.2); // c (normalization constant)
f.SetParameter(1, 0.2); // b
f.SetParameter(2, 4); // eta
graph2.Fit(&f, "ME");
f.DrawClone("Same");
}
int main( )
{
A();
return 0;
}
-----------------------data File________________**
10 0.03987 0 0 0.0029644561 0.0020554318
11 0.03472 0 0 0.0025455844 0.0017670597
12 0.03035 0 0 0.0021980446 0.0015500323
13 0.02661 0 0 0.001908743 0.0013800362
14 0.02328 0 0 0.0016690416 0.0012684636
15 0.02018 0 0 0.0014689112 0.0011763078
16 0.01728 0 0 0.001317953 0.0010841587
17 0.0147 0 0 0.0011866339 0.0009823441
18 0.0125 0 0 0.0010651291 0.000880568
19 0.01067 0 0 0.0009339165 0.0007692204
20 0.00916 0 0 0.0008052329 0.0006705222
21 0.00786 0 0 0.0006868042 0.0005913544
22 0.00671 0 0 0.0005948109 0.0005375872
23 0.0057 0 0 0.0005440588 0.000515461
24 0.00478 0 0 0.0005220153 0.0005124451
25 0.00394 0 0 0.0005192302 0.000490408
26 0.00319 0 0 0.0004972927 0.0004492215
27 0.00251 0 0 0.0004368066 0.00037
28 0.00196 0 0 0.0003573514 0.0003008322
29 0.00156 0 0 0.0002879236 0.0002416609
30 0.001301 0 0 0.0002420021 0.0002110853