ROOT: Functions & Fitting Harinder Singh Bawa California State University Fresno.

Slides:



Advertisements
Similar presentations
Interaction Design: Visio
Advertisements

Working with Profiles in IX1D v 3 – A Tutorial © 2006 Interpex Limited All rights reserved Version 1.0.
Acadia Junior High School
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Chapter 12 Creating and Using Templates. If you have already created and designed a page you like, you can use the layout and design for other pages in.
Fitting procedure using ROOT Department of High Energy Physics Nekrasov M. Dmitriy.
1.2 - Displaying quantitative data with graphs (Histograms)
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 2.2.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 3 1 Microsoft Office Excel 2003 Tutorial 3 – Developing a Professional- Looking.
1 Data Analysis Framework for DHC Tower Update - 07/28/2003 Kurt Francis - Northern Illinois University.
Checking the Required Conditions. Check these 3 boxes.
12.18 report LIU Qian. Moon box test Purpose: Try to find the reason why the Q resolution is about 10%. Test: The stability of Ref-PMT test Ref-PMT voltage.
MATLAB Week 3 17 November Outline Graphics – Basic plotting – Editing plots from GUI – Editing plots from m-file – Advanced plotting commands.
G. Cowan Lectures on Statistical Data Analysis 1 Computing and Statistical Data Analysis Some slides about ROOT Interactive data analysis program and class.
Need to know in order to do the normal dist problems How to calculate Z How to read a probability from the table, knowing Z **** how to convert table values.
Using Interactive Charting Gaussian Output, ADF Output, Vasprun.xml files.
Generation of atlas graphs & charts. Objective The major objective this training session is to equip participants with the knowledge and skills of creating.
Every week: Sign in at the door If you are new: Fill in Registration Form Ask a Mentor how to get started Make sure you are on the Athenry Parents/Kids.
To get to the Progress Toward Degree worksheets, click on “Contents” on the menu bar…
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.
DAQ_HowTo_ ppt1 How to use DAQ for Argonne Beam Test Tsunefumi Mizuno November 07, 2003 History.
- Circle markers produced by TAsimage: They do not match was is produced on screen. The line width is too thick. Some other markers need to be tune a bit.
-Problem with the Fill Color/Style on PS: 2 problems pending. Need to be fixed soon. Working on it. -Make some “session capture”: To show some “Typical.
EMetric Presents A reporting application designed to fit the needs of ACCESS for ELLs users.
Web Technologies Website Development Trade & Industrial Education
February 2006Colby College ITS Formatting Techniques for Excel 2003.
Chapter 2 Developing a Web Page. A web page is composed of two distinct sections: –The head content –The body Creating Head Content and Setting Page Properties.
Introduction to Matlab & Data Analysis
Microsoft Office Excel 2003 Tutorial 3 – Developing a Professional-Looking Worksheet.
21-Apr-2005J. Adamczewski1 DVEE C++ course 2005 The ROOT framework 1: Introduction.
1 Online Textbook Adooptions
Virtual Interaction Manager
Domain 3 Understanding the Adobe Dreamweaver CS5 Interface.
Lesson 8- Assemblies. –Are a grouping of parts –Have orientation and alignment specified –Are Three dimensional Assemblies let you –See if the parts will.
Stat 155, Section 2, Last Time Numerical Summaries of Data: –Center: Mean, Medial –Spread: Range, Variance, S.D., IQR 5 Number Summary & Outlier Rule Transformation.
University of Sunderland CDM105 Session 6 Dreamweaver and Multimedia Fireworks MX 2004 Creating Menus and Button images.
Graphics Concepts CS 2302, Fall /3/20142 Drawing Paths.
Quick guide on making PowerPoint slides  PowerPoint is a presentation program  A PowerPoint slideshow is a stack of slides being presented one after.
Macromedia Studio 8 Step-by-Step MACROMEDIA FIREWORKS 8 Project 2: Experience Bank Logo.
Excel – Lesson 2 Excel Lesson 2 Changing the Appearance of a Worksheet Microsoft Office 2007: Introductory Pasewark & Pasewark 1.
Advanced Stata Workshop FHSS Research Support Center.
PowerPoint Basics Tutorial 1: Objects These tutorials will introduce you to the most basic and useful functions of Microsoft PowerPoint We’re going.
CISB434: VisiRule 1.
1.  Formatting applied to spreadsheet for the purpose of organizing and clarifying information.  Data presented in a uniform and consistent format 
Interactive Frequency Filtering Program Geoff Franz.
HES-HKS & KaoS meeting Toshi Gogami 26June June2013.
UsersTraining StatisticsCommunication Tests Knowledge Board Welcome to the Knowledge Board interactive guide! We encourage you to start with a click on.
Designing a Web Page Layout Using a Professional Bitmap & Vector Graphic Editing Suite 1IT: Web Technologies – Design a Web Page Layout 2 Copyright © Texas.
Performance of Trigger counter for WC test Toshiyuki Gogami 3Dec2014.
Energy Loss Graduate School of Science, Tohoku University Toshi Gogami 22/May/2013.
Learning the Basics of ArcMap 3.3 Updated 4/27/2010 Using Arc/View pt. 1 1.
Systematics in Hfitter. Reminder: profiling nuisance parameters Likelihood ratio is the most powerful discriminant between 2 hypotheses What if the hypotheses.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
Chapter 11 Collaboration Features for Workbooks Microsoft Excel 2013.
User Manual for Tmaptool – T1 ρ processing tool Guruprasad Krishnamoorthy Chetana Bayas Gargi Pednekar.
© Execview Ltd 2015: all rights reserved Execview Scorecard Training/Reference Guide 2013 Key functions guide for Scorecard administrators.
Wouter Verkerke, UCSB Data Analysis Exercises - Day 2 Wouter Verkerke (NIKHEF)
International Electrotechnical Commission. To insert full size picture: Design > Background Styles > Format Background > Fill > Picture or Texture Fill.
Summary Slide (created in slide sorter view) Create a PowerPoint Show in Word Create a PowerPoint Show in Word Important Considerations Important Considerations.
Course Number and Name Do not move or resize the white textbox; font change and text edits MUST fit inside white text box. It is recommended to leave background.
ROOT: Functions & Histograms
Data Assimilation Research Testbed Tutorial
ROOT: Functions & Fitting
How to use this SPARKlab Authoring Template (PowerPoint 2008 for Mac)
Project Objectives Open an image Save an image Resize an image
Tips for Inserting Graphs or Images Tips for Title/Headers Bar Color
Course Name Course Number Section Term – Instructor Name
Learning the Basics of ArcMap 3.3 Updated 4/27/2010
Course Name Course Number Section Term – Instructor Name
Presentation transcript:

ROOT: Functions & Fitting Harinder Singh Bawa California State University Fresno

Review of previous sessions: Any Question? * Good to practice some exercises side by side in order to understand

Functions

A function can have parameters (e.g. floating parameters for fits...) TF1 with parameters

a TCanvas is an object too... Like most objects in ROOT, functions can be drawn on a canvas Let's draw a TF1 on a TCanvas

Functions and Histograms  Define a function  Define a function: TF1 *myfunc=new TF1(“myfunc”,”gaus”,0,3); Myfunc->SetParameters(10., 1.5, 0.5); Myfunc->Draw();  Generate histograms from functions: (Myfunc->GetHistogram())->Draw();  Generate histograms with random numbers from a function: TH1F *hgaus=new TH1F(“hgaus”,”histo from gaus”, 50, 0,3); hgaus->FillRandom(“myfunc”,10000); hgaus->Draw();  Write histogram to a rootfile: TFile *myfile= new Tfile(“hgaus.root”,”RECREATE”); hgaus->Write(); Myfile->Close();

Fitting Histograms Let us try to fit the histogram created by the previous step: Interactively:  Open rootfile containing histogram: root –l hgaus.root  Draw histogram hgaus->Draw()  Right click on the histogram and select “Fit Panel”  Check to ensure:  “gaus” is selected in the Function->Predefined pop- menu  “Chi-square” is selected in the Fit Settings->Method menu  Click on “Fit” at the bottom [Display fit parameters: Select Options->FitParameters]

Fitting contd: Using user defined functions:  Create a file called user_func.C with the following contents: Last 3 parameters specify the number of parameters for the function

gStyle->SetOptStat( ) Also can try : gStyle->SetOptFit(1111)

Move the slider to change fit Range Fitting contd:

Mean=65, sigma=5.

Exercise: 1)  Create a gaussian function using TF1 class of Root, set its parameters(500.,65.,5.), plot it and finally save the plot. Hint: Gaussian function: TF1 f1("gauss", "[0] / sqrt(2.0 * TMath::Pi()) / [2] * exp(-(x-[1])*(x-[1])/2./[2]/[2])", 0, 100)  Create a gaussian distributed random numbers using the Random number generator class TRandom3 and using the provided basic Random distribution "Gaus(mean=65,sigma=5)". Create a 1-dimensional histogram TH1D and fill in with the generated random numbers. Finally book a canvas TCanvas and plot the distribution and save it  Fit the histogram from (2) with function (1) 2) Write a root macro that creates randomly generated data as a signal peak (gaussian) with mean= & sigma=10.0. Perform fit with a gaussian function and inspect the parameters.  Add background as uniform  Fit using function gaus+pol2  Write down the good parameters.

Full Exercise upto now  Fill a histogram randomly (n=~10,000) with a Landau distribution with a most probable value at 20 and a “width” of 5 (use the ROOT website to find out about the Landau function)  Fill the same histogram randomly (n=~5,000) with a Gaussian distribution centered at 5 with a “width” of 3  Write a compiled script with a fit function that describes the total histogram nicely (it might be a good idea to fit both peaks individually first and use the fit parameters for a combined fit)  Add titles to x- and y-axis  Include a legend of the histogram with number of entries, mean, and RMS values  Add text to the canvas with the fitted function parameters  Draw everything on a square-size canvas (histogram in blue, fit in red)  Save as png, eps, and root file