Roofit RooAddPdf not accepting RooCmdArgs

Hello Rooters, I have a code that attempts to fit a model to a mass distribution. The model->fitTo() part does not seem to recognize any arguments such as Save() or Extended(). Below is the code snippet

RooAddPdf *model = new RooAddPdf("model", "model", RooArgList(*rap[1], *rap[2], *rap[3], *rap[4], *rap[5]), RooArgList(q1, q2, q3, q4));
RooFitResult *res = model -> fitTo(*rds[0], Extended(), Save());
ofstream os;
os.open("temp_out_roofit.txt");
res -> printArgs(os);
os.close();
res -> Print();

If I leave the arguments in I get the following error:
error: use of undeclared identifier ‘Extended’

If I remove them the fit runs.

I am using Root 6.12 on Ubuntu inside Windows. Any help is greatly appreciated.

Hi,

those symbols are available in the RooFit namespace. There are two solutions: either add a using namespace RooFit; or use RooFit::Extended instead of Extended.

Cheers,
D

Hey, thanks that was it. I guess I missed the namespace declaration in the tutorials. Thanks again.

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