Hey,
I have 8 root files containing ~200+ histograms. All the histograms in the 8 different root files have the same naming structure. So I want to extract histograms titled 27599 and 27199 from each root file in turn, divde them and then fit them. I created a small c_str file which is simply a list of the root files with their path directories separated by commas. However, I keep getting the error message saying the file does not exist for each root file.
Below is a short snippet of the code:
void Fitting_Code() { //OPENING BRACE
int numfiles = 8;
TFile* s[numfiles];
for (Int_t i = 0; i <numfiles; i++)
{
s[i] = TFile::Open("root_File_Names.c_str()", "read");
TH1D *h1 = (TH1D*)s[i]->Get("Data_27199");
TH1D *h2 = (TH1D*)s[i]->Get("Data_27599");
TH1D *h12=new TH1D(*h1);
h12->Divide(h1,h2,1.,1.);
//Perform fitting of the newly created histogram here.
}
}