// Implementation of RooAbsFunc that represent the the integrand
// of a generic (numeric) convolution A (x) B so that it can be
// passed to a numeric integrator. This is a utility class for
// RooNumConvPdf
// END_HTML
#include "RooFit.h"
#include "RooConvIntegrandBinding.h"
#include "RooAbsReal.h"
#include "RooArgSet.h"
#include "RooAbsRealLValue.h"
#include "RooMsgService.h"
#include <assert.h>
ClassImp(RooConvIntegrandBinding)
;
RooConvIntegrandBinding::RooConvIntegrandBinding(const RooAbsReal& func, const RooAbsReal& model,
RooAbsReal& xprime, RooAbsReal& x,
const RooArgSet* nset, Bool_t clipInvalid) :
RooAbsFunc(2), _func(&func), _model(&model), _vars(0), _nset(nset), _clipInvalid(clipInvalid)
{
_vars= new RooAbsRealLValue*[2];
if(0 == _vars) {
_valid= kFALSE;
return;
}
_vars[0]= dynamic_cast<RooAbsRealLValue*>(&xprime);
if(0 == _vars[0]) {
oocoutE(&func,InputArguments) << "RooConvIntegrandBinding: cannot bind to ";
xprime.Print("1");
_valid= kFALSE;
}
_vars[1]= dynamic_cast<RooAbsRealLValue*>(&x);
if(0 == _vars[1]) {
oocoutE(&func,InputArguments) << "RooConvIntegrandBinding: cannot bind to ";
x.Print("1");
_valid= kFALSE;
}
_xvecValid = kTRUE ;
}
RooConvIntegrandBinding::~RooConvIntegrandBinding()
{
if(0 != _vars) delete[] _vars;
}
void RooConvIntegrandBinding::loadValues(const Double_t xvector[], Bool_t clipInvalid) const
{
_xvecValid = kTRUE ;
for(UInt_t index= 0; index < _dimension; index++) {
if (clipInvalid && !_vars[index]->isValidReal(xvector[index])) {
_xvecValid = kFALSE ;
} else {
_vars[index]->setVal(xvector[index]);
}
}
}
Double_t RooConvIntegrandBinding::operator()(const Double_t xvector[]) const
{
assert(isValid());
_ncall++ ;
loadValues(xvector);
if (!_xvecValid) return 0 ;
Double_t f_xp = _func->getVal(_nset) ;
const Double_t xvec_tmp[2] = { xvector[1]-xvector[0] , xvector[1] } ;
loadValues(xvec_tmp,kTRUE);
if (!_xvecValid) return 0 ;
Double_t g_xmxp = _model->getVal(_nset) ;
return f_xp*g_xmxp ;
}
Double_t RooConvIntegrandBinding::getMinLimit(UInt_t index) const
{
assert(isValid());
return _vars[index]->getMin();
}
Double_t RooConvIntegrandBinding::getMaxLimit(UInt_t index) const
{
assert(isValid());
return _vars[index]->getMax();
}
RooConvIntegrandBinding.cxx:1 RooConvIntegrandBinding.cxx:2 RooConvIntegrandBinding.cxx:3 RooConvIntegrandBinding.cxx:4 RooConvIntegrandBinding.cxx:5 RooConvIntegrandBinding.cxx:6 RooConvIntegrandBinding.cxx:7 RooConvIntegrandBinding.cxx:8 RooConvIntegrandBinding.cxx:9 RooConvIntegrandBinding.cxx:10 RooConvIntegrandBinding.cxx:11 RooConvIntegrandBinding.cxx:12 RooConvIntegrandBinding.cxx:13 RooConvIntegrandBinding.cxx:14 RooConvIntegrandBinding.cxx:15 RooConvIntegrandBinding.cxx:16 RooConvIntegrandBinding.cxx:17 RooConvIntegrandBinding.cxx:18 RooConvIntegrandBinding.cxx:19 RooConvIntegrandBinding.cxx:20 RooConvIntegrandBinding.cxx:21 RooConvIntegrandBinding.cxx:22 RooConvIntegrandBinding.cxx:23 RooConvIntegrandBinding.cxx:24 RooConvIntegrandBinding.cxx:25 RooConvIntegrandBinding.cxx:26 RooConvIntegrandBinding.cxx:27 RooConvIntegrandBinding.cxx:28 RooConvIntegrandBinding.cxx:29 RooConvIntegrandBinding.cxx:30 RooConvIntegrandBinding.cxx:31 RooConvIntegrandBinding.cxx:32 RooConvIntegrandBinding.cxx:33 RooConvIntegrandBinding.cxx:34 RooConvIntegrandBinding.cxx:35 RooConvIntegrandBinding.cxx:36 RooConvIntegrandBinding.cxx:37 RooConvIntegrandBinding.cxx:38 RooConvIntegrandBinding.cxx:39 RooConvIntegrandBinding.cxx:40 RooConvIntegrandBinding.cxx:41 RooConvIntegrandBinding.cxx:42 RooConvIntegrandBinding.cxx:43 RooConvIntegrandBinding.cxx:44 RooConvIntegrandBinding.cxx:45 RooConvIntegrandBinding.cxx:46 RooConvIntegrandBinding.cxx:47 RooConvIntegrandBinding.cxx:48 RooConvIntegrandBinding.cxx:49 RooConvIntegrandBinding.cxx:50 RooConvIntegrandBinding.cxx:51 RooConvIntegrandBinding.cxx:52 RooConvIntegrandBinding.cxx:53 RooConvIntegrandBinding.cxx:54 RooConvIntegrandBinding.cxx:55 RooConvIntegrandBinding.cxx:56 RooConvIntegrandBinding.cxx:57 RooConvIntegrandBinding.cxx:58 RooConvIntegrandBinding.cxx:59 RooConvIntegrandBinding.cxx:60 RooConvIntegrandBinding.cxx:61 RooConvIntegrandBinding.cxx:62 RooConvIntegrandBinding.cxx:63 RooConvIntegrandBinding.cxx:64 RooConvIntegrandBinding.cxx:65 RooConvIntegrandBinding.cxx:66 RooConvIntegrandBinding.cxx:67 RooConvIntegrandBinding.cxx:68 RooConvIntegrandBinding.cxx:69 RooConvIntegrandBinding.cxx:70 RooConvIntegrandBinding.cxx:71 RooConvIntegrandBinding.cxx:72 RooConvIntegrandBinding.cxx:73 RooConvIntegrandBinding.cxx:74 RooConvIntegrandBinding.cxx:75 RooConvIntegrandBinding.cxx:76 RooConvIntegrandBinding.cxx:77 RooConvIntegrandBinding.cxx:78 RooConvIntegrandBinding.cxx:79 RooConvIntegrandBinding.cxx:80 RooConvIntegrandBinding.cxx:81 RooConvIntegrandBinding.cxx:82 RooConvIntegrandBinding.cxx:83 RooConvIntegrandBinding.cxx:84 RooConvIntegrandBinding.cxx:85 RooConvIntegrandBinding.cxx:86 RooConvIntegrandBinding.cxx:87 RooConvIntegrandBinding.cxx:88 RooConvIntegrandBinding.cxx:89 RooConvIntegrandBinding.cxx:90 RooConvIntegrandBinding.cxx:91 RooConvIntegrandBinding.cxx:92 RooConvIntegrandBinding.cxx:93 RooConvIntegrandBinding.cxx:94 RooConvIntegrandBinding.cxx:95 RooConvIntegrandBinding.cxx:96 RooConvIntegrandBinding.cxx:97 RooConvIntegrandBinding.cxx:98 RooConvIntegrandBinding.cxx:99 RooConvIntegrandBinding.cxx:100 RooConvIntegrandBinding.cxx:101 RooConvIntegrandBinding.cxx:102 RooConvIntegrandBinding.cxx:103 RooConvIntegrandBinding.cxx:104 RooConvIntegrandBinding.cxx:105 RooConvIntegrandBinding.cxx:106 RooConvIntegrandBinding.cxx:107 RooConvIntegrandBinding.cxx:108 RooConvIntegrandBinding.cxx:109 RooConvIntegrandBinding.cxx:110 RooConvIntegrandBinding.cxx:111 RooConvIntegrandBinding.cxx:112 RooConvIntegrandBinding.cxx:113 RooConvIntegrandBinding.cxx:114 RooConvIntegrandBinding.cxx:115 RooConvIntegrandBinding.cxx:116 RooConvIntegrandBinding.cxx:117 RooConvIntegrandBinding.cxx:118 RooConvIntegrandBinding.cxx:119 RooConvIntegrandBinding.cxx:120 RooConvIntegrandBinding.cxx:121 RooConvIntegrandBinding.cxx:122 RooConvIntegrandBinding.cxx:123 RooConvIntegrandBinding.cxx:124 RooConvIntegrandBinding.cxx:125 RooConvIntegrandBinding.cxx:126 RooConvIntegrandBinding.cxx:127 RooConvIntegrandBinding.cxx:128 RooConvIntegrandBinding.cxx:129 RooConvIntegrandBinding.cxx:130 RooConvIntegrandBinding.cxx:131 RooConvIntegrandBinding.cxx:132 RooConvIntegrandBinding.cxx:133 RooConvIntegrandBinding.cxx:134 RooConvIntegrandBinding.cxx:135 RooConvIntegrandBinding.cxx:136 RooConvIntegrandBinding.cxx:137 RooConvIntegrandBinding.cxx:138 RooConvIntegrandBinding.cxx:139 RooConvIntegrandBinding.cxx:140 RooConvIntegrandBinding.cxx:141 RooConvIntegrandBinding.cxx:142 RooConvIntegrandBinding.cxx:143 RooConvIntegrandBinding.cxx:144 RooConvIntegrandBinding.cxx:145 RooConvIntegrandBinding.cxx:146 RooConvIntegrandBinding.cxx:147 RooConvIntegrandBinding.cxx:148 RooConvIntegrandBinding.cxx:149 RooConvIntegrandBinding.cxx:150 RooConvIntegrandBinding.cxx:151 RooConvIntegrandBinding.cxx:152 RooConvIntegrandBinding.cxx:153 RooConvIntegrandBinding.cxx:154 RooConvIntegrandBinding.cxx:155 RooConvIntegrandBinding.cxx:156 RooConvIntegrandBinding.cxx:157 RooConvIntegrandBinding.cxx:158 RooConvIntegrandBinding.cxx:159 RooConvIntegrandBinding.cxx:160 RooConvIntegrandBinding.cxx:161 RooConvIntegrandBinding.cxx:162 RooConvIntegrandBinding.cxx:163 RooConvIntegrandBinding.cxx:164