Is there a way to list user-defined classes in a workspace before loading it?

If a workspace is built with custom classes, e.g. custom pdfs, users will get a segmentation fault when trying to load the workspace before loading the corresponding custom classes into ROOT.
e.g.

import ROOT
rfile = ROOT.TFile("my_workspace.root")

This will give the following warning if the user-defined class HggBernstein is not loaded.

TClass::Init:0: RuntimeWarning: no dictionary for class HggBernstein is available

Then if user proceed to load the workspace

workspace = rfile.Get("ws")

This will cause a seg fault

Error in <TBufferFile::ReadObject>: trying to read an emulated class (HggBernstein) to store in a compiled pointer (RooAbsArg)
 *** Break *** segmentation violation

Is there a way for a user to check beforehand that a workspace contains user-define classes that are without dictionaries to prevent a seg fault?

Thanks a lot!

Hi @AlkaidCheng ,

sorry for the high latency! I think RooFit should not crash but rather report an error in this case. @jonas or @moneta can correct me if I’m wrong (and/or suggest a workaround) – let’s ping them.

Cheers,
Enrico

Hi,

The problem is in the ROOT I/O not roofit when reading the workspace. Can you please upload this workspace causing the crash so I can see what can be done

Best,

Lorenzo

Hi, I have shared the workspaces with you in a private message since they are internal analysis workspaces.

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