Please read tips for efficient and successful posting and posting code
ROOT Version: 5.34/36
Platform: cygwin
Compiler: 10.2.0
Hi, I have a funny problem, see this example:
TH1F* h1 = new TH1F("h1","h1",10,0.,1.);
h1->Fill(0.3)
h1->Fill(0.3)
h1->Fill(0.4)
h1->Fill(0.4)
h1->Fill(0.4)
h1->Fill(0.5)
h1->Fill(0.5)
h1->Fill(0.5)
h1->Fill(0.5) // etc.....
TF1* gauss = new TF1("gFun","gaus");
gauss->SetParNames("height","mean","sigma");
gauss->SetLineColor(kRed);
gauss->SetLineWidth(2);
double gauPeak = h1->GetMaximum();
gauss->SetParameters(10.,gauPeak,0.001);
TFitResultPtr res = h1->Fit("gFun","QS0"); // do NOT plot this just now
....... h1 is done, do other things, big code parts.....
h1->Draw(); //this does NOT plot the red gaussian!
h1->Draw("FUNC") //this does NOT plot anything. note there is a stat box
I thought (I am even 99% sure that I have used this behaviour before) that using option “0” to the fit means “do the fit, but do not mess with my pads & windows just_now” ; but it appears that it means instead “do not ever plot this curve” even if the associated curve exists.
Could you please clarify me this?
Thank you!