ROOT courses1 The ROOT System A Data Access & Analysis Framework 3-4-5 June 2003 Ren é Brun/EP Histograming & Fitting.

Slides:



Advertisements
Similar presentations
Statistical Methods for Data Analysis Random numbers with ROOT and RooFit Luca Lista INFN Napoli.
Advertisements

EBSCO Discovery Service
Introduction to MATLAB The language of Technical Computing.
Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
Why ROOT?. ROOT ROOT: is an object_oriented frame work aimed at solving the data analysis challenges of high energy physics Object _oriented: by encapsulation,
Computational Biology, Part 23 Biological Imaging II Robert F. Murphy Copyright  1996, 1999, All rights reserved.
Durham1 Collection of algorithms in ROOT Advanced Multivariate & Statistical Techniques FermiLab Workshop May 31, 2002 Ren é Brun CERN.
Postgraduate Computing Lectures Applications I: Analysis Tools 1 Applications: Analysis Tools Analysis Tools –Used to extract Physics from reconstructed.
Fitting procedure using ROOT Department of High Energy Physics Nekrasov M. Dmitriy.
CSC321: 2011 Introduction to Neural Networks and Machine Learning Lecture 10: The Bayesian way to fit models Geoffrey Hinton.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 17 JavaScript.
ASENT_MTTR.PPT Maintainability Predictions Last revised 8/11/2005.
Blueprint RTAGs1 Coherent Software Framework a Proposal LCG meeting CERN- 11 June Ren é Brun ftp://root.cern.ch/root/blueprint.ppt.
Coherent Software Framework a Proposal
O. Stézowski IPN Lyon AGATA Week September 2003 Legnaro Data Analysis – Team #3 ROOT as a framework for AGATA.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Resampling techniques Why resampling? Jacknife Cross-validation Bootstrap Examples of application of bootstrap.
1 Data Analysis Framework for DHC Tower Update - 07/28/2003 Kurt Francis - Northern Illinois University.
Simulation and Probability
1 Data Analysis Framework for DHC Tower 07/21/2003 Kurt Francis - Northern Illinois University.
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.
Modern Navigation Thomas Herring
Binary Variables (1) Coin flipping: heads=1, tails=0 Bernoulli Distribution.
Sept 11, 2003ROOT Day1, Suzanne Panacek39 ROOT An object oriented HEP analysis framework. Day 1.
ROOT An object oriented HEP analysis framework.. Computing in Physics Physics = experimental science =>Experiments (e.g. at CERN) Planning phase Physics.
ROOT: A Data Mining Tool from CERN Arun Tripathi and Ravi Kumar 2008 CAS Ratemaking Seminar on Ratemaking 17 March 2008 Cambridge, Massachusetts.
Machine Learning CUNY Graduate Center Lecture 3: Linear Regression.
Introduction to Hall-D Software February 27, 2009 David Lawrence - JLab.
30th September 2005ROOT2005 Workshop 1 Developments in other math and statistical classes Anna Kreshuk, PH/SFT, CERN.
21-Apr-2005J. Adamczewski1 DVEE C++ course 2005 The ROOT framework 1: Introduction.
Steps in simulation study 1. - Clearly understand problem - Reformulation of the problem 2. - Which questions should be answered? - Is simulation appropriate?
N ATIONAL E NERGY R ESEARCH S CIENTIFIC C OMPUTING C ENTER Charles Leggett A Lightweight Histogram Interface Layer CHEP 2000 Session F (F320) Thursday.
Computational Biology, Part 23 Biological Imaging III G. Steven Vanni Robert F. Murphy Copyright  1998, All rights reserved.
_______________________________________________________________CMAQ Libraries and Utilities ___________________________________________________Community.
Acat OctoberRene Brun1 Future of Analysis Environments Personal views Rene Brun CERN.
Recap Sum and Product Functions Matrix Size Function Variance and Standard Deviation Random Numbers Complex Numbers.
ROOT Future1 Some views on the ROOT future ROOT Workshop 2001 June 13 FNAL Ren é Brun CERN.
ROOT courses1 The ROOT System A Data Access & Analysis Framework Graphics.
SEAL-ROOT Math Plans for 2005 Math work package Andras Zsenei, Anna Kreshuk, Lorenzo Moneta, Eddy Offermann LCG Application Area Internal Review, 30 March,
5/2/  Online  Offline 5/2/20072  Online  Raw data : within the DAQ monitoring framework  Reconstructed data : with the HLT monitoring framework.
Introduction to EBSCOhost Tutorial support.ebsco.com.
Graphics Work Package ROOT release 5.28 Review Root meeting 11/06/2010.
David Adams ATLAS DIAL: Distributed Interactive Analysis of Large datasets David Adams BNL August 5, 2002 BNL OMEGA talk.
Postgraduate Computing Lectures PAW 1 PAW: Physicist Analysis Workstation What is PAW? –A tool to display and manipulate data. Learning PAW –See ref. in.
ROOT: Status & Developments1 Aachen 1 February 2005 Ren The ROOT Project Status & Developments.
The MEG Offline Project General Architecture Offline Organization Responsibilities Milestones PSI 2/7/2004Corrado Gatto INFN.
Claritas 3D REFSTAT: Refraction statics calculations.
Lorenzo Moneta,LHCb Software week, 26 May New ROOT Math Libraries Activities MathLib work package from ROOT SEAL merge new proposed structure for.
Introduction to Blackboard Rabie A. Ramadan Session 3.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
LCG AA Meeting 30 June 2004 Ilka Antcheva Graphics User Interface in ROOT.
Gaudi Framework Tutorial, April Histograms And N-tuples.
ROOT: Functions & Fitting Harinder Singh Bawa California State University Fresno.
Level 3 Tracking Tutorial R. Beuselinck 7 February 2001 Current status of level 3 tracking interface User access methods and parameter definitions Simple.
Course ILT Using complex selection structures Unit objectives Include radio buttons and check boxes in an interface, create and call a user- defined Sub.
Online Data Monitoring Framework Based on Histogram Packaging in Network Distributed Data Acquisition Systems Tomoyuki Konno 1, Anatael Cabrera 2, Masaki.
Wouter Verkerke, UCSB Data Analysis Exercises - Day 2 Wouter Verkerke (NIKHEF)
Introduction to EBSCOhost
Developments in other math and statistical classes
ROOT: Functions & Histograms
Ex1: Event Generation (Binomial Distribution)
ROOT: Functions & Fitting
S.Linev, J. Adamczewski, M. Al-Turany, D. Bertini, H.G.Essel
Statistical Methods for Data Analysis Random numbers with ROOT and RooFit Luca Lista INFN Napoli.
Introductory Statistics
Presentation transcript:

ROOT courses1 The ROOT System A Data Access & Analysis Framework June 2003 Ren é Brun/EP Histograming & Fitting

R.Brun LCG ROOT corses2

ROOT courses3 The Histogram Package

R.Brun LCG ROOT corses4 The Histogram Classes Structure 1-Dim 2-Dim 3-Dim

R.Brun LCG ROOT corses5 Filling Histograms An histogram is typically filled with statements like: h1->Fill(x); h1->Fill(x,w); //fill with weight h2->Fill(x,y) h2->Fill(x,y,w) h3->Fill(x,y,z) h3->Fill(x,y,z,w) h1->Fill(string) The Fill functions return the bin number for 1-D histograms or global bin number for 2-D and 3-D histograms. If TH1::Sumw2 has been called before filling, the sum of squares of weights is also stored. One can also increment directly a bin number via TH1::AddBinContent or replace the existing content via TH1::SetBinContent. To access the bin content of a given bin, do: Double_t binContent = h->GetBinContent(bin);

R.Brun LCG ROOT corses6 Automatic binning #include "TH1.h" #include "TF1.h" void demoauto() { TF1 *f1 = new TF1("f1","gaus",0,30); f1->SetParameters(1,10,3); TH1F *h = new TH1F("h","Automatic binning demo",100,0,0); for (Int_t i=0;i< ;i++) { h->Fill(f1->GetRandom()); } h->Draw(); } No limits

R.Brun LCG ROOT corses7 Filling with strings See tutorials -hlabels1.C -hlabels2.C -cernstaff.C

R.Brun LCG ROOT corses8 Histograms New class THStack Long list of new functions in TH1 Plenty of new drawing options Filling with string variables TH1::Merge(TCollection *list)

R.Brun LCG ROOT corses9 Peak Finder + Deconvolutions by Miroslav Morach TSpectrum

R.Brun LCG ROOT corses10 Fitting TVirtualFitter TFitter TMinuit TH1::Fit bin chisquare bin likelihood TGraph::Fit unbinned chisquare User TTree::Fit unbinned likelihood TFumili

R.Brun LCG ROOT corses11 Fitting histograms Histograms (1-D,2-D,3-D and Profiles) can be fitted with a user specified function via TH1::Fit. Two Fitting algorithms are supported: Chisquare method and Log Likelihood The user functions may be of the following types: standard functions: gaus, landau, expo, poln combination of standard functions; poln + gaus A C++ interpreted function or a C++ precompiled function An option is provided to compute the integral of the function bin by bin instead of simply compute the function value at the center of the bin. When an histogram is fitted, the resulting function with its parameters is added to the list of functions of this histogram. If the histogram is made persistent, the list of associated functions is also persistent. One can retrieve the function/fit parameters with calls such as: Double_t chi2 = myfunc->GetChisquare(); Double_t par0 = myfunc->GetParameter(0); //value of 1st parameter Double_t err0 = myfunc->GetParError(0); //error on first parameter

R.Brun LCG ROOT corses12 Associated functions One or more object (typically a TF1*) can be added to the list of functions associated to each histogram. When TF1::Fit is invoked, the fitted function is added to this list. Given an histogram h, one can retrieve an associated function with: TF1 *myfunc = h->GetFunction("myfunc");

ROOT courses13 RooFit A general purpose tool kit for data modeling Wouter Verkerke (UC Santa Barbara) David Kirkby (UC Irvine) ftp://root.cern.ch/root/R2002/verkerke.ppt

R.Brun LCG ROOT corses14 Operations on histograms Many types of operations are supported on histograms or between histograms Addition of an histogram to the current histogram Additions of two histograms with coefficients and storage into the current histogram Multiplications and Divisions are supported in the same way as additions. The Add, Divide and Multiply functions also exist to add,divide or multiply an histogram by a function. If an histogram has associated error bars (TH1::Sumw2 has been called), the resulting error bars are also computed assuming independent histograms. In case of divisions, Binomial errors are also supported. The standard operators +, -, *, / are supported.

R.Brun LCG ROOT corses15 Random Numbers and Histograms TH1::FillRandom can be used to randomly fill an histogram using the contents of an existing TF1 analytic function anothe r histogram (for all dimensions). For example the following two statements create and fill an histogram times with a default gaussian distribution of mean 0 and sigma 1: TH1F h1("h1","histo from a gaussian",100,-3,3); h1.FillRandom("gaus",10000); TH1::GetRandom can be used to return a random number distributed according the contents of an histogram.

R.Brun LCG ROOT corses16 Drawing Histograms When you call the Draw method of a histogram for the first time (TH1::Draw), it creates a THistPainter object and saves a pointer to painter as a data member of the histogram. The THistPainter class specializes in the drawing of histograms. It is separate from the histogram so that one can have histograms without the graphics overhead, for example in a batch program. The choice to give each histogram have its own painter rather than a central singleton painter, allows two histograms to be drawn in two threads without overwriting the painter's values. When a displayed histogram is filled again you do not have to call the Draw method again. The image is refreshed the next time the pad is updated. The same histogram can be drawn with different graphics options in different pads. When a displayed histogram is deleted, its image is automatically removed from the pad.

R.Brun LCG ROOT corses17 1-D drawing Options Any object in the canvas is clickable and editable

R.Brun LCG ROOT corses18

R.Brun LCG ROOT corses19 2-D drawing options

R.Brun LCG ROOT corses20 2-D drawing options

R.Brun LCG ROOT corses21 2-D drawing Options All these plots can be rotated with the mouse

R.Brun LCG ROOT corses22 2-D drawing Options Same output on the screen and with vector Postscript

R.Brun LCG ROOT corses23 THStack examples

R.Brun LCG ROOT corses24 Filling with string variables

R.Brun LCG ROOT corses25 Math Libs & Statistics GRID middleware RDBMS run/file catalogs Object persistency 2-d, 3-d graphics GUI Toolkits Math Libs Statistics Detector Geometry Event Generators Detector Simulation Object persistency Histograming Fitting Event Models Folders Event Display Ntuple analysis Interpreters DAQ Online System services In ROOT today TVector2,3 TLorentzRotation TLorentzVector TRandom,2,3 TMatrix TMath TFeldmanCousins TPrincipal TMultidimFit TConfidenceLevel TFractionFitter Can generate random numbers from basic distributions; gaus, poisson, etc from parametric analytic functions 1,2,3-d from histograms, 1,2,3-d A collection of many algorithms CERNLIB, Numerical Recipes in C/C++ Would like to see an interface to GSL to Numerical Recipes in C++ Collaboration with Fred James, Louis Lyons, Sherry Towers Many algorithms classes developed by a huge user community See recent FNAL meeting and effort organized within ACAT Matrix package maintained by E. Offermann (Rentec)