So now in my new script I am trying to do a ratio of two fitted histograms and have the ratio of their functions, but right now I am having to put in the parameters by hand and I am wondering if I can call the parameters from the rootfile like
TFile *Z = new TFile("myrootfile.root");
TH1F *Pseudhist = Z->Get("hist");
TF1 *Pseudfunc = Pseudhist->GetFunction("myfunc");
double_t a1 = Pseudfunc->GetParameter(0)
//... and so on
I’ve tried this along with other combinations and I can’t seem to get this to work. Is it possible? Thanks as always
You forgot to add some of the file referenced in your script :
root [0] .x RatioEx.C
Error in <TFile::TFile>: file NewFit4lepMassNCzz.root does not exist
Error in <TFile::TFile>: file NewFit4lepMassPseudozz.root does not exist
Your script had lots of error.
You are also retrieving the histogram and the functions from the file with the wrong names. Here attached is the script working, but please send the next time a RUNNING script