Warning in <TBufferFile::WriteObjectAny>:

Hi, For any RooStats applicaton I am trying to use I am getting a lot of these warning messages, and then the program terminates. Anyone has any idea what are all these warnings messages are and how to get rid of them?
Warning in TBufferFile::WriteObjectAny:
since RooAbsPdf has no public constructor
which can be called without argument, objects of this class
can not be read with the current library. You will need to
add a default constructor before attempting to read it.

Cheers.

Gio

Hi,

What ROOT version are you using?

Wouter

Hi, I am using 5.24. The code compiles under CMT; ROOT is called as an external package. I have no problems using any other ROOT/ROOFit applications…
Cheers.

Gio

Hi,

That’s funny. Class RooAbsPdf has a default constructor in release 5.24

root.cern.ch/viewcvs/tags/v5-24- … iew=markup

and persistence of RooFit objects is known to work in this release.
Are you sure you are picking up the correct ROOT/RooFit version?

Wouter

Hi, I have partially solved this issue… The problem seems to arise from a pdf component which is constructed using the RooNDKeysPdf. It appears that this pdf constructor has a problem with persistence.
Is there any other way to overcome this problem, without the need to change the pdf constructor?

Cheers.

Gio

Hi,

Almost all pdfs can be persisted, but RooNDKeysPdf is an exception
for now because it contains complex STL data members that
are incorrectly parsed by rootcint, so that standard ROOT persistence
wil not work. I am in contact with the author on this, but I do not
foresee a solution on a very short time scale.

Wouter

Hi,

Yes, I am trying to save that type of pdf with a piece of code that looks like:

int toy() 
{ 
    gSystem->Load("libRooFit"); 
    using namespace RooFit; 
    RooRealVar x("x","x",0,20) ; 
    RooPolynomial p("p","p",x,RooArgList(RooConst(0.01),RooConst(-0.01),RooConst(0.0004))) ; 
    RooRealVar y("y","y",0,20); 
    RooPolynomial py("py","py",y,RooArgList(RooConst(0.01),RooConst(0.01),RooConst(-0.0004))); 
    RooProdPdf pxy("pxy","pxy",RooArgSet(p, py)); 
    RooDataSet *data = pxy.generate(RooArgSet(x,y),1000); 
    RooNDKeysPdf pdf("pdf", "pdf", RooArgSet(x,y), *data, "am", 2); 
    RooWorkspace *w = new RooWorkspace("w_sig", "worksapce"); 
    w->import(pdf); 
    w->import(*data); 
    w->writeToFile("sample.root"); 
    return 0; 
} 

But I can’t, I get:

Warning in TBufferFile::WriteObjectAny: since RooNDKeysPdf has no public constructor
which can be called without argument, objects of this class
can not be read with the current library. You will need to
add a default constructor before attempting to read it.
Warning in TClass::TClass: no dictionary for class RooNDKeysPdf::BoxInfo is available
Warning in TStreamerInfo::Build:: RooNDKeysPdf: RooNDKeysPdf::BoxInfo has no streamer or dictionary, data member “_fullBoxInfo” will not be saved

And I am using version 5.34, is this still not available?

Hi,

This should be possible in version 6, using clink instead of CINT. DO you have a simple test program, so we can test this

Best Regards

Lorenzo

Hi,

Yes, sorry for the late response, I did not see your reply. I attached the code if you start a root session in the run directory it compiles and then you have to

root [0] Test_RooNDKeysPdf()

To make it run, you can see that it says:

[#1] INFO:Eval -- RooAbsReal::attachToTree(wt) TTree Float_t branch wt will be converted to double precision [#1] INFO:Eval -- RooAbsReal::attachToTree(wtPRW) TTree Float_t branch wtPRW will be converted to double precision Warning in <TKey::TKey>: since RooNDKeysPdf has no public constructor which can be called without argument, objects of this class can not be read with the current library. You will need to add a default constructor before attempting to read it. Warning in <TClass::TClass>: no dictionary for class RooNDKeysPdf::BoxInfo is available Warning in <TStreamerInfo::Build:>: RooNDKeysPdf: RooNDKeysPdf::BoxInfo has no streamer or dictionary, data member "_fullBoxInfo" will not be saved

Could you please modify it so that it works? then I can adapt accordingly my code.

Thanks.
Test_RooNDKeysPdf.zip (63.3 KB)