app.Run()

I have to do this:

plot a TH1F
ask some input parameter with cin
fit the TH1F
draw the TH1F

How can I do it with app.Run() ? Now I do:

use default parameter
fit the TH1F
draw the TH1F
app.Run()

but I can’t do this:

plot a TH1F
app.Run()
ask some input parameter with cin
fit the TH1F
draw the TH1F

Hi,

You did not say anything about the fit function you want to use. If it will be a predefined functions in ROOT you can draw your histogram and use the Fit Panel for selecting a function from the list, setting parameters, fit options, etc. For more details see page 68 of the User’s Guide at ftp://root.cern.ch/root/doc/chapter5.pdf

Cheers, Ilka

I use a ROOT standard fit function, but is not this the point. The point is:

  1. Draw the graph
  2. Take some input from user
  3. Do something like fit the graph using the input of 2)
  4. Display the output like the fit

the problem is that 1) and 4) are done when I invoke app.Run(). I need a simple solution.