Dear experts,
I what to access histograms function after a Fit and plot all the fit on the same canvas. I used (1), but it does not find the function. You can see the complete code here (2). Do you see something wrong in the procedure?
Regards
The full example you posted via its URL uses data we do not have. Can you post a self contained example we can run and showing what is your problem ? What do you mean by “it does not find the function” ? I do not see any problem with the standard hex histogram stored in hsimple.root:
root [0] hpx->Fit("gaus")
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
FCN=63.6385 FROM MIGRAD STATUS=CONVERGED 54 CALLS 55 TOTAL
EDM=6.235e-10 STRATEGY= 1 ERROR MATRIX ACCURATE
EXT PARAMETER STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant 8.00108e+02 6.20101e+00 1.98916e-02 -6.18780e-06
2 Mean -3.86196e-03 6.30762e-03 2.47615e-05 1.13881e-03
3 Sigma 9.94740e-01 4.45485e-03 4.77918e-06 -2.46080e-02
(TFitResultPtr) <nullptr TFitResult>
root [1] hpx->GetListOfFunctions()->ls()
OBJ: TList TList Doubly linked list : 0
OBJ: TPaveStats stats X1= 2.800000 Y1=718.495291 X2=4.800000 Y2=888.805322
OBJ: TF1 gaus gaus : 0 at: 0x7fa48cc50030
root [2] auto f = hpx->GetFunction("gaus");
root [3] f->Draw()
root [4]
yes you are right, it’s working. But I want to have all the fits on the same pad number 17 as you can see at line 129 of (*). Why it does not draw them there?
Regards