Menu

#86 Error in <TVirtualFFT::FFT>: plugin failed to create TVirtualFFT object

v1.0 (example)
open
nobody
FFTW lib (1)
5
2014-11-02
2014-11-02
Ruchika
No

Hi

I am trying to use RooFit to do the convolution of two pdfs (Crystall Ball and a Voigtian) but I run into this issue with libFFTW.so. The fftw package has been downloaded and the path has been added to the LD_LIABRARY_PATH. Even then it complains with this errror:

Error in <tpluginhandler::setupcallenv>: class TFFTRealComplex not found in plugin FFTW
Error in <tvirtualfft::fft>: plugin failed to create TVirtualFFT object
Error in <tvirtualfft::fft>: plugin failed to create TVirtualFFT object
Error in <tpluginhandler::setupcallenv>: class TFFTComplexReal not found in plugin FFTW
Error in <tvirtualfft::fft>: plugin failed to create TVirtualFFT object</tvirtualfft::fft></tpluginhandler::setupcallenv></tvirtualfft::fft></tvirtualfft::fft></tpluginhandler::setupcallenv>

This is the standalone macro I am trying to use:


void fitTop()
{

gROOT->SetStyle("Plain");
gStyle->SetOptStat(111111);

std::cout<<"open the root file"<<std::endl; tfile="" *f="new" tfile("="" export="" home="" jveatch="" testarea="" topanalysis="" rel18="" d5pd="" v03="" d5pdmacros="" jmr.2014.10.17.root");="" th1d="" *histo="(TH1D*)" f-="">Get("data_sig_FJetsM_akt10_fjTop_300in_iso_fj");</std::endl;>

//------------------------------------
// define x range and frame
//------------------------------------
std::cout<<"defined"<<std::endl;
RooRealVar x("Top Mass","Mass",100.,250.,"GeV/c^{2}") ;
RooPlot frame = x.frame(Title("Fit for M_{T}")) ;
TCanvas
c1 = new TCanvas("c1","c1",20,20,600,600);

//------------------------------------
// import histo
//------------------------------------
std::cout<<"imported histo"<<std::endl;
RooDataHist *datah;
datah = new RooDataHist("datah","datah",x,histo);

datah->plotOn(frame,Name("datah"),
DataError(RooAbsData::SumW2),MarkerColor(kBlack),MarkerSize(0.8),XErrorSize(0.));

//------------------------------------
// define Voigitian Fitting Function
//------------------------------------

// Construct the voigtian pdf by defining parameters.

RooRealVar mean ("mean", "mean of the voigtian", 173.2,155,175);
RooRealVar width ("width", "width of Voigtian", 2,0,10);
RooRealVar sigma ("sigma", "sigma of the gaussian", 2, 0, 20);
RooVoigtian gauss("gauss", "gauss", x, mean, width, sigma);

// fix the number of signal events in the histogram
RooRealVar nsig("nsignal","nsignal",1500 ,1400,1800);
RooExtendPdf esig("esig","esig",gauss,nsig);

//------------------------------------
// define Crystal Ball
//------------------------------------

RooRealVar cbmean("cb mean","cb_mean",173.2,155,175);
RooRealVar cbwidth("cb width","cb_width",2,0.0,10);
RooRealVar cbn("cb n","cb_n",150,100,250);
RooRealVar cbalpha("cb alpha","cb_alpha",10,0,10.);
RooCBShape cb("cb","cb",x,cbmean,cbwidth,cbalpha,cbn) ;
RooExtendPdf esig1("esig1","esig1",cb,nsig);

// set the range of the fit
x.setRange("fitrange",100.,250.);

// convolute the pdfs together
//--------------------------------------------
RooFFTConvPdf sum1("sum1","convulted pdf for signal and bkg",x,gauss,cb);
RooFitResult r1;
r1 = sum1.fitTo(
datah,Range("fitrange"),Extended(kTRUE),Save()) ;
sum1.plotOn(frame,Components("sum1"),LineColor(kPink),LineStyle(kDashed));
frame->Draw();
}


I would appreciate any help.
Thanks,
Ruchika

Discussion


Log in to post a comment.