一个基于python的命令行工具,用于读取根文件。
peroose的Python项目详细描述
过氧
一个基于python的命令行工具,用于读取根(https://root.cern.ch/)文件。在
安装
pip install peroose
使用
要检查根文件:
^{pr2}$这将加载TTree(如果文件包含)并启动IPython 替换。将定义以下变量:
filelist : List[str]
找到的文件列表。在tree : Optional[TTree]
找到根目录树。在tfile : Optional[TFile]
找到第一个根TFile。在
使用示例:
print(filelist)# see the files that were found.tree.Draw("branch_name")# make a plot!tfile.ls()# use the TFilebr=TBrowser()# inspect files in the TBrowser
为了方便起见,将以下内容导入REPL local作用域:
importnumpyasnpimportmatplotlib.pyplotaspltimportROOT.TFileasTFile# only if pyROOT is installedimportROOT.TBrowserasTBrowser# only if pyROOT is installed
有关更多选项,请参见:
python -m peroose --help
- 项目
标签: