Differences between revisions 16 and 17
Deletions are marked like this. | Additions are marked like this. |
Line 16: | Line 16: |
using anafile. | |
Line 17: | Line 18: |
root[i] book(new TArtAnaLoopExample, "ana/example.ana") | root[i] book(new TAlNEBULAExample, "ana/example.ana") |
Line 20: | Line 21: |
root[i] status() root[i] ls() root[i] hn() root[i] hn() |
|
Line 25: | Line 22: |
root[i] clear() // histのみ初期化は今のところ作ってない root[i] book(new TArtAnaLoopExample, "ana/example.ana") root[i] push("ridf/run0002.ridf") |
}}} not using anafile {{{ root[i] book(new TAlSAMURAIExample) root[i] push("ridf/run0001.ridf") |
Line 34: | Line 34: |
root[i] book(new TArtAnaLoopExample, "ana/example.ana") | root[i] book(new TAlNEBULAExample, "ana/example.ana") |
Line 41: | Line 41: |
root[i] nex() // 次のridfファイルの解析に移る | root[i] next() // 次のridfファイルの解析に移る |
Line 56: | Line 56: |
root[i] zoom() // for 2D, xystaはまだ作ってないのでとりあえずこれで代用 | root[i] xysta() // for 2D |
Line 79: | Line 79: |
gH1 is pointer of current hist |
使い方についてざっくばらんに
Contents
login to anaroot
$ anarootlogin username $ root -l root[i] .x hoge.C // マクロを実行 root[i] .q // rootを終了
analysis ridf
using anafile.
root[i] book(new TAlNEBULAExample, "ana/example.ana") root[i] push("ridf/run0001.ridf") root[i] start() ...
not using anafile
root[i] book(new TAlSAMURAIExample) root[i] push("ridf/run0001.ridf") root[i] start() ...
analysis several ridf files
root[i] book(new TAlNEBULAExample, "ana/example.ana") root[i] push("ridf/run0001.ridf") root[i] start() root[i] push("ridf/run0002.ridf") // いつでもpushできる root[i] push("ridf/run0003.ridf") root[i] status() root[i] pop(2) // 二個目に解析を待っているridfを削除 root[i] next() // 次のridfファイルの解析に移る
draw id i to j
root[i] zone(2,3) root[i] ht(1,6)
count events
root[i] stop() // stopしないと刻一刻とevent数が増えていくのでわけがわからなくなる 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")
もしzone()しているのなら、
root[i] ht(1) root[i] hht(2, "same") // hhなんたらは次の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;
macro内でanaloopをまわして解析
for(int i=0; i<10; ++i){ std::ostringstream oss; oss << "nebula" << std::setw(4) << std::setfill('0') << i; nebula0002とか std::string name = oss.str(); clear();book(new TAlNEBULAExample, "ana/hoge.ana"); push(("ridf/nebula/"+name+".ridf").c_str(),1000); //1000events start(); join(); // これで処理が終わるのをまつ hstore(("root/"+name+".root").c_str()); }