Deprecated
: Array and string offset access syntax with curly braces is deprecated in
/mnt/hep_web/hep_web/member/n-kota/dokuwiki/inc/init.php
on line
542
✎ ja:root:ttree [GiriWiki]
内容へ移動
GiriWiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
トレース:
ja:root:ttree
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== TTree ====== ---- ==== 読み込むBranchを限定する ==== === 方法1 -SetBranchStatus === デフォルトではGetEntryすると、SetBranchAddressで指定されていないBranchまでも読みにいく(らしい)。 treeに多数のBranchが入っていて、その一部だけを使う場合、これは非常に無駄になる。 Branchを読み込む・読み込まないを指定するメソッドが、SetBranchStatus である。 <code c_mac> tree->SetBranchStatus("*",0); //まず全体を読み込まない様に指定 tree->SetBranchStatus("Detector.nHit",1); //次いで、使用するものを順次読み込む設定に変えていく tree->SetBranchStatus("Detector.hits.*",1);//クラス化されているものはワイルドカードで指定したりもできる </code> このとき、先に0番目のEntryをGetEntryしてやらなければならないらしい。http://root.cern.ch/root/roottalk/roottalk03/4900.html 理由は不明。 具体的には以下のようにする。 <code c_mac> tree->SetBranchAddress("hoge",&hoge); tree->SetBranchAddress("hogehoge.",&hogehoge); ・ ・ ・ tree->GetEntry(0); tree->SetBranchStatus("*",0); tree->SetBranchStatus("Detector.nHit",1); tree->SetBranchStatus("Detector.hits.*",1); ・ ・ ・ 以下 event loop </code> === 方法2 -TBranch::GetEntry===
ja/root/ttree.1427872127.txt.gz
· 最終更新: 2015/04/01 07:08 by
kota
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ