1 / 60

ROOT

ROOT. An Object Oriented Data Analysis Framework. Day 1. The Early ROOT Team. The ROOT Web Pages. http://root.cern.ch. General Information and News Download source and binaries HowTo’s & tutorials User Guide & Reference Guide Roottalk mailing list & Forum

ormanc
Download Presentation

ROOT

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ROOT An Object Oriented Data Analysis Framework Day 1 ROOT Day1, Fons Rademakers

  2. The Early ROOT Team ROOT Day1, Fons Rademakers

  3. The ROOT Web Pages http://root.cern.ch • General Information and News • Download source and binaries • HowTo’s & tutorials • User Guide & Reference Guide • Roottalk mailing list & Forum • Savannah bug reporting and rootdev@root.cern.ch ROOT Day1, Fons Rademakers

  4. Acknowledgements • Suzanne Panacek (Fermilab) • Philippe Canal (Fermilab) • For their help in developing this course ROOT Day1, Fons Rademakers

  5. Class Schedule - Day 1 • Overview of the ROOT Framework • GUI basics • Command line basics • Finding Information (class reference guide) • Getting started with the exercises ROOT Day1, Fons Rademakers

  6. Class Schedule - Day 2 • ROOT commands and CINT • Discuss exercises • Functions and fitting • Building ROOT Trees • Reading Trees • Using Trees in Analysis ROOT Day1, Fons Rademakers

  7. ROOT Overview • What is ROOT • What about PAW • Concepts: Object Oriented Design, Frameworks • Services and Utilities • Libraries • Physical Organization ROOT Day1, Fons Rademakers

  8. Prehistory • In the beginning there was PAW • HBOOK • ZEBRA • KUIP • COMIS • SIGMA • Mini/Micro-DST analysis was done using Ntuples • Ntuples are basically simple tables • Only basic types • No data structures • No cross reference between Ntuples • Successful because simple and efficient • Dead-end • No way to grow to more complex data structures • Difficult to extend • Expensive to maintain • Too many languages: Fortran, KUIP, SIGMA ROOT Day1, Fons Rademakers

  9. Main Goals for New System • Being able to support full data analysis chain • Raw data, DSTs, mini-DSTs, micro-DSTs • Being able to handle complex structures • Complete objects • Object hierarchies • Support at least the PAW data analysis functionality • Histogramming • Fitting • Visualization • Only one language • C++ • Better maintainable • Use OOP • Make the system extensible • Use OO framework technology ROOT Day1, Fons Rademakers

  10. 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 scripts • The command and scripting language is C++, thanks to the embedded CINT C++ interpreter, and large scripts can be compiled and dynamically loaded ROOT Day1, Fons Rademakers

  11. ROOT: An Open Source Project • The project is developed as a collaboration between: • Full time developers: • 10 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 • Several thousand users giving feedback, comments, bug fixes and many small contributions • An Open Source Project, source available under the LGPL license ROOT Day1, Fons Rademakers

  12. ROOT Development Process • We follow an Open Source development model • “Release early, release often” • Major releases 3-4 times per year • Minor releases every 2-3 weeks • Daily/nightly builds + regression testing + benchmarking (rootmarks) • “Let user feedback drive the development” • Bug reporting system • Roottalk mailing list • Annual workshop • Open cvs repository • Let users become developers ROOT Day1, Fons Rademakers

  13. Object Oriented Concepts • Class: the description of a “thing” in the system • Object: instance of a class • Methods: functions for a class • Members: a “has a” relationship to the class. • Inheritance: an “is a” relationship to the class. TObject IsA Event HasA HasA HasA Segment Track Vertex HasA HasA HasA Momentum MeanCharge MassSquare ROOT Day1, Fons Rademakers

  14. A Framework provides utilities and services ROOT Day1, Fons Rademakers

  15. ROOT's Services and Utilities • Data analysis and visualization tools • Histogramming and Fitting • 2D and 3D graphics, Postscript, PDF, LateX • Geometrical modeller • Object persistency and Trees • PROOF parallel query engine • Collection Classes • Run Time Type Identification • Online services • User Interface • GUI: Browsers, Panels, Tree Viewer • Command Line interface: C++ interpreter CINT • Script Processor (C++ compiled C++ interpreted) ROOT Day1, Fons Rademakers

  16. Class Class Class Calling API vs Sub-classing API Class Program using calling API Class A Class Y calls method B virtual method Z inherits Class newY Framework virtual method Z Program using sub-classing API ROOT Day1, Fons Rademakers

  17. 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 ROOT Day1, Fons Rademakers

  18. 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) ROOT Day1, Fons Rademakers

  19. Three User Interfaces • GUIwindows, buttons, menus • Command lineCINT (C++ interpreter) • Macros, applications, libraries (C++ compiler and interpreter) ROOT Day1, Fons Rademakers

  20. Differences from PAW • Regular grammar (C++) on command line • Single language (compiled and interpreted) • Object Oriented (use your class in the interpreter) • Advanced Interactive User Interface • Well Documented code. HTML class descriptions for every class. • Object I/O including Schema Evolution • 3-D interfaces with OpenGL and X3D. ROOT Day1, Fons Rademakers

  21. PAW to ROOT File Conversion • Get the example PAW file from ftp://root.cern.ch/root/exercises.tar.gz • exercises_files/day1/toyz.rz • At the system prompt type • > h2root toyz.rz toyz.root • Once you've done the conversion, you can then start a ROOT session and open toyz.root • Also see: http://root.cern.ch/root/HowtoConvert.html ROOT Day1, Fons Rademakers

  22. A Data Analysis & Visualization Tools ROOT Day1, Fons Rademakers

  23. Graphics: 1,2,3-D functions ROOT Day1, Fons Rademakers

  24. Histograms ROOT Day1, Fons Rademakers

  25. Full LateXsupport on screen and postscript Formula or diagrams can be edited with the mouse TCurlyArc TCurlyLine TWavyLine and other building blocks for Feynman diagrams ROOT Day1, Fons Rademakers

  26. 3 million nodes Alice ROOT Day1, Fons Rademakers

  27. ROOT Overview Summary • Concepts: Object Oriented Design, Frameworks • Services and Utilities • Libraries • Physical Organization • PAW Compatibility • Some Visual Examples ROOT Day1, Fons Rademakers

  28. GUI Basics • Browsing and opening files • Drawing histograms • Right click, left click, middle click • Draw Panel • Fit Panel • Adding Color and Zooming • Adding text and other objects • Dividing the canvas • Setting the log scale ROOT Day1, Fons Rademakers

  29. GUI Basics • Display the browser • TBrowser b; • Start root • > root • Quit root (just in case) • root[0] .q ROOT Day1, Fons Rademakers

  30. Displaying a Histogram • Display a histogram The Canvas Open the ROOT file Browse the file ROOT Day1, Fons Rademakers

  31. Basic Navigation by Clicking • Left Click • select the object • drag the object • resize the object • Right Click • context menu • class::name • methods • Middle Click • activate canvas • pop pads • freezes event status bar ROOT Day1, Fons Rademakers

  32. The Editor Panel • The Event Status The Editor Panel Adding Error bars Changing colors Styles ROOT Day1, Fons Rademakers

  33. The Editor Panel Sliders Rebining ROOT Day1, Fons Rademakers

  34. Fitting, Coloring, and Zooming • Adding a gaussian fit • Coloring the histogram • Zooming/unzooming ROOT Day1, Fons Rademakers

  35. Adding Objects to the Canvas • The Editor • Adding an Arrow • Adding Text ROOT Day1, Fons Rademakers

  36. Adding Another Pad • Add a Pad • Select the new Pad • Draw a histogram • Add a title for the axis ROOT Day1, Fons Rademakers

  37. Modifying the Statistics • The Canvas in the Browser • Setting the (7) statistics options • default = 0001111 ROOT Day1, Fons Rademakers

  38. Dividing the Canvas • Create a new Canvas • Divide it in 2 • Draw two histograms. 1. Lego plot 2. LogY ROOT Day1, Fons Rademakers

  39. 1-D Drawing Options Any object in the canvas is clickable and editable ROOT Day1, Fons Rademakers

  40. 2-D Drawing Options ROOT Day1, Fons Rademakers

  41. 2-D Drawing Options ROOT Day1, Fons Rademakers

  42. 2-D Drawing Options All these plots can be rotated with the mouse ROOT Day1, Fons Rademakers

  43. 2-D Drawing Options Same output on the screen and with vector Postscript ROOT Day1, Fons Rademakers

  44. THStack Examples ROOT Day1, Fons Rademakers

  45. Filling with String Variables ROOT Day1, Fons Rademakers

  46. Command Line Basics • Use up and down arrows to recall commands • $HOME/.root_hist • Use emacs commands to navigate ROOT Day1, Fons Rademakers

  47. Open a File • Open a file for reading root [] TFile f("Example.root") • Look at the contents of the file root [] f.ls() TFile** Example.root ROOT file TFile* Example.root ROOT file KEY: TTree myTree;1 Example ROOT tree KEY: TH1F totalHistogram;1 Total Distribution KEY: TH1F mainHistogram;1 Main Contributor KEY: TH1F s1Histogram;1 First Signal KEY: TH1F s2Histogram;1 Second Signal ROOT Day1, Fons Rademakers

  48. Plotting a Variable • Plot a variable • root [] myTree->Draw("xs1") • Where did myTree come from? • ROOT executed an implicit gROOT->FindObject("myTree") • And now.. • root[] f.ls() • … OBJ: TTree myTree Example ROOT tree: 0 KEY: TTree myTree;1 Example ROOT tree ROOT Day1, Fons Rademakers

  49. The ROOT File • A TFile is a directory structure like UNIX • Object in Memory (OBJ) Object on Disk (KEY) ROOT Day1, Fons Rademakers

  50. The ROOT Tree • Stores large quantities of same class objects: • Optimize disk space • Optimize access speed • Had analysis methods (TTree::Draw()) • TNtuple is a TTree limited to floating point numbers. • More details later … ROOT Day1, Fons Rademakers

More Related