User defined fit function

How would someone go about defining a user function such as “gaus+gaus+pol2” then being able to use the “user” button on the FitPanel to fit a histogram using the slider bar (i.e is there a way to fit a user defined function between given points using the GUI interface rather than setting the parameters in the code each time?)


There are several methods, if you not need to take care of the normalization you can define the function as:

 TF1 *user = new TF1("user","gaus(0)+gaus(3)+pol12(6)")

The most important part is to name the function “user”, so when in the fit panel you chose the user defined function this function is called.

Before run the fit I think you need to set the initial parameters to value different by 0.