next up previous
Next: Setting the upper limit Up: ana10 program Previous: Tools to use the

Fit and plot results

In the urun.cpp file you have an example of analysis. There are two basic routines provided for fit and plot data. Users are encouraged to develop there own fit and plot routines and put them into CVS for everybody else usage.

Each component defined in control file is loaded in separate bana10 class. There are 4 bana10** arrays: data,bgr,sig,lim where components marked as D,B,S and L correspondingly are loaded. First dimension is a channel number (channel 0 is default if only one is used), second dimension - component number. Only one data component allowed. nbgr,nsig and nlim hold information about numbers of components in other arrays for every channel.

FitSignal function performs signal(s) fit, using TFractionFitter ROOT method.

FitSignal("etot",data[0],bgr[0],nbgr[0],sig[0],nsig[0],1,99);

Here etot - name of common histogram to fit, data[0] - data tree for channel 0 (channel 0 is default one), bgr[0] - list of background components for channel 0, sig[0] - list for signal components, we need to fit there values. nbgr and nsig - number of background and signal components. All these arrays (data,sig,bgr etc.) are passed from main program and already ready for use. Last two numbers restrict fit range (bins from 1 to 99 here).

LFitSignal function performs signal fit, in the case of only one signal component, using minimal likelihood method.

FitSignal("etot",data[0],bgr[0],nbgr[0],sig[0],nsig[0],1,99);

FitSignalCh function preforms the same job for multiple channels case. Basically it unfolds several channels for the same component into one big histogram and do the same job as FitSignal then.

FitSignal("etot",data,bgr,nbgr,sig,nsig,nchnls,1,99);

Here nchnls - number of channels.

Function Drawall_d1 plots 1D histogram for all components. Data is plot with stat. error bars, MC components highlighted with different colors. Sum of all MC component shown as well. It draws legend for convenience.

Drawall_d1("etot",data[0],bgr[0],nbgr[0],sig[0],nsig[0],true);

Last parameter, tells whether to show the legend. By default it is true.

To access individual histograms, use Geth1 method. E.g. to plot etot distribution for data

data[0]->Geth1('etot')->Draw();

To fit it with exponential function

data[0]->Geth1('etot')->Fit('expo');

And so on.

At the end, program leaves ROOT GUI window open. So user can start ROOT TBrowser to inspect different histograms, or save pictures into ps file.


next up previous
Next: Setting the upper limit Up: ana10 program Previous: Tools to use the
Vladimir Vasiliev 2008-12-02