Introduction to ROOT1 Summer Students Lecture 20 July 2005 ftp://root.cern.ch/root/SummerStudents2005.ppt Introduction to ROOT.

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
CP411 Computer Graphics, Wilfrid Laurier University Introduction # 1 Welcome to CP411 Computer Graphics 2012 Instructor: Dr. Hongbing Fan Introduction.
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.
O. Stézowski IPN Lyon AGATA Week September 2003 Legnaro Data Analysis – Team #3 ROOT as a framework for AGATA.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Goals Give student some idea.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
VB in Context Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh Pittsburgh, Pa 15260
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Platforms, installation, configuration; accessing example collections Course material prepared by Greenstone Digital Library Project University of Waikato,
PART A Emac Lisp   Emac Lisp is a programming language  Emacs Lisp is a dialect.
ROOT courses1 The ROOT System A Data Access & Analysis Framework February 2003 Ren é Brun/EP Trees.
Oct ROOT 2002, CERN, Geneva Qt-Based Implementation of Low Level ROOT Graphical Layer By V.Fine.
Doxygen: Source Code Documentation Generator John Tully.
Introduction to ROOT1 Summer Students Lecture 10 July 2007 Ren é Brun CERN/PH/SFT Introduction to ROOT
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.
COMP1070/2002/lec3/H.Melikian COMP1070 Lecture #3 v Operating Systems v Describe briefly operating systems service v To describe character and graphical.
ROOT: A Data Mining Tool from CERN Arun Tripathi and Ravi Kumar 2008 CAS Ratemaking Seminar on Ratemaking 17 March 2008 Cambridge, Massachusetts.
CINT Retrospect ROOT Workshop Mar 2013 Agilent Technologies Masaharu Goto.
WORK ON CLUSTER HYBRILIT E. Aleksandrov 1, D. Belyakov 1, M. Matveev 1, M. Vala 1,2 1 Joint Institute for nuclear research, LIT, Russia 2 Institute for.
Introduction to Hall-D Software February 27, 2009 David Lawrence - JLab.
Java Analysis Studio Status Update 12 May 2000 Altas Software Week Tony Johnson
Herramientas de simulación, reconstrucción y análisis de datos en Física de Partículas (II): ROOT Javier Fernández Menéndez Master Técnicas de Computación.
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.
University of Sunderland CDM105 Session 5 Web Authoring Tools The past and present A history of web authoring tools and an overview of Macromedia Dreamweaver.
C O M P U T E R G R A P H I C S Jie chen Computer graphic -- OpenGL Howto.
21-Apr-2005J. Adamczewski1 DVEE C++ course 2005 The ROOT framework 1: Introduction.
Introduction to ROOT May May Rene Brun/CERN.
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
1 Computer Programming (ECGD2102 ) Using MATLAB Instructor: Eng. Eman Al.Swaity Lecture (1): Introduction.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
CINT C++ Interpreter update ROOT2001 at Fermi-Lab Masaharu Goto.
ROOT for Data Analysis1 Intel discussion meeting CERN 5 Oct 2003 Ren é Brun CERN Distributed Data Analysis.
Acat OctoberRene Brun1 Future of Analysis Environments Personal views Rene Brun CERN.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
ROOT Future1 Some views on the ROOT future ROOT Workshop 2001 June 13 FNAL Ren é Brun CERN.
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.
H.G.Essel: Go4 - J. Adamczewski, M. Al-Turany, D. Bertini, H.G.Essel, S.Linev ROOT 2002 GSI Online Offline Object Oriented Go4.
Introduction to ROOT1 Summer Students Lecture 6 July 2009 Fons Rademakers (PH/SFT) Jan Fiete Grosse-Oetringhaus (PH/AIP) Introduction to ROOT
G.Govi CERN/IT-DB 1 September 26, 2003 POOL Integration, Testing and Release Procedure Integration  Packages structure  External dependencies  Configuration.
9/28/2005Philippe Canal, ROOT Workshop TTree / SQL Philippe Canal (FNAL) 2005 Root Workshop.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
D. Duellmann - IT/DB LCG - POOL Project1 The LCG Dictionary and POOL Dirk Duellmann.
ROOT: Status & Developments1 Aachen 1 February 2005 Ren The ROOT Project Status & Developments.
S.Linev: Go4 - J.Adamczewski, H.G.Essel, S.Linev ROOT 2005 New development in Go4.
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
CCA Common Component Architecture CCA Forum Tutorial Working Group Contributors: Introduction to the Ccaffeine Framework.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
LCG AA Meeting 30 June 2004 Ilka Antcheva Graphics User Interface in ROOT.
2001 ROOT Workshop The Summary. Content Most Requested Request already satisfied Build and Distribution Web Page Information and Documentation.
Barthélémy von Haller CERN PH/AID For the ALICE Collaboration The ALICE data quality monitoring system.
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
LCG AA Internal Review 30 March 2005 ROOT Graphical User Interface Ilka Antcheva, Bertrand Bellenot, Valeri Fine, Valeriy Onuchin, Fons Rademakers.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program.
Go4 v2.2 Status & Overview CHEP 2003
Goals Give student some idea what this class is about
Distributed object monitoring for ROOT analyses with Go4 v.3
Introduction to Operating System (OS)
Summer Students Lecture 21 July 2004
User Interface Classes Signals / Slots
Simulation And Modeling
Java Analysis Studio - Status
The ROOT framework 1: Introduction
ROOT Support and Developments at FNAL
Web Application Development Using PHP
Presentation transcript:

Introduction to ROOT1 Summer Students Lecture 20 July 2005 ftp://root.cern.ch/root/SummerStudents2005.ppt Introduction to ROOT

2 ROOT in a Nutshell The ROOT system is an Object Oriented framework for large scale data handling applications Written in C++ Provides, among others, an efficient data storage and access system designed to support structured data sets (PetaBytes) a query system to extract data from these data sets a C++ interpreter advanced statistical analysis algorithms (multi dimensional histogramming, fitting, minimization and cluster finding) scientific visualization tools with 2D and 3D graphics an advanced Graphical User Interface The user interacts with ROOT via a graphical user interface, the command line or batch scripts The command and scripting language is C++, thanks to the embedded CINT C++ interpreter and large scripts can be compiled and dynamically loaded

Introduction to ROOT3 ROOT: An Open Source Project The project is developed as a collaboration between: Full time developers: 12 people full time at CERN 2 developers at FermiLab 1 developer in Japan (Agilent Technologies) 2 developers at MIT Large number of part-time contributors Source freely available (cvs and tarballs) Release early, release often Several thousand users giving feedback and providing many small contributions

Introduction to ROOT4 27 binary tar balls + source Download Source and Binaries

Introduction to ROOT5 Makefiles 3 major OS’es (Unix, Windows, Mac OS X) 32 and 64 bit little and big endian 10 different compilers gcc with many flavors on nearly all platforms, Solaris: CC4,5, HPUX: aCC, SGI: CC, AIX: xlC Alpha: CXX6, Windows: VC++6,7 Intel icc on Linux 37 Makefiles

Introduction to ROOT6 ROOT Downloads 333,000 binaries download 1,500,000 clicks per month 140,000 user guides 1300 users subscribed to roottalk

Introduction to ROOT7 The ROOT Project Evolution ROOT 0.5 ROOT 1.0 ROOT 2.0 ROOT 3.0 LEP,HERA,SPS RHIC, FNAL/RUN II, Babar,KEK LHC Large Hadron Collider functionality ROOT 4.0 ROOT 5.0

Introduction to ROOT8 The ROOT Web Site  General Information and News  Download sources and binaries  HowTo’s & Tutorials  User Guide & Reference Guide  Roottalk Digest & Forum Printed copies of the user guide are available from Ilka Antcheva, room 32-R-C13

Introduction to ROOT9 Fundamental features of an Object- Oriented Data Analysis Framework Object Persistency must be simple for simple applications: histograms, simple simulations, test beams must be efficient for Perabytes of data User Interface, must have command and script mode interpreted code compiled code GUI and browsers Class Dictionary is the vital element

Introduction to ROOT10 ROOT: Framework & Library User classes user can define new classes interactively either via calling API or sub-classing API these classes can inherit from ROOT classes Dynamic linking interpreted code can call compiled code compiled code can call interpreted code macros can be dynamically compiled & linked This is the normal operation mode Interesting feature for GUIs, config files, etc. Script Compiler root >.x file.C++

Introduction to ROOT11 ROOT Library Structure ROOT libraries are a layered structure The CORE classes are always required (support for RTTI, basic I/O and interpreter) The optional libraries (you load only what you use). Separation between data objects and the high level classes acting on these objects. Example, a batch job uses only the histogram library, no need to link histogram painter library Shared libraries reduce the application link time Shared libraries reduce the application size ROOT shared libraries can be used with other class libraries Shared libraries are mostly loaded via the plug-in manager

Introduction to ROOT12 The ROOT Libraries Over 1000 classes 1,350,000 lines of code CORE (12 Mbytes) CINT (2 Mbytes) Green libraries linked on demand via plug-in manager (only a subset shown)

Introduction to ROOT13 C++ interpreter Data analysis and visualization tools 2D and 3D graphics, Postscript, PDF, LateX Geometrical modeller Object persistency and Trees GUI Online services Quick Overview

Introduction to ROOT14 CINT CINT is a C and C++ interpreter Written by Masaharu Goto and available under an Open Source license It implements about 95% of ANSI C and 95% of ANSI C++ It is robust and complete enough to interpret itself (85000 lines of C++) Has good debugging facilities In most cases it is faster than tcl, perl, python

Introduction to ROOT15 CINT in ROOT CINT is used in ROOT: as command line interpreter as script interpreter to generate class dictionaries to generate function/method calling stubs The command line, script and programming language become the same Large scripts can be compiled for optimal performance

Introduction to ROOT16 The dictionary provided by CINT is the nerve-centre of ROOT The dictionary provides the Run Time Type Information (RTTI) The rootcint program is used to parse the classes and generate the dictionaries RTTI is used by the I/O services By definition the interpreter is based on it The GUI context sensitive menus The browsers, object inspectors The ROOT utilities to draw class diagrams The html documentation generator The signal/slot mechanism The CINT Dictionary

Introduction to ROOT17 CINT as Interpreter CINT is used as command line interpreter: And as script interpreter: root[0] for (int i = 0; i < 10; i++) printf(“Hello\n”) root[1] TF1 *f = new TF1(“f”, “sin(x)/x”, 0, 10) root[2] f->Draw() bash$ cat script.C { for (int i = 0; i < 10; i++) printf(“Hello\n”); TF1 *f = new TF1(“f”, “sin(x)/x”, 0, 10); f->Draw(); } root[0].x script.C

Introduction to ROOT18 A Data Analysis & Visualization Tools

Introduction to ROOT19 Graphics: 1,2,3-D functions

Introduction to ROOT20 Full LateX support on screen and postscript TCurlyArc TCurlyLine TWavyLine and other building blocks for Feynmann diagrams Formula or diagrams can be edited with the mouse

Introduction to ROOT21 Alice 3 million nodes

Introduction to ROOT22 ROOT I/O : An Example TFile f(“example.root”,”new”); TH1F h(“h”,”My histogram”,100,-3,3); h.FillRandom(“gaus”,5000); h.Write(); TFile f(“example.root”); TH1F *h = (TH1F*)f.Get(“h”): h->Draw(); f.Map(); Program Writing Program Reading / At:64 N=90 TFile / At:154 N=453 TH1F CX = / At:607 N=2364 StreamerInfo CX = / At:2971 N=96 KeysList / At:3067 N=56 FreeSegments / At:3123 N=1 END demoh.C demohr.C

Introduction to ROOT23 A Root file pippa.root with two levels of directories Objects in directory /pippa/DM/CJ eg: /pippa/DM/CJ/h15

Introduction to ROOT24 Memory Tree Each Node is a Branch in the Tree tr T.Fill() T.GetEntry(6) T Memory

Introduction to ROOT25 Example Writing a Tree void demoe(int nevents) { //load shared lib with the Event class gSystem->Load("$ROOTSYS/test/libEvent"); //create a new ROOT file TFile f("demoe.root",”new"); //Create a ROOT Tree with one single top level branch int split = 99; //try also split=1 and split=0 int bufsize = 16000; Event *event = new Event; TTree T("T","Event demo tree"); T.Branch("event","Event",&event,bufsize,split); //Build Event in a loop and fill the Tree for (int i = 0; i < nevents; i++) { event->Build(i); T.Fill(); } T.Print(); //Print Tree statistics T.Write(); //Write Tree header to the file } All the examples can be executed with CINT or the compiler root >.x demoe.C root >.x demoe.C++

Introduction to ROOT26 Example Reading a Tree void demoer() { //load shared lib with the Event class gSystem->Load("$ROOTSYS/test/libEvent"); //connect ROOT file TFile *f = new TFile("demoe.root"); //Read Tree header and set top branch address Event *event = 0; TTree *T = (TTree*)f->Get("T"); T->SetBranchAddress("event",&event); //Loop on events and fill an histogram TH1F *h = new TH1F("hntrack","Number of tracks",100,580,620); int nevents = (int)T->GetEntries(); for (int i = 0; i < nevents; i++) { T->GetEntry(i); h->Fill(event->GetNtrack()); } h->Draw(); } Rebuilds the full event in memory

Introduction to ROOT27 8 Branches of T 8 leaves of branch Electrons A double-click to histogram the leaf

Introduction to ROOT28 The Tree Viewer & Analyzer A very powerful class supporting complex cuts, event lists, 1-d,2-d, 3-d views parallelism

Introduction to ROOT29 Tree Friends tr Public read Public read User Write Entry # 8

Introduction to ROOT30 Basic GUI Widgets

Introduction to ROOT31 GUI Example

Introduction to ROOT32 ROOT now used in many DAQ environments Timers, shared memory, sockets GUI & event display Macros for rapid prototyping Histogramming Thread support ROOT in Online

Introduction to ROOT33 General Remarks In 1995, we had planned less than 50% of ROOT importance of dictionary, RTTI automatic Schema Evolution effort in GUI online requirements (threads, timers, sockets, etc.) Development of a system is driven by: ideas from authors ideas from users new ideas and techniques in computing OS development, in 1995, push for Windows, Linux not here language developments (e.g. template support, exception handling, Java) cooperation with other systems (e.g. Oracle, Corba, Qt, etc.) manpower Users expect stable and working systems. Quality of a system should improve with time. Often in contradiction with major new developments.

Introduction to ROOT34 ROOT: an Evolving System The ROOT system has been in continuous development since 1995 surviving major changes, major enhancements and an ever increasing number of users. In the same way that ROOT 2005 is far from the original ROOT 1995, we expect that ROOT 2010 will include many contributions reflecting the continuous changes and new ideas in the field of computing. This implies a strong cooperation between software developers and the software users. ROOT is being developed in very close cooperation with a cloud of software developers in science but also in the commercial world.

Introduction to ROOT35 Playing with ROOT on lxplus Set the environment variables export ROOTSYS=/afs/cern.ch/sw/root/v /slc3_gcc3.2.3/root export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH export PATH=$ROOTSYS/bin:$PATH Copy the ROOT tutorials cd $HOME cp $ROOTSYS/tutorials. cd tutorials Run ROOT root

Introduction to ROOT36 Playing with ROOT on a PC Import a binary tar file from: E.g.: Intel x86 Linux for SLC 3 and gcc 3.2.3, version 5.02/00 Untar the file in your home directory cd $HOME tar zxvf root_v Linux.slc3.gcc3.2.3.tar.gzroot_v Linux.slc3.gcc3.2.3.tar.gz Set the environment variables export ROOTSYS=$HOME/root export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH export PATH=$ROOTSYS/bin:$PATH Go to the ROOT tutorials cd $HOME cp $ROOTSYS/tutorials. cd tutorials Run ROOT root

Introduction to ROOT37 My first session root [0] (const double) e+002 root [1] float x=89.7; root [2] float y=567.8; root [3] x+sqrt(y) (double) e+002 root [4] float z = x+2*sqrt(y/6); root [5] z (float) e+002 root [6].q root root [0] try up and down arrows See file $HOME/.root_hist

Introduction to ROOT38 My second session root [0].x session2.C for N=100000, sum= root [1] sum (double) e+004 Root [2] r.Rndm() (Double_t) e-001 root [3].q root { int N = ; TRandom r; double sum = 0; for (int i = 0; i < N; i++) { sum += sin(r.Rndm()); } printf("for N=%d, sum= %g\n",N,sum); } session2.C unnamed macro executes in global scope

Introduction to ROOT39 My third session root [0].x session3.C for N=100000, sum= root [1] sum Error: Symbol sum is not defined in current scope *** Interpreter error recovered *** Root [2].x session3.C(1000) for N=1000, sum= root [3].q root void session3 (int N=100000) { TRandom r; double sum = 0; for (int i = 0; i < N; i++) { sum += sin(r.Rndm()); } printf("for N=%d, sum= %g\n",N,sum); } session3.C Named macro Normal C++ scope rules

Introduction to ROOT40 My third session with ACLIC root [0] gROOT->Time(); root [1].x session4.C( ) for N= , sum= e+006 Real time 0:00:06, CP time root [2].x session4.C+( ) for N= , sum= e+006 Real time 0:00:09, CP time root [3] session4( ) for N= , sum= e+006 Real time 0:00:01, CP time root [4].q #include “TRandom.h” void session4 (int N) { TRandom r; double sum = 0; for (int i=0;i<N;i++) { sum += sin(r.Rndm()); } printf("for N=%d, sum= %g\n",N,sum); } session4.C File session4.C Automatically compiled and linked by the native compiler. Must be C++ compliant

Introduction to ROOT41 Macros with more than one function root [0].x session5.C >session5.log root [1].q void session5(int N=100) { session5a(N); session5b(N); gROOT->ProcessLine(“.x session4.C+(1000)”); } void session5a(int N) { for (int i=0;i<N;i++) { printf("sqrt(%d) = %g\n",i,sqrt(i)); } void session5b(int N) { double sum = 0; for (int i=0;i<N;i++) { sum += i; printf("sum(%d) = %g\n",i,sum); } session5.C.x session5.C executes the function session5 in session5.C root [0].L session5.C root [1] session5(100); >session5.log root [2] session5b(3) sum(0) = 0 sum(1) = 1 sum(2) = 3 root [3].q use gROOT->ProcessLine to execute a macro from a macro or from compiled code

Introduction to ROOT42 Interactive Demo You can import the tar file with all demos from ftp://root.cern.ch/root/SummerStudents2005.tar.gz root summershow.C You can find more demos, examples, tests at $ROOTSYS/tutorials $ROOTSYS/test $ROOTSYS/test/RootShower