Current ROOT Math z Current situation in ROOT

  • Slides: 10
Download presentation
Current ROOT Math z Current situation in ROOT: y lib. Core : x. TMath

Current ROOT Math z Current situation in ROOT: y lib. Core : x. TMath x. TRandom (1, 2, 3) x. TComplex y lib. Math. Core: xspecial functions (gamma, erf) xprobability density functions (pdf) xsome cumulative distribution functions (cdf) x. Physics and geometry Vectors x. Function interfaces and template functor classes y lib. Hist: xderivation, root finder (1 D), integration, y lib. Math. More: xnumerical algorithms implemented with GSL xinterface classes for some numerical algorithm (integration) 1

Current ROOT Math Libraries 2

Current ROOT Math Libraries 2

Proposal for a new lib. Math z Have a new basic Math library with

Proposal for a new lib. Math z Have a new basic Math library with y Math classes from base: x. TRandom classes, TComplex , TMath • some functions needed by ROOT core classes are defined in TMath. Base and will stay in lib. Core y all classes and interfaces from Math. Core xbasic mathematical and statistical functions xphysics vector: • 3 D and Lorentz. Vector • Rotation and Boost classes y numerical algorithms from TF 1 xnumerical derivation (TF 1: : Derivative, 2, 3) xnumerical integration (TF 1: : Integral, TF 1: : Integral. Multiple) x 1 D minimization and root finder (Brent method) used in TF 1: : Get. Minimum, TF 1: : Get. X xuse a set of interfaces which can be re-implemented using GSL in Math. More 3

Library Size z Current initial estimate size of the library (on Linux slc 3

Library Size z Current initial estimate size of the library (on Linux slc 3 gcc 3. 2. 3) Classes/Functions size of Library (KB) size of Library and Dictionary (KB) TMath 109 240 TRandom, 1, 2, 3 55 150 TComplex 4 70 ROOT: : Math functions 16 150 Physics Vector 116 ~2000 TF 1 numerical algo. 15 30 315 ~2600 Total for lib. Math z actual size probably slightly bigger 4

lib. Math improvements z Remove duplications TMath - ROOT: : Math functions y implement

lib. Math improvements z Remove duplications TMath - ROOT: : Math functions y implement using code from CEPHES some of the mathematical functions ( incomplete beta and gamma) xbetter implementation than current one based on Numerical Recipes y have a consistent set of mathematical functions and distributions xcan be extended using Math. More to more sophisticated functions • Legendere polynomial, Elliptic integral, etc. . . z Improve TRandom classes y better naming (remark made also in the internal review) xuse typedef’s for backward compatibility y provide more type of random variates and implement some more efficient algorithms xadditional Gaussian random variates, bi-Gaussian, Poisson, Binomial y have Mersenne-Twister as default engine 5

Function interfaces z Minimal function interfaces to be commonly used by the numerical algorithms

Function interfaces z Minimal function interfaces to be commonly used by the numerical algorithms y interfaces for functions in one and multi-dimensions y distinguish parametric functions from general functions 6

Functor classes z Functor classes to wrap any C++ callable object in a function

Functor classes z Functor classes to wrap any C++ callable object in a function with the right interface y free function y member functions z User does not need to provide as input a function with the right type of interface. z Example: 7

Modifications to TF 1 z Ideal would be that TF 1 contains inside a

Modifications to TF 1 z Ideal would be that TF 1 contains inside a pointer to a parametric function interface z Have template constructor to create a TF 1 from a : y free C function like now y an object pointer and a member function name z use internally the Functor classes to create the f. Function pointer. 8

Numerical Algorithm z Collect in the new lib. Math all the numerical algorithms (Derivation,

Numerical Algorithm z Collect in the new lib. Math all the numerical algorithms (Derivation, integration, root finders, etc. . ) from TF 1. y maintain the current methods for user convenience and backward compatibility z use the classes already developed in Math. More: y Derivator, Integrator, Root. Finder y Have a direct implementation extracting the code from TF 1 y same interface can be used for algorithms implemented using GSL xthe code will be in the Math. More library and plug-in manager could be used in this case to load the plug-in’s in Math. More z Algorithms could be used directly by the users (with-out the need of having a TF 1) or from other ROOT classes y user just needs to provide any callable object 9

Summary z Proposing a new Math library merging Math. Core with some existing ROOT

Summary z Proposing a new Math library merging Math. Core with some existing ROOT Math functionality present in lib. Core and lib. Hist. y it would be nice to maintain independence of the library y small library size : ~ 500 KB y we should temporarily have current Math. Core dictionaries (for the template physics vector) in a separate library z Proposed restructure of TF 1 : y use new function interfaces xextend capability of the class y use numerical algorithms from lib. Math z Possible future extensions: y Add the interfaces and base classes for fitting and minimization x. Fitter and Minimizer interfaces, Fit. Data, Fit. Result • will use plug-in manager to load minimization library 10