I have a question about ~.root file reading.
I wrote the sample macro such as
{
TFile* fFileA;
TFile* fFileB;
fFileA = new TFile("90A_NewAveSpec_MRS_pions_-0.10_0.10_0_10_3_13.root","READ");
fFileB = new TFile("90B_NewAveSpec_MRS_pions_-0.10_0.10_0_10_3_13.root","READ");
fFileA->ls();
fFileB->ls();
// 90A_NewAveSpec_MRS_pions_-0.10_0.10 is TH1F in 90A_NewAveSpec_MRS_pions_-0.10_0.10_0_10_3_13.root file.
TH1F *h1 = (TH1F *)gROOT->FindObject(“90A_NewAveSpec_MRS_pions_-0.10_0.10”);
h1->Draw();
}
But, it does not run. However, I commet out fFileA (or fFileB) case, it runs.
So, would you tell me open and read both root files, and do h1->Draw(); h2->Draw(); ???
The error message is
“Error: illegal pointer to class object h1 0x0 397 new_macro.C:18:”