#include "RooRealVar.h" #include "RooDataSet.h" #include "RooGaussian.h" #include "TCanvas.h" #include "TAxis.h" #include "RooPlot.h" #include "RooFitResult.h" #include "RooGenericPdf.h" #include "RooConstVar.h" using namespace RooFit ; void savewpace(){ RooRealVar x("x","x",-20,20) ; RooRealVar alpha("alpha","alpha",5,0.1,10) ; TString format_a = "(1+0.1*abs(x)+sin(sqrt(abs(x*alpha+0.2))))"; TString format_b = "(1+0.1*x**2+0.2*x**3)"; TString format = TString::Format("%s*%s",format_a.Data(),format_b.Data()); RooGenericPdf genpdf("genpdf","genpdf",format,RooArgSet(x,alpha)) ; RooWorkspace *wspace = new RooWorkspace("wspace","wspace"); wspace->import(genpdf); wspace->writeToFile("wspace_signal.root"); }