Strange things after installing FFWT and enabling RooFit

Hi there,

I have been using ROOT 6 to run some codes for my project on Ubuntu 14.04. The codes ran just fine until I installed FFTW and reconfigured ROOT with “–enable-roofit”. I have received a lot of redefinition errors when running the codes. This is the message:

Info in <TUnixSystem::ACLiC>: creating shared library /home/nhnguyen/root6/macros/./aragorn_C.so Info in <ACLiC>: script has already been loaded in interpreted mode Info in <ACLiC>: unloading /home/nhnguyen/root6/macros/./quink.C and compiling it Info in <TUnixSystem::ACLiC>: creating shared library /home/nhnguyen/root6/macros/./quink_C.so In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:24:18: error: redefinition of 'Rfunc' double RLAfuncs::Rfunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:24:18: note: previous definition is here double RLAfuncs::Rfunc(double *t, double *par) ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:47:18: error: redefinition of 'Lfunc' double RLAfuncs::Lfunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:47:18: note: previous definition is here double RLAfuncs::Lfunc(double *t, double *par) ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:56:18: error: redefinition of 'Afunc' double RLAfuncs::Afunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:56:18: note: previous definition is here double RLAfuncs::Afunc(double *t, double *par) ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:74:18: error: redefinition of 'RLAconv' double RLAfuncs::RLAconv(double tt, double t_R, double sigmaL, double t_... ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:74:18: note: previous definition is here double RLAfuncs::RLAconv(double tt, double t_R, double sigmaL, double t_... ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:11: /home/nhnguyen/root6/macros/Qfuncs.cxx:26:16: error: redefinition of 'PadRect' double Qfuncs::PadRect(double tt, double xl, double xh, double yl, doubl... ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:26:16: note: previous definition is here double Qfuncs::PadRect(double tt, double xl, double xh, double yl, doubl... ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:11: /home/nhnguyen/root6/macros/Qfuncs.cxx:65:16: error: redefinition of 'TestTri' double Qfuncs::TestTri(double tt) ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:65:16: note: previous definition is here double Qfuncs::TestTri(double tt) ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:11: /home/nhnguyen/root6/macros/Qfuncs.cxx:83:16: error: redefinition of 'TestBox' double Qfuncs::TestBox(double tt) ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:83:16: note: previous definition is here double Qfuncs::TestBox(double tt) ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:14:9: error: redefinition of 'now' TDatime now; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:14:9: note: previous definition is here TDatime now; ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:16:8: error: redefinition of 'outfile' TFile* outfile = new TFile("PRF_all.root", "RECREATE"); ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:16:8: note: previous definition is here TFile* outfile = new TFile("PRF_all.root", "RECREATE"); ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:6: error: redefinition of 'fRLA' TF1 *fRLA, *fQ, *f_12; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:6: note: previous definition is here TF1 *fRLA, *fQ, *f_12; ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:13: error: redefinition of 'fQ' TF1 *fRLA, *fQ, *f_12; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:13: note: previous definition is here TF1 *fRLA, *fQ, *f_12; ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:18: error: redefinition of 'f_12' TF1 *fRLA, *fQ, *f_12; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:18: note: previous definition is here TF1 *fRLA, *fQ, *f_12; ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:26:8: error: redefinition of 'Func_1' double Func_1(double *t, double *par) // The detector-response function ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:26:8: note: previous definition is here double Func_1(double *t, double *par) // The detector-response function ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:34:8: error: redefinition of 'Func_2' double Func_2(double *t, double *par) // The charge dispersion function ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:34:8: note: previous definition is here double Func_2(double *t, double *par) // The charge dispersion function ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:42:8: error: redefinition of 'Func_12' double Func_12( double *t, double *par ) // The multiplication of both functions ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:42:8: note: previous definition is here double Func_12( double *t, double *par ) // The multiplication of both functions ^ In file included from input_line_73:16: In file included from /home/nhnguyen/root6/macros/quink.C:5: /home/nhnguyen/root6/macros/ConvoluteLoop.C:57:6: error: redefinition of 'ConvoluteLoop' void ConvoluteLoop(double * maspar, double * relativepos, bool endOfLoop) ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:57:6: note: previous definition is here void ConvoluteLoop(double * maspar, double * relativepos, bool endOfLoop) ^ In file included from input_line_73:16: /home/nhnguyen/root6/macros/quink.C:9:8: error: redefinition of 'quink' quink::quink(double Xl, double Xh, double Yl, double Yh) ^ /home/nhnguyen/root6/macros/quink.C:9:8: note: previous definition is here quink::quink(double Xl, double Xh, double Yl, double Yh) ^ In file included from input_line_73:16: /home/nhnguyen/root6/macros/quink.C:17:13: error: redefinition of 'Display' void quink::Display(double t[5], double &x0, double &y0, int &lxmax, in... ^ /home/nhnguyen/root6/macros/quink.C:17:13: note: previous definition is here void quink::Display(double t[5], double &x0, double &y0, int &lxmax, in... ^ In file included from input_line_73:16: /home/nhnguyen/root6/macros/quink.C:47:13: error: redefinition of 'Report' void quink::Report() ^ /home/nhnguyen/root6/macros/quink.C:47:13: note: previous definition is here void quink::Report() ^ Warning in <TInterpreter::TCling::RegisterModule>: Problems declaring payload for module quink_C_ACLiC_dict. Info in <TUnixSystem::ACLiC>: creating shared library /home/nhnguyen/root6/macros/./Qfuncs_cxx.so In file included from input_line_77:16: /home/nhnguyen/root6/macros/Qfuncs.cxx:26:16: error: redefinition of 'PadRect' double Qfuncs::PadRect(double tt, double xl, double xh, double yl, doubl... ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:26:16: note: previous definition is here double Qfuncs::PadRect(double tt, double xl, double xh, double yl, doubl... ^ In file included from input_line_77:16: /home/nhnguyen/root6/macros/Qfuncs.cxx:65:16: error: redefinition of 'TestTri' double Qfuncs::TestTri(double tt) ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:65:16: note: previous definition is here double Qfuncs::TestTri(double tt) ^ In file included from input_line_77:16: /home/nhnguyen/root6/macros/Qfuncs.cxx:83:16: error: redefinition of 'TestBox' double Qfuncs::TestBox(double tt) ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:83:16: note: previous definition is here double Qfuncs::TestBox(double tt) ^ Warning in <TInterpreter::TCling::RegisterModule>: Problems declaring payload for module Qfuncs_cxx_ACLiC_dict. Info in <TUnixSystem::ACLiC>: creating shared library /home/nhnguyen/root6/macros/./RLAfuncs_cxx.so In file included from input_line_81:16: /home/nhnguyen/root6/macros/RLAfuncs.cxx:24:18: error: redefinition of 'Rfunc' double RLAfuncs::Rfunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:24:18: note: previous definition is here double RLAfuncs::Rfunc(double *t, double *par) ^ In file included from input_line_81:16: /home/nhnguyen/root6/macros/RLAfuncs.cxx:47:18: error: redefinition of 'Lfunc' double RLAfuncs::Lfunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:47:18: note: previous definition is here double RLAfuncs::Lfunc(double *t, double *par) ^ In file included from input_line_81:16: /home/nhnguyen/root6/macros/RLAfuncs.cxx:56:18: error: redefinition of 'Afunc' double RLAfuncs::Afunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:56:18: note: previous definition is here double RLAfuncs::Afunc(double *t, double *par) ^ In file included from input_line_81:16: /home/nhnguyen/root6/macros/RLAfuncs.cxx:74:18: error: redefinition of 'RLAconv' double RLAfuncs::RLAconv(double tt, double t_R, double sigmaL, double t_... ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:74:18: note: previous definition is here double RLAfuncs::RLAconv(double tt, double t_R, double sigmaL, double t_... ^ Warning in <TInterpreter::TCling::RegisterModule>: Problems declaring payload for module RLAfuncs_cxx_ACLiC_dict. Info in <TUnixSystem::ACLiC>: creating shared library /home/nhnguyen/root6/macros/./ConvoluteLoop_C.so In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:24:18: error: redefinition of 'Rfunc' double RLAfuncs::Rfunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:24:18: note: previous definition is here double RLAfuncs::Rfunc(double *t, double *par) ^ In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:47:18: error: redefinition of 'Lfunc' double RLAfuncs::Lfunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:47:18: note: previous definition is here double RLAfuncs::Lfunc(double *t, double *par) ^ In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:56:18: error: redefinition of 'Afunc' double RLAfuncs::Afunc(double *t, double *par) ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:56:18: note: previous definition is here double RLAfuncs::Afunc(double *t, double *par) ^ In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:10: /home/nhnguyen/root6/macros/RLAfuncs.cxx:74:18: error: redefinition of 'RLAconv' double RLAfuncs::RLAconv(double tt, double t_R, double sigmaL, double t_... ^ /home/nhnguyen/root6/macros/RLAfuncs.cxx:74:18: note: previous definition is here double RLAfuncs::RLAconv(double tt, double t_R, double sigmaL, double t_... ^ In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:11: /home/nhnguyen/root6/macros/Qfuncs.cxx:26:16: error: redefinition of 'PadRect' double Qfuncs::PadRect(double tt, double xl, double xh, double yl, doubl... ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:26:16: note: previous definition is here double Qfuncs::PadRect(double tt, double xl, double xh, double yl, doubl... ^ In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:11: /home/nhnguyen/root6/macros/Qfuncs.cxx:65:16: error: redefinition of 'TestTri' double Qfuncs::TestTri(double tt) ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:65:16: note: previous definition is here double Qfuncs::TestTri(double tt) ^ In file included from input_line_85:16: In file included from /home/nhnguyen/root6/macros/ConvoluteLoop.C:11: /home/nhnguyen/root6/macros/Qfuncs.cxx:83:16: error: redefinition of 'TestBox' double Qfuncs::TestBox(double tt) ^ /home/nhnguyen/root6/macros/Qfuncs.cxx:83:16: note: previous definition is here double Qfuncs::TestBox(double tt) ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:14:9: error: redefinition of 'now' TDatime now; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:14:9: note: previous definition is here TDatime now; ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:16:8: error: redefinition of 'outfile' TFile* outfile = new TFile("PRF_all.root", "RECREATE"); ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:16:8: note: previous definition is here TFile* outfile = new TFile("PRF_all.root", "RECREATE"); ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:6: error: redefinition of 'fRLA' TF1 *fRLA, *fQ, *f_12; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:6: note: previous definition is here TF1 *fRLA, *fQ, *f_12; ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:13: error: redefinition of 'fQ' TF1 *fRLA, *fQ, *f_12; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:13: note: previous definition is here TF1 *fRLA, *fQ, *f_12; ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:18: error: redefinition of 'f_12' TF1 *fRLA, *fQ, *f_12; ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:17:18: note: previous definition is here TF1 *fRLA, *fQ, *f_12; ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:26:8: error: redefinition of 'Func_1' double Func_1(double *t, double *par) // The detector-response function ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:26:8: note: previous definition is here double Func_1(double *t, double *par) // The detector-response function ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:34:8: error: redefinition of 'Func_2' double Func_2(double *t, double *par) // The charge dispersion function ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:34:8: note: previous definition is here double Func_2(double *t, double *par) // The charge dispersion function ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:42:8: error: redefinition of 'Func_12' double Func_12( double *t, double *par ) // The multiplication of both functions ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:42:8: note: previous definition is here double Func_12( double *t, double *par ) // The multiplication of both functions ^ In file included from input_line_85:16: /home/nhnguyen/root6/macros/ConvoluteLoop.C:57:6: error: redefinition of 'ConvoluteLoop' void ConvoluteLoop(double * maspar, double * relativepos, bool endOfLoop) ^ /home/nhnguyen/root6/macros/ConvoluteLoop.C:57:6: note: previous definition is here void ConvoluteLoop(double * maspar, double * relativepos, bool endOfLoop) ^ Warning in <TInterpreter::TCling::RegisterModule>: Problems declaring payload for module ConvoluteLoop_C_ACLiC_dict.

I have done “make clean, make distclean” the FFTW and rebuilt both ROOT 5 and 6 from source without enabling RooFit. In ROOT 6, same thing happens. In ROOT 5, the codes seem to be running but taking a huge amount of time (at an integration step) . In fact, they are still running and I have not received the expected result.

Before FFWT and RooFit, it took only a few seconds, at most a few minutes, for the codes to run. Everything has been behaving very strangely after that. Do you have any ideas? Thank you!!

I think there are some configuration errors in the way you build your application.
Normally using FFTW, the integration integral is much faster to compute than using numerical convolutions. So this is very strange.
With the information you have provide it is difficult to help you. We would need your code and instructions to build it to understand your configuration problems.

Best Regards

Lorenzo

I rebooted my Ubuntu and built ROOT from source again. Unfortunately, the results remain. I am afraid there are more than configuration errors. Here is a shared Google Drive link: drive.google.com/folderview?id= … sp=sharing, where you can view and download the codes. You will need everything except PRF, PRFtypes, README and TestHisto. Instructions:

  • Copy everything to root/macros
  • cd to root/macros
  • Run ROOT, then .x macroRunLoop.C
  • There will be a .log file and a .root file in root/macros. cout will print into the log file and the root file should contain 3 histograms.

Thank you for your time!

Hi,
Can you please upload the code as a tar-file. It will be easier to get everything needed

Thanks

Lorenzo

Hi,
I just did. Please find the file codes.tar in the same link. Thank you for your time!

Best,
Nam

Hi there,

The code does run on my ROOT5 but it takes a huge amount of time. For a particular input, it took less than a second to run, now it takes about 15 minutes. Could there be something wrong with my computer?

Best,
Nam

Hi,
Sorry for my delay in looking at this.
First of all your first errors is due to re-include many times the same files with the function definitions. Maybe ROOT 5 allowed you to do this, but it is not valid. It is enough you do in your file macroRunLoop.C

  gROOT->ProcessLine(".>output.log");
  gROOT->ProcessLine(".L aragorn.C+");
  // all the other files are not needed to load they are already included in aragorn.C
 
  
  gROOT->ProcessLine("aragorn t");
  gROOT->ProcessLine("t.Construct()");
  gROOT->ProcessLine("t.Event()");

Then concerning the running problem, I don’t understand the relation with RooFit and FFTW. It looks to me you ar not using them. All your time is spent in the convolution integral that you are doing numerically in TF1::Integral.

I see you call the same function with the same parameters 3 times. This makes a factor of 3 longer the calculations.
Also for the convolution you should use FFT. I can suggest you to look at the new class
TF1Convolution, which does automatically for you. Doing convolution with FFTW is much faster than computing the integral numerically.
See root.cern.ch/root/htmldoc/TF1Convolution.html

Lorenzo

Hi Lorenzo,

I have eliminated the redundant lines and it’s working on ROOT 6 now. However, it’s still taking a long time, probably something happened to my laptop.

About the convolution, I tried to include “TF1Convolution.h” but both ROOT 5 and 6 said it was not found. I also tried to download TF1Convolution.h and put it into root/hist/hist/inc but it still did not work. How should I add this class to ROOT?

Thank you so much!

Best,
Nam

Hi,
You would need to use ROOT 6.04 and possibly the latest patch version. It has been added only few weeks ago.

Cheers

Lorenzo

Hi Lorenzo,

Thank you for the suggestion. TF1Convolution is really helpful.

Best,
Nam