Hi Alberto, For your first question, see the tutorials about fitting $ROOTSYS/tutorials/multifit.C (sum of 3 gaussians) $ROOTSYS/tutorials/FittingDemo.C (more general example). I also recommend reading the chapter about fitting in the Users Guide. For your last question, see: http://root.cern.ch/root/htmldoc/TMath.html#TMath:Gaus Using the CVS version, you can fot a normalized gaussian with hist.Fit("gausn") instead of hist.Fit("gaus") Rene Brun Alberto Pulvirenti wrote: > > Dear all, > > I have made a study where I needed to manage a histogram which should > have a shape which is the result of the superimposition of two distinct > gaussians, with similar mean (around 0) and very different constant & > sigma values. > > I managed to realize a macro which performs the fit of two gaussians, > which is initialized first excluding the 'signal' events (the higher and > narrower one), and fitting the background. Then, I excluded such > background and fitted the signal. > Finally, using the values obtained from these partial fits, I generated > a function which i just the sum of two gaussians, and I refitted it. > > Of course, the result can be approximative (sometimes I get large chi > square). A colleague of mine told me that in PAW there was an automatic > procedure to perform a double-gaussian fit. I was wondering if such a > procedure is present also in ROOT or not. > > Another question about fit is the following. We know that in a > normalized gaussian there is a precise relationship between the constant > and sigma, and then such a function has only two (not three) free > parameters. Is there any "automatic" function which performs this? > > Cheers > > -- > Alberto Pulvirenti, Ph. D. > University of Catania / INFN Catania > Address: Via S. Sofia, 64 I-95123 Catania > Phone: +39-095-378-5286
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET