PyROOT runs into "requested class does not exist" error

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


I’m trying to run a simple script using PyROOT to read a ROOT file. However, I run into a problem with missing classes when doing so. Here’s a bare-bones example to show what I’m doing:

input_file = ROOT.TFile.Open(“DAOD_IDTRKVALID.11500650._000001.pool.root.1”, “read”)
input_tree = input_file.CollectionTree
for event in input_tree:
truth_particles = event.TruthParticles

Traceback (most recent call last):
File “”, line 2, in
TypeError: requested class ‘ROOT::DataVector<xAOD::TruthParticle_v1>’ does not exist

In general, many classes are missing, such as xAOD::TruthPileupEvent_v1, DataVector<xAOD::Electron_v1>, DataVector<xAOD::Muon_v1> etc. How can I get PyROOT to import the correct classes?



this is a question for an ATLAS specific forum. PyROOT is able to create any class provided that its dictionaries are available or the headers where it is defined known to the interpreter. It looks like the libraries of your data model are not available to PyROOT due to a misconfiguration perhaps.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.