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

Nice! Thanks for sharing!