81
Introduction to ROOT, Akiya Miyamoto 26-May-2003 Bases on ROOT lecture by Suzanne Panacek ( FNAL ) http://www-root.fnal.gov/root Akiya Miyamoto, KEK 26-May Ba

Akiya Miyamoto, KEK Bases on ROOT lecture by Suzanne

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Introduction to ROOT, Akiya Miyamoto 26-May-2003

� �

� � �� �� � � � � � �

� ��� � � � � � � ��

Bases on ROOT lecture by Suzanne Panacek ( FNAL ) http://www-root.fnal.gov/root

Akiya Miyamoto, KEK

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Bases on ROOT lecture by Suzanne Panacek ( FNAL ) http://www-root.fnal.gov/root

Akiya Miyamoto, KEK

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Bases on ROOT lecture by Suzanne Panacek ( FNAL ) http://www-root.fnal.gov/root

Akiya Miyamoto, KEK

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Bases on ROOT lecture by Suzanne Panacek ( FNAL ) http://www-root.fnal.gov/root

Akiya Miyamoto, KEK

Introduction to ROOT, Akiya Miyamoto

�26-May-2003

�� ���������

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Introduction to ROOT, Akiya Miyamoto 26-May-2003 Introduction to ROOT, Akiya Miyamoto 26-May-2003

Introduction to ROOT, Akiya Miyamoto

26-May-2003

! " # ! " $

1. Overview of the ROOT Framework2. GUI basics3. Command line basics4. Root Commands and CINT5. Examples of Histograms, Functions and Fitting6. How to add your Own Class

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. Overview of the ROOT Framework2. GUI basics3. Command line basics4. Root Commands and CINT5. Examples of Histograms, Functions and Fitting6. How to add your Own Class

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. Overview of the ROOT Framework2. GUI basics3. Command line basics4. Root Commands and CINT5. Examples of Histograms, Functions and Fitting6. How to add your Own Class

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. Overview of the ROOT Framework2. GUI basics3. Command line basics4. Root Commands and CINT5. Examples of Histograms, Functions and Fitting6. How to add your Own Class

Introduction to ROOT, Akiya Miyamoto

%26-May-2003

& '

( What about PAW

( Concepts: Object Oriented Design, Frameworks

( Services and Utilities

( Libraries

( Physical Organization

Introduction to ROOT, Akiya Miyamoto 26-May-2003

What about PAWConcepts: Object Oriented Design, FrameworksServices and UtilitiesLibraries Physical Organization

Introduction to ROOT, Akiya Miyamoto 26-May-2003

What about PAWConcepts: Object Oriented Design, FrameworksServices and UtilitiesLibraries Physical Organization

Introduction to ROOT, Akiya Miyamoto 26-May-2003

What about PAWConcepts: Object Oriented Design, FrameworksServices and UtilitiesLibraries Physical Organization

Introduction to ROOT, Akiya Miyamoto

)26-May-2003

* + , * *

- Members: a “has a” relationship to the class.

- Inheritance: an “is a” relationship to the class.

- . /10 2 23 4 516 7 6 28 9 :<; 4 :<= > = ? 0 @ 4 5 : >A B : > 4 516 2C 2 46 D

- EF 6 8 43 : > 2 40 > 8 6 = ? 0 8 /10 2 2

- 6 4 5 = 7 2 3 ?HG > 8 4 :<= > 2 ?= 9 0 8 /0 2 2Event

TrackSegment Vertex

Momentum MassSquare InterceptAtVert

HAS AHAS AHAS A

HAS A HAS AHAS A

TObject

IS A

Introduction to ROOT, Akiya Miyamoto 26-May-2003

- Members: a “has a” relationship to the class.

- Inheritance: an “is a” relationship to the class.

- . /10- E

- 6

Event

TrackSegment Vertex

Momentum MassSquare InterceptAtVert

HAS AHAS AHAS A

HAS A HAS AHAS A

TObject

IS A

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Members: a “has a” relationship to the class.Inheritance: an “is a” relationship to the class.

Event

TrackSegment Vertex

Momentum MassSquare InterceptAtVert

HAS AHAS AHAS A

HAS A HAS AHAS A

TObject

IS A

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Members: a “has a” relationship to the class.Inheritance: an “is a” relationship to the class.

Event

TrackSegment Vertex

Momentum MassSquare InterceptAtVert

HAS AHAS AHAS A

HAS A HAS AHAS A

TObject

IS A

Introduction to ROOT, Akiya Miyamoto

I26-May-2003

J J

KLMNO OP

QRS T U VXW YZ [ U \ U [ UW Y] ^ V YW R T U`_ W Yba

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Introduction to ROOT, Akiya Miyamoto 26-May-2003 Introduction to ROOT, Akiya Miyamoto 26-May-2003

Introduction to ROOT, Akiya Miyamoto

c26-May-2003

d e f g f h f g f

-Histogramming and Fitting

-Graphics (2D, 3D)

-I/O to file or socket: specialized for histograms, Ntuples (Trees)

-Collection Classes and Run Time Type Identification

-User Interface

i jkl m n`op q rs o rbt u`v w s x rbt yo s s z{ s qs o

i |p } } v w ~� { w s { w �s o �v �s m |�� � { w �s o� o s �s o |l � y

i � �o {� � uo p �s r rp o � |�� � �p }� { x s ~⇔

|�� � { w �s o� o s �s ~�

Introduction to ROOT, Akiya Miyamoto 26-May-2003

-Histogramming and Fitting

-Graphics (2D, 3D)

-I/O to file or socket: specialized for histograms, Ntuples (Trees)

-Collection Classes and Run Time Type Identification

-User Interface

i ji |p

i � � ⇔

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Histogramming and FittingGraphics (2D, 3D)I/O to file or socket: specialized for histograms, Ntuples (Trees)Collection Classes and Run Time Type IdentificationUser Interface

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Histogramming and FittingGraphics (2D, 3D)I/O to file or socket: specialized for histograms, Ntuples (Trees)Collection Classes and Run Time Type IdentificationUser Interface

Introduction to ROOT, Akiya Miyamoto

�26-May-2003

� � � �

� Over 350 classes

� Core

� CINT

� Libraries loaded at startup: Hist, Tree …

� Libraries loaded when needed: HistPainter, TreePlayer,…

� Special purpose libraries: EG, Physics…

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Over 350 classes

CoreCINTLibraries loaded at startup: Hist, Tree …Libraries loaded when needed: HistPainter, TreePlayer,…Special purpose libraries: EG, Physics…

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Over 350 classes

CoreCINTLibraries loaded at startup: Hist, Tree …Libraries loaded when needed: HistPainter, TreePlayer,…Special purpose libraries: EG, Physics…

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Over 350 classes

CoreCINTLibraries loaded at startup: Hist, Tree …Libraries loaded when needed: HistPainter, TreePlayer,…Special purpose libraries: EG, Physics…

Introduction to ROOT, Akiya Miyamoto

�26-May-2003

� � � � � �

*.h...

cintmakecintnewproofdproofservrmkdependrootroot.exerootcintroot-configrootd

bin

$ROOTSYS

libCint.solibCore.solibEG.so*libEGPythia.so*libEGPythia6.solibEGVenus.solibGpad.solibGraf.solibGraf3d.solibGui.solibGX11.so*libGX11TTF.solibHist.solibHistPainter.solibHtml.solibMatrix.solibMinuit.solibNew.solibPhysics.solibPostscript.solibProof.so*libRFIO.so*libRGL.solibRint.so*libThread.solibTree.solibTreePlayer.solibTreeViewer.so*libttf.solibX3d.solibXpm.a

Aclock.cxxAclock.hEvent.cxxEvent.hEventLinkDef.hHello.cxxHello.hMainEvent.cxxMakefileMakefile.inMakefile.win32READMETestVectors.cxxTetris.cxxTetris.heventa.cxxeventb.cxxeventload.cxxguitest.cxxhsimple.cxxhworld.cxxminexam.cxxstress.cxxtcollbm.cxxtcollex.cxxtest2html.cxxtstring.cxxvlazy.cxxvmatrix.cxxvvector.cxx

lib testtutorials include

* OptionalInstallation

EditorBar.CIfit.Canalyze.Carchi.Carrow.Cbasic.Cbasic.datbasic3d.Cbenchmarks.Ccanvas.Cclasscat.Ccleanup.Ccompile.Ccopytree.Ccopytree2.Cdemos.Cdemoshelp.Cdialogs.Cdirs.Cellipse.Ceval.Cevent.Cexec1.Cexec2.Cfeynman.Cfildir.Cfile.Cfillrandom.Cfirst.Cfit1.Cfit1_C.C

fitslicesy.Cformula1.Cframework.Cgames.Cgaxis.Cgeometry.Cgerrors.Cgerrors2.Cgraph.Ch1draw.Chadd.Chclient.Chcons.Chprod.Chserv.Chserv2.Chsimple.Chsum.ChsumTimer.Chtmlex.Cio.Clatex.Clatex2.Clatex3.Cmanyaxis.Cmultifit.Cmyfit.Cna49.Cna49geomfile.Cna49view.Cna49visible.C

ntuple1.Coldbenchmarks.Cpdg.datpsexam.Cpstable.Crootalias.Crootenv.Crootlogoff.Crootlogon.Crootmarks.Cruncatalog.sqlrunzdemo.Csecond.Cshapes.Cshared.Csplines.Csqlcreatedb.Csqlfilldb.Csqlselect.Cstaff.Cstaff.datsurfaces.Ctcl.Ctestrandom.Ctornado.Ctree.Ctwo.Cxyslider.CxysliderAction.Czdemo.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

*.h...

cintmakecintnewproofdproofservrmkdependrootroot.exerootcintroot-configrootd

bin

$ROOTSYS

libCint.solibCore.solibEG.so*libEGPythia.so*libEGPythia6.solibEGVenus.solibGpad.solibGraf.solibGraf3d.solibGui.solibGX11.so*libGX11TTF.solibHist.solibHistPainter.solibHtml.solibMatrix.solibMinuit.solibNew.solibPhysics.solibPostscript.solibProof.so*libRFIO.so*libRGL.solibRint.so*libThread.solibTree.solibTreePlayer.solibTreeViewer.so*libttf.solibX3d.solibXpm.a

Aclock.cxxAclock.hEvent.cxxEvent.hEventLinkDef.hHello.cxxHello.hMainEvent.cxxMakefileMakefile.inMakefile.win32READMETestVectors.cxxTetris.cxxTetris.heventa.cxxeventb.cxxeventload.cxxguitest.cxxhsimple.cxxhworld.cxxminexam.cxxstress.cxxtcollbm.cxxtcollex.cxxtest2html.cxxtstring.cxxvlazy.cxxvmatrix.cxxvvector.cxx

lib testtutorials include

* OptionalInstallation

EditorBar.CIfit.Canalyze.Carchi.Carrow.Cbasic.Cbasic.datbasic3d.Cbenchmarks.Ccanvas.Cclasscat.Ccleanup.Ccompile.Ccopytree.Ccopytree2.Cdemos.Cdemoshelp.Cdialogs.Cdirs.Cellipse.Ceval.Cevent.Cexec1.Cexec2.Cfeynman.Cfildir.Cfile.Cfillrandom.Cfirst.Cfit1.Cfit1_C.C

fitslicesy.Cformula1.Cframework.Cgames.Cgaxis.Cgeometry.Cgerrors.Cgerrors2.Cgraph.Ch1draw.Chadd.Chclient.Chcons.Chprod.Chserv.Chserv2.Chsimple.Chsum.ChsumTimer.Chtmlex.Cio.Clatex.Clatex2.Clatex3.Cmanyaxis.Cmultifit.Cmyfit.Cna49.Cna49geomfile.Cna49view.Cna49visible.C

ntuple1.Coldbenchmarks.Cpdg.datpsexam.Cpstable.Crootalias.Crootenv.Crootlogoff.Crootlogon.Crootmarks.Cruncatalog.sqlrunzdemo.Csecond.Cshapes.Cshared.Csplines.Csqlcreatedb.Csqlfilldb.Csqlselect.Cstaff.Cstaff.datsurfaces.Ctcl.Ctestrandom.Ctornado.Ctree.Ctwo.Cxyslider.CxysliderAction.Czdemo.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

*.h...

cintmakecintnewproofdproofservrmkdependrootroot.exerootcintroot-configrootd

bin

$ROOTSYS

libCint.solibCore.solibEG.so*libEGPythia.so*libEGPythia6.solibEGVenus.solibGpad.solibGraf.solibGraf3d.solibGui.solibGX11.so*libGX11TTF.solibHist.solibHistPainter.solibHtml.solibMatrix.solibMinuit.solibNew.solibPhysics.solibPostscript.solibProof.so*libRFIO.so*libRGL.solibRint.so*libThread.solibTree.solibTreePlayer.solibTreeViewer.so*libttf.solibX3d.solibXpm.a

Aclock.cxxAclock.hEvent.cxxEvent.hEventLinkDef.hHello.cxxHello.hMainEvent.cxxMakefileMakefile.inMakefile.win32READMETestVectors.cxxTetris.cxxTetris.heventa.cxxeventb.cxxeventload.cxxguitest.cxxhsimple.cxxhworld.cxxminexam.cxxstress.cxxtcollbm.cxxtcollex.cxxtest2html.cxxtstring.cxxvlazy.cxxvmatrix.cxxvvector.cxx

lib testtutorials include

* OptionalInstallation

EditorBar.CIfit.Canalyze.Carchi.Carrow.Cbasic.Cbasic.datbasic3d.Cbenchmarks.Ccanvas.Cclasscat.Ccleanup.Ccompile.Ccopytree.Ccopytree2.Cdemos.Cdemoshelp.Cdialogs.Cdirs.Cellipse.Ceval.Cevent.Cexec1.Cexec2.Cfeynman.Cfildir.Cfile.Cfillrandom.Cfirst.Cfit1.Cfit1_C.C

fitslicesy.Cformula1.Cframework.Cgames.Cgaxis.Cgeometry.Cgerrors.Cgerrors2.Cgraph.Ch1draw.Chadd.Chclient.Chcons.Chprod.Chserv.Chserv2.Chsimple.Chsum.ChsumTimer.Chtmlex.Cio.Clatex.Clatex2.Clatex3.Cmanyaxis.Cmultifit.Cmyfit.Cna49.Cna49geomfile.Cna49view.Cna49visible.C

ntuple1.Coldbenchmarks.Cpdg.datpsexam.Cpstable.Crootalias.Crootenv.Crootlogoff.Crootlogon.Crootmarks.Cruncatalog.sqlrunzdemo.Csecond.Cshapes.Cshared.Csplines.Csqlcreatedb.Csqlfilldb.Csqlselect.Cstaff.Cstaff.datsurfaces.Ctcl.Ctestrandom.Ctornado.Ctree.Ctwo.Cxyslider.CxysliderAction.Czdemo.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

*.h...

cintmakecintnewproofdproofservrmkdependrootroot.exerootcintroot-configrootd

bin

$ROOTSYS

libCint.solibCore.solibEG.so*libEGPythia.so*libEGPythia6.solibEGVenus.solibGpad.solibGraf.solibGraf3d.solibGui.solibGX11.so*libGX11TTF.solibHist.solibHistPainter.solibHtml.solibMatrix.solibMinuit.solibNew.solibPhysics.solibPostscript.solibProof.so*libRFIO.so*libRGL.solibRint.so*libThread.solibTree.solibTreePlayer.solibTreeViewer.so*libttf.solibX3d.solibXpm.a

Aclock.cxxAclock.hEvent.cxxEvent.hEventLinkDef.hHello.cxxHello.hMainEvent.cxxMakefileMakefile.inMakefile.win32READMETestVectors.cxxTetris.cxxTetris.heventa.cxxeventb.cxxeventload.cxxguitest.cxxhsimple.cxxhworld.cxxminexam.cxxstress.cxxtcollbm.cxxtcollex.cxxtest2html.cxxtstring.cxxvlazy.cxxvmatrix.cxxvvector.cxx

lib testtutorials include

* OptionalInstallation

EditorBar.CIfit.Canalyze.Carchi.Carrow.Cbasic.Cbasic.datbasic3d.Cbenchmarks.Ccanvas.Cclasscat.Ccleanup.Ccompile.Ccopytree.Ccopytree2.Cdemos.Cdemoshelp.Cdialogs.Cdirs.Cellipse.Ceval.Cevent.Cexec1.Cexec2.Cfeynman.Cfildir.Cfile.Cfillrandom.Cfirst.Cfit1.Cfit1_C.C

fitslicesy.Cformula1.Cframework.Cgames.Cgaxis.Cgeometry.Cgerrors.Cgerrors2.Cgraph.Ch1draw.Chadd.Chclient.Chcons.Chprod.Chserv.Chserv2.Chsimple.Chsum.ChsumTimer.Chtmlex.Cio.Clatex.Clatex2.Clatex3.Cmanyaxis.Cmultifit.Cmyfit.Cna49.Cna49geomfile.Cna49view.Cna49visible.C

ntuple1.Coldbenchmarks.Cpdg.datpsexam.Cpstable.Crootalias.Crootenv.Crootlogoff.Crootlogon.Crootmarks.Cruncatalog.sqlrunzdemo.Csecond.Cshapes.Cshared.Csplines.Csqlcreatedb.Csqlfilldb.Csqlselect.Cstaff.Cstaff.datsurfaces.Ctcl.Ctestrandom.Ctornado.Ctree.Ctwo.Cxyslider.CxysliderAction.Czdemo.C

Introduction to ROOT, Akiya Miyamoto

��26-May-2003

� � � � �

� GUIwindows, buttons, menus

� Root Command lineCINT (C++ interpreter)

� Macros, applications, libraries (C++ compiler and interpreter)

�� ������� 

Introduction to ROOT, Akiya Miyamoto 26-May-2003

GUIwindows, buttons, menusRoot Command lineCINT (C++ interpreter)Macros, applications, libraries (C++ compiler and interpreter)

Introduction to ROOT, Akiya Miyamoto 26-May-2003

GUIwindows, buttons, menusRoot Command lineCINT (C++ interpreter)Macros, applications, libraries (C++ compiler and interpreter)

Introduction to ROOT, Akiya Miyamoto 26-May-2003

GUIwindows, buttons, menusRoot Command lineCINT (C++ interpreter)Macros, applications, libraries (C++ compiler and interpreter)

Introduction to ROOT, Akiya Miyamoto

¡ ¡26-May-2003

¢ £ £

¤ 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.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Regular grammar (C++) on command lineSingle language (compiled and interpreted)Object Oriented (use your class in the interpreter)Advanced Interactive User InterfaceWell Documented code. HTML class descriptions for every class.Object I/O including Schema Evolution3-d interfaces with OpenGL and X3D.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Regular grammar (C++) on command lineSingle language (compiled and interpreted)Object Oriented (use your class in the interpreter)Advanced Interactive User InterfaceWell Documented code. HTML class descriptions for every class.Object I/O including Schema Evolution3-d interfaces with OpenGL and X3D.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Regular grammar (C++) on command lineSingle language (compiled and interpreted)Object Oriented (use your class in the interpreter)Advanced Interactive User InterfaceWell Documented code. HTML class descriptions for every class.Object I/O including Schema Evolution3-d interfaces with OpenGL and X3D.

Introduction to ROOT, Akiya Miyamoto

¥¦26-May-2003

§ ¨ © ª «¬ ¨ ª

­ Get the example PAW file fromhttp://www-root.fnal.gov/root/class/examples/toyz.rz

® At the system prompt type

¯ °± ²³ ³ ´ ´ ³ µ¶¸· ² ¶ ´ ³ µ¶¸· ²³ ³ ´

¹ 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

open terminal

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Get the example PAW file fromhttp://www-root.fnal.gov/root/class/examples/toyz.rz

At the system prompt type

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

open terminal

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Get the example PAW file fromhttp://www-root.fnal.gov/root/class/examples/toyz.rz

At the system prompt type

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

open terminal

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Get the example PAW file fromhttp://www-root.fnal.gov/root/class/examples/toyz.rz

At the system prompt type

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

open terminal

Introduction to ROOT, Akiya Miyamoto

»¼26-May-2003

½ ¾ ½

¿ PAW

À Concepts: Object Oriented Design, Frameworks

Á Services and Utilities

 Libraries

à Physical Organization

Introduction to ROOT, Akiya Miyamoto 26-May-2003

PAWConcepts: Object Oriented Design, FrameworksServices and UtilitiesLibraries Physical Organization

Introduction to ROOT, Akiya Miyamoto 26-May-2003

PAWConcepts: Object Oriented Design, FrameworksServices and UtilitiesLibraries Physical Organization

Introduction to ROOT, Akiya Miyamoto 26-May-2003

PAWConcepts: Object Oriented Design, FrameworksServices and UtilitiesLibraries Physical Organization

Introduction to ROOT, Akiya Miyamoto

ÄÅ26-May-2003

Æ Ç

È 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

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Browsing and opening filesDrawing histogramsRight click, left click, middle clickDraw PanelFit PanelAdding Color and ZoomingAdding text and other objectsDividing the canvasSetting the log scale

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Browsing and opening filesDrawing histogramsRight click, left click, middle clickDraw PanelFit PanelAdding Color and ZoomingAdding text and other objectsDividing the canvasSetting the log scale

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Browsing and opening filesDrawing histogramsRight click, left click, middle clickDraw PanelFit PanelAdding Color and ZoomingAdding text and other objectsDividing the canvasSetting the log scale

Introduction to ROOT, Akiya Miyamoto

ÑÒ26-May-2003

Ó Ô

Display the browserÕ Ö×ÙØ ÚÛ ÜÝ Ø Þàß

Start rootáãâ ä ä å

Quit root (just in case) æç ç è éê ëíì î

run root

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Display the browser

Start root

Quit root (just in case)

run root

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Display the browser

Start root

Quit root (just in case)

run root

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Display the browser

Start root

Quit root (just in case)

run root

Introduction to ROOT, Akiya Miyamoto

ïð26-May-2003

ñ ò ñ ñ ó ô Display a histogram

The Canvas

Open the root fileBrowse the file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Display a histogram The Canvas

Open the root fileBrowse the file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Display a histogram The Canvas

Open the root fileBrowse the file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Display a histogram The Canvas

Open the root fileBrowse the file

Introduction to ROOT, Akiya Miyamoto

õö26-May-2003

÷ ÷ ø ÷ ù ÷ ÷

úLeft Click

ûü ý þ ýÿ � � � ý � �� ýÿ �

� ��� � �� � �� � �

� �� � ��� � � � � � �� � � �

�Right Click !" # $% & $ ' % #(

)* +�, - -. . / , 01

2 34 5 6�7 8�9

:Middle Click; <= > ?�@ < >A = <B @ <C

D EGFH H IH J H KH L M J MN MPO J Q N F

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Left Click

Right Click

Middle Click

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Left Click

Right Click

Middle Click

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Left Click

Right Click

Middle Click

Introduction to ROOT, Akiya Miyamoto

RS26-May-2003

T U

The Event Status

The Draw PanelAdding Error barsSliderDefaults

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The Event Status

The Draw PanelAdding Error barsSliderDefaults

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The Event Status

The Draw PanelAdding Error barsSliderDefaults

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The Event Status

The Draw PanelAdding Error barsSliderDefaults

Introduction to ROOT, Akiya Miyamoto

VW26-May-2003

XZY Y X

[

\ ] X [

X

^ Adding a gaussian fit

_ Coloring the histogram

` Zooming/unzooming

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Adding a gaussian fitColoring the histogramZooming/unzooming

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Adding a gaussian fitColoring the histogramZooming/unzooming

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Adding a gaussian fitColoring the histogramZooming/unzooming

Introduction to ROOT, Akiya Miyamoto

ab26-May-2003

c d d d

e The Editor

f Adding an Arrow

g Adding Text

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The EditorAdding an ArrowAdding Text

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The EditorAdding an ArrowAdding Text

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The EditorAdding an ArrowAdding Text

Introduction to ROOT, Akiya Miyamoto

hi26-May-2003

j k lm Add a Pad

n Select the new Pad

o Draw a histogram

p Add a title for the axis

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Add a PadSelect the new PadDraw a histogramAdd a title for the axis

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Add a PadSelect the new PadDraw a histogramAdd a title for the axis

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Add a PadSelect the new PadDraw a histogramAdd a title for the axis

Introduction to ROOT, Akiya Miyamoto

q q26-May-2003

r r s s s r s r

t The Canvas in the Browser

u Setting the (7) statistics optionsvdefault = 0001111

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The Canvas in the BrowserSetting the (7) statistics optionsdefault = 0001111

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The Canvas in the BrowserSetting the (7) statistics optionsdefault = 0001111

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The Canvas in the BrowserSetting the (7) statistics optionsdefault = 0001111

Introduction to ROOT, Akiya Miyamoto

wx26-May-2003

y y y z{ Create a new Canvas| Divide it in 2

} Draw two histograms.~�� ��� �� � � � �

� � �� � �

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Create a new CanvasDivide it in 2Draw two histograms.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Create a new CanvasDivide it in 2Draw two histograms.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Create a new CanvasDivide it in 2Draw two histograms.

Introduction to ROOT, Akiya Miyamoto

��26-May-2003

� �

� Use up and down arrows to recall commands

� � �� �� � ���� � �

� Use emacs commands to navigate

� � ���  ¢¡ � £ ��¤ ¥  §¦ � ¡ � £ ��¤ ¥   ¦ ¨ ¡

� £ �¤ ¥  ¦ ©Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use up and down arrows to recall commands

Use emacs commands to navigate

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use up and down arrows to recall commands

Use emacs commands to navigate

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use up and down arrows to recall commands

Use emacs commands to navigate

Introduction to ROOT, Akiya Miyamoto

ª«26-May-2003¬ ­

® Open a file for reading

¯° ° ± ²³ ´µ¶ ·¹¸ º»¼ ½¿¾ ÀÁ  · ¸Äà ¯ ° ° ±¼ Å

Æ Look at the contents of the file

ÇÈ È É ÊË ÌÍ Î¹Ï ÐÑ

ÒÓÔ Õ�Ö × × ØÚÙ ÛÜ Ý Õ ÖßÞ àá á â ã ä ä Ò åÔ ÕÖ

Ò ÓÔ Õ Ö × ØÙ Û Ü Ý Õ�Ö Þ àá á â ã ä ä Ò åÔ ÕÖ

æ ØçÚè Ò Ò àÖ Ö Ü é Ò àÖ Öê ë ØÙ ÛÜ Ý ÕÖ ã ä ä Ò â àÖ Ö

æ ØçÚè Òì ë Ó âá â Û Õ ì Ô í âáî à ÛÜ ê ë Ò�á â Û Õï Ô í â àÔ ðòñ âÔ áó

æ ØçÚè Òì ë Ó Ü ÛÔ ó ì Ô í âáî à ÛÜ ê ëô ÛÔ ó õ áó â àÔ ðòñ âá à

æ ØçÚè Òì ë Ó í ë ì Ô í âá î à Û Ü ê ë ÓÔ à í â öÔ î ó Û Õ

æ ØçÚè Òì ë Ó í ÷ ì Ô í âá î à Û Ü ê ë ö Öø áó ù öÔ î ó Û Õ

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Open a file for reading

Look at the contents of the file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Open a file for reading

Look at the contents of the file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Open a file for reading

Look at the contents of the file

Introduction to ROOT, Akiya Miyamoto

úû26-May-2003

ü ý ý þ ÿ þ ü

�Plot a variable

� �� � � �� �� � � � � �� �� � � �� �

��Where did myTree come from?

� � � �� �� �� � � ! "# $&% ' ( $ � $

) * + +, - . / 021 3 + 45 67 8 9: ;< , = 6 6: >

?And now.. @A B B C DE FHG IKJ LM

NOQP RSUT V VXW Y Y Z[ VXW Y Y \U] ^ Z_ ` Y aP P V b W Y YT c d \eUTV VXW Y Y Z[ VXW Y Yf g \] ^ Z_ ` Y aP P V b W Y Y

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Plot a variable

Where did myTree come from?

And now..

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Plot a variable

Where did myTree come from?

And now..

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Plot a variable

Where did myTree come from?

And now..

Introduction to ROOT, Akiya Miyamoto

hi26-May-2003

j k

l A TFile is a directory structure like UNIX

m Object in Memory (OBJ) Object on Disk (KEY)

Introduction to ROOT, Akiya Miyamoto 26-May-2003

n A TFile is a directory structure like UNIX

o Object in Memory (OBJ) Object on Disk (KEY)

Introduction to ROOT, Akiya Miyamoto 26-May-2003

A TFile is a directory structure like UNIXObject in Memory (OBJ) Object on Disk (KEY)

Introduction to ROOT, Akiya Miyamoto 26-May-2003

A TFile is a directory structure like UNIXObject in Memory (OBJ) Object on Disk (KEY)

Introduction to ROOT, Akiya Miyamoto

pq26-May-2003

r

sStores large quantities of same class objects:

t uwv x y&z yK{ | } y&~ � ~ v �� |

� �w� � �&� �K� � �� � �� � � � � � �

� �&� � � �� ��� � � � �� � �2� � � �� � �� �    ¡ �� ¢ £

¤TNtuple is a TTree limited to floating point numbers.

¥More details later …

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Stores large quantities of same class objects:

TNtuple is a TTree limited to floating point numbers.More details later …

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Stores large quantities of same class objects:

TNtuple is a TTree limited to floating point numbers.More details later …

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Stores large quantities of same class objects:

TNtuple is a TTree limited to floating point numbers.More details later …

Introduction to ROOT, Akiya Miyamoto

¦§26-May-2003

¨ ¨

© Open and browse a file

ª Drawing histograms

« Adding a Fit

¬ Adding Error bars

­ Adding Color

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Open and browse a fileDrawing histogramsAdding a FitAdding Error barsAdding Color

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Open and browse a fileDrawing histogramsAdding a FitAdding Error barsAdding Color

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Open and browse a fileDrawing histogramsAdding a FitAdding Error barsAdding Color

Introduction to ROOT, Akiya Miyamoto

®¯26-May-2003

°

± Overview of ROOT

² GUI Basics

³ Command line basics

´ Using the Class reference guide

µ PAW to ROOT conversion

Introduction to ROOT, Akiya Miyamoto 26-May-2003

¶ Overview of ROOT

· GUI Basics

¸ Command line basics

¹ Using the Class reference guide

º PAW to ROOT conversion

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Overview of ROOTGUI BasicsCommand line basicsUsing the Class reference guidePAW to ROOT conversion

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Overview of ROOTGUI BasicsCommand line basicsUsing the Class reference guidePAW to ROOT conversion

Introduction to ROOT, Akiya Miyamoto

»¼26-May-2003½¾¿ ÀÁ ¿ ½ÂÃLast time

Ä ÅÆ Ç ÈÉ ÊË Ì É Í

ÎToday

Ï Ð ÑÒ Ó ÔÕ Ò Ö × Ø Ù

Ú ÛÜ ÝßÞ àâá ã ä å Ý æ

ç è éê ë ìßí éí

î ï ðñ ò óßô ðõ ö ð ÷ ó ò ò ó ðø

ù úû û ü û û úIntroduction to ROOT, Akiya Miyamoto 26-May-2003ýþ

Last time

Today

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Last time

Today

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Last time

Today

Introduction to ROOT, Akiya Miyamoto

ÿ�26-May-2003��� � �� � �� �

� Environment Settings

Command types

� CINT Commands

� Global Variables

� TObject

Introduction to ROOT, Akiya Miyamoto 26-May-2003�� Environment Settings

� Command types

� CINT Commands

� Global Variables

� TObject

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Environment SettingsCommand typesCINT CommandsGlobal VariablesTObject

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Environment SettingsCommand typesCINT CommandsGlobal VariablesTObject

Introduction to ROOT, Akiya Miyamoto

� �26-May-2003��� � �� � �� � � ! " " "

#Environment setting file: $ % & ' '( )* ) +-, .0/ +21 31 . , 465 78 8 . 7/

9 :-; ; <-= >?A@ = B ?AC DE @ @ FC B G ?@ F D B; @ H >; @ I@ ; ; B@ D

JK LM NO PQ O R S TU VWYX Z N N [ ZM

\ ] ^_A` a _Ab cd e ef gh giAj ]k iAl ml ]j npo ` q q ]` k

rFind the current settingsst u u v wx y zA{ |~} � �t � { v ��open terminal

Introduction to ROOT, Akiya Miyamoto 26-May-2003��Environment setting file: � �� � �

� �-� ����

�� ���Find the current settings�� � �

open terminal

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Environment setting file:

Find the current settings

open terminal

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Environment setting file:

Find the current settings

open terminal

Introduction to ROOT, Akiya Miyamoto

��26-May-2003���� �� � �¡ ¡¢£¥¤ ¦ ¦ ¦ £ ¦§

¨The .rootrc file:©The Macro Pathª «­¬ ®°¯²± ³± ´­µ µ ¶± ·­¸ ¹º µ » ¸ ¶ ¼°½± ½ ¾¿ À Á ·Â ÃÄ ÅÆ ´­µ µ ¶ ·­¸ ¹º µ ÇÈOptions in .rootrcÉ Ê­Ë Ë ÌpÍ Î Ï Ë Ð Ñ­Ò Ì Ï°Ó ÔÒ Õ×Ö Ø

ÙHistory FileÚ ÛÜ ÝÞ ß àâá ãä ä åçæ èé ê å

ëAutomatically Executing Macrosìí î î ï ð îñ îòôó õ

ö÷ ø ø ù ú øû ø ü üþý ÿ

� �� � �� �� � ��

Introduction to ROOT, Akiya Miyamoto 26-May-2003��The .rootrc file: The Macro Path� �

�Options in .rootrc��History File�

�Automatically Executing Macros��

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The .rootrc file:The Macro Path

Options in .rootrc

History File

Automatically Executing Macros

Introduction to ROOT, Akiya Miyamoto 26-May-2003

The .rootrc file:The Macro Path

Options in .rootrc

History File

Automatically Executing Macros

Introduction to ROOT, Akiya Miyamoto

��26-May-2003���� ��! �" "#

$ % $

> root -/?& ')(* +,- ./ / 0 132 45 132 65 1 2 7 5 132 8 5 1 9: 4, ;=< > < < < 9: 4, ? < > 5

@ ACB D E)FG HI

JLK MON PQ R S R MUT VW XUY Z [U\ ] S V X Z Q V^ PT_ X S W`

acb de fUg dg hi ji kl hi mg ng do d f mg n g p pOq o kr gs o s s ti k u p ui f u d!v r g g hr k

wcx yz {| }~ � �~ {� ��� � {� � })�� �� � � �� �� } � { � � ��� � }� { �

��� �O� �U� �� �� �� � � � �U� � � � ��� � �Introduction to ROOT, Akiya Miyamoto 26-May-2003�

> root -/?� �)�  ¡¢£ ¤C¥ ¦ §)¨

©Lª «O¬ ­®c¯ °± ²

³c´ µ¶ ·

¸�¹ ºO» ¼

Introduction to ROOT, Akiya Miyamoto 26-May-2003

> root -/?

Introduction to ROOT, Akiya Miyamoto 26-May-2003

> root -/?

Introduction to ROOT, Akiya Miyamoto

½¾26-May-2003¿�ÀÁ ÂÃ!Ä ÂÅ ÅÆÇ

ÈCINT commands start with “.”ÉÊ Ë Ë Ì ÍÎ ÏÑÐ Ò

Ó Ô ÕÖØ× ÙÚ Û ÛÜÝ Þàß Öá á á ÖØ× Ô Üá á Ô ÕØâ ãäå æ ÙÚ Û ÛÜÝ Þ×

çè é é ê ëì íÑî ï ë ðñ òUó ôõ öó í

÷ øØùú ûü ýþ øØÿ� ú �ÿ � ú � û ÿ �ÿ �� � ÿ ý� � � � þ ù� ü ýþ øØÿ� ú �ÿ �

� � � � �� � � �� ��� �� ��

� ��� � � � ! ��" # �$ " %

&SHELL commands start with “.!” for example: '( ( ) *+ , - . /10

Introduction to ROOT, Akiya Miyamoto 26-May-200323CINT commands start with “.”4

56

7SHELL commands start with “.!” for example:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

CINT commands start with “.”

SHELL commands start with “.!” for example:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

CINT commands start with “.”

SHELL commands start with “.!” for example:

Introduction to ROOT, Akiya Miyamoto

8926-May-2003:<;= >?A@ >B BCD

3. C++ syntax (almost)

EF F G HI J KL E F M NO E P Q R SO M KL E F M NO E TU

F EEF F G HI J KL E F M NO E P Q R SO M KL E F M NO E TU VThe optional Semicolon:Leave off the semicolon to see the return value of the command.WX X Y Z[ \ ]^ _ ` a a b cX d We Ygf Wh i j kf elm n o pq r

st t u vw x yz { |~} � � �t s� ug� s � � � �� ��� � � �� �

Introduction to ROOT, Akiya Miyamoto 26-May-2003�

3. C++ syntax (almost)

The optional Semicolon:Leave off the semicolon to see the return value of the command.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

3. C++ syntax (almost)

The optional Semicolon:Leave off the semicolon to see the return value of the command.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

3. C++ syntax (almost)

The optional Semicolon:Leave off the semicolon to see the return value of the command.

Introduction to ROOT, Akiya Miyamoto

��26-May-2003�<�� ��A� �� ��

� �

� Use the Tab feature to get help …

�� � � � � �   ¡ ¢£ ¤ ¥¦ § ¥¨ ¦ ©

�� � � �ª �   ¡ ¢£ ¤ ¥¦ � � ¤ § ¥¨ ¦ ©

�� � � �« �   ¡ ¢£ ¤ ¥¦ � � ¤ ¬ £ � ­ § ¥¨ ¦ ©

® Find List of Methods

¯ Find Parameter list

Introduction to ROOT, Akiya Miyamoto 26-May-2003°

Use the Tab feature to get help …

Find List of MethodsFind Parameter list

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use the Tab feature to get help …

Find List of MethodsFind Parameter list

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use the Tab feature to get help …

Find List of MethodsFind Parameter list

Introduction to ROOT, Akiya Miyamoto

±²26-May-2003³<´µ ¶·A¸ ¶¹ ¹º» ¼ »

Based on Taligent

½ Classes begin with T TTree, TBrowser¾ Non-class types end with _t Int_t ¿ Data members begin with f fTree À Member functions begin with a capital Loop() Á Constants begin with k kInitialSize, kRed  Static variables begin with g gEnv à Static data members begin with fg fgTokenClient

Introduction to ROOT, Akiya Miyamoto 26-May-2003Ä

Based on Taligent

Å Classes begin with T TTree, TBrowserÆ Non-class types end with _t Int_t Ç Data members begin with f fTree È Member functions begin with a capital Loop() É Constants begin with k kInitialSize, kRed Ê Static variables begin with g gEnv Ë Static data members begin with fg fgTokenClient

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Based on TaligentClasses begin with T TTree, TBrowserNon-class types end with _t Int_t Data members begin with f fTree Member functions begin with a capital Loop() Constants begin with k kInitialSize, kRed Static variables begin with g gEnv Static data members begin with fg fgTokenClient

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Based on TaligentClasses begin with T TTree, TBrowserNon-class types end with _t Int_t Data members begin with f fTree Member functions begin with a capital Loop() Constants begin with k kInitialSize, kRed Static variables begin with g gEnv Static data members begin with fg fgTokenClient

Introduction to ROOT, Akiya Miyamoto

Ì Í26-May-2003Î<ÏÐ ÑÒAÓ ÑÔ ÔÕÖ

C++ type Size (bytes) ROOT types Size(bytes)

FORTRAN analog

(unsigned)char 1 (U)Char_t 1 CHARACTER*1

(unsigned)short(int)

2 (U)Short_t 2 INTEGER*2

(unsigned)int 2 or 4 (U)Int_t 4 INTEGER*4

(unsigned)long(int)

4 or 8 (U)Long_t 8 INTEGER*8

float 4 Float_t 4 REAL*4

double 8 (=4) Double_t 8 REAL*8

long double16 (=

double)REAL*16

Introduction to ROOT, Akiya Miyamoto 26-May-2003×

C++ type Size (bytes) ROOT types Size(bytes)

FORTRAN analog

(unsigned)char 1 (U)Char_t 1 CHARACTER*1

(unsigned)short(int)

2 (U)Short_t 2 INTEGER*2

(unsigned)int 2 or 4 (U)Int_t 4 INTEGER*4

(unsigned)long(int)

4 or 8 (U)Long_t 8 INTEGER*8

float 4 Float_t 4 REAL*4

double 8 (=4) Double_t 8 REAL*8

long double16 (=

double)REAL*16

Introduction to ROOT, Akiya Miyamoto 26-May-2003

C++ type Size (bytes) ROOT typesSize

(bytes) FORTRAN analog

(unsigned)char 1 (U)Char_t 1 CHARACTER*1

(unsigned)short(int)

2 (U)Short_t 2 INTEGER*2

(unsigned)int 2 or 4 (U)Int_t 4 INTEGER*4

(unsigned)long(int)

4 or 8 (U)Long_t 8 INTEGER*8

float 4 Float_t 4 REAL*4

double 8 (=4) Double_t 8 REAL*8

long double 16 (=double)

REAL*16

Introduction to ROOT, Akiya Miyamoto 26-May-2003

C++ type Size (bytes) ROOT typesSize

(bytes) FORTRAN analog

(unsigned)char 1 (U)Char_t 1 CHARACTER*1

(unsigned)short(int)

2 (U)Short_t 2 INTEGER*2

(unsigned)int 2 or 4 (U)Int_t 4 INTEGER*4

(unsigned)long(int)

4 or 8 (U)Long_t 8 INTEGER*8

float 4 Float_t 4 REAL*4

double 8 (=4) Double_t 8 REAL*8

long double 16 (=double)

REAL*16

Introduction to ROOT, Akiya Miyamoto

Ø Ù26-May-2003Ú<ÛÜ ÝÞAß Ýà àáâ ã ä ã

1. Declaration can be omitted

å æ çè é êë ìí è îï ð�ñ òó ôí è õ ö÷ ÷ øï ù

2. "." notation rather than "->"

úû ü1ý þÿ

3. Search for an object by its name

�� �� ��� � � � � � � � �� � �� ��

��

small

��� � �� � �� � ��� �� � � � �� � � �

small ! " #%$ &' () *

Warning: These will not work in compiled code!

+,-./0

Introduction to ROOT, Akiya Miyamoto 26-May-20031

1. Declaration can be omitted

2. "." notation rather than "->"

3. Search for an object by its name

2

small

smallWarning: These will not work in compiled code!

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. Declaration can be omitted

2. "." notation rather than "->"

3. Search for an object by its name

small

smallWarning: These will not work in compiled code!

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. Declaration can be omitted

2. "." notation rather than "->"

3. Search for an object by its name

small

smallWarning: These will not work in compiled code!

Introduction to ROOT, Akiya Miyamoto

3 426-May-20035768 9:<; 9= =>?

@ [expression] evaluates the expression

AB B C DE F E GH

IJ K L MN O

P .files show loaded source files

Q .class [name] show class definition

R .g prints all objects in the root session

S .ls ls on current directory

T .pwd list the current directory, canvas, and style.

U .![shell-command] execute shell commandIntroduction to ROOT, Akiya Miyamoto 26-May-2003V

W [expression] evaluates the expression

X .files show loaded source files

Y .class [name] show class definition

Z .g prints all objects in the root session

[ .ls ls on current directory

\ .pwd list the current directory, canvas, and style.

] .![shell-command] execute shell command

Introduction to ROOT, Akiya Miyamoto 26-May-2003

[expression] evaluates the expression

.files show loaded source files

.class [name] show class definition

.g prints all objects in the root session

.ls ls on current directory

.pwd list the current directory, canvas, and style.

.![shell-command] execute shell commandIntroduction to ROOT, Akiya Miyamoto 26-May-2003

[expression] evaluates the expression

.files show loaded source files

.class [name] show class definition

.g prints all objects in the root session

.ls ls on current directory

.pwd list the current directory, canvas, and style.

.![shell-command] execute shell command

Introduction to ROOT, Akiya Miyamoto

^ _26-May-2003`7ab cd<e cf fg

h

.class

ij j k lm n o p qr s st uv u w k x y k wz {| }�~ x � k o y j

ij j k l� n o � z � y y }�~ x � k

.g

� � � � �� � � �

� � ���� � �� � �� � � ��� �� � � � � � � �¡ � �

� � � ¢£ �� ¤ � �¥ ¦ � �¨§ � ©ª � £ ¤ � «

� � � ¢£ �� ¤ � �¥ ¦ � �¨§ � ©ª � �¬

� � � ¢£ �� ¤ � �¥ ¦ � �¨§ � ©ª � � £ � � �

­ ­ ­

Introduction to ROOT, Akiya Miyamoto 26-May-2003®

.class

.g

Introduction to ROOT, Akiya Miyamoto 26-May-2003

.class

.g

Introduction to ROOT, Akiya Miyamoto 26-May-2003

.class

.g

Introduction to ROOT, Akiya Miyamoto

¯ ¯26-May-2003°7±² ³´<µ ³¶ ¶·¸ ¸ ¹ º ¸

»gRandom¼½ ¾À¿ Á Â�à ÄÆÅ Ç È ¿ É Ê ËÌ Í Î Ï

Ð ÑÓÒÔ ÕÖ ×Ø ÙÚ Û Ö Õ Ù Ü Ý Ù Ø Ö × Þ Ò ßà Ù × ÙØ Ö Ü Ò Ø á â Ü Ý�ã ÒÔ Ø Ò á ×ä

å�æ ç æ è æ é êÀë ì å�í îï

é êÀë ì å�í î ð ìæ ñ òó ôõ ö�÷ ø ù úû ü ý þ þ�ÿ � � ��� û

�gFile� � � � �� � � ��� � ��

�gDirectory� � � ��� �� � � !#" $ % � � &�' ( � )*

+gSystem

, -/. 0 12 3�4 5 6�7 0 1 8�9 32 :;

Introduction to ROOT, Akiya Miyamoto 26-May-2003<=gRandom

>gFile

?gDirectory

@gSystem

Introduction to ROOT, Akiya Miyamoto 26-May-2003

gRandom

gFile

gDirectory

gSystem

Introduction to ROOT, Akiya Miyamoto 26-May-2003

gRandom

gFile

gDirectory

gSystem

Introduction to ROOT, Akiya Miyamoto

AB26-May-2003CEDF GHJI GK KL

M global ROOT session object

N gROOT->GetListOf< list type >();

O gROOT->LoadMacro();

P gROOT->Time();

Q gROOT->ProcessLine()

Introduction to ROOT, Akiya Miyamoto 26-May-2003R

S global ROOT session object

T gROOT->GetListOf< list type >();

U gROOT->LoadMacro();

V gROOT->Time();

W gROOT->ProcessLine()

Introduction to ROOT, Akiya Miyamoto 26-May-2003

global ROOT session object

gROOT->GetListOf< list type >();

gROOT->LoadMacro();

gROOT->Time();

gROOT->ProcessLine()

Introduction to ROOT, Akiya Miyamoto 26-May-2003

global ROOT session object

gROOT->GetListOf< list type >();

gROOT->LoadMacro();

gROOT->Time();

gROOT->ProcessLine()

Introduction to ROOT, Akiya Miyamoto

X Y26-May-2003ZE[\ ]^J_ ]` `a

b

c d

ef gh ij kl m mn oj prq s tu v wx yz

{| }~ � � ���

� �� � �� � �� �� � � � � � � ���

� "small" is the Object Name

� � � �� � � � ��� � � �� �� � ��  ¡ ¢ £ £ ¤ ¥

¦�§ ¨ª© « « ¬ ­ ®¯ °§ ± ² ¥³ ´ µ³ ¶�· ¸¹ º»

¼ "smallHisto" is the Variable Name

½ ¾ ¿ ¿À Á  à Ä�Å Æ ¿ ÇÈ ÉÊ Ë ÌÍ ÎÏ Ð Ñ ÑÒ Ó Î ÔrÕ Ö×

Ø�Ù ÚªÛ Ü Ü Ý Þ ßà áÙ â ã× äæå ä ç ç èé ê ê ëì í è îEï ð

ñ FindObject needs the Object Name.

Introduction to ROOT, Akiya Miyamoto 26-May-2003òóô õ

ö "small" is the Object Name

÷ ø ù

ú "smallHisto" is the Variable Name

û ü ý

þ FindObject needs the Object Name.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

"small" is the Object Name

"smallHisto" is the Variable Name

FindObject needs the Object Name.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

"small" is the Object Name

"smallHisto" is the Variable Name

FindObject needs the Object Name.

Introduction to ROOT, Akiya Miyamoto

ÿ�26-May-2003��� � �� � �� � � �

FindObject returns a pointer to TObject. This generates an error:

� � �� � � � ��� � � �� �� � �� � ! " "� # � � $ � � % ��� &(' � � �� � �) #

This is OK:

* + , ,- . / 0 1�2 3 , 45 67 8 9: ;< = > >: ? . / @ > = ; ; A =< 6 9 ?

BC D 0E F 1 ; 8HG I 9 BC D 0E ? * + , , B . / 0 1�2 3 , 45 67 8 9: ;< = > >: ?

F 1 ; 8HG . / J 6 8 K 1�2 @G 2 8 62 8 9L ?

Introduction to ROOT, Akiya Miyamoto 26-May-2003M

FindObject returns a pointer to TObject. This generates an error:

N O P PQ R

This is OK:

S T U UV W

V X YZ [

\] ^ _H` W

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FindObject returns a pointer to TObject. This generates an error:

This is OK:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FindObject returns a pointer to TObject. This generates an error:

This is OK:

Introduction to ROOT, Akiya Miyamoto

a b26-May-2003c�de fgih fj jk

l m n no

Due to CINT magic this is also OK:pq rs tvu w x y y q zu {H| } ~� � pq rs

�� �� � � � � � � �� � �� � � � �� � � � � � � ���

�� � � �� � �(� � � ��� �(  � � � � � ¡¢ £�¤

¥¦ §¨ © ª« ¬ ©®­ ©°¯ ¬²± ³´ ³­ µ ¯ ³¶ · ¸ ©®¹ º »¼ ³­ ¯ ½¾ ¶ ª · ¬ ¬ ¾¿

ÀÂÁ Ã Ä Ã Å Ä ÄÇÆ Ä ÈÊÉ Ë Æ Ì ÌÉ Ë Ä Ë Í Á à Õ

ÎÂÏ ÐÑ Ò ÐÓ Ñ ÔÑ Ï Õ Ñ Ö× ÐØ Ñ × × Ð ÙÚ Ó Û Ñ × ×Ú Ü Ý Ò Þ ÐØ ÜÏ Ï ÐØ Ò

Ø × Ñ Ó Ó

Warning: This will not work in compiled code!

ßàáâãä

Introduction to ROOT, Akiya Miyamoto 26-May-2003å

Due to CINT magic this is also OK:æçèé

Warning: This will not work in compiled code!

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Due to CINT magic this is also OK:

Warning: This will not work in compiled code!

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Due to CINT magic this is also OK:

Warning: This will not work in compiled code!

Introduction to ROOT, Akiya Miyamoto

ê ë26-May-2003ì�íî ïðiñ ïò òó

ô õ

ö Environment Settings

÷ Command types

ø CINT Commands

ù Global Variables

ú TObject

Introduction to ROOT, Akiya Miyamoto 26-May-2003û

Environment SettingsCommand typesCINT CommandsGlobal VariablesTObject

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Environment SettingsCommand typesCINT CommandsGlobal VariablesTObject

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Environment SettingsCommand typesCINT CommandsGlobal VariablesTObject

Introduction to ROOT, Akiya Miyamoto

ü ý26-May-2003þ�ÿ� � ��� � � ��� � � � �

Named and Un-named Scripts

� Debugging

� ACLiC

Introduction to ROOT, Akiya Miyamoto 26-May-2003 � Named and Un-named Scripts

� Debugging

� ACLiC

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Named and Un-named ScriptsDebuggingACLiC

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Named and Un-named ScriptsDebuggingACLiC

Introduction to ROOT, Akiya Miyamoto

� �26-May-2003��� � ���� �� � �� � �

Un-named Script

� !" # $ %& '& !( )+* ( ) # $ %& ,&

- . .0/ 12 3 1 4 .+5 6 12 5 387 9 : 5 ; .+< 4 1 . 6= < >5

?8@ A B+C D D E+F GH8I HJ H @ I D

K8L MON PQ R S8L P T+U Q V+W XW R S L PY

Z8[ \] ^] _` a` ^b

Named Script

ced d fOg hi j k8l hm

npo qr st u v sw x q v v qy w z{ | } { t } ~e� �

��� �� � �8� � � � � � � �+� �� �� � � �� � � � �� � � �+� � � � �� � � �� � � � � � � � �

�� �� �� �� � �

� � � � � �+� � � � � � � � � � � � � � ��� � � � �� � � � � �� � �� � � �� � � � �� � � � � � �� � � ��

Introduction to ROOT, Akiya Miyamoto 26-May-2003�

Un-named Script

Named Script

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Un-named Script

Named Script

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Un-named Script

Named Script

Introduction to ROOT, Akiya Miyamoto

� �26-May-2003�� ¡ ¢£�¤ ¢¥ ¥¦§ ¨ © ª

« Un-named Script: hello.C¬­® ¯ ° ± ± ²³ ´ µ µ® ² ± ± ´¶ · µ¹¸º

» Named Script:say.C¼ ½ ¾¿ ÀÁ  ÃÅÄ ÆÁ Ç È É ÆÁ Ê Ë ÌÍ Î Ï Ï ½ ÌÐ

ÑÄ ½Ò Ê Ó Ó É ÆÁ Ê Ó Ó ÎÔ ¿ ϹÕÖ

× Executing the Named ScriptØÙ Ù Ú ÛÜ Ý Þ ß àá â Þ ã

äæå ç çÅÙØÙ Ù Ú Ûè Ý Þ ß àá â Þ ã éê ä ë Ú ìÅå Ø å ê í

ä ë Ú ìÅå Ø å

Introduction to ROOT, Akiya Miyamoto 26-May-2003îï Un-named Script: hello.Cð

ñò Named Script:say.Có ôõ

ö÷ Executing the Named Scriptøù ùúæû

øù ùúü

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Un-named Script: hello.C

Named Script:say.C

Executing the Named Script

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Un-named Script: hello.C

Named Script:say.C

Executing the Named Script

Introduction to ROOT, Akiya Miyamoto

ý þ26-May-2003ÿ�� � � ��� �� � � �

� gROOT->Reset()

��� � ��� ��� � �� � � �� � � � � � � � � �� � � �� � � � � �� � � � � �� � �� �

! " #$&% ' () *+ ,% -. -/ % + * ( 0% 1% (% 02 #43 ( . * 5 + (% / 6 -/ 5 - # 1%

5 ) 0 5 ) - ) ) * ' 5 - (% 0Introduction to ROOT, Akiya Miyamoto 26-May-20037

8 gROOT->Reset()

9:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

gROOT->Reset()

Introduction to ROOT, Akiya Miyamoto 26-May-2003

gROOT->Reset()

Introduction to ROOT, Akiya Miyamoto

;<26-May-2003=�>? @A�B @C CDE F E

G Counting Objects and Memory use

HIKJ L MON P QR R L QS R QT UT LN V P QR R L QS WX YNZ

[K\ \ ]_^ `Ka b c ]ed ]gf h

[K\ \ ]_^ i jk a l ] c ]d ] f h

m Print the Object count and Memory use

n o pq rs t uwv px r4y z {K| }O~ t �� �

Introduction to ROOT, Akiya Miyamoto 26-May-2003�

Counting Objects and Memory use

Print the Object count and Memory use

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Counting Objects and Memory use

Print the Object count and Memory use

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Counting Objects and Memory use

Print the Object count and Memory use

Introduction to ROOT, Akiya Miyamoto

� �26-May-2003���� ���� �� ��� � �

� Example output:

�K� ���� � � � ��� � � � � � � � �� ����

 ¡¢ £ ¤ ¡ £ ¥§¦¨ © ª «­¬ ¦ ¤¡ ¤¨ ® ª « ¬ ¦ ¥¦ ¨ © ª «­¬ ¦

¯¡ ¤¨ ®�° ±³² ´µ ¶ ± ² ´· ¸ ¹ ² ± ¸ ´ º »½¼ » »¾ ¿À Á Âà ¿

ÄÆÅÈÇ ÉÊ

ËÍÌ ÎÏ Ð�Ñ Ò³Ó Ô ÕÖ Ò Ó Ô× Ø Ò ÔÓ ØÙÚ Û Û Ü½Ý Þ Û ß Û Ûà Ý á â Ü

ã Put ä å æç èé ê ë&ì æí èïî ð ñ&ò ó�ô ê õö

before and after code segment in your script to find memory leaks.

Introduction to ROOT, Akiya Miyamoto 26-May-2003÷

Example output:

Put before and after code segment in your script to find memory leaks.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Example output:

Put before and after code segment in your script to find memory leaks.

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Example output:

Put before and after code segment in your script to find memory leaks.

Introduction to ROOT, Akiya Miyamoto

ø ù26-May-2003ú�ûü ýþ�ÿ ý� � �

� � � �

� Named and Un-named Scripts

� Debugging

� ACLiC

Introduction to ROOT, Akiya Miyamoto 26-May-2003�

Named and Un-named ScriptsDebuggingACLiC

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Named and Un-named ScriptsDebuggingACLiC

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Named and Un-named ScriptsDebuggingACLiC

Introduction to ROOT, Akiya Miyamoto

26-May-2003� � � ���� �� � �� � � � � �

�Function Objects (TF1)

� � ��� � �� � ! "� #� " �� ! $ �� �% &

' (*) +, - + ./*0 + 1 243 0 5 6 /*7 0 )

8Fitting

9 :;< =>? @AB B A*C D EA B F GH IJ K L J MA*C J L MH C NB A*O C

P QRS S R*T UV W X�Y ZT U[ V ZT \�] ^_ X R*T R*T U ` WT ] S R ^T V

a b*c de fg hij h ke f e lm j n o�p i e q f r j f r g k p fj s

l q f n h ke f

Introduction to ROOT, Akiya Miyamoto 26-May-2003t

Function Objects (TF1)

Fitting

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Function Objects (TF1)

Fitting

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Function Objects (TF1)

Fitting

Introduction to ROOT, Akiya Miyamoto

u v26-May-2003

w x y z{

root/demo/ex0/hist1.C

FloatingFrame

Introduction to ROOT, Akiya Miyamoto 26-May-2003

root/demo/ex0/hist1.C

FloatingFrame

Introduction to ROOT, Akiya Miyamoto 26-May-2003

root/demo/ex0/hist1.C

FloatingFrame

Introduction to ROOT, Akiya Miyamoto 26-May-2003

root/demo/ex0/hist1.C

FloatingFrame

Introduction to ROOT, Akiya Miyamoto

| }26-May-2003

~ � � �

FloatingFrame

root/demo/ex0/hist2.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist2.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist2.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist2.C

Introduction to ROOT, Akiya Miyamoto

��26-May-2003

� � �

� � � � �

FloatingFrame

root/demo/ex0/hist3.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist3.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist3.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist3.C

Introduction to ROOT, Akiya Miyamoto

��26-May-2003

� � � � � �

� � � ��� � �

FloatingFrame

root/demo/ex0/plot2.CIntroduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/plot2.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

� � � � � �

FloatingFrame

root/demo/ex0/plot2.CIntroduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/plot2.C

Introduction to ROOT, Akiya Miyamoto

��26-May-2003� �� ���� �   ¡

¢¤£ ¢ £

1. A C++ like expression using x with a fixed set of operators and functions defined in TFormula

¥¦ §¨ © §«ª ¬­® ¥ ¦ § ¯° © §°²± ³µ´ ¶µ· ¸º¹ »¼ ¹ ³½ ¾½ ¿ ¾ ÀÂÁ

à ¿ÅÄ Æ ÇÉÈÊ Ë Ì À Á

ÍÎ ¿Ï ÃÐ Ñ ÒÓ Ë Í Î ¿ ÌÔ Ã Ð Ô ½ Ô ÕÖ × Ø Ù²Ú ÛÚ Ü Û ÝÂÞ

Introduction to ROOT, Akiya Miyamoto 26-May-2003ß

1. A C++ like expression using x with a fixed set of operators and functions defined in TFormula

àáâã

äå

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. A C++ like expression using x with a fixed set of operators and functions defined in TFormula

Introduction to ROOT, Akiya Miyamoto 26-May-2003

1. A C++ like expression using x with a fixed set of operators and functions defined in TFormula

Introduction to ROOT, Akiya Miyamoto

æç26-May-2003è éê ëì�í ëî îï

ð¤ñ ð ñ ðò

2. Same as the previous TF1 with Parameters

óÂô õ õ÷ö ø�ù úû üý öþ ÿ úö ûþ � �ö ø�� ô þ ô �ù ö ù þ � ü � � úù ý�� � � �

� � �� � �� � �� � � �� � ��� ��� � � ! "# $ %�& '( ) * + ) + '-,.-/ / 01 23 45 6�7 8 23 97 6: ; / < =3 / > >: 2? >Set the parameters explicitly@A B C D-E F GIH J H KE F E J LM N A M OQP@A B C D-E F GIH J H KE F E J L A N R OQP@A B C S J H T L OQP

Introduction to ROOT, Akiya Miyamoto 26-May-2003U

2. Same as the previous TF1 with Parameters

VW

X

Set the parameters explicitlyYZ [YZ [YZ [

Introduction to ROOT, Akiya Miyamoto 26-May-2003

2. Same as the previous TF1 with Parameters

Set the parameters explicitly

Introduction to ROOT, Akiya Miyamoto 26-May-2003

2. Same as the previous TF1 with Parameters

Set the parameters explicitly

Introduction to ROOT, Akiya Miyamoto

\]26-May-2003^`_a bced bf fg

hji h i hk

3. Use a defined functionl mon pqor n s put r v w qox r

y�z { |} ~�� � ��� � { �� � � z � � y�z { |} ~ � � ����� y z { |} ~ � � ��� �� ��� � � � ��� � � � � � �� �-���   ¡ � ¢ � � £ � � �¤¥ � � ¦-§ § ¨ ¡ © ª « �¬ �� �­ © ® ¯ ª « �¬ �° �­ � � ±² � � ±�¬ ¢ �  ¬ ¯ £ � ��³´ µ¶ · ¸¹ º» ¼¾½ ¿ ¸ ¼¹ ½

ÀÁ Â Ã Ä Â Å ÆÇ È À Á  ÉÊ Ä ÂÊ Ë Ì�Í Î�Ï ÐÑ Ò Ó Ô ÐÕ Ö Õ × Ö Õ Ø Ù-Ú

Û Ü ÝÞ ß�à Þ á â ãä�å æ ç è éê ë ìèí î ï-ð ñí ñ ëè æè í å ä é ò�ó ôê éõ æä î éeö÷ øúù û û ü ù ýþ ÿþ � ù ûù ÿ����� � �� � �� � �� � � � ���� � ���Introduction to ROOT, Akiya Miyamoto 26-May-2003�

3. Use a defined function� ���� �� !" #

$%&' ()

*+ ,- . /0

1 243 567�8

Introduction to ROOT, Akiya Miyamoto 26-May-2003

3. Use a defined function

Introduction to ROOT, Akiya Miyamoto 26-May-2003

3. Use a defined function

Introduction to ROOT, Akiya Miyamoto

9:26-May-2003;=<> ?@BA ?C CDEGF F E H I

FloatingFrame

root/demo/ex0/hist4.CIntroduction to ROOT, Akiya Miyamoto 26-May-2003J

FloatingFrame

root/demo/ex0/hist4.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist4.CIntroduction to ROOT, Akiya Miyamoto 26-May-2003

FloatingFrame

root/demo/ex0/hist4.C

Introduction to ROOT, Akiya Miyamoto

K K26-May-2003

LGM M L N M O M L

P Fitting sub-range h->Fit(“func”,”R”); h->Fit(“func2”,”R+”);

Q Fit using Minuit

R Get fitted results

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Fitting sub-range h->Fit(“func”,”R”); h->Fit(“func2”,”R+”);Fit using MinuitGet fitted results

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Fitting sub-range h->Fit(“func”,”R”); h->Fit(“func2”,”R+”);Fit using MinuitGet fitted results

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Fitting sub-range h->Fit(“func”,”R”); h->Fit(“func2”,”R+”);Fit using MinuitGet fitted results

Introduction to ROOT, Akiya Miyamoto

ST26-May-2003U=VW XYBZ X[ [\

] ^ _G` ` _ ` _

aFunctions Objects (TF1)b c dfeg g hi jk lem h li e k ni e co p

q rts uv w u xytz u {| }z ~ � yt� z s

�Fitting� ��� ��� ��� � �t� � �� � �f� � ��� � � �� � � � � �� �� �t� �

� ��� � �t� ��   ¡f¢ £� �¤ � £� ¥f¦ §¨ ¡ � � � � � ©  � ¦ � � §� �

ª «t¬ ­® ¯° ±²³ ± ´® ¯ ® µ¶ ³ · ¸f¹ ² ® º ¯ » ³ ¯ » ° ´ ¹ ¯³ ¼

µ º ¯ · ± ´® ¯Introduction to ROOT, Akiya Miyamoto 26-May-2003½

Functions Objects (TF1)

Fitting

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Functions Objects (TF1)

Fitting

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Functions Objects (TF1)

Fitting

Introduction to ROOT, Akiya Miyamoto

¾¿26-May-2003

À À Á Â Ã

Ä Create tree and branch: ÅÆ Æ Ç ÈÉËÊ Ì Æ È Ç ÅÊ Ê È ÌÍ ÎÊ Ï Ç ÅÊ ÊÑÐ Ò

Ó Read Tree:

Ô By Draw method: ÕÖ Ö × ØÙËÚ Û Ö Ø × ÕÚ Ú Ø ÕÚÜ ÙÞÝ × ÕÚ ÚÑß à t->Draw(variable, critera, option, nentries, 1st_entry)á Draw variables: 1D, 2D, OverWriteâ Put cutsã Limit number of eventsä Extract histogram

å Event loop by yourself

Introduction to ROOT, Akiya Miyamoto 26-May-2003

æ Create tree and branch:

ç Read Tree: By Draw method: t->Draw(variable, critera, option, nentries, 1st_entry)

Draw variables: 1D, 2D, OverWritePut cutsLimit number of eventsExtract histogram

Event loop by yourself

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Create tree and branch: Read Tree:

By Draw method: t->Draw(variable, critera, option, nentries, 1st_entry)

Draw variables: 1D, 2D, OverWritePut cutsLimit number of eventsExtract histogram

Event loop by yourself

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Create tree and branch: Read Tree:

By Draw method: t->Draw(variable, critera, option, nentries, 1st_entry)

Draw variables: 1D, 2D, OverWritePut cutsLimit number of eventsExtract histogram

Event loop by yourself

Introduction to ROOT, Akiya Miyamoto

èé26-May-2003

ê ë ë ì í ì ê ê

î

Use THtml classï Anything between begin_html and end_html is raw html commandð Link to class name is created automatically.ñ

THtml html;html.MakeClass( class_name );html.Convert( script_file, title, out_dir );

Introduction to ROOT, Akiya Miyamoto 26-May-2003

ò

Use THtml classó Anything between begin_html and end_html is raw html commandô Link to class name is created automatically.õ

THtml html;html.MakeClass( class_name );html.Convert( script_file, title, out_dir );

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use THtml class Anything between begin_html and end_html is

raw html command Link to class name is created automatically.

THtml html;html.MakeClass( class_name );html.Convert( script_file, title, out_dir );

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Use THtml class Anything between begin_html and end_html is

raw html command Link to class name is created automatically.

THtml html;html.MakeClass( class_name );html.Convert( script_file, title, out_dir );

Introduction to ROOT, Akiya Miyamoto

ö ÷26-May-2003

ø ù ú ú

û TMath::xxxx

ü TRandom/TRandom2/TRandom3

ý TMatrix

þ TLorentzVector/TLorentzRotation

ÿ TLatex� TMinuit� TGxxxxx : graphic� TPythia6

Introduction to ROOT, Akiya Miyamoto 26-May-2003

� TMath::xxxx � TRandom/TRandom2/TRandom3� TMatrix� TLorentzVector/TLorentzRotation� TLatex� TMinuit TGxxxxx : graphic TPythia6

Introduction to ROOT, Akiya Miyamoto 26-May-2003

TMath::xxxx TRandom/TRandom2/TRandom3TMatrixTLorentzVector/TLorentzRotationTLatexTMinuitTGxxxxx : graphicTPythia6

Introduction to ROOT, Akiya Miyamoto 26-May-2003

TMath::xxxx TRandom/TRandom2/TRandom3TMatrixTLorentzVector/TLorentzRotationTLatexTMinuitTGxxxxx : graphicTPythia6

Introduction to ROOT, Akiya Miyamoto

� �26-May-2003

TObjArray,TClonesArray,TIter

TObjArray � ��� � �� � �� �� � � � � �� � �� � � � � �� � � � � � � �! � � �#" � �$ � � � � �

% & ' '& ' '( ) *+ ,

- .0/ 1 234 56 78 90: ; < / ; =/ 2 3 4 56 78 >? 4 / @

A TClonesArrayB C�D E FG H EI JK L G M M ND J M G OI K L G M MQP N H R I SUT M H V I D WX I K F

Y Z [ [\] ^ _a` bac \ ] de fg h i jk ] ` l

root/array/tobjarray.C, tclonesarray.CIntroduction to ROOT, Akiya Miyamoto 26-May-2003

TObjArray,TClonesArray,TIterm TObjArray

n TClonesArray

root/array/tobjarray.C, tclonesarray.C

Introduction to ROOT, Akiya Miyamoto 26-May-2003

TObjArray,TClonesArray,TIterTObjArray

TClonesArray

root/array/tobjarray.C, tclonesarray.CIntroduction to ROOT, Akiya Miyamoto 26-May-2003

TObjArray,TClonesArray,TIterTObjArray

TClonesArray

root/array/tobjarray.C, tclonesarray.C

Introduction to ROOT, Akiya Miyamoto

o p26-May-2003

q q r

s Building Root Treest Reading Root Treesu Using Trees in Analysis v w xzy {}| ~� �y � xz� �

� � �z� � �� � � �� � � � � �z� �

� Add your class to ROOT� ��� � � �z� �}� � � �� �� � � �

� ��� �z  ¡¢ £¤ � ¥z¦ § ¨© �  §¦ ª« � ¬ §  §­ ®

¯ °�± ² ³´ ° ³Introduction to ROOT, Akiya Miyamoto 26-May-2003

µ Building Root Trees¶ Reading Root Trees· Using Trees in Analysis

¸ Add your class to ROOT

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Building Root TreesReading Root TreesUsing Trees in Analysis

Add your class to ROOT

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Building Root TreesReading Root TreesUsing Trees in Analysis

Add your class to ROOT

Introduction to ROOT, Akiya Miyamoto

¹ º26-May-2003

» ¼ ¼ ½ ¼ ¼Step 1:

define your class as a descendent of TObject and write the implementation.

SClass.h¾ ¿ ÀÁ Â�Ã Ä Å Æ ¿ ÇÈ ÉÊ ÅË ÌÎÍ ÏÑо ¿ ÀÁ Â�Ã Ä Å ÒÓ Ô ÕÖ ÅÁ É Í Ï Ò

Á ÂË È È ×Ø ÂË È È Ù ÚÃ Õ Â ¿Á Ó Ô ÕÖ ÅÁ É Û

Ü

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 1:define your class as a descendent of TObject and write the implementation.

SClass.hÝ Þ ßà áÝ Þ ßà áà á âã ã

ä

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 1:define your class as a descendent of TObject and write the implementation.

SClass.h

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 1:define your class as a descendent of TObject and write the implementation.

SClass.h

Introduction to ROOT, Akiya Miyamoto

åæ26-May-2003

ç è è é è èStep 2:

ClassDef(ClassName,ClassVersionID)

At the end of the class definitionClassImp(ClassName)

At the beginning of the implementation file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 2:ClassDef(ClassName,ClassVersionID)

At the end of the class definitionClassImp(ClassName)

At the beginning of the implementation file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 2:ClassDef(ClassName,ClassVersionID)

At the end of the class definitionClassImp(ClassName)

At the beginning of the implementation file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 2:ClassDef(ClassName,ClassVersionID)

At the end of the class definitionClassImp(ClassName)

At the beginning of the implementation file

Introduction to ROOT, Akiya Miyamoto

êë26-May-2003

ì ì í îClassDef and ClassImp needed for Object I/O :These macros can automatically create:• Streamer method needed for writing to ROOT files

and Trees.

• ShowMembers()

• >> operator overload

Introduction to ROOT, Akiya Miyamoto 26-May-2003

ClassDef and ClassImp needed for Object I/O :These macros can automatically create:• Streamer method needed for writing to ROOT files

and Trees.

• ShowMembers()

• >> operator overload

Introduction to ROOT, Akiya Miyamoto 26-May-2003

ClassDef and ClassImp needed for Object I/O :These macros can automatically create:• Streamer method needed for writing to ROOT files

and Trees.

• ShowMembers()

• >> operator overload

Introduction to ROOT, Akiya Miyamoto 26-May-2003

ClassDef and ClassImp needed for Object I/O :These macros can automatically create:• Streamer method needed for writing to ROOT files

and Trees.

• ShowMembers()

• >> operator overload

Introduction to ROOT, Akiya Miyamoto

ï ð26-May-2003

ñ ñ ò

Step 3:create a LinkDef.h fileó ô õö ÷ õ ø ø ùú ûü ø øó0ý þ ÿ� � ÿ � ô�� � � õ õ ÿ � � � � � � ÿ �� ó0ý þ ÿ� � ÿ � ô�� � � õ õ ÿ � � � � ÿ� � ÷� ó0ý þ ÿ� � ÿ � ô�� � � õ õ ÿ � � õ � � � � ô �� �

��� �� �� � �� � � ��� � � ��� � � � � ��� � �

!�" # $% &

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 3:create a LinkDef.h file' (

'�)'�)

'�)*�+

,�-

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 3:create a LinkDef.h file

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 3:create a LinkDef.h file

Introduction to ROOT, Akiya Miyamoto

. .26-May-2003

/ 0 1 2

3"-" do not generate a streamer.4 5�6 78 9: 8 ;< = > ?�@ @ A ;�8 B B C ? ;�8 B BED F

G HJI K LNM O M PQ KR S I T U S V R WI S M X UZY K [ I S O K \ X K O I

]"!" do not generate the operator >>^ _�` ab cd b ef g h i�j j k e�b l l m i e�b l lEn oEp

q rJs t uNv w x yz s s t s {v | } { ~ t w } | } { � u w v �� � �� t x |���"+" use the byte count check� ��� �� �� � �� � � ��� � � ��� � � � � ��� � � � �

� � � ��� � � ��   ¡ ¢�£ ¤¦¥ ¤ ¡¨§ ©� ª «� ¡ ¢�£ � £ ¬ � � ��� �®­

Introduction to ROOT, Akiya Miyamoto 26-May-2003

¯"-" do not generate a streamer.° ±²³

´"!" do not generate the operator >>µ ¶·¸¹

º"+" use the byte count check» ¼½¾¿

Introduction to ROOT, Akiya Miyamoto 26-May-2003

"-" do not generate a streamer.

"!" do not generate the operator >>

"+" use the byte count check

Introduction to ROOT, Akiya Miyamoto 26-May-2003

"-" do not generate a streamer.

"!" do not generate the operator >>

"+" use the byte count check

Introduction to ROOT, Akiya Miyamoto

À Á26-May-2003

Â Ã Ä Å Â Å

Step 4:

Æ Ç¨È É Ê Ê Ë É Ì Ç Í É ÊÎ Ï Ð Ê Í Í ÆÑ Ñ È Ð Ç Î È È Ñ Ê Ï Ï Ò Ñ Ó Æ

Ð Í ÊÔ Ô È Ñ È Õ É Ï Ç ÐÈ Ç Ñ Î Ê Æ ÒÖ

×Ø ÙÛÚ Ü Ü Ý Þàß áãâ ß ä ä ×Ø ÙÛÚ Ü Üâ å æ Þàç è Ýêé ëâ å

ìí î ï ïð ×ñ × ò ó Þàç ôõ õ öø÷ ùàú ö û ü

ýþ ÿ�� � � � ��� �� � û � ýþ ÿ�� � �� � � �� � ��� ü� �

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 4:

�� �����

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 4:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Step 4:

Introduction to ROOT, Akiya Miyamoto

� �26-May-2003

� � � � �

�LinkDef.h must be the last argument on the rootcint command line. �The LinkDef file name MUST contain the string:� !�" #$�% &' (�)* + ! " #,% & ' (- ! '% ' . / 01 ! " # $% & ' ( !�2&!�" % 354 2 6 + ! #% - 78 + !�" # ,% & ' ( '9

Introduction to ROOT, Akiya Miyamoto 26-May-2003

LinkDef.h must be the last argument on the rootcint command line.

The LinkDef file name MUST contain the string:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

LinkDef.h must be the last argument on the rootcint command line.

The LinkDef file name MUST contain the string:

Introduction to ROOT, Akiya Miyamoto 26-May-2003

LinkDef.h must be the last argument on the rootcint command line.

The LinkDef file name MUST contain the string:

Introduction to ROOT, Akiya Miyamoto

:;26-May-2003

< =

Compile the class using the Makefile>? @ ACB D EF @ ACB EGH BJI K > G ACL L

Load the shared libraryMN N O PQ RTS U VW X5YZ Z S Z NMN N O P[ R VW X5YZ Z \Z ]_^ `ab VW X5YZ Z cdMN N O Pe Rf g h X a \ i^ `ab f g h X a cjk i h X aS MN N OjTljm nok f pj drqMN N O Ps R Z ]ut v w M h O a cdrqIntroduction to ROOT, Akiya Miyamoto 26-May-2003

Compile the class using the Makefilexy z

Load the shared library{| {|{|}~�{|

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Compile the class using the Makefile

Load the shared library

Introduction to ROOT, Akiya Miyamoto 26-May-2003

Compile the class using the Makefile

Load the shared library

Introduction to ROOT, Akiya Miyamoto

��26-May-2003

More information on ROOT

� ROOT home page http://root.cern.ch/�

Root class categories �� ���� � ���� � ��� �� �� � � � �� � � � ���� � �� � � � �� � � ��� �� ����� � ��  ¡�¢£ ¤¥ ¥�¦§ ¨ ¨�©ª ª ¥�« ¬¢ ©   « ¬ ¤ ¨ ©ª ª ¥ ¨ ¤¥�­ � ®¯° ¨ �� � � � ��  ¡ ¢ £ « ¤ ¥ ­ �± ²�³ ³ ´ µ ³¶ ´³ · ´ ´�¸¹ º º�» ³ ³ ´�¼ ½¾ »¿ ¼ ½ · º» ³ ³ ´ º µ ³ ¶ ´�³ ¼ · ´�À Á

 ÃÄ Å ÅÆ ÇÈ ÇÉÊÌË Ê�ÍÎ Ï�Ð Ñ

To run demo programs, do ÒÔÓÕ Õ Ö ×�ØÙ ÕÚ Û ÜIntroduction to ROOT, Akiya Miyamoto 26-May-2003

More information on ROOTÝ ROOT home page http://root.cern.ch/Þ

Root class categories ßàáâã

To run demo programs, do

Introduction to ROOT, Akiya Miyamoto 26-May-2003

More information on ROOTROOT home page http://root.cern.ch/

Root class categories

To run demo programs, do

Introduction to ROOT, Akiya Miyamoto 26-May-2003

More information on ROOTROOT home page http://root.cern.ch/

Root class categories

To run demo programs, do