// RooConvCoefVar is an auxilary class that represents the coefficient
// of a RooAbsAnaConvPdf implementation as a separate RooAbsReal object
// to be able to interface these coefficient terms with the generic
// RooRealIntegral integration mechanism
// END_HTML
#include "RooFit.h"
#include "RooAbsAnaConvPdf.h"
#include "RooAbsAnaConvPdf.h"
#include "RooConvCoefVar.h"
using namespace std;
ClassImp(RooConvCoefVar)
;
RooConvCoefVar::RooConvCoefVar(const char *name, const char *title, const RooAbsAnaConvPdf& input,
Int_t coefIdx, const RooArgSet* varList) :
RooAbsReal(name,title),
_varSet("varSet","Set of coefficient variables",this),
_convPdf("convPdf","Convoluted PDF",this,(RooAbsReal&)input,kFALSE,kFALSE),
_coefIdx(coefIdx)
{
if (varList) _varSet.add(*varList) ;
}
RooConvCoefVar::RooConvCoefVar(const RooConvCoefVar& other, const char* name) :
RooAbsReal(other,name),
_varSet("varSet",this,other._varSet),
_convPdf("convPdf",this,other._convPdf),
_coefIdx(other._coefIdx)
{
}
Double_t RooConvCoefVar::getValV(const RooArgSet*) const
{
return evaluate() ;
}
Double_t RooConvCoefVar::evaluate() const
{
return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefficient(_coefIdx) ;
}
Int_t RooConvCoefVar::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName) const
{
Int_t code = ((RooAbsAnaConvPdf&)_convPdf.arg()).getCoefAnalyticalIntegral(_coefIdx,allVars,analVars,rangeName) ;
return code ;
}
Double_t RooConvCoefVar::analyticalIntegral(Int_t code, const char* rangeName) const
{
return ((RooAbsAnaConvPdf&)_convPdf.arg()).coefAnalyticalIntegral(_coefIdx,code,rangeName) ;
}