RooClassFactory::makePdf n-variables integral crash

Dear experts,

Apologies in advance for the duplicate (Analytical integrals for many observables in RooClassFactory::makePdf), but it seems that this thread has not been solved yet. Basically I’m trying to provide the analytical integral of a given PDF which depends on two variables. However, I find a segmentation fault when I try to do it:

Info in <TUnixSystem::ACLiC>: creating shared library /home/hep/rsilvaco/Analysis/Studies/PIDCalibMoM/RooCombLegPdf_cxx.so
In file included from input_line_12:9:
/home/hep/rsilvaco/Analysis/Studies/PIDCalibMoM/RooCombLegPdf.cxx:66:57: warning: expression result unused [-Wunused-value]
   if (code==1) { return (0.5*pow(x.max(rangeName),2)*y - 0.5*pow(x.min(rangeName),2)*y,y:0.5*x*pow(y.max(rangeName),2) - 0.5*x*pow(y.min(rangeName),2)) ; } 
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/hep/rsilvaco/Analysis/Studies/PIDCalibMoM/RooCombLegPdf.cxx:66:90: error: expected ')'
   if (code==1) { return (0.5*pow(x.max(rangeName),2)*y - 0.5*pow(x.min(rangeName),2)*y,y:0.5*x*pow(y.max(rangeName),2) - 0.5*x*pow(y.min(rangeName),2)) ; } 
                                                                                         ^
/home/hep/rsilvaco/Analysis/Studies/PIDCalibMoM/RooCombLegPdf.cxx:66:26: note: to match this '('
   if (code==1) { return (0.5*pow(x.max(rangeName),2)*y - 0.5*pow(x.min(rangeName),2)*y,y:0.5*x*pow(y.max(rangeName),2) - 0.5*x*pow(y.min(rangeName),2)) ; } 
                         ^
Error in <ACLiC>: Dictionary generation failed!
 *** Break *** segmentation violation

Any suggestion on how to solve this? Or there is any bug in the code itself? Thanks in advance for any insight!

Cheers, Rafael
scriptROOTForum_integral_simplest.py (1.51 KB)

Dear experts,

Sorry for the noise on this, but any suggestion on how to solve this problem ? Thanks a lot again in advance!

Cheers,
Rafael

Hi,

I see you have a compilation error, are you sure you pass the string correctly ?
If this does not work as expected I would implement my self in C++ the PDF instead of using the RooClassFactory.
You could add eventually submit a bug report in JIRA for this problem.

Best Regards

Lorenzo

Hi Lorenzo,

Thanks for having a look into this. I don’t see any obvious mistake in the implementation of the code. Indeed this should be a very simple script, so I’m not sure what is going on. The reason why RooClassFactory is preferred here is because in the actual application of this script, it is much faster and simpler to create using this. So still makes sense to actual use this class. I will go on and submit a bug report.

Thanks!
Rafael