RooFit
New tutorial macros available
A completely new set of 70(!) tutorial macros is now available in $ROOTSYS/tutorials/roofit
These macros are divided in several subjects and are all referenced as iluustrations of concepts explained in the forthcoming edition on RooFit Users Manual.
All macros are extensively documented and each is fully functional standalone. The accompanying update
of the Manual is expected mid-September.
BASIC FUNCTIONALITY
- rf101_basics.C - Fitting, plotting, toy data generation on one-dimensional p.d.f
- rf102_dataimport.C - Importing data from ROOT TTrees and THx histograms
- rf103_interprfuncs.C - Interpreted functions and p.d.f.s
- rf104_classfactory.C - The class factory for functions and p.d.f.s
- rf105_funcbinding.C - Demonstration of binding ROOT Math functions as RooFit functions and pdfs
- rf106_plotdecoration.C - Adding boxes with parameters, statistics to RooPlots.
- rf107_plotstyles.C - Demonstration of various plotting styles of data, functions
- rf108_plotbinning.C - Plotting unbinned data with alternate and variable binnings
- rf109_chi2residpull.C - Calculating chi^2 from histograms and curves in RooPlots,
- rf110_normintegration.C - Examples on normalization & integration of p.d.f.s, construction of cumulative distribution functions.
- rf111_numintconfig.C - Configuration and customization of how numeric (partial) integrals
ADDITION AND CONVOLUTION
- rf201_composite.C - Composite p.d.f with signal and background component
- rf202_extendedmlfit.C - Setting up an extended maximum likelihood fit
- rf203_ranges.C - Fitting and plotting in sub ranges
- rf204_extrangefit.C - Extended maximum likelihood fit with alternate range definition
- rf205_compplot.C - Options for plotting components of composite p.d.f.s.
- rf206_treevistools.C - Tools for visualization of RooAbsArg expression trees
- rf207_comptools.C - Tools and utilities for manipulation of composite objects
- rf208_convolution.C - One-dimensional numeric convolution
- rf209_anaconv.C - Decay function p.d.fs with optional B physics
MULTIDIMENSIONAL MODELS
- rf301_composition.C - Multi-dimensional p.d.f.s through composition, e.g. substituting a p.d.f parameter with a function that depends on other observables
- rf302_utilfuncs.C - Utility functions classes available for use in tailoring
- rf303_conditional.C - Use of tailored p.d.f as conditional p.d.fs.s
- rf304_uncorrprod.C - Simple uncorrelated multi-dimensional p.d.f.s
- rf305_condcorrprod.C - Multi-dimensional p.d.f.s with conditional p.d.fs in product
- rf306_condpereventerrors.C - Complete example with use of conditional p.d.f. with per-event errors
- rf307_fullpereventerrors.C -Complete example with use of full p.d.f. with per-event errors
- rf308_normintegration2d.C - Examples on normalization of p.d.f.s in more than one dimension
- rf309_ndimplot.C - Making 2 and 3 dimensional plots of p.d.f.s and datasets
- rf310_sliceplot.C -Projecting p.d.f and data slices in discrete observables
- rf311_rangeplot.C -Projecting p.d.f and data ranges in continuous observables
- rf312_multirangefit.C - Performing fits in multiple (disjoint) ranges in one or more dimensions
- rf313_paramranges.C - Working with parameterized ranges to define non-rectangular regions
- rf314_paramfitrange.C - Working with parameterized ranges in a fit.
- rf315_projectpdf.C - Marginizalization of multi-dimensional p.d.f.s through integration
- rf316_llratioplot.C - Using the likelihood ratio techique to construct a signal enhanced 1-D projection of a multi-dimensional p.d.f.
DATA AND CATEGORIES
- rf401_importttreethx.C -Overview of advanced option for importing data from ROOT TTree and THx histograms
- rf402_datahandling.C - Tools for manipulation of (un)binned datasets
- rf403_weightedevts.C - Using weights in unbinned datasets
- rf404_categories.C - Working with RooCategory objects to describe discrete variables
- rf405_realtocatfuncs.C - Demonstration of real-->discrete mapping functions
- rf406_cattocatfuncs.C - Demonstration of discrete-->discrete (invertable) functions
- rf407_latextables.C - Latex printing of lists and sets of RooArgSets
ORGANIZATION AND SIMULTANEOUS FITS
- rf501_simultaneouspdf.C - Using simultaneous p.d.f.s to describe simultaneous fits to multiple datasets
- rf502_wspacewrite.C - Creating and writing a workspace
- rf503_wspaceread.C - Reading and using a workspace
- rf504_simwstool.C - Using RooSimWSTool to construct a simultaneous p.d.f that is built of variations of an input p.d.f
- rf505_asciicfg.C - Reading and writing ASCII configuration files
- rf506_msgservice.C - Tuning and customizing the RooFit message logging facility
- rf507_debugtools.C - Using the RooFit memory tracing debug tool
- rf508_listsetmanip.C - RooArgSet and RooArgList tools and tricks
LIKELIHOOD AND MINIMIZATION
- rf601_intminuit.C - Interactive minimization with MINUIT
- rf602_chi2fit.C - Setting up a binning chi^2 fit
- rf603_multicpu.C - Setting up a multi-core parallelized unbinned maximum likelihood fit
- rf604_constraints.C - Fitting with constraints
- rf605_profilell.C - Working with the profile likelihood estimator
- rf606_nllerrorhandling.C - Understanding and customizing error handling in likelihood evaluations
- rf607_fitresult.C - Demonstration of options of the RooFitResult class
SPECIAL PDFS
- rf701_efficiencyfit.C - Unbinned maximum likelihood fit of an efficiency eff(x) function
- rf702_efficiencyfit_2D.C - Unbinned maximum likelihood fit of an efficiency eff(x) function to
- rf703_effpdfprod.C - Using a product of an (acceptance) efficiency and a p.d.f as p.d.f.
- rf704_amplitudefit.C - Using a p.d.f defined by a sum of real-valued amplitude components
- rf705_linearmorph.C - Linear interpolation between p.d.f shapes using the 'Alex Read' algorithm
- rf706_histpdf.C - Histogram based p.d.f.s and functions
- rf707_kernelestimation.C - Using non-parametric (multi-dimensional) kernel estimation p.d.f.s
- rf708_bphysics.C - Special decay pdf for B physics with mixing and/or CP violation
VALIDATION AND MC STUDIES
- rf801_mcstudy.C - A Toy Monte Carlo study that perform cycles of event generation and fittting
- rf802_mcstudy_addons.C - RooMCStudy: using separate fit and generator models, using the chi^2 calculator model
- rf803_mcstudy_addons2.C - RooMCStudy: Using the randomizer and profile likelihood add-on models
- rf804_mcstudy_constr.C - Using RooMCStudy on models with constrains
Miscellaneous small improvements
A very large number of small fixes and interface improvements have been made in the context of the systematic review of all methods for the new tutorial macros and updated Users Manual.
Listed below are the most significant functionality upgrades that were introduced in the process.
- Runtime binding of C++ functions - You can now trivially bind at run time any C++ functions as a RooFit function or p.d.f. objects, e.g. RooAbsReal* erfx = bindFunction("erfx",TMath::erf,x). See rf105_funcbinding.C for details
- Runtime binding of TFx functions - You can now trivially bind at run time any ROOT TFx function as a RooFit function or p.d.f. objects, e.g. RooAbsReal* myFunc = bindFunction(myTF1,x). See rf105_funcbinding.C for details
- RooAbsReal - The handling of -log(L) evaluation errors in plotting is now explicitly controllable, just like in fitting. See rf606_nllerrorhandling.C for details
- RooDataHist - Add new named argument constructor that can collate multiple ROOT THn histgrams into a n+1 dimensional RooDataHist
- RooDataSet - Add new named argument constructor that can collate multiple input RooDataSets into a n+1 dimensional RooDataSet.
Add createHistogram() method for simplified plotting
- RooFitResult - Add new method correlationHist() that returns a labeled TH2 with the contents of the fit correlation matrix
- RooFFTConvPdf - Automatically put sampling windows of 'resolution model' p.d.f. centered around zero, even if fit range of convolution observable does not bracket zero. Improve internal effeciency
- RooAbsData - Add ability to plot efficiency distribution with correct binomial errors given a RooRealVar and a RooCategory category observable encoding distribution and accept/reject state respectively. See rf701_efficiencyfit.C for details
- RooAbsPdf - Included extended ML term by default in fit if p.d.f is extendable. You can still use Extended() to override default behavior. Do not run MINOS by default anymore if no fit options are provided.
- RooProfileLL - Add option to always start minimization from global minimimum (takes more time, but improves reproducibility). Can now profile multi-core paralellized likelihoods as well.
- RooRealSumPdf - Enable plotting of component p.d.f.s using same scheme as RooAddPdf, i.e. just use the Components() specified in plotOn().
- RooExpensiveObjectCache - New cache manager for sharing and storing of expensive components cached by operator p.d.f.s
- RooMCStudy - Add Silence() argument to constructor to request minimal verbosity during running
- RooMinuit - Improve contour() method to return RooPlots rather than drawing TGraphs straight on a canvas
- RooWorkspace - Add private expensive object cache to workspace
- RooBinningCategory - New real-to-category function that maps values of input RooRealVar to categories with labels that correspond to bins of input RooRealVar. See rf405_realtocatfuncs.C for details
RooStats
This is a new package introduced in this version for statistical tools built on top of RooFit. It is a joint effort between the LHC experiments and the ROOT team (see the RooStats Wiki page).
This version contains the interfaces for performing the statistical calculations and dealing with the obtained results and concrete classes implementing the statistical methods.
All the classes and functions in RooStats are provided in the namespace RooStats.
RooStats interfaces
- ConfInterval: interface for describing a confidence interval.
- IntervalCalculator: interface for a statistical tool producing confidence intervals (class ConfInterval).
- HypoTestResult: interface for representing results of a hypothesis test
- HypoTestCalculator: interface for a statistical tool performing an hypothesis test.
- CombinedCalculator: interface for a statistical tool which can produce both hypothesis test results and confidence intervals.
RooStats concrete classes
The concrete classes describing statistical tools implementing the above interfaces are:
- ProfileLikelihoodCalculator: it is an implementation of a CombinedCalculator using the profile likelihood ratio as a test statistics. After configuring the calculator, one only needs to ask GetHypoTest() (which will return a HypoTestResult pointer) or GetInterval() (which will return an ConfInterval pointer).
- LikelihoodInterval: concrete implementation of a ConfInterval interface. It implements connected N-dimensional intervals based on the contour of a likelihood ratio. The boundary of the interval is equivalent to a MINUIT/MINOS contour about the maximum likelihood estimator.
- HybridCalculator: hypothesis test calculator using a Bayesian-frequentist hybrid method (often called in HEP as CLs method). This class extends the functionality of the TLimit class by taking advantage of the RooFit package. The result of the calculator is returned as an HybridResult pointer. HybridResult implements the HypoTestResult interface. The class HybridPlot allows for a graphical representation of a HybridResult.
HybridCalculator implements the interface class HypoTestCalculator. A contructor exists taking as input the pdf's (expressed as RooAbsPdf instances) for the signal+background (alternate) and backgorund only (null) hypothesis and the data set (as RooAbsData instance). One can provide optionally also the nuisance parameters and its pdf which will be marginalized by the calculator. The HypoTestCalculator interface provides also the possibility of setting the model via a Rooworkspace class and names of the pdf. This possibility is not yet supported for the HybridCalculator class.
Additional classes or functions provided by RooStats are:
- NumberCountingUtils: a collection of number counting statistical utilities
- NumberCountingPdfFactory: a factory for building
the PDF and the data for a number counting combination and adding them in a RooWorkspace.
- SPlot: implementation of the SPlot statistical tool to unfold data distributions and based on RooFit. This class uses the same statistical algorithm used in the class TSPlot, but in addition it provides the possibility to model the input distributions using RooFit model classes. This class can then be used in combination of a RooFit maximum likelihood fit.
RooStats tutorials macros
Tutorials are provided in the tutorials/roostats directory:
- rs100_numbercounting.C: an example of a combination of two searches using number counting with background uncertainty.
- rs102_hypotestwithshapes.C: example of usage of ProfileLikleihoodCalculator to do a hypothesis test of the background-only and signal+background hypotheses.
- rs201_hybridcalculator.C: example how to use the HybridCalculator.