How to get all RooConstVar objects from a RooWorkspace?

I have a workspace where there’re several RooConstVar objects inside. May I ask how I can retrieve all of them without knowing the names?

Hi Kunlin,

Thanks for the post.
I add in the loop our RooFit experts, @jonas @moneta , that can provide hints if this is something supported.

Best,
D

Thank a lot Danilo! I managed to use something like this:

comp=ws.components()

for iComp in comp:
    if iComp.IsA()==ROOT.RooConstVar.Class():
        print('found!')

Let me know if it makes sense.

Cheers,
Kunlin

1 Like

Nice! Thanks for sharing!

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