Hi,
I’ve got some problems to obtain the integral of a TGraphErrors. Maybe, I did not understand how to use it.
I wrote a macro with the 10 points of the TGraphErrors “gberyllium” (see below). Then, I just typed in a terminal :
root [6] gberyllium->Integral()
(const Double_t)2.03678272110499137e+00
root [7] gberyllium->Integral(0,9)
(const Double_t)2.03678272110499137e+00
root [8] gberyllium->Integral(1,9)
(const Double_t)2.47531736688499393e+00
root [9] gberyllium->Integral(2,9)
(const Double_t)2.60782873108500013e+00
root [10] gberyllium->Integral(3,9)
(const Double_t)2.77735564388000356e+00
root [11] gberyllium->Integral(7,9)
(const Double_t)3.66642639874998899e-01
The arguments of the method are the number of the first and last points to calculate the integral
So, I don’t know how the integral can be around 2 whereas all the point are above 2. Moreover, how the integral can increase when some points are removed, in particular the highest ones ?
Thanks in advance for your help.
Xavier
P.S. : I’m using the 28.00 version. I used the 26 before, by there is a problem with the sign (there is a post about this in this forum).
The macro :
[code] TGraphErrors *gberyllium = new TGraphErrors(10);
gberyllium->SetName(“Beryllium”);
gberyllium->SetTitle(“Beryllium”);
gberyllium->SetFillColor(0);
gberyllium->SetLineColor(2);
gberyllium->SetLineWidth(2);
gberyllium->SetMarkerStyle(21);
gberyllium->SetMarkerSize(1.5);
gberyllium->SetMarkerColor(2);
gberyllium->SetPoint(0,43.15239,8.294693);
gberyllium->SetPointError(0,0.6353388,0.3472161);
gberyllium->SetPoint(1,44.39691,7.374403);
gberyllium->SetPointError(1,0.6094376,0.3682447);
gberyllium->SetPoint(2,45.59066,6.561093);
gberyllium->SetPointError(2,0.5845697,0.3904019);
gberyllium->SetPoint(3,46.73571,5.769022);
gberyllium->SetPointError(3,0.5607353,0.4163407);
gberyllium->SetPoint(4,47.83411,5.426276);
gberyllium->SetPointError(4,0.5379253,0.4292883);
gberyllium->SetPoint(5,48.88791,4.835798);
gberyllium->SetPointError(5,0.5161223,0.4547429);
gberyllium->SetPoint(6,49.89909,4.096092);
gberyllium->SetPointError(6,0.4953032,0.4941003);
gberyllium->SetPoint(7,50.8696,3.974766);
gberyllium->SetPointError(7,0.47544,0.5015846);
gberyllium->SetPoint(8,51.80132,3.339357);
gberyllium->SetPointError(8,0.4565014,0.5472283);
gberyllium->SetPoint(9,52.69605,1.942151);
gberyllium->SetPointError(9,0.4384539,0.7175604);
gberyllium->Draw(“APC”);[/code]