Cant call GetRMSError();

Hello,

I’m relatively new to root… I’ve produced a simulation which creates some Gaussian plots and I’ve got a macro (below) which plots the RMS value of these plots. I want to include the RMS-error (error bars) on my plot but im getting the following when run:

root [0] .x Gaussian_Fit_Zsim.C
Error: Can’t call TH1F::GetRMSError() in current scope FILE:Gaussian_Fit_Zsim.C LINE:31
Possible candidates are…

Am I calling this method in the wrong context?

Thanks for any suggestions.
Paul

#include “TFile.h”
#include “TProfile.h”
#include “TGraph.h”
#include “TH1.h”

void Gaussian_Fit_Zsim() {

TFile *f = new TFile(“Zsimulation.root”);

TH1F* h_u2_1 = (TH1F*) f->Get(“h_u2_1”);
TH1F* h_u2_2 = (TH1F*) f->Get(“h_u2_2”);
TH1F* h_u2_3 = (TH1F*) f->Get(“h_u2_3”);
TH1F* h_u2_4 = (TH1F*) f->Get(“h_u2_4”);

/*
TCanvas *c1 = new TCanvas(“c1”,“c1”,900,900);
c1->SetFillColor(0);
c1->SetBorderSize(0);
c1->Divide(2,2,0.03,0.03,0);

gStyle->SetOptStat();

c1->cd(1); h_u2_1->SetTitle(“0 -> 20 Luminosity Range: Min Bias plot”); h_u2_1->Draw(); h_u2_1->Fit(“gaus”);
c1->cd(2); h_u2_2->SetTitle(“20 -> 40 Luminosity Range: Min Bias plot”);h_u2_2->Draw(); h_u2_2->Fit(“gaus”);
c1->cd(3); h_u2_3->SetTitle(“40 -> 60 Luminosity Range: Min Bias plot”);h_u2_3->Draw(); h_u2_3->Fit(“gaus”);
c1->cd(4); h_u2_4->SetTitle(“60 -> 80 Luminosity Range: Min Bias plot”);h_u2_4->Draw(); h_u2_4->Fit(“gaus”);
c1->Print(“Zsim_u2.gif”);

*/

float sigma_1 = h_u2_1->GetRMS();float error_1 = h_u2_1->GetRMSError();
float sigma_2 = h_u2_2->GetRMS();float error_2 = h_u2_2->GetRMSError();
float sigma_3 = h_u2_3->GetRMS();float error_3 = h_u2_3->GetRMSError();
float sigma_4 = h_u2_4->GetRMS();float error_4 = h_u2_4->GetRMSError();

int n = 4;

float y[n];
y[0] = sigma_1;
y[1] = sigma_2;
y[2] = sigma_3;
y[3] = sigma_4;

float y_e[n];
y[0] = error_1;
y[1] = error_2;
y[2] = error_3;
y[3] = error_4;

float x[n];
x[0] = 10;
x[1] = 30;
x[2] = 50;
x[3] = 70;

float x_e[n];
x[0] = 0;
x[1] = 0;
x[2] = 0;
x[3] = 0;

TCanvas* c2 = new TCanvas(“c2”,“Plot of sigma Vs Luminosity over 4 ranges”,900,900);
c2->SetFillColor(42);
c2->SetGrid();

TGraphErrors* gr = new TGraphErrors(n,x,y,x_e,y_e);

gr->SetMarkerColor(4);
gr->SetMarkerStyle(21);
gr->SetTitle(“Simulated plot of Luminosity Vs Sigma(u2)”);
gr->GetXaxis()->SetTitle(“Luminosity”);
gr->GetYaxis()->SetTitle(“Sigma(u2)”);
gr->Draw(“ALP*”);
c2->Print(“lum_Vs_sigma_Zsim.gif”);

}

This function was introduced in version 5.08.
You are likely using an older version.

Rene