Postgraduate Computing Lectures ROOT 1 What is ROOT? Tool and a Framework for OO Data Analysis As a Tool –Enter commands to display and manipulate data.

Slides:



Advertisements
Similar presentations
Noadswood Science,  To know how to use Python to produce windows and colours along with specified co-ordinates Sunday, April 12, 2015.
Advertisements

Joe Foster Visualizing Data with ROOT Joe Foster University of Manchester.
ROOT Root Commands and CINT Functions and Fitting (The Tree Viewer)
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,
Postgraduate Computing Lectures Applications I: Analysis Tools 1 Applications: Analysis Tools Analysis Tools –Used to extract Physics from reconstructed.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Guide To UNIX Using Linux Third Edition
Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes.
SE-565 Software System Requirements More UML Diagrams.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
Introduction to Data Structures. Data Structures A data structure is a scheme for organizing data in the memory of a computer. Some of the more commonly.
Digital Image Processing Lecture3: Introduction to MATLAB.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
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.
Java Programming, 2E Introductory Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Introduction to Data Structures. About the document. The document is prepared by Prof. Shannon Bradshaw at Drew University. The key concepts in data structure.
Java Analysis Studio Status Update 12 May 2000 Altas Software Week Tony Johnson
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
IE 411/511: Visual Programming for Industrial Applications
21-Apr-2005J. Adamczewski1 DVEE C++ course 2005 The ROOT framework 1: Introduction.
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.
ImageJ EE4H, M.Sc Computer Vision Dr. Mike Spann
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
ROOT’s graphics on iOS. ROOT’s graphics (general scheme):
IBC233 Lecture 2 Updated Winter 2008 Agenda Test next Week – Jan 23 ISeries Architecture CL (Control Language) Library Lists Operations Navigator.
Data Structures Types of Data Structure Data Structure Operations Examples Choosing Data Structures Data Structures in Alice.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
ROOT What & Why? ROOT Status ROOT Application ROOT Install ROOT Example ROOT References Introduction to March 13, 2003 Dae Jung CHEP.
H.G.Essel: Go4 - J. Adamczewski, M. Al-Turany, D. Bertini, H.G.Essel, S.Linev CHEP 2003 GSI Online Offline Object Oriented Go4.
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
9-Nov-97Tri-Ada '971 TASH An Alternative to the Windows API TRI-Ada ‘97 Terry J. Westley
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
General Purpose ROOT Utilities Victor Perevoztchikov, BNL.
Creating a Java Application and Applet
Postgraduate Computing Lectures PAW 1 PAW: Physicist Analysis Workstation What is PAW? –A tool to display and manipulate data. Learning PAW –See ref. in.
Announcements Assignment 1 due Wednesday at 11:59PM Quiz 1 on Thursday 1.
INFSO-RI Enabling Grids for E-sciencE Using of GANGA interface for Athena applications A. Zalite / PNPI.
GLAST 1 Event Display VRVS meeting Glast software collaboration Pisa experience with ROOT N Lumb and G Spandre INFN-Pisa.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Online Data Monitoring Framework Based on Histogram Packaging in Network Distributed Data Acquisition Systems Tomoyuki Konno 1, Anatael Cabrera 2, Masaki.
INTRODUCTION TO DATA STRUCTURES 1. DATA STRUCTURES A data structure is a scheme for organizing data in the memory of a computer. Some of the more commonly.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Go4 v2.2 Status & Overview CHEP 2003
Applications Active Web Documents Active Web Documents.
Microsoft Foundation Classes MFC
Console and GUI Programs
An Introduction to Computers and Visual Basic
Review Session Biggest discrepancy questions
An Introduction to Computers and Visual Basic
Topics Graphical User Interfaces Using the tkinter Module
Java Programming Language
The ROOT framework 1: Introduction
Presentation transcript:

Postgraduate Computing Lectures ROOT 1 What is ROOT? Tool and a Framework for OO Data Analysis As a Tool –Enter commands to display and manipulate data –Commands are C++ (covers ~85% of full language – including simple templates) –Can use to prototype new code As a Framework –Use ROOT as a library and link in user C++ code –Can use result as a tool Supports User Classes –User can define new classes –Can do this either as Tool or Framework –These can inherit from ROOT classes

Postgraduate Computing Lectures ROOT 2 Caution Rapidly Developing –Has a few rough edges! –But support team respond rapidly to bug reports Now CERN Supported –CERN’s official replacement is LHC++ However CERN now also support ROOT, particularly for analysis –ROOT development lead by Rene Brun One of founders of PAW Principle: Use free packages and support wide range of platforms –(including Linux and gcc) –Does have a wide user base Both within HEP:- – NA49, CMS, PHOBOS, E907, ATLAS, BABAR, STAR, ALICE, CDF, D0, MINOS, BLAST... and Beyond:- –Financial sector, health screening, network performance, satellite monitoring,...

Postgraduate Computing Lectures ROOT 3 ROOT Components Base Classes –Objects –Files and Directories –I/O –System interface –Basics maths Containers –Collections –Lists –Arrays –Maps (hashs) Histogram and Minimisation –Up to 3D –Profile –Minuit (general fitting package) Trees and N-tuples –Generalise n-tuple concept to a binary tree of objects Matrices

Postgraduate Computing Lectures ROOT 4 Components (cont). 2D Graphics –lines, text, shapes etc. 3D Graphics and Geometry –3D shapes e.g. cone, helix –Geometry description Tree of nodes Nodes properties: shape, material, rotation GUI –Toolkit to build GUI Meta Data –For describing classes Network –Access to network, including HTTP Documentation –Build HTML directly from source code Interactive Interface –For user application to act as a tool Parallel Process Support

Postgraduate Computing Lectures ROOT 5 C++ Syntax Primer –Just enough to understand example Creating an Object –E.g ROOT class TH1F (1D histogram with one float/chan):- TH1F my_hist; –Creating an object causes its constructor function to be called –Often constructor passed args e.g.:- TH1F my_hist("hfix", "hfix title",nbins,xlow,xup); Interacting with an Object –By calling its member functions e.g.:- my_hist.Fill(x); my_hist.Draw(”option”); to fill and draw the histogram. Above Syntax is for Auto Objects –Created on program stack –  FORTRAN local variables –O.K. for short lived data

Postgraduate Computing Lectures ROOT 6 C++ Syntax Primer (cont) Snags with Auto Objects –Local to a single function Disappear when function exits But objects should be independent –Must decide how many at compile time May want to decide at execution time Solution: Heap Variables –Created in pool of free memory –Space reserved using ‘new’ function –Exist as long as required –Snag: Compiler does not know objects address Have to use a pointer Notation: TH1F *my_hist is a pointer to object of type TH1F

Postgraduate Computing Lectures ROOT 7 C++ Syntax Primer (cont) Creating a Heap Object –Example:- TH1F *my_hist = new TH1F ("hfix", "hfix title",nbins,xlow,xup); new:- –creates a TH1F object on heap –calls its constructor function –returns a pointer Interacting with Heap Objects –Follow pointer and then call member –This is done with -> operator e.g.:- my_hist->Fill(x); my_hist->Draw(”option”);

Postgraduate Computing Lectures ROOT 8 C++ Syntax Primer (cont) Pointers and Inheritance –ROOT Class TH1F inherits from class TObject –So a TH1F object contains a TObject object. –Pointers can point to either:- Pointers can be converted –Moving down inheritance tree:- my_object = my_hist; –Moving up inheritance tree:- my_hist = (TH1F*) my_object; Can be dangerous: What if TObject wasn’t in a TH1F? TH1F object TObject object TH1F *my_hist TObject *my_object

Postgraduate Computing Lectures ROOT 9 ROOT Primer Naming Convention –TName e.g. TList TObject –Is the primordial object –Most other classes inherit from it –Provides base for generic operations such as:- I/O, Graphics, Containerisation Graphics: TCanvas, TPad –TCanvas is rectangular window holding TPads. –TPad maps to a rectangular area on a TCanvas –TPad holds a list of objects (including TPads) to be displayed

Postgraduate Computing Lectures ROOT 10 ROOT Primer (cont) File access: TDir and TFile –A TDir is a directory. It holds a list of named objects (can include other TDir) –A TFile is a file. It consists of a series of TDir objects. –Reading from a file Involves passing TFile the name of the object to be retrieved. It returns pointer. Event I/O: TTree and TBranch –General concept of an event A heterogeneous collection of objects. –All have to be output together –A TBranch holds a collection of objects It can include TBranch. It has its own buffer. –A TTree is a collection of TBranch. It synchronises I/O. –But, can just input partial event Select TBranch Input rest of Ttree conditionally

Postgraduate Computing Lectures ROOT 11 ROOT Demo hbooksm.ntp –n-tuple 800 –has variables:- Vx_x Vx_y Vx_z hbooksm.root –TTree h800 –TBranch:- Vx_x Vx_y Vx_z Working with an HBOOK N-tuple –Converted using h2root:- hbooksm.ntp h2root hbooksm.root

Postgraduate Computing Lectures ROOT 12 ROOT Demo Code { // Clear out any object created by user in the current session by // sending Reset message to the master object gROOT. gROOT->Reset(); // Create a canvas (window) and within it define 3 pads (sub-windows // holding graphical material). // Create canvas giving name, title, top left corner, width and height // in pixels. c1 = new TCanvas("c1","ROOT Demo",200,10,700,500); // Create pads giving name, title, limits (as fraction of canvas) and // background colour (8 = white) pad1 = new TPad("pad1","Pad1: (Top half)", 0.02,0.52,0.98,0.98,8); pad2 = new TPad("pad2","Pad2: (Bottom left)", 0.02,0.02,0.48,0.48,8); pad3 = new TPad("pad3","Pad3: (Bottom right)",0.52,0.02,0.98,0.48,8); // Tell the pads to draw themselves. This actually adds them to the list // of objects that the canvas holds. Later, when the canvas is sent the // Update message, it will send an Update message to all its pads. pad1->Draw(); pad2->Draw(); pad3->Draw(); // Create a File object as an input from the file hbooksm.root. TFile *hfile = new TFile("hbooksm.root", "READ"); // Set up a Tree object pointer by asking hfile to find the object whose // name is h800 (the name created by h2root for n-tuple 800). The Get // message returns a pointer to Object so have to be cast up to a Tree. TTree *my_ntuple = (TTree *) hfile->Get("h800");

Postgraduate Computing Lectures ROOT 13 ROOT Demo Code (cont) // Make pad1 the current working graphics directory by sending it cd // (cf. Unix). From now on, any Draw message will draw in this pad. pad1->cd(); // Send the n-tuple a Draw message, supplying the expression to be drawn. // This automatically creates and fills a histogram object (like PAW). // pad1 will contain this histogram. my_ntuple->Draw("Vx_z"); // In a similar way, plot a 2d histogram in pad2. pad2->cd(); // This time we tell the n-tuple to change the defaults to be used when // creating the 2d histogram. my_ntuple->SetFillColor(5); my_ntuple->SetMarkerStyle(3); // Note the syntax is different to PAW (Vx_z%Vx_x). my_ntuple->Draw("Vx_z:Vx_x"); // Finally plot a 3d plot in pad3. This time, we also place a cut on the // data to be plotted. pad3->cd(); my_ntuple->SetMarkerStyle(7); my_ntuple->Draw("Vx_z:Vx_y:Vx_x", ”sqrt(Vx_x**2+Vx_y**2+Vx_z**2)<5000."); // Now tell the canvas to update itself, causing all its pads to tell all // the objects they contain to paint themselves. c1->Update(); }

Postgraduate Computing Lectures ROOT 14 ROOT Demo Code (cont) Result:-