Differences between revisions 18 and 19
Deletions are marked like this. | Additions are marked like this. |
Line 18: | Line 18: |
root[i] book(new TAlNEBULAExample, "ana/example.ana") root[i] push("ridf/run0001.ridf") |
root[i] book(new TAlEncExample, "ana/example/nebula.ana") root[i] push("ridf/dayone0123.ridf") |
Line 27: | Line 27: |
root[i] push("ridf/run0001.ridf") | root[i] push("ridf/dayone0123.ridf") |
Line 34: | Line 34: |
root[i] book(new TAlNEBULAExample, "ana/example.ana") | root[i] book(new TAlEncExample, "ana/example.ana") |
Line 109: | Line 109: |
for(int i=0; i<10; ++i){ std::ostringstream oss; oss << "nebula" << std::setw(4) << std::setfill('0') << i; like nebula0002 std::string name = oss.str(); clear();book(new TAlNEBULAExample, "ana/hoge.ana"); push(("ridf/nebula/"+name+".ridf").c_str(),1000); // 1000events start(); join(); // wait analysis finish hstore(("root/"+name+".root").c_str()); } |
book(new TAlEncExample, "ana/hoge.ana"); spush("ridf/sm_dayone/sdaq02/dayone",".ridf",1,10); // dayone0001.ridf, ..., dayone0010.ridf start(); join(); // wait analysis finish hstore("root/temp.root"); |
About How to do something.
Contents
login to anaroot
$ anarootlogin username $ root -l root[i] .x hoge.C // execute macro root[i] .q // finish root
analysis ridf
using anafile.
root[i] book(new TAlEncExample, "ana/example/nebula.ana") root[i] push("ridf/dayone0123.ridf") root[i] start() ...
not using anafile
root[i] book(new TAlSAMURAIExample) root[i] push("ridf/dayone0123.ridf") root[i] start() ...
analysis several ridf files
root[i] book(new TAlEncExample, "ana/example.ana") root[i] push("ridf/run0001.ridf") root[i] start() root[i] push("ridf/run0002.ridf") // you can push at anytime root[i] push("ridf/run0003.ridf") root[i] status() root[i] pop(2) // delete 2nd ridf file waiting analyzed root[i] next() // go to next ridf file at once
draw id i to j
root[i] zone(2,3) root[i] ht(1,6)
count events
root[i] stop() // you have to stop because event number will increase every moment root[i] ls() root[i] ht(5) root[i] xsta() // for 1D root[i] xysta() // for 2D root[i] start() // resume
Draw same
root[i] ht(1) root[i] ht(2, "same")
if you are dividing canvas、
root[i] ht(1) root[i] hht(2, "same") // hh something means draw histogram without going to next pad
save/read hist
... root[i] hstore("hist.root") // save root[i] fetch("hist.root") // read
access to current hist
gH1 is pointer of current hist
root[i] gH1->GetName() root[i] gH1->Draw("COLZ")
access to hist by ID
root[i] gethist(i)->GetName() root[i] gethist(i)->Draw("same")
fit 2D hist by polynomial
root[i] ht(2) root[i] pfx() root[i] fitp(1) //linear
get fit result
root[i] ht(3) root[i] TFitResultPtr frp = fitp(1) root[i] std::cout << frp->Parameter(0) << " " << frp->ParError(0) << std::endl; root[i] std::cout << frp->Parameter(1) << " " << frp->ParError(1) << std::endl; root[i] std::cout << frp->Parameter(2) << " " << frp->ParError(2) << std::endl;
analysis in macro
book(new TAlEncExample, "ana/hoge.ana"); spush("ridf/sm_dayone/sdaq02/dayone",".ridf",1,10); // dayone0001.ridf, ..., dayone0010.ridf start(); join(); // wait analysis finish hstore("root/temp.root");