uproot - 与 root_numpy 相比,uproot 中 TTreeMethods.array 的性能较慢
问题描述
我正在使用 root_numpy / uproot 来处理一个 ROOT 文件(包含大约 800 万个事件)。我知道 uproot 只有在大 Tbasket 大小的情况下才能快速,但是,我正在查看一个 TBasket 大小约为 50kB 的分支,并且要读取分支,uproot 需要 70 秒,而 root_numpy 只需要 45 秒,这令人费解,因为我希望完全相反。有没有人对这里出了什么问题以及我该如何解决有任何建议?
这是我的根目录代码:
ttree = uproot.open(file)["TTree"]
array = ttree.array("Branch")
这是我的 root_numpy 代码:
tfile = ROOT.TFile(file,"OLD")
ttree = tfile.Get("TTree")
array = root_numpy.tree2array(ttree,branches="Branch")
解决方案
推荐阅读
- mysql - 返回所有组值除以组中的第一个值
- html - 为什么“最大宽度”被忽略到表格单元格上?
- php - Laravel memcached - 跨域的相同会话
- powershell - 如何更好地格式化此输出?
- jquery - 从 Ajax 请求 (Struts 2 / jQuery) 下载 Excel 文件:“parsererror”、“Invalid XML”或“位置处的 JSON 中的意外标记...”
- angular - 使用 viewChild 读取输入
- android - 为多个图像创建渐变作为背景
- c# - 如何在不改变 x,y 坐标数据的情况下放大/缩小图片框中的图像?
- asp.net-mvc-5 - 模型对象内部变量的 mvc 5 自定义验证
- sbt - 是否可以在 sbt 中使用的 build.properties 文件中添加注释