====== Using ROOT within the VLSI lab ======
[ __[[vlsi:home|Home]]__ ]
[ __[[vlsi:workbook:analysis:main|Back]]__ ]
== Contents ==
* Introduction
* ...
* ...
**Keywords:**
===== Introduction =====
====== Installation from binaries ======
Check //[[http://root.cern.ch/drupal/content/build-prerequisites|dependences]]//
* subversion
* make
* gcc-c++
* gcc
* binutils
* libX11-devel
* libXpm-devel
* libXft-devel
* libXext-devel
Download the last stable version binary package from
//[[http://root.cern.ch/drupal/content/downloading-root]]//
tar -xvzf root_v5.xx.yy.zzzzzz.tar.gz
sudo mv root /opt
setenv ROOTSYS /opt/root
====== Accessing gcc/g++ from Cadence ======
The ''g++'' compiler might not be installed on your VLSI lab machine!
Nevertheless, you can use the GCC version which comes with a Cadence Incisive installation under
''/usr/cadence/Incisive_13.10/tools/cdsgcc/gcc/''
To use g++ you need to set up the UNIX environment as follows:
setenv INCISIV_DIR /usr/cadence/Incisive_13.10/
set incisivPath = ( $INCISIV_DIR/bin $INCISIV_DIR/tools/bin $INCISIV_DIR/tools/cdsgcc/gcc/bin )
set path = ( $incisivPath $path )
===== Accessing ROOT from the UNIX cluster =====
ROOT e' installato sulle macchine PHOINIX e BEDDU!
ssh -X username@phoinix.to.infn.it
e poi basta fare il source dello scriptino che setta le variabili d'ambiente in
''/usr/local+/profile.d/root.(c)sh''
usare .sh oppure .csh a seconda della shell in uso (tcsh di default!)
source /opt/local+/profile.d/root.(c)sh
La main directory e'
''/opt/local+/root''
In order to automatize the source at the startup cat and paste the following lines
in your ''~/.cshrc'' initialization file:
if ( -e /usr/local+/profile.d/root.csh ) then
source /usr/local+/profile.d/root.csh
endif
If you have a ''bash'' shell indeed edit the ''~/.bashrc'' with
if [ -f /usr/local+/profile.d/root.sh ] ; then
source /usr/local+/profile.d/root.csh
fi
At this point ROOT executables have been added to the search path. Start ROOT typing
root -l
ricordare che per customizzare il comportamento di root si possono creare nella HOME i files .rootrc
rootlogon.C rootlogoff.C rootalias.C
# .rootrc file example
## rootlogon.C path
Rint.Logon: $HOME/rootlogon.C
## rootlogoff.C path
Rint.Logoff: $HOME/rootlogoff.C
## rootalias.C path
Rint.Load: $HOME/rootalias.C
## .root_hist number of lines
Rint.HistSize: 500
Rint.HistSave: 400
## ROOT user macros path
# Unix.*.Root.MacroPath: ./custom/path:$ROOTSYS/macros
## tracking memory leaks
Root.MemStat: 1
Root.ObjectStat: 1
## memory checker
Root.MemCheck: 1
Esempio di rootlogon.C
// ~/rootlogon.C file example
{
printf("Loading rootlogon.C script \n");
// resets the CINT command line
gROOT->Reset();
// current .rootrc system environment
//gEnv->Print();
// namespace for TMath utilities
using namespace TMath;
// global "plain" style for plots
gROOT->SetStyle("Plain");
// histograms Stats Box content
// gStyle->SetOptStat(mode)
// mode = kurtosis, skewness, integral of bins, overflows, underflows, rms, mean, entries, name
// gStyle->SetOptStat() default = 000001111
// gStyle->SetOptStat(0) disables Stats Box
gStyle->SetOptStat(001111111);
// fit paramenters box content
gStyle->SetOptFit(111111);
// RooFit library loading
gSystem->Load("libRooFit.so");
using namespace RooFit;
}
===== How to plot .csv files in ROOT =====
Uso **TGraph**
$ root -l
root[] TGraph plot("waveform.csv","%lg , %lg")
root[] plot.SetMarkerStyle(21)
root[] plot.SetMarkerSize(0.7)
root[] plot.Draw("ALP")
Se ho families di curve uso un **TMultiGraph** e creo uno script:
{
TGraph plot1("waveform.csv","%lg , %lg , %*lg ......);
TGraph plot2("waveform.csv","%lg , %*lg , %lg ......);
...
plot1.SetMarkerStyle(21);
plot2.SetMarkerStyle(22);
...
TMultiGraph mgr("mgr","");
mgr.Add(plot1,"LP");
mgr.Add(plot2,"LP");
...
mgr.Draw("A");
}
Poi lo runno semplicemente come
root [] .x scriptName.cpp
===== Exploring the content of a ROOT file =====
$ root -l
root [0]
Attaching file as _file0...
root [1] TBrowser b
====== ======
\\
----
Last update: [[pacher@NOSPAMto.infn.it|Luca Pacher]] - Aug 20, 2013
~~NOTOC~~