Lorenzo Moneta,LHCb Software week, 26 May 2005 1 New ROOT Math Libraries Activities MathLib work package from ROOT SEAL merge new proposed structure for.

Slides:



Advertisements
Similar presentations
Physicist Interfaces Project an overview Physicist Interfaces Project an overview Jakub T. Moscicki CERN June 2003.
Advertisements

Common Variable Types in Elasticity
Common Variable Types in Elasticity
3D Geometry for Computer Graphics
Kinematic Synthesis of Robotic Manipulators from Task Descriptions June 2003 By: Tarek Sobh, Daniel Toundykov.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
An Open-Source, Object-Oriented General Cartographic Transformation Program (GCTP) Michael S. Williams, Michael P. Finn*, and Robert A. Buehler** United.
Lightweight Abstraction for Mathematical Computation in Java 1 Pavel Bourdykine and Stephen M. Watt Department of Computer Science Western University London.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Web services for Improving the development of automatic generalisation solutions Nicolas Regnauld Research & Innovarion Ordnance Survey 07 th March 2006,
1cs542g-term Notes  Assignment 1 will be out later today (look on the web)
Rational Trigonometry Applied to Robotics
Outline for Today More math… Finish linear algebra: Matrix composition
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
DRY. 11: DRY—Don’t Repeat Yourself Every piece of knowledge should have a single, unambiguous, authoritative representation within a system Duplication.
1 Numerical geometry of non-rigid shapes Non-Euclidean Embedding Non-Euclidean Embedding Lecture 6 © Alexander & Michael Bronstein tosca.cs.technion.ac.il/book.
15th September 2005PHYSTAT 05, Oxford 1 Statistics in ROOT René Brun, Anna Kreshuk, Lorenzo Moneta PH/SFT group, CERN ftp://root.cern.ch/root/phystat05.ppt.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Modern Navigation Thomas Herring
MathMore Lorenzo Moneta, Andràs Zsenei ROOT Workshop 30/9/2005.
ME451 Kinematics and Dynamics of Machine Systems Review of Matrix Algebra – 2.2 Review of Elements of Calculus – 2.5 Vel. and Acc. of a point fixed in.
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
1 C01 – Advanced Robotics for Autonomous Manipulation Department of Mechanical EngineeringME 696 – Advanced Topics in Mechanical Engineering.
Point set alignment Closed-form solution of absolute orientation using unit quaternions Berthold K. P. Horn Department of Electrical Engineering, University.
SEAL V1 Status 12 February 2003 P. Mato / CERN Shared Environment for Applications at LHC.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Game Physics – Part IV Moving to 3D
Math LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.
Recent and Proposed Changes to ZOOM Recent entries Intended future additions Possibilities –D0 and CDF users can affect which new “possible” additions.
Framework for track reconstruction and it’s implementation for the CMS tracker A.Khanov,T.Todorov,P.Vanlaer.
New ROOT Math Libraries W. Brown 1), M. Fischler 1), L. Moneta 2), A. Zsenei 2) 1) Fermi National Accelerator Laboratory, Batavia, Illinois, USA 2) CERN.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Geometric Transforms Changing coordinate systems.
A. Aimar - EP/SFT LCG - Software Process & Infrastructure1 Software Process panel SPI GRIDPP 7 th Collaboration Meeting 30 June – 2 July 2003 A.Aimar -
Event Data History David Adams BNL Atlas Software Week December 2001.
New ROOT Mathematical Libraries SMatrix Package with matrix and vector classes of arbitrary type (initially developed by T. Glebe for HeraB software) complementary.
§ Linear Operators Christopher Crawford PHY
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
Some Thoughts about Hits, Geometry etc Rob Kutschke, Hans Wenzel Fermilab March 13, 2007.
LCG Generator Meeting, December 11 th 2003 Introduction to the LCG Generator Monthly Meeting.
SEAL Core Libraries and Services CLHEP Workshop 28 January 2003 P. Mato / CERN Shared Environment for Applications at LHC.
March 23 & 28, Csci 2111: Data and File Structures Week 10, Lectures 1 & 2 Hashing.
March 23 & 28, Hashing. 2 What is Hashing? A Hash function is a function h(K) which transforms a key K into an address. Hashing is like indexing.
CGDD 4003 THE MATH LECTURE (BOILED DOWN, YET LIGHTLY SALTED)
SEAL Project Core Libraries and Services 18 December 2002 P. Mato / CERN Shared Environment for Applications at LHC.
SEAL-ROOT Math Plans for 2005 Math work package Andras Zsenei, Anna Kreshuk, Lorenzo Moneta, Eddy Offermann LCG Application Area Internal Review, 30 March,
Lorenzo Moneta,LHCb Software week, 26 May Proposal for ROOT Math Libraries MathLib work package from ROOT SEAL merge new proposed structure for.
Feedback from LHC Experiments on using CLHEP Lorenzo Moneta CLHEP workshop 28 January 2003.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA
SEAL and PI Project Status LHCC Comprehensive Review of LCG November 2004 P. Mato / CERN.
Computing and Statistical Data Analysis Lecture 6 Glen Cowan RHUL Physics Computing and Statistical Data Analysis Introduction to classes and objects:
Data Design and Implementation. Definitions Atomic or primitive type A data type whose elements are single, non-decomposable data items Composite type.
Computer Graphics Matrices
MND review. Main directions of work  Development and support of the Experiment Dashboard Applications - Data management monitoring - Job processing monitoring.
CSci 162 Lecture 8 Martin van Bommel. Large-scale Programming Up to now we have been writing relatively short programs to solve simple problem Want to.
SEAL Project Status SC2 Meeting 16th April 2003 P. Mato / CERN.
CPT Week, November , 2002 Lassi A. Tuura, Northeastern University Core Framework Infrastructure Lassi A. Tuura Northeastern.
MathMore Lorenzo Moneta, Andràs Zsenei ROOT Meeting 19/8/2005.
Linear Algebra Libraries: BLAS, LAPACK, ScaLAPACK, PLASMA, MAGMA Shirley Moore CPS5401 Fall 2013 svmoore.pbworks.com November 12, 2012.
ME451 Kinematics and Dynamics of Machine Systems Review of Linear Algebra 2.1 through 2.4 Th, Jan. 22 © Dan Negrut, 2009 ME451, UW-Madison.
Elements of LCG Architecture Application Architecture Blueprint RTAG 8 th June 2002 P. Mato / CERN.
Sect. 4.5: Cayley-Klein Parameters 3 independent quantities are needed to specify a rigid body orientation. Most often, we choose them to be the Euler.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Outline Addition and subtraction of vectors Vector decomposition
Test and Validation Studies of Mathematical Software Libraries
structures and their relationships." - Linus Torvalds
structures and their relationships." - Linus Torvalds
Presentation transcript:

Lorenzo Moneta,LHCb Software week, 26 May New ROOT Math Libraries Activities MathLib work package from ROOT SEAL merge new proposed structure for Math libraries MathCore and MathMore propose CLHEP merge with ROOT Random, Vector and Linear Algebra new Vector package for 3D and LorentzVector

Lorenzo Moneta,LHCb Software week, 26 May ROOT MathLib Work Package Work package from ROOT-SEAL merge Main responsabilities for this work package: Basic Mathematical functions (TMath ) Functions and Fitting Parametric function classes (TF1) Minimizers (Minuit) linear and robust fitters, etc.. Random Numbers Linear Algebra Physics and geometry Vectors (3D and 4D) Not considered now, but still relevant : Histograms Statistics (confidence level ) Neural Net, multivariate analysis, etc..

Lorenzo Moneta,LHCb Software week, 26 May Current Math Libraries

Lorenzo Moneta,AA internal review, 30 March CLHEP CLHEP packages (which are the most used ones): Random Vector (Physics Vectors) Matrix Similar functionality exist in ROOT TRandom classes TVector2 (3) and TLorentzVector classes new ROOT linear algebra package Major difference is TObject inheritance for ROOT classes Otherwise there is lots of duplication problem for long term maintenance make sense aiming to merge in a new library

Lorenzo Moneta,LHCb Software week, 26 May New Math Libraries

Lorenzo Moneta,LHCb Software week, 26 May Proposed new structure Core Mathematical Library: MathCore An extended library: MathMore

Lorenzo Moneta,LHCb Software week, 26 May MathCore CVS repository mathCore with basic functionality build-able as a standalone library (libMathCore.so) no dependency on others ROOT packages or external libraries in ROOT is inside libCore for convenience content of MathCore: Basic and common used mathematical functions Random numbers Basic numerical algorithms 3D and LorentzVectors will not use algorithms from GSL for ROOT we need to be distributed with free license and the GSL is based on the GPL (restricted) license

Lorenzo Moneta,LHCb Software week, 26 May MathMore will include more mathematical functions less used special functions (i.e. Bessel) additional and more sophisticated algorithms will use interface defined in MathCore will contain C++ Wrapper to GSL (now in SEAL) use GSL (as an external library or built together) repository for needed and useful extra Math functionality Statistics library Confidence levels, Multivariate analysis, etc.. Fitting library using various Minimizers as plug-in’s

Lorenzo Moneta,LHCb Software week, 26 May Mathematical Functions Special functions: most common and basic functions in MathCore gamma functions ( with incomplete and log Gamma) Error function other less used functions will be in MathMore Implement the functions using proposed interface to the C++ standard as it is currently done in SEAL Probability functions used in statistics Majority of these functions are computed using the gamma and error functions Basics one will be in MathMore pdf ( gaussian, BreitWigner, Gamma, Chi2, Landau) cdf (lower and upper integrals of pdf) inverse of cdf 2

Lorenzo Moneta,LHCb Software week, 26 May Numerical Algorithms MathCore will contains also numerical algorithms: adaptive integration, differentiation, interpolation, root finders, simple minimization (1D) Define interface for these algorithms and have in MathCore one possible implementation start defining interfaces from what is now in SEAL implement starting using what is in ROOT ( from TF1) cannot use SEAL implementation in MathCore since is based on GSL have a set of more sophisticated algorithms in the extended MathMore library import SEAL C++ wrappers to GSL 7

Lorenzo Moneta,LHCb Software week, 26 May Random Numbers Merge CLHEP and ROOT Random number classes CLHEP and ROOT have a different design ROOT has a common base class for all the engines and defining also the distributions easier to use (no need to create separate classes) CLHEP separates distribution classes from engine classes easier to extend if user wants to add new distributions distributions classes can have a state New design has been proposed to the C++ standard based on the Boost random numbers Need to decide which direction to go for short term: extend ROOT TRandom with more generators and distrib. use (import) CLHEP classes to implement TRandom

Lorenzo Moneta,LHCb Software week, 26 May Physics and Geometry Vectors Have classes for 2D, 3D and Lorentz Vectors and their operations and transformations (rotations and boosts ) specialized vector for geometry and kinematics and not generic Linear Algebra Vectors Merge functionality from ROOT Physics classes and CLHEP Vector and Geometry packages CLHEP provides a lot of functionality but with not sufficient coherence and too much duplication: two vector packages (Geometry and Vector) with similar functionality bloat interfaces in CLHEP Vector classes ROOT Physics classes originated from CLHEP and then developed in parallel since ‘98

Lorenzo Moneta,LHCb Software week, 26 May New Vector classes A new prototype is available since few weeks Developments done being in contact with the LHC experiments and some CLHEP authors re-use some ideas from CMS Common Vector package Characteristics of the new classes: Have minimal interfaces (and possibly stable) minimal number of methods and try to avoid duplications no x() and getX() like in CLHEP no single setter methods ( setX() or setPhi() ) Separate extra functionality in global functions in a namespace deltaR(v1,v2), invariantMass(q1,q2)

Lorenzo Moneta,LHCb Software week, 26 May New Vector classes properties New classes template on the scalar type Vector based on single precision (float) to decrease memory usage and for persistency Generic Coordinate type describe the Coordinates concept as a type have Vectors based on the coordinate system type: can have Vectors represented by cartesian (x,y,z), polar (r, theta,phi) or cylindrical coordinates (rho, eta, phi) express this as a template parameter on the Vector Vector3D allow conversions and operations between mixed vectors can improve performances in some use cases some representation can be optimal for persistency

Lorenzo Moneta,LHCb Software week, 26 May New Vector classes properties (2) Points and Vector distinction have in the geometry case (3D) different classes for Points and Vectors: PositionVector rotate and translate cannot be added and their difference results in a DisplacementVector DisplacementVector only rotate have cross and dot multiplications This distinction is present in the CLHEP Geometry but using a common base class No need to have this separation for LorentzVectors used in kinematics (DisplacementVectors in 4D)

Lorenzo Moneta,LHCb Software week, 26 May Rotations and Transformations 3D Rotations describe them according to different representations: 3x3 orthogonal matrix representation (9 numbers) 3 Euler angles Direction Axis (Vector) + angle generic rotation is template on the representation type LorentzRotations ( Boost + 3D Rotations) described by a 4x4 matrix symmetric 4x4 in the case of pure Boosts 3D Transformations (3D Rotations + Translation) described as a 3D Rotation + DisplacementVector have interface to look like a 4x4 matrix (as CLHEP)

Lorenzo Moneta,LHCb Software week, 26 May Connection to Linear Algebra Some experiments require easy connection/conversion between 3D/4D Vectors and Linear Algebra Vectors between 3D/4D Rotations and Linear Algebra matrices We want to avoid direct dependency on any LA package Proposed solution: store vector and rotation data in a C array : construct/assign from C array pointers (double *) return a C array pointer able to use Vector/Rotation content in a LA package ROOT Linear Algebra allows to create matrices by copying the data or by using the data

Lorenzo Moneta,LHCb Software week, 26 May Examples of usage: LorentzVector we have Lorentz Vectors based on Cartesian4D (x,y,z,t) or (px,py,pz,E) CylindricalEta4D ( pt, eta, phi, E) EEtaPhiMSystem ( E, eta, phi, M) and we could have more type of system (flexible to extend) one based on px,py,pz, M to avoid some numerical problems (electrons at LHC) template class on scalar type and Coordinate type use typedef’s to hide template complexity to the users typedef BasicLorentzVector LorentzVector; typedef BasicLorentzVector LorentzVectorPtEtaPhiE;

Lorenzo Moneta,LHCb Software week, 26 May LorentzVector Example LorentzVector v0; // create an empty vector (x=y=z=t=0) LorentzVector v1(1,2,3,4); // create a vector (x=1, y=2, z=3, t=4) LorentzVectorPtEtaPhiE v2(1,2,M_PI,5); // create a vector (pt=1,eta=2,phi=PI,E=5) LorentzVectorPtEtaPhiE v3(v1); // create from a Cartesian4D LV CLHEP::HepLorentzVector q(1,2,3,4); LorentzVector v3(q) // create from a CLHEP LV Accessors Constructors double x = v1.x() = v1.px(); // have both x() and px() double t = v1.t() = v1.E(); // have both t() and E() double eta = v1.eta(); XYZVector w = v1.vec(); // return vector with spatial components v1 += v2; v1 -= v2; // additions and subtructions v3 = v1 + v2; v3 = v1 - v2; double a; v1 *= a; v1 /= a; // multipl. and divisions with a scalar double p = v1.dot(v2) = v1 * v2; // prefer dot (less ambiguous) Operations

Lorenzo Moneta,LHCb Software week, 26 May Current Status and future work Current proposed version available for feedback: Received some very useful comments improved design from Fermilab CLHEP authors provide soon an updated version more feedback is still needed We need to agree on names define a set of unique names have for LV both x() and px() ? mag() or m() ? make classes usable in generic helper functions define smooth migration from CLHEP classes have some form of inter-operability need to define error handling (use std::exception ?)

Lorenzo Moneta,LHCb Software week, 26 May Linear Algebra CLHEP and ROOT have both optimized support for small matrices More functionality in ROOT Linear Algebra decompositions for solving LA systems support for sparse matrices support for external data storage pre-allocation on the stack up to 6x6 matrix and optimized inversion Proposal is to base on ROOT Linear Algebra Consider to move in the long term to template classes for supporting complex matrices Continue detailed evaluation with other LA packages follow evolution of new GLAS (Boost) project

Lorenzo Moneta,LHCb Software week, 26 May Conclusions Have first version of stand-alone libMathMore with Vectors, Random numbers and basic math functions for the first ROOT 5 release (end of June) first proposal for Vector package already exists any comment or feedback is highly desirable Later we will revise the Linear Algebra should try to use ROOT package if have particular requests here please let us know Other things that will be available later : integration of C++ Minuit from SEAL in ROOT fitting framework library

Lorenzo Moneta,Seal-ROOT meeting, 8 April References Special functions C++ proposal link to C++ extension draft (includes Random proposal) Statistical functions proposal (for Boost) SEAL Math inventory packages/mathlibs/mathTable.html packages/mathlibs/mathTable.html SEAL MathCore reference doc (GSL C++ wrappers) Proposal for new Physics Vectors