我正在尝试使用 uproot 从 Delphes .root 输出文件中进行一些基本选择。Delphes 的 c++ 代码示例循环遍历事件并访问重构的 BranchElements,它具有访问属于各种类的分支元素的方法。
例如,根文件包含一个<TBranchElement b'Jet' at 0x7fb36526b3c8>(在 c++ 中)Delphes 示例代码可以用来进入object=jet->Constituents.At(i)“for”循环,然后如果这object是一个object->IsA() == Tower::Classthen 调用object->P4()来获取 4momentum。因此,虽然使用 uproot 只能分别获取这两个值,但在 Delphes 示例中,使用 Jet 类使用一种方法来访问 Tower 类(从中重建 Jet)。
我看到的信息是:
Jet_size (no streamer) asdtype('>i4')
Jet TStreamerInfo asdtype('>i4')
Jet.fUniqueID TStreamerBasicType asjagged(asdtype('>u4'))
.
.
.
Jet.Constituents TStreamerInfo asgenobj(SimpleArray(TRefArray))
<TBranchElement b'Jet' at 0x7fb3657825f8>
<TBranchElement b'Jet.Constituents' at 0x7fb47840cba8>
对于 uproot,如果将 TBranchElement 作为数组加载,则只能访问 中的数组元素Jet.Constituents[i],它们是数字列表。我如何能够以Jet.Constituents引用Tower.PT它包含的(或 eta、phi 等)值的方式加载?