{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Users_Guide_5_26 - Users Guide 5.26 December 2009 Comments...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Users Guide 5.26 December, 2009 Comments to: [email protected] ______________________________________________________________________________________ The ROOT Users Guide: Authors: The ROOT team. Editors: Ilka Antcheva, Olivier Couet. Special Thanks to: Nick West (Oxford), Elaine Lyons, Suzanne Panacek and Andrey Kubarovsky (FNAL), Damir Buskulic (LAPP). Preface In late 1994, we decided to learn and investigate Object Oriented programming and C++ to better judge the suitability of these relatively new techniques for scientific programming. We knew that there is no better way t o learn a new programming environment than to use it to write a program that can solve a real problem. After a few weeks, we had our first histogramming package in C++. A few weeks later we had a rewrite of the same package using the, at that time, very new template features of C++. Again, a few weeks later we had another rewrite of the package without templates since we could only compile the version with templates on one single platform using a specific compiler. Finally, after about four months we had a histogramming package that was faster and more efficient than the well -known FORTRAN based HBOOK histogramming package. This gave us enough confidence in the new technologies to decide to continue the development. Thus was born ROOT. Since its first public release at the end of 1995, ROOT has enjoyed an ever -increasing popularity. Currently it is being used in all major High Energy and Nuclear Physics laboratories around the world to monitor, to store and to analyze data. In the other sciences as well as th e medical and financial industries, many people are using ROOT. We estimate the current user base to be around several thousand people. In 1997, Eric Raymond analyzed in his paper "The Cathedral and the Bazaar" the development method that makes Linux such a success. The essence of that method is: "release early, release often and listen to your customers". This is precisely how ROOT is being developed. Over the last five years, many of our "customers" became co developers. Here we would like to thank our main co-developers and contributors: Masaharu Goto wrote the CINT C++ interpreter that became an essential part of ROOT. Despite being 8 time zones ahead of us, we have the feeling he has been sitting in the room next door since 1995. Andrei and Mihaela Gheata (Alice collaboration) are co-authors of the ROOT geometry classes and Virtual Monte-Carlo. They have been working with the ROOT team since 2000. Olivier Couet, who after a successful development and maintenance of PAW, has joined the ROOT team in 2000 and has been working on the graphics sub-system. Ilka Antcheva has been working on the Graphical User Interface classes. She is also responsible for this latest edition of the Users Guide with a better style, improved index and several new chapters (since 2002). Bertrand Bellenot has been developing and maintaining the W in32GDK version of ROOT. Bertrand has also many other contributions like the nice RootShower example (since 2001). Valeriy Onoutchin has been working on several ROOT packages, in particular the graphics sub-system for Windows and the GUI Builder (since 2000). Gerri Ganis has been working on the authentication procedures to be used by the root daemons and the PROOF system (since 2002). Maarten Ballintijn (MIT) is one of the main developers of the PROOF sub-system (since 1995). Valeri Fine (now at BNL) ported ROOT to Windows and contributed largely to the 3 -D graphics. He is currently working on the Qt layer of ROOT (since 1995). Victor Perevoztchikov (BNL) worked on key elements of the I/O system, in particular the improved support for STL collections (1997-2001). Nenad Buncic developed the HTML documentation generation system and integrated the X3D viewer inside ROOT (1995-1997). Suzanne Panacek was the author of the first version of this User‘s Guide and very active in preparing tutorials and giving lectures about ROOT (1999-2002). Axel Naumann has been developing further the HTML Reference Guide and helps in porting ROOT under Windows (cygwin/gcc implementation) (since 2000). Anna Kreshuk has developed the Linear Fitter and Robust Fitter classes as well as many functions in TMath, TF1, TGraph (since 2005). Richard Maunder has contributed to the GL viewer classes (since 2004). Timur Pocheptsov has contributed to the GL viewer classes and GL in pad classes (since 2004). Sergei Linev has developed the XML driver and the TSQLFile classes (since 2003). Stefan Roiser has been contributing to the reflex and cintex packages (since 2005). Lorenzo Moneta has been contributing the MathCore, MathMore, Smatrix & Minuit2 packages (since 2005). Wim Lavrijsen is the author of the PyRoot package (since 2004). Further we would like to thank all the people mentioned in the $ROOTSYS/README/CREDITS file for their contributions, and finally, everybody who gave comments, reported bugs and provided fixes. Happy ROOTing! Rene Brun & Fons Rademakers Geneva, July 2007 Preface i Table of Contents Preface i Table of Contents iii Table of Figures xv 1 Introduction 1 The ROOT Mailing Lists .............................................................................. 1 Contact Information ...................................................................................... 1 Conventions Used in This Book ................................................................... 1 The Framework ............................................................................................. 2 What Is a Framework? .................................................................... 2 Why Object-Oriented? .................................................................... 3 Installing ROOT ........................................................................................... 3 The Organization of the ROOT Framework ................................................. 3 $ROOTSYS/bin .............................................................................. 4 $ROOTSYS/lib............................................................................... 4 $ROOTSYS/tutorials ...................................................................... 6 $ROOTSYS/test ............................................................................. 7 $ROOTSYS/include ....................................................................... 7 $ROOTSYS/<library> .................................................................... 7 How to Find More Information ..................................................................... 7 2 Getting Started 9 Setting the Environment Variables ............................................................... 9 Start and Quit a ROOT Session .................................................................... 9 Using the GUI ............................................................................................. 10 Main Menus and Toolbar ............................................................. 11 The Editor Frame .......................................................................... 13 Classes, Methods and Constructors .............................................. 14 User Interaction ............................................................................ 15 Building a Multi-pad Canvas ........................................................ 16 Saving the Canvas ........................................................................ 16 Printing the Canvas ....................................................................... 16 The ROOT Command Line ........................................................................ 17 Multi-line Commands ................................................................... 17 CINT Extensions .......................................................................... 17 Helpful Hints for Command Line Typing .................................... 17 Regular Expression ....................................................................... 17 Conventions ................................................................................................ 18 Coding Conventions ..................................................................... 18 Machine Independent Types ......................................................... 18 TObject ......................................................................................... 19 Global Variables ......................................................................................... 19 gROOT ......................................................................................... 19 gFile .............................................................................................. 20 gDirectory ..................................................................................... 20 gPad .............................................................................................. 20 gRandom ...................................................................................... 20 gEnv.............................................................................................. 20 Environment Setup ..................................................................................... 20 Logon and Logoff Scripts ............................................................. 21 History File ................................................................................... 21 Tracking Memory Leaks .............................................................. 21 Table of Contents iii Memory Checker .......................................................................... 21 Converting from PAW to ROOT ................................................................ 22 Converting HBOOK/PAW Files .................................................. 22 3 Histograms 23 The Histogram Classes ............................................................................... 23 Creating Histograms ................................................................................... 24 Fixed or Variable Bin Size .......................................................................... 24 Bin Numbering Convention.......................................................... 24 Re-binning .................................................................................... 25 Filling Histograms ...................................................................................... 25 Automatic Re-binning Option ...................................................... 25 Random Numbers and Histograms ............................................................. 25 Adding, Dividing, and Multiplying............................................................. 26 Projections .................................................................................................. 26 Drawing Histograms ..................................................................... 26 Setting the Style ............................................................................ 27 Draw Options .............................................................................................. 27 The SCATter Plot Option ............................................................. 29 The ARRow Option ...................................................................... 29 The BOX Option .......................................................................... 29 The ERRor Bars Options .............................................................. 29 The Color Option .......................................................................... 29 The TEXT Option......................................................................... 30 The CONTour Options ................................................................. 30 The LEGO Options ....................................................................... 31 The SURFace Options .................................................................. 32 The BAR Options ......................................................................... 33 The Z Option: Display the Color Palette on the Pad .................... 33 The SPEC Option ......................................................................... 34 3-D Histograms ............................................................................ 36 Drawing a Sub-range of a 2-D Histogram .................................................. 36 Superimposing Histograms with Different Scales ...................................... 37 Statistics Display......................................................................................... 37 Setting Line, Fill, Marker, and Text Attributes ........................................... 38 Setting Tick Marks on the Axis .................................................................. 38 Giving Titles to the X, Y and Z Axis .......................................................... 39 Making a Copy of an Histogram ................................................................. 39 Normalizing Histograms ............................................................................. 39 Saving/Reading Histograms to/from a File ................................................. 39 Miscellaneous Operations ........................................................................... 39 Alphanumeric Bin Labels ........................................................................... 40 Histogram Stacks ........................................................................................ 41 Profile Histograms ...................................................................................... 42 Build Options................................................................................ 43 Drawing a Profile without Error Bars ........................................... 44 Create a Profile from a 2D Histogram .......................................... 44 Create a Histogram from a Profile ................................................ 44 Generating a Profile from a TTree................................................ 44 2D Profiles .................................................................................... 44 Iso Surfaces ................................................................................................. 45 3D Implicit Functions ................................................................................. 46 TPie ............................................................................................................. 46 The User Interface for Histograms.............................................................. 47 TH1Editor ..................................................................................... 47 TH2Editor ..................................................................................... 48 4 Graphs 51 TGraph ........................................................................................................ 51 Graph Draw Options ..................................................................... 51 Superimposing Two Graphs ....................................................................... 54 iv Table of Contents Graphs with Error Bars ............................................................................... 55 Graphs with Asymmetric Error Bars .......................................................... 55 Graphs with Asymmetric Bent Errors ......................................................... 56 TGraphPolar ............................................................................................... 57 TGraph Exclusion Zone .............................................................................. 58 TGraphQQ .................................................................................................. 59 TMultiGraph ............................................................................................... 60 TGraph2D ................................................................................................... 61 TGraph2DErrors ......................................................................................... 63 Fitting a Graph ............................................................................................ 63 Setting the Graph's Axis Title ..................................................................... 63 Zooming a Graph ........................................................................................ 63 The User Interface for Graphs .................................................................... 64 5 Fitting Histograms 65 The Fit Method ........................................................................................... 65 Fit with a Predefined Function .................................................................... 65 Fit with a User-Defined Function ............................................................... 66 Creating a TF1 with a Formula ..................................................... 66 Creating a TF1 with Parameters ................................................... 66 Creating a TF1 with a User Function............................................ 66 Fixing and Setting Parameters’ Bounds ...................................................... 67 Fitting Sub Ranges ...................................................................................... 67 The Fit Panel ............................................................................................... 68 Fitting Multiple Sub Ranges ....................................................................... 69 Adding Functions to the List ....................................................................... 70 Combining Functions .................................................................................. 70 Associated Function .................................................................................... 72 Access to the Fit Parameters and Results .................................................... 72 Associated Errors ........................................................................................ 72 Fit Statistics ................................................................................................ 72 The Minimization Package ......................................................................... 72 Basic Concepts of Minuit ............................................................. 73 The Transformation of Limited Parameters .................................. 73 How to Get the Right Answer from Minuit .................................. 73 Reliability of Minuit Error Estimates ........................................... 74 FUMILI Minimization Package .................................................................. 75 Neural Networks ......................................................................................... 76 Introduction .................................................................................. 76 The MLP....................................................................................... 76 Learning Methods ......................................................................... 76 Using the Network ........................................................................ 77 Examples ...................................................................................... 78 6 A Little C++ 81 Classes, Methods and Constructors ............................................................ 81 Inheritance and Data Encapsulation ............................................................ 81 Method Overriding ....................................................................... 82 Data Encapsulation ....................................................................... 82 Creating Objects on the Stack and Heap ..................................................... 83 7 CINT the C++ Interpreter 85 What is CINT? ............................................................................................ 85 The ROOT Command Line Int...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern