Cannot find generic objects in workspace


Below is a very simple reproducer of something that seems a problem:

x=ROOT.RooRealVar('x', '', 0, 10) 
m=ROOT.RooRealVar('m', '', 0, 10) 
s=ROOT.RooRealVar('s', '', 1, 10) 

g=ROOT.RooGaussian('g', '', x, m, s)


obj   = w.genobj('g')
l_obj = w.allGenericObjects()

if not obj:
    print('Not found')


The workspace has objects, neither function is able to find them:


Please read tips for efficient and successful posting and posting code

_ROOT Version:6.24/06
Platform: linuxx8664gcc
_Compiler: linuxx8664gcc

Hi @rooter_03 ,
we need @moneta 's or @jonas 's help here, let’s ping them – but please consider that things might be slow during the holiday season.


Hi @eguiraud

It’s ok, I found a workaround. I am just letting you know so that it gets taken care some day.


alright then please consider converting this post into a bug report at .


Hi @rooter_03, thanks for reporting!

This is the expected behavior, actually. A RooWorkspace can contain 4 classes of object:

  1. A RooAbsArg, which you can get with arg() (or var()/pdf() if the object is a RooRealVar/RooAbsPdf)
  2. A RooAbsData, which you can get with data()
  3. A RooArgSet, which you can get with set()
  4. Any other object of a class inheriting from TObject, which you can get with genobj()

If you want to retrieve any object, no matter which of the 4 cases it belongs to, you do this with RooWorkspace::obj() and not RooWorkspace::genob()j.

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