...
Getting
...
the
...
most
...
out
...
of
...
your
...
plots
Outline
- #Introduction
- #Creating histograms in org.lcsim
- #Saving your work
- Changing the layout
- #Basic Fitting
- #Advanced Tutorials
Here is a possible outline for this section:
- usage of the static AIDA defaultInstance
- explanations of basic types: clouds 1D/2D, histograms 1D/2D, tuples, etc.
- defining each type (e.g. bin sizes for histograms, etc.)
- filling each type
- creating plots from a sample Driver (use Analysis101 or some other template)
- changing axis label: text value, font, size, etc.
- changing axis range min/max
- changing to log scale
- changing filled/unfilled and colors for value bars, error bars
- modifying fields that show in statistics box
- saving and reloading plots using .aida files
- importing into a Powerpoint presentation
- basic fitting (would keep this pretty simple)
It would probably be best done with more than one page.
--Jeremy M.
Introduction
Anchor | ||||
---|---|---|---|---|
|
For plotting and fitting, org.lcsim provides an implementation of the Abstract Interfaces for Data Analysis AIDA.
AIDA objects is organized in Trees, which can have a directory structure like a file system.
This tutorial will assume that you are working in JAS3 and have either loaded an existing AIDA file or created objects in AIDA with the org.lcsim plugin.
If you have executed some of the examples in JAS3, you have already used AIDA in lines like these:
Code Block |
---|
h2. Outline * [#Introduction] ** [#Terminology] * [#Creating histograms in org.lcsim] * [#Saving your work] ** [#Saving your plots as image files] ** [#Saving your data in the AIDA format] * Changing the layout ** [#Changing the title and the axis labels] * [#Basic Fitting] * [#Advanced Tutorials] Here is a possible outline for this section: * usage of the static AIDA defaultInstance * explanations of basic types: clouds 1D/2D, histograms 1D/2D, tuples, etc. ** defining each type (e.g. bin sizes for histograms, etc.) ** filling each type * creating plots from a sample Driver (use Analysis101 or some other template) * changing axis label: text value, font, size, etc. * changing axis range min/max * changing to log scale * changing filled/unfilled and colors for value bars, error bars * modifying fields that show in statistics box * saving and reloading plots using .aida files * importing into a Powerpoint presentation * basic fitting (would keep this pretty simple) It would probably be best done with more than one page. --Jeremy M. h2. Introduction{anchor:Introduction} For plotting and fitting, org.lcsim provides an implementation of the Abstract Interfaces for Data Analysis [AIDA|http://aida.freehep.org]. AIDA objects is organized in Trees, which can have a directory structure like a file system. This tutorial will assume that you are working in JAS3 and have either loaded an existing AIDA file or created objects in AIDA with the [org.lcsim] plugin. If you have executed some of the examples in JAS3, you have already used AIDA in lines like these: {code}AIDA aida = AIDA.defaultInstance(); ... aida.cloud1D("nTracks").fill(tracks.size()); {code} |
These
...
lines
...
create
...
and
...
fill
...
an
...
unbinned
...
one-dimensional
...
histogram
...
named
...
nTracks
...
with
...
the
...
return
...
value
...
of
...
tracks.size()
...
Teminology
Anchor | ||||
---|---|---|---|---|
|
AIDA provides two different kinds of histograms: binned and unbinned.
Binned histograms are called IHistogram1D, IHistogram2D, IHistogram3D
for one, two and three-dimensional histograms.
Similarly, unbinned histograms are called ICloud1D, ICloud2D, ICloud3D
Getting started
Creating histograms in org.lcsim
Anchor | ||||
---|---|---|---|---|
|
Viewing and Loading Plots
Anchor | ||||
---|---|---|---|---|
|
Lets start with viewing AIDA objects. You can either create them with the AIDA examples, the org.lcsim examples or you can load an existing AIDA file with File->Open File...
in the menu.
All AIDA objects are arranged in trees. You can have many trees open at the same time; they are represented as Folders, . Trees can contain, e.g. Clouds and/or Histograms , with the name of the object appearing next to it. If a folder is closed, double-clicking will open it and display its contents. Similarly, double-clicking on an open folder will close it, so that the contents are hidden.
Info |
---|
Trees that are created by the org.lsim examples will have non-descriptive names like |
A double-click on a Cloud or a Histogram will cause JAS3 to plot the contents.
Info |
---|
Clouds are automatically displayed with 50 bins over the range of the data. |
Note |
---|
If the active page shows source code or the examples, double clicking on an item in the tree will create a new plot page and display the item. |
Tip |
---|
If you want to display more than one plot on a page, you have to use the context menu.
|
In order to display an item together with an already displayed item, select Overlay on Current Plot
from the context menu
Saving your work
Anchor | ||||
---|---|---|---|---|
|
Saving your plots as image files
Anchor | ||||
---|---|---|---|---|
|
JAS3 supports various graphics formats, for both bitmap and vector graphics.
Info |
---|
Bitmap graphics are not scalable. JAS3 saves all Plots in their current size. Please make sure to draw the window to the desired width before saving in a bitmap format. |
The following list gives a brief description of the most often used formats
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
Saving Plots is a trivial task in JAS3:
- You want to save the whole page:
- Select
File->Save As...
- Select
- You want to save only one plot in the current page
- Right click on the plot and select
Save Plot As...
- Right click on the plot and select
Section | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Saving your data in the AIDA format
Anchor | ||||
---|---|---|---|---|
|
In order to save your whole tree with all Cloud and Histogram objects, right-click on the folder icon , and select Save As...
from the context menu. Please select a filename with the extension .aida
so that you will be able to recognize the file later.
Changing Layout/Style/Properties with the Mouse
Thanks to the close integration of JAS3 and AIDA, a plethora of manipulations is availabe via menus and dialogs. This tutorial can merely give an overview over the most commonly used ones.
Changing the title and the axis labels
Anchor | ||||
---|---|---|---|---|
|
- Right-click on the plot and select
Plot Properties...
from the menu. You will see tabs that represent different regions of the plot. - The Title of the plot can be found under the General tab. Change it so something descriptive and click on the Apply button to see it change.
- The axis labels can be changed under the Y Axis and X Axis tabs, respectively. After entering the label in the text field, click the Apply button to see it change
Changing
Basic Fitting
Anchor | ||||
---|---|---|---|---|
|
Advanced Tutorials
Anchor | ||||
---|---|---|---|---|
|
- The second part of this Tutorial has more examples on fitting and scripting as well as Tuples
- The Documentation on the AIDA homepage contains many advanced examples together with code samples that demonstrate the features
- The Documentation on the PAIDA homepage contains many small examples of Python scripts together with images that demonstrate advanced AIDA capabilities. At the point of this writing, PAIDA contains some functionality that cannot be found in the JAIDA implementation, such as 3D plotting.