Roofit Users Manual V2.91 W
Total Page:16
File Type:pdf, Size:1020Kb
Document version 2.91-33 – October 14, 2008 RooFit Users Manual v2.91 W. Verkerke, D. Kirkby Table of Contents Table of Contents .................................................................................................................................... 2 What is RooFit? ....................................................................................................................................... 4 1. Installation and setup of RooFit .......................................................................................................... 6 2. Getting started ..................................................................................................................................... 7 Building a model .................................................................................................................................. 7 Visualizing a model .............................................................................................................................. 7 Importing data ...................................................................................................................................... 9 Fitting a model to data ....................................................................................................................... 10 Generating data from a model ........................................................................................................... 13 Parameters and observables ............................................................................................................ 13 Calculating integrals over models ..................................................................................................... 14 Tutorial macros .................................................................................................................................. 16 3. Signal and Background – Composite models ................................................................................... 17 Introduction ........................................................................................................................................ 17 Building composite models with fractions .......................................................................................... 17 Plotting composite models ................................................................................................................ 19 Using composite models ................................................................................................................... 20 Building extended composite models ................................................................................................ 21 Using extended composite models ................................................................................................... 23 Note on the interpretation of fraction coefficients and ranges ........................................................... 23 Navigation tools for dealing with composite objects .......................................................................... 25 Tutorial macros .................................................................................................................................. 28 4. Choosing, adjusting and creating basic shapes .............................................................................. 29 What p.d.f.s are provided? ................................................................................................................ 29 Reparameterizing existing basic p.d.f.s ............................................................................................. 30 Binding TFx, external C++ functions as RooFit functions ................................................................ 32 Writing a new p.d.f. class................................................................................................................... 33 Tutorial macros .................................................................................................................................. 36 5. Convolving a p.d.f. or function with another p.d.f. ............................................................................. 37 Introduction ........................................................................................................................................ 37 Numeric convolution with Fourier Transforms ................................................................................... 38 Plain numeric convolution.................................................................................................................. 43 Analytical convolution ........................................................................................................................ 44 Tutorial macros .................................................................................................................................. 48 6. Constructing multi-dimensional models ............................................................................................ 49 Introduction ........................................................................................................................................ 49 Using multi-dimensional models ........................................................................................................ 50 Modeling building strategy ................................................................................................................. 52 Multiplication ...................................................................................................................................... 53 Composition ....................................................................................................................................... 54 Conditional probability density functions ........................................................................................... 56 Products with conditional p.d.f.s ........................................................................................................ 58 Extending products to more than two dimensions ............................................................................ 61 Modeling data with per-event error observables. .............................................................................. 61 Tutorial macros .................................................................................................................................. 65 2 7. Working with projections and ranges ................................................................................................ 66 Using a N-dimensional model as a lower dimensional model ........................................................... 66 Visualization of multi-dimensional models ......................................................................................... 69 Definitions and basic use of rectangular ranges ............................................................................... 70 Fitting and plotting with rectangular regions ...................................................................................... 73 Ranges with parameterized boundaries ............................................................................................ 75 Regions defined by a Boolean selection function ............................................................................. 80 Tuning performance of projections through MC integration .............................................................. 83 Blending the properties of models with external distributions ........................................................... 84 Tutorial macros .................................................................................................................................. 87 8. Data modeling with discrete-valued variables .................................................................................. 88 Discrete variables .............................................................................................................................. 88 Models with discrete observables ..................................................................................................... 88 Plotting models in slices and ranges of discrete observables ........................................................... 91 Unbinned ML fits of efficiency functions using discrete observables ................................................ 93 Plotting asymmetries expressed in discrete observables ................................................................. 95 Tutorial macros .................................................................................................................................. 96 9. Dataset import and management ...................................................................................................... 97 Importing unbinned data from ROOT TTrees .................................................................................. 97 Importing unbinned data from ASCII files .......................................................................................... 98 Importing binned data from ROOT THx histograms .......................................................................... 98 Manual construction, filling and retrieving of datasets .................................................................... 100 Working with weighted events in unbinned data ............................................................................. 102 Plotting, tabulation and calculations of