You are not allowed to do newaccount on this page. Login and try again.

Clear message
Locked History Actions

ANAROOT/Manual/reference

Known Problems

In ANAROOT, analysis goes in background (using TThread class). This is useful feature, but since ANAROOT is NOT completely thread safe, some times strange bug occur. Known problem is following...

  • doing something very fast, very rare but sometimes crash.
  • Cannot draw branch of tree(TTree) while analysis is running. This is particular problem for tree consists CLASS. If you are using tree as ntuple, this problem will not occur.
  • TFile::Write() function will cause freeze if you call in sub-thread (namely like TAlXXXExample::Destruct or others). If you want to write TFile, call write function on main-thread(namely command line).

class relation of ANAROOT

(Unofficial) UML of ANAROOT

uml_anaroot.pdf

command reference

Global Variables

gH1

Pointer of last histogram which was drawn. This make easy to use ROOT native command of current histogram.

TH1* gH1;
// ex. std::cout << gH1->GetName() << std::endl;

Commands for Analysis Management

book

Register "analoop" and "anafile" to TArtAnaLoopManager. If you want to usr your own analoop class or not to use anafile, please contact to Tanaka@Tokyo Institute of Technology

void book(TArtAnaLoop* analoop, const char* anafilename = 0);
// ex. book(new TArtAnaLoopUser, "ana/user.ana");

push

Add RIDF file to stack. Check stack by status() command.

void push(const char* filename, int eventnumber = -1);
void push(int sid = 0, int eventnumber = -1);
// ex.
// push("ridf/run0001.ridf"); //offline
// push(); //online
// push(1); //online, sid (shared memory ID) = 1

spush

Add some RIDF file to stack at once.

void push(const char* filename_start, const char* filename_end, int start, int end, int width = 4, char fill = '0');
// ex.
// push("ridf/run", ".ridf", 1,11); // add ridf/run0001.ridf to ridf/run0011.ridf
// push("ridf/nebula", ".ridf", 12, 111, 5); // add ridf/nebula00012.ridf to ridf/nebula00111.ridf

pop

Remove RIDF file from stack. Check stack by status() command.

void pop(int i);
// ex. pop(1)

start

Start analysis. Construct() of TArtAnaLoop will be called for the first time.

void start();

stop

Stop analysis. You can resume by start() command.

void stop();

next

Skip remaining event of current RIDF file and go to next RIDF file.

void next();

join

Wait current analysis to finish. This function need when you are using macro.

void join();
// ex. push("ridf/0001.ridf", 10000);start();join();ht(2);

end

End current analysis. Destruct() of TArtAnaLoop will be called.

void end();

clear

Clear all histograms and destruct TArtAnaLoopManager.

void clear();

status

Print status of current Analysis.

void status();

Commands for Histogram Management

fetch

Read all TH1 object in file(filename) to current ROOT directory.

void fetch(char* filename);
// ex. fetch("root/hist.root");

hstore

Write all TH1 object in current ROOT directory to file(filename)

void hstore(char* filename);
// ex. hstore("ridf/hist2.root");

hdel

Delete TH1 objects in current ROOT directory.

void hdel(); // delete all
void hdel(int id); //delete by id
void hdel(int idstart, int idend); //delete hist between idstart and idend
// ex. hdel(2,4);

erase

Reset all TH1 objects in current ROOT directory.

void erase();
// ex. erase();

ls

Show list of hist in current directory.

void ls();

lv (only for AnaFile user)

Show list of EAnalyser and EWNum.

void lv();

lc (only for AnaFile user)

Show list of Cut.

void lc();

ht, htp, hn, hb

Move to next pad and ...

void ht(int id, Option_t* option = ""); // draw hist by id. You can use draw option like "same".
void ht(int idstart, int idend); // draw hist from idstart to idend.
void htp(); // draw current hist.
void hn(); // draw next hist.
void hb(); // draw previous hist.
// ex. hn(); ht(3,"same");

hht, hhtp, hhn, hhb

Not Moving version of ht, htp, hn, hb.

(same as above command)

sh

Sequential hn,hb,ht(i),htp. Draw next: press n key, Draw previous: press p key, ... try and see message

void sh();

lg, ln, lgx, lgy, lgz, lnx, lny, lnz

Set/Unset log scale

void lg(); //do lgx, lgy, and lgz
void ln(); //do lnx, lny, and lnz
void lgx(); //set xaxis of all pad to logscale
void lgy(); //set yaxis of all pad to logscale
void lgz(); //set zaxis of all pad to logscale
void lgx(Int_t subpadnumber); //set xaxis of pad at subpadnumber to logscale
void lgy(Int_t subpadnumber); //set xaxis of pad at subpadnumber to logscale
void lgz(Int_t subpadnumber); //set xaxis of pad at subpadnumber to logscale
void lnx(); //unset lgx of all pad
void lny(); //unset lgy of all pad
void lnz(); //unset lgz of all pad
void lnx(Int_t subpadnumber); //unset lgx of supadnumber
void lny(Int_t subpadnumber); //unset lgy of supadnumber
void lnz(Int_t subpadnumber); //unset lgz of supadnumber

size

Change size of canvas.

void size(UInt_t ww, UInt_t wh);
// ex. size(600,600);

cd, cdn, cdb

cd to...

void cd(Int_t subpadnumber = 0); // subpadnumber(0 is assigned to root canvas)
void cdn(); // next subpad
void cdb(); // previous subpad

zone

Divide canvas(not gPad).

void zone(Int_t nx = 1, Int_t ny = 1, Float_t xmargin = 0.01, Float_t ymargin = 0.01, Int_t color = 0);

xval (gui), yval (gui), xyval (gui)

Print values where you click.

Double_t xval(); // only x-axis value
Double_t yval(); // only y-axis value
void xyval(); // both x- and y-axis value

zoom, zoom (gui), unzoom

zoom and unzoom

void zoom(double firstx, double lastx, double firsty = 0, double lasty = -1, double firstz = 0, double lastz = -1);
void zoom();
void unzoom();

hsta

Print statics of current hist.

void hsta();

xsta (gui), xysta (gui)

Print statics of selected region

void xsta();
void xysta();

cpro (gui)

Cut out selected region of TH2

void cpro();

fit, fitp, fite, fitg, fitl, figa, xfitp (gui), xfite (gui), xfitg (gui), xfitl (gui)

Fit(p:polynomial, e:exponential g:gaussian, l:landau). General fit can be done by fit()(see ROOT Manual). You can access to fitting result via TFitResultPtr.

TFitResultPtr fit(const char* formula, Option_t* option = "S", Option_t* goption = "", Double_t xmin = 0, Double_t xmax = 0);
TFitResultPtr fitp(int n = 1, Double_t xmin = 0, Double_t xmax = 0, Option_t* option = "S", Option_t* goption = "");
TFitResultPtr fite(Double_t xmin = 0,  Double_t xmax = 0, Option_t* option = "S", Option_t* goption = "");
TFitResultPtr fitg(Double_t xmin = 0,  Double_t xmax = 0, Option_t* option = "S", Option_t* goption = "");
TFitResultPtr fitl(Double_t xmin = 0,  Double_t xmax = 0, Option_t* option = "S", Option_t* goption = "");
void figa(); // auto fit by gaussian.

TFitResultPtr xfitp(int n = 1);
TFitResultPtr xfite();
TFitResultPtr xfitg();
TFitResultPtr xfitl();

hcut (only for AnaFile user)

Create a graphical cut(same as TCutG) and write into file.

TCutG* hcut(int id = 0, const char* filename = 0, const char* cutname = 0);
// ex. hcut(1001, "my.cut", "t_gate");

cdraw (only for AnaFile user)

Draw cut region to current pad(current version support only hcut). "id" could find by "lc" command.

void cdraw(int id);
// ex. cdraw(1001);

chbin

Change bin.

void chbin(Int_t ngroupx, Int_t ngroupy = 1, Int_t ngroupz = 1);
// ex. chbin(2);

pfx, pfy

profile of hist.

void pfx();
void pfy();

prx, pry

projection of hist

void prx();
void pry();

slx, sly

slice of hist

void slx(Int_t num);
void sly(Int_t num);
// ex. sly(16);

bnx, bny

projection bins between first and last

void bnx(double firsty, double lasty, Option_t* option = "");
void bny(double firstx, double lastx, Option_t* option = "");
// ex. bnx(100,200);

blow (gui), blowxyz, blowx, blowy, blowz

blow hist.

void blow();
void blowxyz(double firstx = 0, double lastx = -1,
             double firsty = 0, double lasty = -1,
             double firstz = 0, double lastz = -1);
void blowx(double firstx = 0, double lastx = -1);
void blowy(double firsty = 0, double lasty = -1);
void blowz(double firstz = 0, double lastz = -1);
// ex. blowx(100, 300);

scale, add, sub, multiply, divide

operations on histograms. only newest version (branches/2012SAMURAI.dayone.tanaka) considers errors propagation.

void scale(Double_t c); //scale by factor c
void add(Int_t id1, Int_t id2, Double_t c1=1, Double_t c2=1); // add between two hist
void sub(Int_t id1, Int_t id2, Double_t c1=1, Double_t c2=1); // sub between two hist
void multiply(Int_t id1, Int_t id2, Double_t c1=1, Double_t c2=1); // multiply between two hist
void divide(Int_t id1, Int_t id2, Double_t c1=1, Double_t c2=1); // divide between two hist
// ex. add(1, 3, 1.3, 0.8);

mami

change min and max.

void mami(double min, double max);
// ex. mami(100,1000);

print

print current canvas to file.

void print(char* filename = "", Option_t* option = "");
// ex. print("temp.eps");

update

Update canvas. Use in your macros.

void update();

raisewindow

Raise Window. Use in your macros.

void raisewindow();

wait

Press ENTER to continue. Use in your macros.

void wait();

watch

like UNIX command

void watch(const char* command, UInt_t milliSec = 1000, Int_t num = 3);
// ex. ht(1); watch("hn();update();", 1000, 10);