ROOT courses1 The ROOT System A Data Access & Analysis Framework Graphics.

Slides:



Advertisements
Similar presentations
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,
Advertisements

ROOT courses1 The ROOT System A Data Access & Analysis Framework June 2003 Ren é Brun/EP Histograming & Fitting.
Postgraduate Computing Lectures Applications I: Analysis Tools 1 Applications: Analysis Tools Analysis Tools –Used to extract Physics from reconstructed.
Fitting procedure using ROOT Department of High Energy Physics Nekrasov M. Dmitriy.
Next Generation MMI Requirements May 4, MMI - High Level Requirements run under UNIX and Windows NT (WNT) use a well defined ASCII definition for.
Blueprint RTAGs1 Coherent Software Framework a Proposal LCG meeting CERN- 11 June Ren é Brun ftp://root.cern.ch/root/blueprint.ppt.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
3D Game Programming All in One By Kenneth C. Finney.
Introduction To Form Builder
An Overview of Qt - asankar1. Agenda About Qt –A brief intro of Qt Qt development tools –Tools used for building Qt application Qt Architecture –The underlying.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Graphical User Interfaces in Haskell Koen Lindström Claessen.
© 2009 Autodesk Autodesk ® Ecotect TM Analysis: The Desktop Component Interface Dr. Andrew Marsh Principal Software Engineer, AEC-Simulation.
Infinity-project.org Engineering education for today’s classroom The Infinity Project SM LabVIEW for The Infinity Project.
XP Tutorial 7 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Working with Graphics Tutorial 7.
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.
ROOT Tutorials - Session 51 ROOT Tutorials – Session 8 GUI, Signal/Slots, Image Processing, Carrot Fons Rademakers.
June 2001ROOT 2001 FNAL1 What Else is New Since ROOT 2000? Fons Rademakers.
Bertrand Bellenot ROOT Users Workshop Mar ROOT GUI Builder Status & Plans ROOT & External GUI World MFC, FOX, Qt, PVSS… Snapshot of the Future.
CIS—100 Chapter 15—Windows Vista 1. Parts of a Window 2.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Laboratory Exercise # 9 – Inserting Graphics to Documents Office Productivity Tools 1 Laboratory Exercise # 9 Inserting Graphics to Documents Objectives:
_______________________________________________________________CMAQ Libraries and Utilities ___________________________________________________Community.
Lection №5 Modern integrated development environment.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
“Paper” output Root Graphics Workshop 16/07/2010.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Introduction to ROOT1 Summer Students Lecture 10 July 2007 Ren é Brun CERN/PH/SFT Introduction to ROOT
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 9 GUI Programming Using Tkinter 1.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
ROOT’s graphics on iOS. ROOT’s graphics (general scheme):
ROOT Future1 Some views on the ROOT future ROOT Workshop 2001 June 13 FNAL Ren é Brun CERN.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
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 Work Package ROOT release 5.28 Review Root meeting 11/06/2010.
06/13/2001Dmitry Litvintsev CDF Event Display Dmitry Litvintsev, Fermilab CDF Collaboration Introduction Elements of CDF Run II Event.
In the name of God Computer Graphics.
Computing Fundamentals Module Lesson 7 — The Windows Operating System Computer Literacy BASICS.
ROOT Users Workshop September 2005 Ilka Antcheva GUI Status and Development.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
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,
INFORMATION SYSTEM – SOFTWARE TOPIC: GRAPHICAL USER INTERFACE.
CMPF124 Personal Productivity With Information Technology Chapter 1 – Part 2 Introduction to Windows Operating Systems Manipulating Windows GUI CMPF 124.
S.Linev: Go4 - J.Adamczewski, H.G.Essel, S.Linev ROOT 2005 New development in Go4.
CHEP06, Mumbai, India February 2006 General Status of ROOT GUI Ilka Antcheva, Bertrand Bellenot, René Brun, Valeriy Onuchin *, Fons Rademakers CERN,
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
®® Microsoft Windows 7 Windows Tutorial 7 Managing Multimedia Files.
LCG AA Meeting 30 June 2004 Ilka Antcheva Graphics User Interface in ROOT.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
ROOT: Functions & Fitting Harinder Singh Bawa California State University Fresno.
LCG AA Meeting 26 April 2006 User Interface Developments in ROOT Ilka Antcheva on behalf of ROOT GUI Work Package.
Introducing Scratch Learning resources for the implementation of the scenario
Adobe Flash Professional CS5 – Illustrated Unit A: Getting Started with Adobe Flash Professional.
Chapter 2 – Introduction to Windows Operating System II Manipulating Windows GUI 1CMPF112 Computing Skills for Engineers.
Go4 v2.2 Status & Overview CHEP 2003
In the name of God Computer Graphics.
Human Computer Interaction Lecture 07 The Interaction
ROOT: Functions & Fitting
Chap 7. Building Java Graphical User Interfaces
GUI Using Python.
Graphical User Interfaces -- Introduction
Tkinter GUIs Computer Science and Software Engineering
Chapter 2 – Introduction to the Visual Studio .NET IDE
GTK + Programming.
Topics Graphical User Interfaces Using the tkinter Module
Presentation transcript:

ROOT courses1 The ROOT System A Data Access & Analysis Framework Graphics

R.Brun RT03 ROOT graphics2

R.Brun RT03 ROOT graphics3 Gui/Graphics strategy TVirtualX TGWin32TGX11TGWin32GDKTGQt TVirtualPad TPad User/Root GUI and Graphics classes Applications see only Abstract Interfaces Low level screen graphics and GUI High level pad graphics TG??

R.Brun RT03 ROOT graphics4 Coordinate Systems Pixel coordinates [0,32000] (TVirtualX) (0,0) at top left corner NDC (Normalized Device Coordinates) [0,1], (0,0) at bottom left corner System used for annotations Normal User coordinates (TVirtualPad) Linear/Log scale in x,y,z Can switch between lin/log scale without calling Draw again. TVirtualPad/TPad have functions to convert between systems

R.Brun RT03 ROOT graphics5 TPad: main graphics container Hello Root > TLine line(.1,.9,.6,.6) Root > line.Draw() Root > TText text(.5,.2,”Hello”) Root > text.Draw() The Draw function adds the object to the list of primitives of the current pad. If no pad exists, a pad is automatically created with a default range [0,1]. When the pad needs to be drawn or redrawn, the object Paint function is called. Only objects deriving from TObject may be drawn in a pad Root Objects or User objects

R.Brun RT03 ROOT graphics6 TPad hierarchy A primitive in the pad can be another pad. The top level pad is a TCanvas. A pad has an associate pixmap. Painting is in the pixmap. When the pad must be redrawn, the pixmap is flushed to the window canvas pad1 pad3pad2 pad1a The pixmap is flushed when the pad is declared “modified” and TPad::Update called

R.Brun RT03 ROOT graphics7 Canvas pixmaps 600x x800 Scroll bars Need Help?

R.Brun RT03 ROOT graphics8 Saving a pad/canvas A pad/canvas may be saved in many formats using the GUI menu or via TPad::SaveAs canvas.C : a C++ script is automatically generated. The canvas may be generated again via.x canvas.C canvas.ps(eps) Postscript or encapsulated ps canvas.svg : scalable vector graphics canvas.gif canvas.root: keep objects in a compressed and portable format.

R.Brun RT03 ROOT graphics9 Picking- Graphics event loop TCanvas::HandleInput manages the event loop. When the mouse moves to a pad, TPad::Pick is called. TPad::Pick loops on all primitives in the pad, calling their function DistancetoPrimitive. The selected object is the one with the smallest distance. Activate the tool bar option “ShowEventStatus” to understand the behaviour.

R.Brun RT03 ROOT graphics10 Picking- Graphics event loop When an object has been selected by DistancetoPrimitive, its ExecuteEvent function is called. The result of ExecuteEvent is object dependent. The cursor changes shape to suggest possible actions : grow/shrink/move box, rotation, etc. Pressing the right mouse button on an object shows its context menu.

R.Brun RT03 ROOT graphics11 The Graphics Event Loop The ROOT event handler supports: keyboard interrupts system signals X11, Xt, Xm events Sockets interrupts Special messages (shared memory, threads..) Foreign systems (eg Inventor, X3d..) can easily be integrated in the ROOT loop. ROOT will dispatch the foreign events using Timers. Signals and Slots like in Qt Qt and ROOT can work together

R.Brun RT03 ROOT graphics12 Basic Primitives TButton TLineTArrow TEllipse TCurvyLine TPaveLabel TPave TDiamond TPavesText TPolyLine TLatex TCrown TMarker TText TCurlyArc TBox

R.Brun RT03 ROOT graphics13 The Graphics Editor See HELP button to use the graphics editor

R.Brun RT03 ROOT graphics14 Graphics attributes Most Root classes derive from very light weight data objects classes like TAttLine, TAttFill, TAttMarker, TAttText

R.Brun RT03 ROOT graphics15 Annotations, Paves quarks.C

R.Brun RT03 ROOT graphics16 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 Feynman.C latex3.C

R.Brun RT03 ROOT graphics17 Graphs TGraph(n,x,y) TCutG(n,x,y) TGraphErrors(n,x,y,ex,ey) TGraphAsymmErrors(n,x,y,exl,exh,eyl,eyh) TMultiGraph gerrors2.C

R.Brun RT03 ROOT graphics18 Graphs zdemo.C

R.Brun RT03 ROOT graphics19 The Histogram Classes Structure 1-Dim 2-Dim 3-Dim

R.Brun RT03 ROOT graphics20 Automatic binning #include "TH1.h" #include "TF1.h" void demoauto() { TF1 f1("f1","gaus",0,30); f1.SetParameters(1,10,3); TH1F *h = new TH1F("h","Automatic binning demo",100,0,0); for (Int_t i=0;i< ;i++) { h->Fill(f1.GetRandom()); } h->Draw(); } No limits

R.Brun RT03 ROOT graphics21 1-D drawing Options Any object in the canvas is clickable and editable

R.Brun RT03 ROOT graphics22

R.Brun RT03 ROOT graphics23 2-D drawing options

R.Brun RT03 ROOT graphics24 2-D drawing options

R.Brun RT03 ROOT graphics25 2-D drawing Options All these plots can be rotated with the mouse

R.Brun RT03 ROOT graphics26 2-D drawing Options Same output on the screen and with vector Postscript

R.Brun RT03 ROOT graphics27 THStack examples

R.Brun RT03 ROOT graphics28 Filling with string variables

R.Brun RT03 ROOT graphics29 Math Libs & Statistics GRID middleware RDBMS run/file catalogs Object persistency 2-d, 3-d graphics GUI Toolkits Math Libs Statistics Detector Geometry Event Generators Detector Simulation Object persistency Histograming Fitting Event Models Folders Event Display Ntuple analysis Interpreters DAQ Online System services In ROOT today TVector2,3 TLorentzRotation TLorentzVector TRandom,2,3 TMatrix TMath TFeldmanCousins TPrincipal TMultidimFit TConfidenceLevel TFractionFitter Can generate random numbers from basic distributions; gaus, poisson, etc from parametric analytic functions 1,2,3-d from histograms, 1,2,3-d A collection of many algorithms CERNLIB, Numerical Recipes in C/C++ Would like to see an interface to GSL to Numerical Recipes in C++ Collaboration with Fred James, Louis Lyons, Sherry Towers Many algorithms classes developed by a huge user community See recent FNAL meeting and effort organized within ACAT Matrix package maintained by E. Offermann (Rentec)

R.Brun RT03 ROOT graphics30 Graphics : 1,2,3-D functions surfaces.C FittingDemo.C TF3 f3(“f3”,”sin(x*x+y*y+z*z-36)”,-2,2,-2,2,-2,2); f3->Draw();

R.Brun RT03 ROOT graphics31 TGaxis gaxis.C

R.Brun RT03 ROOT graphics32 Histograms New class THStack Long list of new functions in TH1 Plenty of new drawing options Filling with string variables TH1::Merge(TCollection *list)

R.Brun RT03 ROOT graphics33 Peak Finder + Deconvolutions by Miroslav Morach TSpectrum

R.Brun RT03 ROOT graphics34 Fitting TVirtualFitter TFitter TMinuit TH1::Fit bin chisquare bin likelihood TGraph::Fit unbinned chisquare User TTree::Fit unbinned likelihood TFumili

R.Brun RT03 ROOT graphics35 Fitting histograms Histograms (1-D,2-D,3-D and Profiles) can be fitted with a user specified function via TH1::Fit. Two Fitting algorithms are supported: Chisquare method and Log Likelihood The user functions may be of the following types: standard functions: gaus, landau, expo, poln combination of standard functions; poln + gaus A C++ interpreted function or a C++ precompiled function An option is provided to compute the integral of the function bin by bin instead of simply compute the function value at the center of the bin. When an histogram is fitted, the resulting function with its parameters is added to the list of functions of this histogram. If the histogram is made persistent, the list of associated functions is also persistent. One can retrieve the function/fit parameters with calls such as: Double_t chi2 = myfunc->GetChisquare(); Double_t par0 = myfunc->GetParameter(0); //value of 1st parameter Double_t err0 = myfunc->GetParError(0); //error on first parameter

R.Brun RT03 ROOT graphics36 Adding dynamic objects to a pad A TExec object may be added to the pad. Its Paint function can call any CINT command. DynamicSlice.C

R.Brun RT03 ROOT graphics37 Using Timers with graphics Double_t pi = TMath::Pi(); TF2 *f2; Float_t t = 0; Float_t phi = 30; void anim() { gStyle->SetFrameFillColor(42); TCanvas *c1 = new TCanvas("c1"); c1->SetFillColor(17); f2 = new TF2("f2","sin(2*x)*sin(2*y)*[0]",0,pi,0,pi); f2->SetParameter(0,1); f2->SetNpx(15); f2->SetNpy(15); f2->SetMaximum(1); f2->SetMinimum(-1); f2->Draw("surf1"); TTimer *timer = new TTimer(20); timer->SetCommand("Animate()"); timer->TurnOn(); } void Animate() { t += 0.05*pi; f2->SetParameter(0,TMath::Cos(t)); phi += 2; gPad->SetPhi(phi); gPad->Modified(); gPad->Update(); } Every 20 milliseconds: -Modify the function parameter -Change the view angle anim.C

R.Brun RT03 ROOT graphics38 More on Timers with Graphics { // run the dancing Hello World Hello hello; // run the analog clock Aclock clock; // run the Tetris game Tetris tetris; } The 3 canvases run in parallel games.C

R.Brun RT03 ROOT graphics39 TASImage classes New set of image processing classes. The TImage class is the abstract image base class and TASImage is the concrete implementation using the libAfterImage imaging library of Sasha Vasko. A large part of the development was done by Reiner Rohlfs from the ISDC based on a set of astrophysics user requirements. The image class allows for the reading and writing of images in different formats, several image manipulations (scaling, tiling, merging, etc.) and displaying in pads. The size of the image on the screen does not depend on the original size of the image but on the size of the pad.Therefore it is very easy to resize the image on the screen by resizing the pad. Rose_image.C Galaxy_image.C

R.Brun RT03 ROOT graphics40 3-D Graphics Basic primitives TPolyLine3D, TPolyMarker3D, THelix, TMarker3DBox,TAxis3D Geant primitives Support for all Geant3 volumes + a few new volume types TBRIK,TCONE,TCONS,TCTUB,TELTU,TGTRA,THYPE,TPARA,TPCON, TPGON,TSPHE,TTUBE,TTUBS,TTRAP,TTRD1,TTRD2,TXTRU Geometry package Rendering with: TPad X3D (very fast. Unix only. Good on networks) OpenGL OpenInventor (new addition in 3.01)

R.Brun RT03 ROOT graphics41 Some detectors in ROOT geometry

R.Brun RT03 ROOT graphics42 Alice 3 million nodes

ROOT courses43 GUI

R.Brun RT03 ROOT graphics44 Available Widgets Complete set of widgets: label, icon, button, check button, radio button, picture button, button box, list box, combo box, list view, icon view, number entry, text entry, text view, text edit, tree view, tab view, scrollbar, slider, menubar, popup menu, cascading menu, statusbar, toolbar, message dialogs, file selection dialog, progress bars, tooltips,...

R.Brun RT03 ROOT graphics45 Creating a GUI The widgets are laid out in frames TGFrame, TGCompositeFrame, TGMainFrame, TGTransientFrame, TGroupFrame And arranged by layout managers TGHorizontalLayout, TGVerticalLayout, TGRowLayout, TGListLayout, TGTileLayout, TGMatrixLayout,... Using a combination of layout hints TGLayoutHints (left, center x, right, top, center y, bottom, expand x, expand y and fixed offsets) Event handling by messaging (as opposed to callbacks). Like Win32. And by signals and slots. Like Qt.

R.Brun RT03 ROOT graphics46 Basic Widgets

R.Brun RT03 ROOT graphics47 Signals and Slots Integration of signal and slot mechanism into the ROOT core TQObject, TQConnection, TQClass, … Signal and slots were pioneered by Trolltech in their Qt GUI toolkit This mechanism facilitates component programming since it allows a total decoupling of the interacting classes

R.Brun RT03 ROOT graphics48 Signals and Slots The ROOT signal and slot system uses the dictionary information and interpreter to connect signals to slots Many different signals are emitted by: TVirtualPad (TCanvas and TPad) TSysEvtHandler (TTimer, TFileHandler) All GUI widgets Let your classes emit signals whenever they change a significant state that others might be interested in

R.Brun RT03 ROOT graphics49 GUI User example Example of GUI based on ROOT tools Each element is clickable

R.Brun RT03 ROOT graphics50 GUI Examples

R.Brun RT03 ROOT graphics51 Graphical User Interface Ex: ZEUS event display Option tabs Status information CanvasPads Object information Input modesZoom controls

R.Brun RT03 ROOT graphics52 Fish-eye View