Summer Students Lecture 21 July 2004

Slides:



Advertisements
Similar presentations
ROOT Root Commands and CINT Functions and Fitting (The Tree Viewer)
Advertisements

June, 20013rd ROOT Workshop1 PROOF and ROOT Grid Features Fons Rademakers.
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.
CHEP 2012 – New York City 1.  LHC Delivers bunch crossing at 40MHz  LHCb reduces the rate with a two level trigger system: ◦ First Level (L0) – Hardware.
O. Stézowski IPN Lyon AGATA Week September 2003 Legnaro Data Analysis – Team #3 ROOT as a framework for AGATA.
K.Harrison CERN, 23rd October 2002 HOW TO COMMISSION A NEW CENTRE FOR LHCb PRODUCTION - Overview of LHCb distributed production system - Configuration.
ROOT courses1 The ROOT System A Data Access & Analysis Framework February 2003 Ren é Brun/EP Trees.
Large Data Bases in High Energy Physics Frontiers in Diagnostic Technologies Frascati November 26 Frascati November 26 Rene Brun/CERN.
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.
PROOF - Parallel ROOT Facility Kilian Schwarz Robert Manteufel Carsten Preuß GSI Bring the KB to the PB not the PB to the KB.
ROOT: A Data Mining Tool from CERN Arun Tripathi and Ravi Kumar 2008 CAS Ratemaking Seminar on Ratemaking 17 March 2008 Cambridge, Massachusetts.
Introduction to Hall-D Software February 27, 2009 David Lawrence - JLab.
Introduction to Analysis Example tutorial P. Skubic 8/6-8/20121ASP2012 Grid School.
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.
The SAMGrid Data Handling System Outline:  What Is SAMGrid?  Use Cases for SAMGrid in Run II Experiments  Current Operational Load  Stress Testing.
21-Apr-2005J. Adamczewski1 DVEE C++ course 2005 The ROOT framework 1: Introduction.
Introduction to ROOT May May Rene Brun/CERN.
3rd June 2004 CDF Grid SAM:Metadata and Middleware Components Mòrag Burgon-Lyon University of Glasgow.
Introduction to ROOT1 Summer Students Lecture 20 July 2005 ftp://root.cern.ch/root/SummerStudents2005.ppt Introduction to ROOT.
1 Marek BiskupACAT2005PROO F Parallel Interactive and Batch HEP-Data Analysis with PROOF Maarten Ballintijn*, Marek Biskup**, Rene Brun**, Philippe Canal***,
10/31/2015PHYS 3446 DØ Data Analysis with ROOT Venkat (for Dr.Yu)
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.
Introduction to ROOT1 Summer Students Lecture 10 July 2007 Ren é Brun CERN/PH/SFT Introduction to ROOT
ROOT-CORE Team 1 PROOF xrootd Fons Rademakers Maarten Ballantjin Marek Biskup Derek Feichtinger (ARDA) Gerri Ganis Guenter Kickinger Andreas Peters (ARDA)
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.
PROOF and ALICE Analysis Facilities Arsen Hayrapetyan Yerevan Physics Institute, CERN.
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
March, PROOF - Parallel ROOT Facility Maarten Ballintijn Bring the KB to the PB not the PB to the KB.
Super Scaling PROOF to very large clusters Maarten Ballintijn, Kris Gulbrandsen, Gunther Roland / MIT Rene Brun, Fons Rademakers / CERN Philippe Canal.
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.
Trees: New Developments1 Trees: New Developments Folders and Tasks ROOT Workshop 2001 June 13 FNAL Ren é Brun CERN
Sept. 2000CERN School of Computing1 PROOF and ROOT Grid Features Fons Rademakers.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
ROOT and PROOF Tutorial Arsen HayrapetyanMartin Vala Yerevan Physics Institute, Yerevan, Armenia; European Organization for Nuclear Research (CERN)
Joe Foster 1 This talk extends the one I gave in 2006 called Visualizing Data with ROOT. –
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
ANALYSIS TRAIN ON THE GRID Mihaela Gheata. AOD production train ◦ AOD production will be organized in a ‘train’ of tasks ◦ To maximize efficiency of full.
HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program.
Persistent Object References in ROOT1 Persistent Object References in ROOT I/O Status & Proposal LCG meeting CERN- 5 June Ren é Brun ftp://root.cern.ch/root/longrefs.ppt.
Advanced Computing Facility Introduction
Compute and Storage For the Farm at Jlab
Go4 v2.2 Status & Overview CHEP 2003
Fundamental of Databases
Experience of PROOF cluster Installation and operation
Introduction to Operating Systems
Current Status of the Geometry Database for the CBM Experiment
PROOF – Parallel ROOT Facility
Chapter 2: System Structures
Distributed object monitoring for ROOT analyses with Go4 v.3
Ruslan Fomkin and Tore Risch Uppsala DataBase Laboratory
Guide To UNIX Using Linux Third Edition
POOL persistency framework for LHC
User Documents and Examples I
ROOT Class Day 1 An Object Oriented Data Analysis Framework
Grid Canada Testbed using HEP applications
Chapter 2: System Structures
Support for ”interactive batch”
Summer Students Lecture 8 July 2008 Fons Rademakers CERN/PH/SFT
Alice Software Demonstration
PROOF - Parallel ROOT Facility
User Interface Classes Signals / Slots
Persistent Object References in ROOT I/O Status & Proposal
The ROOT framework 1: Introduction
Presentation transcript:

Summer Students Lecture 21 July 2004 René.Brun@cern.ch Introduction to ROOT Summer Students Lecture 21 July 2004 René.Brun@cern.ch ftp://root.cern.ch/root/SummerStudents2004.ppt Introduction to ROOT

ROOT in a nutshell An efficient data storage and access system designed to support structured data sets in very large distributed data bases (Petabytes). A query system to extract information from these distributed data sets. The query system is able to use transparently parallel systems on the GRID (PROOF). A scientific visualisation system with 2-D and 3-D graphics. An advanced Graphical User Interface A C++ interpreter allowing calls to user defined classes. An Open Source Project Introduction to ROOT

ROOT: An Open Source Project The project is developed as a collaboration between : Full time developers: 6 people full time at CERN 1 key developer at FermiLab 1 key developer in Japan (Agilent Technologies) 1 key developer at MIT 1 mathematician at CERN sponsored by a US Finance Company Many contributors spending a substantial fraction of their time in specific areas (> 50). Key developers in large experiments using ROOT as a framework. Several thousand users given feedback and a very long list of small contributions. Introduction to ROOT

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

http://root.cern.ch The ROOT web pages General Information and News Download source and binaries Howto & tutorials User Guide & Reference Guides Roottalk Digest & Forum Introduction to ROOT

Batch/Interactive models Need only widely available tools Need experiment framework +widely available tools Interactive batch model Batch Production Simulation reconstruction Interactive Chaotic analysis Introduction to ROOT

Data Volume & Processing Time Using technology available in 2004 100MB 1GB 10GB 100GB 1TB 10TB 100TB 1PB ROOT 1 Processor P IV 2.4GHz 2004 : Time for one query using 10 per cent of data 1” 10” 1’ 10’ 1h 10h 1day 1month batch Interactive PROOF 10 Processors 1” 1” 10” 1’ 10’ 1h 10h 1day 10days PROOF 100Processors 1” 1” 1” 10” 1’ 10’ 1h 10h 1day PROOF/GLite 1000Processors 1’ 10’ 1h 10h Introduction to ROOT

Data Volume & Processing Time Using technology available in 2010 100MB 1GB 10GB 100GB 1TB 10TB 100TB 1PB ROOT 1 Processor XXXXX 2010 : Time for one query using 10 per cent of data 1” 1” 10” 1’ 10’ 1h 10h 1day 10days batch Interactive PROOF 10 Processors 1” 1” 1” 10” 1’ 10’ 1h 10h 1day PROOF 100Processors 1” 1” 1” 1” 10” 1’ 10’ 1h 10h PROOF/GLite 1000Processors 1’ 10’ 1h Introduction to ROOT

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 Introduction to ROOT

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

ROOT: a Framework and a Library User classes User can define new classes interactively Either using 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 & event displays Script Compiler root > .x file.C++ Introduction to ROOT

A Data Analysis & Visualisation tool Introduction to ROOT

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

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

Alice 3 million nodes Introduction to ROOT

ROOT + RDBMS Model Run/File Catalog Event Store Trees ROOT files Oracle MySQL Calibrations Event Store histograms Run/File Catalog Trees Geometries Introduction to ROOT

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

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

Memory <--> Tree Each Node is a branch in the Tree T.GetEntry(6) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 T.Fill() 18 T Introduction to ROOT tr

Tree example Event (write) All the examples can be executed with CINT or the compiler root > .x demoe.C root > .x demoe.C++ 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 Introduction to ROOT

Tree example Event (read 1) 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(); Rebuild the full event in memory Introduction to ROOT

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

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

Tree Friends Public read User Write Entry # 8 1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Public read User Write Public read Introduction to ROOT tr

Tree Friends Processing time independent of the number of friends Collaboration-wide public read Processing time independent of the number of friends unlike table joins in RDBMS Analysis group protected user private x Root > TFile f1(“tree1.root”); Root > tree.AddFriend(“tree2”,“tree2.root”) Root > tree.AddFriend(“tree3”,“tree3.root”); Root > tree.Draw(“x:a”,”k<c”); Root > tree.Draw(“x:tree2.x”,”sqrt(p)<b”); Introduction to ROOT

GRID: Interactive Analysis Case 1 Data transfer to user’s laptop Optional Run/File catalog Optional GRID software Optional run/File Catalog Analysis scripts are interpreted or compiled on the local machine Trees Remote file server eg rootd Trees Introduction to ROOT

GRID: Interactive Analysis Case 2 Remote data processing Optional Run/File catalog Optional GRID software Optional run/File Catalog Analysis scripts are interpreted or compiled on the remote machine Trees Remote data analyzer eg proofd Commands, scripts Trees histograms Introduction to ROOT

GRID: Interactive Analysis Case 3 Remote data processing Run/File catalog Full GRID software Run/File Catalog Analysis scripts are interpreted or compiled on the remote master(s) Trees slave Trees Trees Trees slave Remote data analyzer eg proofd slave Commands, scripts slave Trees Histograms,trees Trees slave Trees Trees slave Introduction to ROOT

Trends Summary Parallelism on the GRID Batch/Interactive Access to Catalogs Resource Brokers Process migration Progress Monitors Proxies/caches Virtual data sets More and more GRID oriented data analysis More and more experiment-independent software Efficient Access to large and structured event collections Interaction with user & experiment classes Histogram Ntuple viewers Data Presenters Introduction to ROOT

Google: a good model Make it simple Simple interface Available everywhere Hidden Parallelism Distributed DB Don’t know a priori the data location Fast Introduction to ROOT

Playing with ROOT on lxplus Set the environment variables setenv ROOTSYS /afs/cern.ch/sw/root/v4.00.08/rh73_gcc32/root setenv LD_LIBRARY_PATH $ROOTSYS/lib:$LD_LIBRARY_PATH setenv PATH $ROOTSYS/bin:$PATH Copy the ROOT tutorials cd $HOME cp $ROOTSYS/tutorials . cd tutorials Run ROOT root Introduction to ROOT

Playing with ROOT on a PC Import a binary tar file from: http://root.cern.ch/root/Version400.html Eg:Intel x86 Linux for Redhat 7.3 and gcc 3.2, version 4.00/08 Untar the file in your home directory cd $HOME tar zxvf root_v4.00.08.Linux.RH7.3.gcc32.tar.gz Set the environment variables setenv ROOTSYS $HOME/root setenv LD_LIBRARY_PATH $ROOTSYS/lib:$LD_LIBRARY_PATH setenv PATH $ROOTSYS/bin:$PATH Go to the ROOT tutorials cp $ROOTSYS/tutorials . cd tutorials Run ROOT root Introduction to ROOT

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

executes in global scope My second session root root [0] .x session2.C for N=100000, sum= 45908.6 root [1] sum (double)4.59085828512453370e+004 Root [2] r.Rndm() (Double_t)8.29029321670533560e-001 root [3] .q session2.C { 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); unnamed macro executes in global scope Introduction to ROOT

My third session root session3.C root [0] .x session3.C root [1] sum for N=100000, sum= 45908.6 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= 460.311 root [3] .q session3.C 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); Named macro Normal C++ scope rules Introduction to ROOT

My third session with ACLIC root [0] gROOT->Time(); root [1] .x session4.C(10000000) for N=10000000, sum= 4.59765e+006 Real time 0:00:06, CP time 6.890 root [2] .x session4.C+(10000000) Real time 0:00:09, CP time 1.062 root [3] session4(10000000) Real time 0:00:01, CP time 1.052 root [4] .q session4.C #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); File session4.C Automatically compiled and linked by the native compiler. Must be C++ compliant Introduction to ROOT

Macros with more than one function root [0] .x session5.C >session5.log root [1] .q 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 session5.C 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; sum += i; printf("sum(%d) = %g\n",i,sum); .x session5.C executes the function session5 in session5.C use gROOT->ProcessLine to execute a macro from a macro or from compiled code Introduction to ROOT

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