Introduction of ROOT Yao. ROOT Development In the mid 1990's, René Brun and Fons Rademakers, they had lead successful projects such as PAW, PIAF, and.

Slides:



Advertisements
Similar presentations
Introduction to C++ An object-oriented language Unit - 01.
Advertisements

Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
ROOT Root Commands and CINT Functions and Fitting (The Tree Viewer)
Gerardo Schneider Department of Informatics University of Oslo December 2008.
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,
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
ROOT TOOLKIT (I) Técnicas Fundamentales de Simulación, Reconstrucción y Análisis de Datos en Física Experimental de Partículas Isidro González Caballero.
Refer to Ivor Horton’s Beginning ANSI C++ The Complete Language, 3rd Ed. APress Media, LLC. About the book Ivor Horton, Beginning ANSI C++: The Complete.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
1 11/3/08CS150 Introduction to Computer Science 1 Reading from and Writing to Files Section 3.12 & 13.1 & 13.5.
01 Introduction1June Introduction CE : Fundamental Programming Techniques.
General Computer Science for Engineers CISC 106 Lecture 26 Dr. John Cavazos Computer and Information Sciences 04/24/2009.
Guide To UNIX Using Linux Third Edition
LIGO-G0200XX-00-M Interactive DMT with Root John G. Zweizig LIGO, Caltech.
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
CS 331, Principles of Programming Languages Introduction.
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
“C” Programming Language CIS 218. Description C is a procedural languages designed to provide lowlevel access to computer system resources, provide language.
History of Programming Languages
Object-Oriented Programming in C++
ROOT An object oriented HEP analysis framework.. Computing in Physics Physics = experimental science =>Experiments (e.g. at CERN) Planning phase Physics.
CSE Fundamentals of Computing Prof. Douglas Thain Fall 2011.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Prof: Dr. Shu-Ching Chen TA: Samira Pouyanfar Spring 2015 C Tutorial CIS5027.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Programming History. Who was the first programmer?
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 13: An Introduction to C++
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Introduction to ROOT1 Summer Students Lecture 20 July 2005 ftp://root.cern.ch/root/SummerStudents2005.ppt Introduction to ROOT.
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Chapter 0 Overview. Why you are here? Where will you go? What is this course for?
JavaScript Defined JavaScript Basics Definitions JavaScript is an object-oriented programming language designed for the world wide web. JavaScript code.
ROOT What & Why? ROOT Status ROOT Application ROOT Install ROOT Example ROOT References Introduction to March 13, 2003 Dae Jung CHEP.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 2.
1 ALICE OFFLINE :ORGANIZATION A user point of view Yves Schutz, SUBATECH, France (PHOS biased)
Chapter Six Introduction to Shell Script Programming.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
General Computer Science for Engineers CISC 106 Lecture 12 James Atlas Computer and Information Sciences 08/03/2009.
int k = Integer.MAX_VALUE; k++; int k = Integer.MAX_VALUE; k++; What happens when the following code executes? byte b = someFile.readByte(); b = (byte)(b.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
 Prepared by: Eng. Maryam Adel Abdel-Hady
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Week 1 -2: Introduction to programming and programming languages Chapter One By Lwomwa Joseph CSC 1107: Structured Programming.
Software Engineering Algorithms, Compilers, & Lifecycle.
Computer Programming - Key Concepts and Terms Computer Program – A computer program is a set of instructions for computer, arranged in logical order, using.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Programming C++ in Linux by various IDEs and editors by: Danial Khashabi Master: Dr.B.Taheri November 2008.
Chapter 3. Module 3ASystem Software Module 3BProgramming Languages 3 System Software and Software Development.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
Basic Concepts: computer, program, programming …
CST 1101 Problem Solving Using Computers
CMIT100 Chapter 14 - Programming.
Programming Languages Dan Grossman 2013
Scripting Languages Info derived largely from Programming Language Pragmatics, by Michael Scott.
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Problem Solving Using C: Orientation & Lecture 1
Chapter 3.
Scripting Tools, languages and the Shell intERLab at AIT
Computer science By/ Midhat Mohiey. Introduction to Programming using C ++ 2.
جامعة البحر الاحمر كلية العلوم التطبيقية قسم الفيزياء التطبيقية الفصل الداسي الثاني IIالمقرر: حاسوب د. خالد عثمان العالم.
Introduction to Computers and Python
Problem Solving.
Problem Solving Using C: Orientation & Lecture 1
جامعة البحر الاحمر كلية العلوم التطبيقية قسمي الحاسوب وتقنية المعلومات الفصل الداسي الثاني المقرر: اساليب برمجة 1 محاضرة رقم 1 د. خالد عثمان العالم.
Problem Solving Using C: Orientation & Lecture 1
Architecture of the web
Presentation transcript:

Introduction of ROOT Yao

ROOT Development In the mid 1990's, René Brun and Fons Rademakers, they had lead successful projects such as PAW, PIAF, and GEANT. They knew the twenty-year-old FORTRAN libraries had reached their limits, could not scale up to the challenges offered by the Large Hadron Collider. At the same time, computer science had made leaps of progress especially in the area of Object Oriented Design (OOD). What is ROOT ?

Object-Oriented Design (OOD) Modularity Reusability Extendibility Maintenance Etc…

Smalltalk: Smalltalk-80 C based : objective-C, C++, JAVA, C# LISP based : Flavors, XLISP, LOOPS,CLOS PASCAL based : Object Pascal, Turbo Pascal, Eiffel, Ada 95

CINT CINT is a command line C/C++ interpreter. The syntax is a bit more forgiving than either language. Interpreted languages : BASIC, Lisp, Perl, Scheme, Python, Ruby, Tcl and Tk, Unix Shell, JavaScript, PHP, VBScript

ROOT is an object-oriented framework aimed at solving the data analysis challenges of high- energy physics, it provides a large selection of HEP specific utilities such as histograms and fitting. 2D Graphics, 3D Graphics, etc. Why do we use ROOT ?

histogram

histograms and fitting

2D Graphics

3D Graphics

Setting the Environment Variables ~] $ export SOFT="${HOME}/local" ~] $ export ROOTSYS="${SOFT}/root" ~] $ export PATH="${SOFT}/root/bin:${PATH}" ~] $ export LD_LIBRARY_PATH="${SOFT}/root/lib/root:${LD_LIBRARY_PATH}” ~/.bashrc Please note: the syntax is for bash. How to use ROOT ?

Start and Quit a ROOT Session ~] $ root *************************************** * * W E L C O M E to R O O T * * *Version 5.27/02 26 April 2010 * * * You are welcome to visit our Web site * * ** *************************************** ROOT 5.27/02 Apr , 11:38:29 on linux) CINT/ROOT C/C++ Interpreter version , Dec 21, 2008 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0].q ~] $

help ~]$ root -? Usage: root [-l] [-b] [-n] [-q] [dir] [[file:]data.root] [file1.C... fileN.C] Options: -b : run in batch mode without graphics -n : do not execute logon and logoff macros as specified in.rootrc -q : exit after processing command line macro files -l : do not show splash screen dir : if dir is a valid directory cd to it before executing

command line root[0] 1+sqrt(9) (const double) e+00 root[1] for (int i = 0; i<4; i++) cout << "Hello " << i << endl Hello 0 Hello 1 Hello 2 Hello 3 root[2].q

histogram void fith() { // filename double tmp; ifstream fin("./data/rr.txt"); int i=0; TCanvas *c1 = new TCanvas("c1","fitting Histogram",200,10,700,500); TH1D *h1 = new TH1D( "h1", "hist1", 20, 0, 10 ); while(!fin.eof()){ fin>>tmp; h1->Fill( tmp* ); } fin.close(); h1->SetTitle("muon lifetime"); h1->SetXTitle("10^{-6}s"); h1->SetYTitle("count"); //******** h1->Draw("E"); C1->Print(); } Do not need to include header file that root provide.

Run a script ]$ root fith.C or root [0].x fith.C

fitting TF1 *t1 = new TF1("t1","[0]+[1]*exp(-x/[2])",0,bin); t1->SetParNames("a","b","lifetime"); t1->SetParameter(0,6); t1->SetParLimits(0,0,10); t1->SetParameter(1,1); t1->SetParameter(2,2.2); h1->Fit("t1"); ]$ root fith.C NO. NAME VALUE ERROR SIZE DERIVATIVE 1 a e e e e-04 2 b e e e e-05 3 lifetime e e e e-03

Scatter Diagram void graph() { TCanvas *c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); const Int_t n = 20; Double_t x[n], y[n]; for (Int_t i=0;i<n;i++) { x[i] = i; y[i] = sin(i*0.5); } gr = new TGraph(n,x,y); //****** gr->Draw("AP*"); c1->Update(); c1->Modified(); }

code]$ root graph.C

gr->SetLineColor(2); gr->SetLineWidth(4); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); gr->SetTitle("a simple graph"); gr->GetXaxis()->SetTitle("X title"); gr->GetYaxis()->SetTitle("Y title"); gr->Draw("ACP*");

2D Graphics void graph2d(){ TCanvas *c = new TCanvas("c","Graph2D example",0,0,700,600); Double_t x, y, z, P = 6.; Int_t np = 200; TGraph2D *dt = new TGraph2D(); TRandom *r = new TRandom(); for (Int_t N=0; N<np; N++) { x = 2*P*(r->Rndm(N))-P; y = 2*P*(r->Rndm(N))-P; z = (sin(x)/x)*(sin(y)/y)+0.2; dt->SetPoint(N,x,y,z); } gStyle->SetPalette(1); dt->Draw("surf1"); }