I have a root file with some histograms and I am having trouble accessing some of these hists using the code attached. I also attached the root file itself. When I try to run this macro I get the following error message:
Error: non class,struct,union object $hEFitg_3 used with . or -> macros/EMedians_A4.C:26:
*** Interpreter error recovered ***
here is the code :
{
TFile *f1 = new TFile(“Energy_hists.root”,“READ”);
TCanvas *Median = new TCanvas(“Median”,“Median”);
hMedian->SetStats(kFALSE);
hMedian->GetXaxis()->SetTitle(“A_{4}”);
hMedian->GetYaxis()->SetTitle(“Median Energy (TeV)”);
hMedian->GetXaxis()->CenterTitle(true);
hMedian->GetYaxis()->CenterTitle(true);
hMedian->SetMinimum(0);
hMedian->Draw(“e”);
TCanvas *MedianGT = new TCanvas(“MedianGT”,“MedianGT”);
hMedianGT->SetStats(kFALSE);
hMedianGT->GetXaxis()->SetTitle(“A_{4}”);
hMedianGT->GetYaxis()->SetTitle(“Median Energy (TeV)”);
hMedianGT->GetXaxis()->CenterTitle(true);
hMedianGT->GetYaxis()->CenterTitle(true);
hMedianGT->SetMinimum(0);
hMedianGT->Draw(“e”);
float ratio[101]={0.};
for (int i=1;i<101>GetBinContent(i)>0.) ratio[i] = hETrigg->GetBinContent(i);
printf("\t %6.2f \n",ratio[i]);
}
}
Energy_hists.root (22 KB)