Rooworkspace: persistency of user-defined pfds

hi all

i’d need to import into a rooworkspace a set of user-defined pdfs, and then write them to a file. but i must be doing something wrong.

find here an example: /afs/cern.ch/user/p/pandolf/public/example.tar

instructions:

tar xvf example.tar
cd example
make writeWorkspace
./writeWorkspace

it should produce the following error:

[blablabla]
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.

and indeed the resulting rootfile is empty.

what is the correct way of doing this?

i’ve read this post: Custom PDF in RooWorkspace

but it doesnt seem to solve the problem (that code used interactive ROOT, i use compiled).

thanks in advance
f

sorry for harassing, but if someone could answer before the weekend it would be truly grand, as i have a deadline approaching.

thanks again
f

Hello,

Is the issue there when compiling or when running? Since you have dependencies on other software for compiling I cannot check. I see a binary I cannot try so I assume that it is when running.

I assume your issue is whith importing some of your costum defined PDFs to the workspace.

What is RooCB.cc? A Crystal Ball? Why not use the CB PDF provided by RooFit instead?

Could you provide a simplest self-enclosed example of the issue that could be run by me and reproducing the problem? (And attach to the POST or send an HTTP link rather than on AFS).

Did you try to save some of the other PDF to the workspace instead of the product of 3: such as each of the individual 3 in that product of some in the convolution to see where the issue starts to arise?

Regards,

– Gregory

hi gregory

thanks for the assistance.

i put it here: dl.dropbox.com/u/795265/example.zip

that should be the simplest self-enclosed example you’re talking about, let me know if the instructions i provided work. (its the same as the one i had on afs, only that i did a make clean to remove the .o objects and the executable).

so the program compiles but when running it spits out that error log, and the produced rootfile (the one with the RooWorkspace inside it) is empty.

RooCB is identical to RooCBShape, but it has an additional parameter theta which rotates alpha and width into each other (its needed for an application of mine).

f

hi gregory

are you able to reproduce the problem?

f

no news?

f

I cannot reproduce the problem (doesn’t compile and cannot run it interactively) but I’m working on it. I should have also asked what ROOT release you are using.

– Gregory

Hello,

I’ve added:

ClassImp(RooDoubleCB) to the .cc files and
ClassDef(RooDoubleCB,1) to the .h files

and then I could run your macro in CINT without problem (tested in ROOT 5.30.03). It produces a workspace:

[code]RooWorkspace(w) w contents

variables

(BW_mean,BW_n,BW_sigma,CB_alpha1,CB_alpha2,CB_n1,CB_n2,CMS_hzz2l2q_mZZ,CMS_hzz2l2q_sig0p1,CMS_hzz2l2q_sig0p2,cutOff2_SIG,cutOff_SIG,g2_SIG,g_SIG)

p.d.f.s

RooRelBW::BW[ x=CMS_hzz2l2q_mZZ mean=BW_mean width=BW_sigma n=BW_n ] = 6.25e-08
RooDoubleCB::CB_SIG[ x=CMS_hzz2l2q_mZZ mean=CMS_hzz2l2q_sig0p1 width=CMS_hzz2l2q_sig0p2 alpha1=CB_alpha1 n1=CB_n1 alpha2=CB_alpha2 n2=CB_n2 ] = 0.000403023
RooFermi::fermi2_SIG[ x=CMS_hzz2l2q_mZZ cutOff=cutOff2_SIG beta=g2_SIG ] = 0.986423
RooFermi::fermi_SIG[ x=CMS_hzz2l2q_mZZ cutOff=cutOff_SIG beta=g_SIG ] = 0.999962
RooFFTConvPdf::sig[ BW(CMS_hzz2l2q_mZZ) (*) CB_SIG(CMS_hzz2l2q_mZZ) ] = 0.0113634
RooProdPdf::signal[ sig * fermi_SIG * fermi2_SIG ] = 0.0653684

embedded class code

RooCB, RooDoubleCB, RooFermi, RooRelBW

embedded precalculated expensive components

uid = 0 key=sig_BW_CONV_CB_SIG_CACHEHIST_Obs[CMS_hzz2l2q_mZZ]_BufFrac1.0_BufStrat0 value=RooDataHist::sig_BW_CONV_CB_SIG_CACHEHIST_Obs[CMS_hzz2l2q_mZZ]_BufFrac1.0_BufStrat0 parameters=( BW_mean=400 BW_n=0 BW_sigma=10 CB_alpha1=1 CB_alpha2=1 CB_n1=1.7 CB_n2=2.2 CMS_hzz2l2q_sig0p1=16 CMS_hzz2l2q_sig0p2=6.4 )
[/code]

Could that be the problem? I didn’t test in compile mode.

PS: why are you importing the definition of the RooAbsPdf class in the workspace too?

– Gregory

hi gregory

thanks again for the effort.

i’m using root version 5.27/06b. this is the complete list of commands i do when compiling on afs:

g++ -Wall -c -g -I. -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//include -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/include/ -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/CommonTools -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/ RooFermi.cc /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//bin/root-config --cflags --libs -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//lib -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/lib/ -lHtml -lMathCore -lGenVector -lMinuit -lEG -lRooFitCore -lRooFit
g++ -Wall -c -g -I. -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//include -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/include/ -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/CommonTools -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/ RooCB.cc /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//bin/root-config --cflags --libs -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//lib -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/lib/ -lHtml -lMathCore -lGenVector -lMinuit -lEG -lRooFitCore -lRooFit
g++ -Wall -c -g -I. -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//include -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/include/ -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/CommonTools -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/ RooDoubleCB.cc /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//bin/root-config --cflags --libs -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//lib -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/lib/ -lHtml -lMathCore -lGenVector -lMinuit -lEG -lRooFitCore -lRooFit
g++ -Wall -c -g -I. -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//include -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/include/ -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/CommonTools -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/ RooRelBW.cc /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//bin/root-config --cflags --libs -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//lib -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/lib/ -lHtml -lMathCore -lGenVector -lMinuit -lEG -lRooFitCore -lRooFit
g++ -Wall -I. -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//include -I/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/include/ -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/CommonTools -I/afs/cern.ch/user/p/pandolf/scratch1/CMSSW_4_2_3_patch5/src/UserCode/pandolf/ -o writeWorkspace writeWorkspace.cpp RooFermi.o RooCB.o RooDoubleCB.o RooRelBW.o /afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//bin/root-config --cflags --libs -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/root/5.27.06b-cms16//lib -L/afs/cern.ch/cms/slc5_amd64_gcc434/lcg/roofit/5.28.00a-cms5/lib/ -lHtml -lMathCore -lGenVector -lMinuit -lEG -lRooFitCore -lRooFit

(not sure if it helps you).

as for the import of rooabspfd, i agree its not necessary, i was only trying to make it work. but taking it out doesnt solve the issue.

how can i make this work in compiled mode?

f

Hello,

Sorry, I didn’t manage to make it work and it’s taken too much of my time so I think I’ll give up on this one. Hopefully someone more knowledgeable with LinkDef, Makefile and class definitions will be able to help further.

Adding -l Foam make the Makefile work and I was able to reproduce the error message you reported using a standalone ROOT 5.30.03

– Gregory