ROOT のヒストグラムの内容を python のリストとして得る

基本的に ROOT のヒストグラムならROOTの機能 (Draw) で描画して絵を得るのが素直ですが,python の方でいろいろと処理したい場合に便利?

ビンの下端の値をリストとして得る
[testh.GetBinLowEdge(i+1) for i in range(testh.GetNbinsX())]
ビンの中身をリストとして得る
[testh.GetBinContent(i+1) for i in range(testh.GetNbinsX())]
使用例

ROOT の Draw と matplotlib でプロットしてみる

figure_3

testh


カテゴリー: matplotlib, pyROOT, python, ROOT パーマリンク

コメントを残す