root for beginners day1
DESCRIPTION
ROOT TutorialTRANSCRIPT
![Page 1: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/1.jpg)
ROOT for beginners
First DayDiscovering the
graphical environment
![Page 2: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/2.jpg)
Welcome to ROOT !Today's menu:
We present a guided tour ofbasic use of ROOT in order toplot spectra and make prettypictures ! For further information, you
should consult the "User'sGuide" at http://root.cern.ch
Handling ROOT filesPlotting 1-D spectraHandling canvases
Decorating a figureFitting a 1-D spectrum
Operations on 2-D spectraSaving figures
![Page 3: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/3.jpg)
Handling ROOT files
![Page 4: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/4.jpg)
TBrowser – the ROOT navigator• You just need to know one command in order to
start the ROOT file/spectra browser :root [0] new TBrowser
Or you could do:TBrowser totoorTBrowser *tata = new TBrowser
Explanations tomorrow (Day 2)!
http://caeinfo.in2p3.fr/root/Formation/en/Day1/hsimple.root
![Page 5: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/5.jpg)
Open a ROOT file withTBrowser
• In the File menu of TBrowser, select"Open…"
• Select a file in the dialogue box whichappears:
1. Select thefile
![Page 6: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/6.jpg)
Open a ROOT file withTBrowser
2. Click"Open"
• In the File menu of TBrowser, select"Open…"
• Select a file in the dialogue box whichappears:
![Page 7: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/7.jpg)
Looking at ROOT file contents
• The file has been added to the list of open ROOTfiles - to see it, you have to display the list
1. Double clickon ROOTFiles
![Page 8: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/8.jpg)
Looking at ROOT file contents
• Next click on the file to see its contents:
2. Click the file
![Page 9: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/9.jpg)
Looking at ROOT file contents
• You see (if you choose the right options) alist of spectra with their titles
3. Choose option"detailed list"
![Page 10: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/10.jpg)
Looking at ROOT file contents
• Icons represent the different types of spectra:– profile, 1-D histogram, 2-D histogram, N-tuple…
![Page 11: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/11.jpg)
Plotting spectra
First of all, 1-D spectra
![Page 12: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/12.jpg)
Plotting a spectrum
• To plot a 1-D histogram, nothing could besimpler: double-click it!
1. Double-clickhistogram "hpx"
![Page 13: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/13.jpg)
Discovering the canvas(TCanvas)
• A new window appears - the canvas
![Page 14: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/14.jpg)
The canvas objects• This canvas contains many objects which
we can manipulate:
Spectrumtitle
Statisticsbox withname ofhistogram
Displayframe
"Y" axis
"X" axis
The histogram
Canvas
![Page 15: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/15.jpg)
What is this object ?• To see the identity of every object the
mouse passes over, activate the "EventStatus" bar in the "View" menu :
The bar appears belowthe canvas:
Object title
Objectname
Mouse positionin pixel units(0,0)=top leftcorner
Position in"spectrum"
units+ bin contents
& partial integralfor spectra
![Page 16: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/16.jpg)
What is this object ?• Or, you can
"right-click" onan object andaccess itscontext menu:
Right-click onhistogram"hpx":
Object type (class)::object name
![Page 17: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/17.jpg)
The canvas objects (again)• So we can identify the type (class) of every
object used in the canvas:
Spectrumtitle(TPaveText)
Statistics boxwith name ofhistogram(TPaveStats)
Displayframe(TFrame)
"Y" axis(TAxis)
"X" axis (TAxis)
Histogram(TH1F)
The canvas(TCanvas)
![Page 18: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/18.jpg)
Manipulating objects• Use the mouse to move and resize objects…
With the left buttonof the mouse you canreposition andredimension allobjects in the canvas
![Page 19: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/19.jpg)
Activate the canvas editor• To change colours, line widths, etc. we use
the canvas editor
Activate theeditor by selecting"Editor" in the"View" menu
![Page 20: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/20.jpg)
Canvas editor• The editor appears to the left of the canvas• It displays/modifies the characteristics of the last
object selected with the mouse (careful!)Name & type (class)of last-clickedobject
E.g. Tick here tomake all spectrascales on this canvaslogarithmic
![Page 21: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/21.jpg)
Canvas editor
Like this !
• The editor appears to the left of the canvas• It displays/modifies the characteristics of the last
object selected with the mouse (careful!)
![Page 22: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/22.jpg)
Changing the look of a spectrum
1. Check you haveselected the rightobject
• or "the art of clicking in the right place at the right time"…
![Page 23: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/23.jpg)
Changing the look of a spectrum
2. Click the line-colour box tothe palette
• or "the art of clicking in the right place at the right time"…
![Page 24: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/24.jpg)
Changing the look of a spectrum
3. Choose a fillstyle…
• or "the art of clicking in the right place at the right time"…
![Page 25: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/25.jpg)
Changing the look of a spectrum
4. …and a colour inorder to activate it
• or "the art of clicking in the right place at the right time"…
![Page 26: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/26.jpg)
Changing the look of a spectrum
5. And why notchange the titlewhile we're at it ?
• or "the art of clicking in the right place at the right time"…
![Page 27: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/27.jpg)
Changing the look of a spectrum
…as well as therange of displayedaxis values
On the second tabyou can change thebinning…
• or "the art of clicking in the right place at the right time"…
![Page 28: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/28.jpg)
Handling the canvas*
*without smudging the artwork
![Page 29: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/29.jpg)
Canvas manipulation• If you want a new canvas:
Using an existingone…
Using the browser…WARNING !Double-click on aspectrum and it will bedrawn on the activecanvas, replacing anyprevious content
![Page 30: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/30.jpg)
Canvas manipulation• To wipe the canvas clean:
Wipe only the active(sub-)pad…
Wipe the WHOLEcanvas (careful!)
![Page 31: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/31.jpg)
Manipulating the canvas• To refresh the canvas display:
Sometimes, the resultof a modification is notvisible straight away.
To force an update of allthe objects on the canvas,option "Refresh" can help*
*(and reduce stress levelsand anxiety…)
![Page 32: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/32.jpg)
Manipulating the canvas• Some useful options:
In the "Options" menu ofthe canvas we also controlwhether or not to show :
statistics boxes
histogram title
fit parameters
![Page 33: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/33.jpg)
Manipulating the canvas• Dividing the canvas to display several
spectra at once:
Open the context menu ofthe canvas (right-click onthe canvas)
Select "Divide"
![Page 34: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/34.jpg)
Manipulating the canvas
Number of columns
Number of rows
Margins between pads
Pad colour
Fill in the form,e.g. to have 2x2 pads:
And click "OK"
• Dividing the canvas to display severalspectra at once:
![Page 35: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/35.jpg)
Next, choose the padwhere you want to displayyour spectrum(click with middle button)
WARNING!The first sub-pad is notautomatically selected
Manipulating the canvas• Dividing the canvas to display several
spectra at once:
![Page 36: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/36.jpg)
Exercise
![Page 37: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/37.jpg)
Decorating a figure
Making pretty pictures
![Page 38: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/38.jpg)
Adding objects to the canvas
• Open the toolbar
Select "Toolbar" in the"View" menu
![Page 39: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/39.jpg)
Adding objects to the canvas
• Open the toolbar
With the buttons we candraw all sorts ofgraphical objects on thecanvas…
![Page 40: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/40.jpg)
Adding objects to the canvas
• Open the toolbar
…arc/circle, line,arrow, diamond, ellipse,rectangle, …
![Page 41: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/41.jpg)
Adding object to the canvas
• Open the toolbar
…polyline, "curly line","curly arc", …
![Page 42: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/42.jpg)
Adding objects to the canvas
• Open the toolbar
…marker, closed contour(graphical cut selection- Day 4!)
![Page 43: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/43.jpg)
Add a pad to the canvas
• Spectra within spectra within…
Why add a pad ?
=> Easy way to have an'insert' showing e.g. azoom
Pad = mini-canvas insidea canvas (or a pad… etc.etc.)
![Page 44: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/44.jpg)
Adding a pad
• Spectra within spectra within…
Draw the pad, thenclick on it with themiddle button to makeit active(yellow border)*
*(true for all pads/canvases)
![Page 45: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/45.jpg)
Adding a pad
• Spectra within spectra within…
Then the next spectrumwe display will be drawnin the active (yellow)pad*
*(this is always true,even with severalwindows)
![Page 46: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/46.jpg)
Adding text• To make the figure self-explanatory, add a
legend…
Several choices areavailable for addingtext, do you want justtext ('L' button)* ortext in a box ?
*(it's 'L' for 'LaTeX')
![Page 47: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/47.jpg)
Adding text• …using LaTeX (well, almost)
Example of a'TPaveLabel'
Raw text entered:-4#leq p_{x}#leq 4
To change font, size,colour of text, use thecanvas editor
![Page 48: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/48.jpg)
Exercise
Tip:it's the 2-Dspectrum'hpxpy' drawnwith option"lego" (use the'Options' drop-down menu inthe browser)
![Page 49: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/49.jpg)
Fitting a 1-D spectrum
![Page 50: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/50.jpg)
Fits
• Simple fitting can easily be done using thegraphical interface
Draw spectrum'hpx' and open itscontext menu
Select "FitPanel"
![Page 51: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/51.jpg)
Fits
Choose a function:
polN = Nth order polynomial
user = user-defined function(Day 3)
• Simple fitting can easily be done using thegraphical interface
![Page 52: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/52.jpg)
Fits
Change the range of the fit
• Simple fitting can easily be done using thegraphical interface
![Page 53: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/53.jpg)
Fits
Click 'Fit' and the fitwill be performed, theresult appears in theactive pad/canvas(unless you choose option"N")
To see the fitparameters :menu "Options","Fit Parameters"
• Simple fitting can easily be done using thegraphical interface
![Page 54: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/54.jpg)
Exercise
![Page 55: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/55.jpg)
Working with 2-D spectra
![Page 56: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/56.jpg)
Displaying 2-D spectra
• Several options are available for displaying2-D histograms:
Divide a new canvas in 4.In the browser,double-click the spectrum"hpxpy" of file"hsimple.root"
By default, a "scatter-plot"is drawn
Not very nice (butsometimes useful)…
![Page 57: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/57.jpg)
Displaying 2-D spectra
The "Option" drop-down menu of thebrowser can be used to choose adisplay option: "box", "lego", "colz" *
*Actually, there aremore of them -"surf", "lego2","arrow"…
• Several options are available for displaying2-D histograms:
![Page 58: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/58.jpg)
An instructive little workedexample
• Let's use our 2x2 canvas & the browser todisplay the 2-D histo "hpxpy" with 4different plotting options:
Can you do it using whatyou have learned so far ?
![Page 59: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/59.jpg)
An instructive little workedexample
• Can't get the same spectrum to appear in 2pads at the same time ?
Look at the spectrum list inthe browser.
Does something seem alittle strange ?
Why does 'hpxpy' appeartwice in the list ? *
(Maybe it's not the only one)*You might need toupdate the browser:"View"->"Refresh"
![Page 60: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/60.jpg)
An instructive little workedexample
Names ending in ";1" or ";N"(N>=1) * are the objects inthe file (on disk)
They cannot be modified(we opened the file in "ReadOnly" mode).
*the 'N' is a versionor 'cycle' number
• Can't get the same spectrum to appear in 2pads at the same time ?
![Page 61: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/61.jpg)
An instructive little workedexample
Names without ";" are memory-resident copies of the spectra:these we can modify.
A new copy is made every timeyou double-click a disk-residentobject.
The previous copy is destroyed !
• Can't get the same spectrum to appear in 2pads at the same time ?
![Page 62: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/62.jpg)
An instructive little workedexample
• Disk-resident vs. memory-resident objects
So to get the right result,you have to make sure to alwaysclick on 'hpxpy' (copy inmemory) and not 'hpxpy;1'(disk-resident).
To remove thestatistics box, usethe 'Options' menu
![Page 63: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/63.jpg)
An instructive little workedexample
• Tip: nice colours if you can get them…
With option 'col'/'colz', thedefault colours are not veryattractive.
This will make a greatimprovement:root [0] gStyle->SetPalette(1)
Then update the canvas(menu "Options"->"Refresh")or click on the histogram.
![Page 64: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/64.jpg)
Operations on 2-D spectra• It's easy to generate projections or profile
histograms* from 2-D spectra
*i.e. plot the mean ands.d. of one of the twovariables versus the other
![Page 65: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/65.jpg)
Right-click to open thecontext menu
Then select e.g. ProjectionX
• It's easy to generate projections or profilehistograms from 2-D spectra
Operations on 2-D spectra
![Page 66: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/66.jpg)
You can give a name forthe new projection.
By default (if you leave"_px") the name will be"hpxpy_px".
• It's easy to generate projections or profilehistograms from 2-D spectra
Operations on 2-D spectra
![Page 67: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/67.jpg)
You can limit the rangeof bins included in theprojection.
By default, as here, allbins are included.
• It's easy to generate projections or profilehistograms from 2-D spectra
Operations on 2-D spectra
![Page 68: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/68.jpg)
Options:"d" - plot in active canvas/pad"e" - calculate errors"[cut]" - use named graphicalcut to select bins (Day 4!)
• It's easy to generate projections or profilehistograms from 2-D spectra
Operations on 2-D spectra
![Page 69: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/69.jpg)
By default, the projectionis not displayed, but shouldbe present in the browser(after a "Refresh")
• It's easy to generate projections or profilehistograms from 2-D spectra
Operations on 2-D spectra
![Page 70: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/70.jpg)
Exercise
![Page 71: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/71.jpg)
Saving your figures
It'd be a pity to lose everything…
![Page 72: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/72.jpg)
Saving a masterpiece• Before saving, we'll remove the yellow border of the
active canvas - otherwise it'll be in the figure
In the canvas' contextmenu selectSetBorderModechange the value:"0" = no border
![Page 73: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/73.jpg)
Saving a masterpiece
• Open the menu "File", sub-menu "Save"
You can save an image ofyour figure in many popularformats (PS, PDF, GIF, JPG)with the name c1.xxx bydefault*
*With "Save As…" you can even choose the name you want
![Page 74: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/74.jpg)
Saving a masterpiece
• What if I want to change the figure later ?
Two choices:create some code ('c1.C')orsave the objects ('c1.root')
![Page 75: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/75.jpg)
Save the objects ???• By choosing ".root" in menu "Save", a file
'c1.root' is created.• In order to display the image later, you need to
open this file, e.g. with the browser:
It seems the file only containsone object, c1.But double-click it and…
![Page 76: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/76.jpg)
Save the objects ???
…the figure is displayed.
In fact, a canvas is a sort of list ofobjects to display on the screen.The command "Draw" just adds anobject to this list…
• By choosing ".root" in menu "Save", a file'c1.root' is created.
• In order to display the image later, you need toopen this file, e.g. with the browser:
![Page 77: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/77.jpg)
Create some code ?• By choosing "c1.C" in the menu, a file is
created which contains all the (C++)instructions necessary to recreate our figure
You can look atthe result in anytext editor…
![Page 78: ROOT for Beginners Day1](https://reader033.vdocument.in/reader033/viewer/2022051609/545d6d4daf7959cd098b4c30/html5/thumbnails/78.jpg)
Create some code ?• Tomorrow we will see how to use this kind
of code to create analysis scripts, etc.
Now this won'thurt a bit…