Cristal Ball function

Hi,
I would like to create a cristal ball function with TF1 object.
I know that the CB exist in RooFit library. My code is :


double E_fct(double z){
double z=0;
RooCBShape *CBall=new RooCBShape(“CBall”,“CBall”,z,66.0,57.9,-0.84,12.56);
return CBall->evaluate();
}

TF1 t1(“t1”,“E_fct(x)”,0,800);


with :
gSystem->Load(“libRooFit”);
gSystem->Load(“libRooFitCore”);
#include
#include “RooFit.h”
#include “RooMath.h”
#include “RooCBShape.h”

But it doesn’t work. I have the following error message :

Error: Can’t call RooCBShape::RooCBShape(“CBall”,“CBall”,z,66.0,57.9,-0.84,12.56) in current scope Integration.C:40:
Possible candidates are…
(in RooCBShape)
/nfs/soft/root/root_v5.26.00.Linux-slc5_ia32-gcc3.4/lib/libRooFit.so -1:-1 0 public: RooCBShape RooCBShape::RooCBShape(void);
/nfs/soft/root/root_v5.26.00.Linux-slc5_ia32-gcc3.4/lib/libRooFit.so -1:-1 0 public: RooCBShape RooCBShape::RooCBShape(const char* name,const char* title,RooAbsReal& _m,RooAbsReal& _m0,RooAbsReal& _sigma,RooAbsReal& _alpha,RooAbsReal& _n);
/nfs/soft/root/root_v5.26.00.Linux-slc5_ia32-gcc3.4/lib/libRooFit.so -1:-1 0 public: RooCBShape RooCBShape::RooCBShape(const RooCBShape& other,const char* name=0);
(in RooAbsPdf)
(in RooAbsReal)
(in RooAbsArg)
(in RooPrintable)
(class G__CINT_ENDL)148062616

Line 40 is : RooCBShape *CBall=new RooCBShape(“CBall”,“CBall”,z,66.0,57.9,-0.84,12.56);

What’s wrong ?

Cheers,
Arnaud.

Hi,

I have a quick suggestion: maybe it helps (at least for using RooFit):

double E_fct(double z){
double z=0;
RooRealVar zz(“zz”,"",z);
RooCBShape *CBall=new RooCBShape(“CBall”,“CBall”,zz,RooConst(66.0),RooConst(57.9),RooConst(-0.84),RooConst(12.56));
return CBall->evaluate();
}

Regards,

– Gregory