/57 2013-03-25 Elementi di C++ Introduzione a ROOT 2013-04-11, Laboratorio Informatico ROOT warm up 2013-04-17, Laboratorio Informatico Introduzione a.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Review pages for the AP CS Exam
Chapter 4 Loops Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved
Chapter 3 Gate-Level Minimization
01 Prologo 02 Bran 103 Catelyn 1 05 Eddard 1 04 Daenerys 1 06 Jon 1 07 Catelyn 2 10 Tyrion 1 08 Arya 1 16 Sansa 1 09 Bran 2 11 Jon 2 12 Daenerys 2 13 Eddard.
Laboratorio di Linguaggi lezione X Marco Tarini Università dellInsubria Facoltà di Scienze Matematiche, Fisiche e Naturali di Varese Corso di Laurea in.
Statistical Methods for Data Analysis a RooStats example
Statistical Methods for Data Analysis Modeling PDF’s with RooFit
Statistical Methods for Data Analysis Random numbers with ROOT and RooFit Luca Lista INFN Napoli.
2000 Prentice Hall, Inc. All rights reserved Oggetti const e funzioni membro const 2. Composizione: oggetti come membri di classi 3. Funzioni friend.
2000 Prentice Hall, Inc. All rights reserved. 1 Capitolo 8 – Overloading di operatori 1.Introduzione 2.Fondamenti sulloverloading di operatori 3.Restrizioni.
Sharpening and Edge Detection C. Andrés Méndez 10/04/2013.
Copyright © 2003 Pearson Education, Inc. Slide 1.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 116.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Appendix 01.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 28.
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 38.
Chapter 1 Image Slides Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Who Wants To Be A Millionaire? Decimal Edition Question 1.
11 aprile 2002 Avvisi: 1 o Esonero: mercoledi 17 aprile ore 11:30 – 14:00 consulta la pag. WEB alla voce esoneri si raccomanda la puntualita!
© 2010 Pearson Prentice Hall. All rights reserved The Normal Distribution.
Describing Distributions with Numbers
Break Time Remaining 10:00.
1 Analysis of Random Mobility Models with PDE's Michele Garetto Emilio Leonardi Politecnico di Torino Italy MobiHoc Firenze.
15. Oktober Oktober Oktober 2012.
Sequence Alignment I Lecture #2
1 MAXIMUM LIKELIHOOD ESTIMATION OF REGRESSION COEFFICIENTS X Y XiXi 11  1  +  2 X i Y =  1  +  2 X We will now apply the maximum likelihood principle.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 4 Loops.
Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved.
1 Final Cut Pro X Winter Connections Conference 2012.
: 3 00.
Visions of Australia – Regional Exhibition Touring Fund Applicant organisation Exhibition title Exhibition Sample Support Material Instructions 1) Please.
Factorial Preparatory Exercise #include using namespace std; double fact(double); int fact(int); int main(void) { const int n=20; ofstream my_file("results.txt");
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
Frame Windows A frame object is used to create a graphical frame window. This frame is used to show information in a graphical application. The JFrame.
Chapter 2: Using Objects Part 2. Assume you wish to test the behaviour of some method. This is accomplished by providing a tester class: Supply a main.
PRIME PROBLEMS OF RECOGNITION IN MAKING ERASMUS Tony Filoni – PRIME Team Padova, 16 Marzo Problems of Recognition in Making Erasmus |
12-CRS-0106 REVISED 8 FEB 2013 PRESENTS Payment Functionality.
Server-Side Scripting with JSP (2) ISYS 350. Post Back A postback is call to the same page that the form is on. In other words, the contents of the form.
01. Consider the following code segment. int x = int n = 0; if (x < 500) { if (x > 750) n = 100; else n = 200; } else { if (x < 300) n = 300; else n =
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 3 Loops.
ROOT Root Commands and CINT Functions and Fitting (The Tree Viewer)
Ponza 05 June 2008 Status report on       analysis F. Ambrosino T. Capussela F. Perfetto Status report on    analysis Frascati 29.
Fitting procedure using ROOT Department of High Energy Physics Nekrasov M. Dmitriy.
A Package For Tracking Validation Chris Meyer UC Santa Cruz July 6, 2007.
G. Cowan Lectures on Statistical Data Analysis 1 Computing and Statistical Data Analysis Some slides about ROOT Interactive data analysis program and class.
Note Questa unità didattica è stata realizzata su lavagna LIM Hitachi per cui il formato originale era quello proprietario.yar. La poca trasferibilità.
Statistical Methods for Data Analysis Parameter estimates with RooFit Luca Lista INFN Napoli.
RooFit A tool kit for data modeling in ROOT
RooFit – tools for ML fits Authors: Wouter Verkerke and David Kirkby.
Statistical Methods for Data Analysis Introduction to the course Luca Lista INFN Napoli.
Introduction to RooFit W. Verkerke (NIKHEF) 1.Introduction and overview 2.Creation and basic use of models 3.Composing models 4.Working with (profile)
Wouter Verkerke, UCSB RooFitTools A general purpose tool kit for data modeling, developed in BaBar Wouter Verkerke (UC Santa Barbara) David Kirkby (Stanford.
Conditional Observables Joe Tuggle BaBar ROOT/RooFit Workshop December 2007.
Getting started – ROOT setup Start a ROOT 5.34/17 or higher session Load the roofit libraries If you see a message that RooFit v3.60 is loaded you are.
RooFit Tutorial – Topical Lectures June 2007
Hands-on exercises *. Getting started – ROOT 5.25/02 setup Start a ROOT 5.25/02 session –On your local laptop installation, or –On lxplus (SLC4) or lx64slc5.
ROOT: Functions & Fitting Harinder Singh Bawa California State University Fresno.
S. Ferrag, G. Steele University of Glasgow. RooStats and MClimit comparison Exercise to use RooStats by an MClimit-formatted person: – Use two programs.
Wouter Verkerke, UCSB Data Analysis Exercises - Day 2 Wouter Verkerke (NIKHEF)
Hands-on Session RooStats and TMVA Exercises
ROOT: Functions & Histograms
Statistical methods in LHC data analysis introduction
ROOT Tutorial Simulation and fitting in ROOT
ROOT: Functions & Fitting
CMS RooStats Higgs Combination Package
Timing Uncertainty Analysis Update
Statistical Methods for Data Analysis Parameter estimates with RooFit
Statistical Methods for Data Analysis Modeling PDF’s with RooFit
Statistical Methods for Data Analysis Random numbers with ROOT and RooFit Luca Lista INFN Napoli.
Presentation transcript:

/ Elementi di C++ Introduzione a ROOT , Laboratorio Informatico ROOT warm up , Laboratorio Informatico Introduzione a RooFit Primo esercizio con RooFit , Laboratorio Informatico RooFit (Workspace, Factory, Composite Model) Analisi Statistica dei Dati per HEP (Laboratorio)

/57 RECAP… Esercizi Lezione-3 [1] roofit_ex1.C Scaricate da roofit_empty.C Editate la macro e seguendo lo schema costruire una p.d.f. gaussiana con media 0, sigma 1. Modificate la sigma a 3. Visualizzate la p.d.f.. Generate un dataset unbinned di 1000 eventi. Eseguite un Fit con Maximum Likelihood. Visualizzate i risultati. Utilizzate le informazioni in Introduction to RooFit, nel manuale di roofit al paragrafo 2 (c:\root\RooFit_Users_Manual_ pdf) e in to RooFit

/57 Questo era loutput dellesercizio 4 della lezione-2, in cui non è stato utilizzato roofit. roofit_ex1

/57 ROOFIT ROOT

/57 void rf101_basics() { // Setup model // ============ // Declare variables x,mean,sigma with associated name, title, initial value and allowed range RooRealVar x("x","x",-10,10) ; RooRealVar mean("mean","mean of gaussian",1,-10,10) ; RooRealVar sigma("sigma","width of gaussian",1,0.1,10) ; // Build gaussian p.d.f in terms of x,mean and sigma RooGaussian gauss("gauss","gaussian PDF",x,mean,sigma) ; // Construct plot frame in 'x' RooPlot* xframe = x.frame(Title("Gaussian p.d.f.")) ; // Plot model and change parameter values // ======================================= // Plot gauss in frame (i.e. in x) gauss.plotOn(xframe) ; // Change the value of sigma to 3 sigma.setVal(3) ; // Plot gauss in frame (i.e. in x) and draw frame on canvas gauss.plotOn(xframe,LineColor(kRed)) ; // Generate events // =============== // Generate a dataset of 1000 events in x from gauss RooDataSet* data = gauss.generate(x,1000) ; // Make a second plot frame in x and draw both the // data and the p.d.f in the frame RooPlot* xframe2 = x.frame(Title("Gaussian p.d.f. with data")) ; data->plotOn(xframe2) ; gauss.plotOn(xframe2) ; // Fit model to data // ================== // Fit pdf to data gauss.fitTo(*data) ; // Print values of mean and sigma (that now reflect fitted values and errors) mean.Print() ; sigma.Print() ; // Draw all frames on a canvas TCanvas* c = new TCanvas("rf101_basics","rf101_basics",800,400) ; c->Divide(2) ; c->cd(1) ; gPad->SetLeftMargin(0.15) ; xframe->GetYaxis()->SetTitleOffset(1.6) ; xframe->Draw() ; c->cd(2) ; gPad->SetLeftMargin(0.15) ; xframe2->GetYaxis()->SetTitleOffset(1.6) ; xframe2->Draw() ; } void recap_lesson2_ex4() { // Book histograms TH1D* h_Gaus = new TH1D("h_Gaus", "gaussian random numbers", 100, -10, 10); // Create a TRandom3 object to generate random numbers int seed = 12345; TRandom3* ran = new TRandom3(seed); // Generate some random numbers and fill histograms const int numValues = 1000; for (int i=0; i<numValues; i++){ double r = ran->Gaus(1,3); // gaussian in mean = 1 sigma = 3 h_Gaus->Fill(r); } c = new TCanvas("c1","c1",800,400) ; c->Divide(2,1) ; c->cd(1); // define a gaussian p.d.f (mean 1 and sigma 1) // gaus(0) is a substitute for [0]*exp(-0.5*((x-[1])/[2])**2) // and (0) means start numbering parameters at 0. TF1* g1 = new TF1( "gaus_1", "gaus(0)", -10, 10 ); double mean = 1 ; double sigma = 1 ; g1->SetParameter( 0, 1./( sigma * sqrt(2* ) ) ); g1->SetParameter( 1, mean ) ; // set mean g1->SetParameter( 2, sigma) ; // set sigma g1->SetLineColor( kBlue ) ; g1->Draw() ; // change sigma to 3 TF1* g2 = new TF1( "gaus_2", "gaus(0)", -10, 10 ); mean = 1 ; sigma = 3 ; g2->SetParameter( 0, 1./( sigma * sqrt(2* ) ) ); g2->SetParameter( 1, mean ) ; // set mean g2->SetParameter( 2, sigma) ; // set sigma g2->SetLineColor( kRed ) ; g2->Draw("SAME") ; c->cd(2); h_Gaus->SetXTitle("x"); h_Gaus->SetYTitle("f(x)"); h_Gaus->SetMarkerStyle(20); h_Gaus->Fit("gaus") ; h_Gaus->Draw("E1"); } ROOTROOFIT

/57 RooFit Introduction to RooFitIntroduction to RooFit slides da 15 a 34

/57 Esercizio RooFit [1] roofit_factory_ex1.C Riprendiamo lex3.C della lezione scorsa e riformuliamolo utilizzando workspace e factory (esercizio 4 da 2012 Roofit/Roostats Desy School) make an exponential + gaussian model using w.factory(SUM::pdf( fs*gaus, expo)) do rst non-extended model ( 0 < fs < 1) generate data (e.g. N=1000), t the data and plot results (use RooFit::Components() to specify components to plot) make extended model using Ns and Nb (Ns = fs*N) w.factory(SUM::pdf( Ns*gaus, Nb*expo)) check difference in error in Ns obtained between extended and not-extended t save the macro making the extended model and also save the workspace in a le (we will be using it later in a RooStats exercise) Note: Il fondo esponenziale espresso in funzione di un parametro tau, exp(-x/tau).