#ifndef ROO_EFF_PROD
#define ROO_EFF_PROD
#include "RooAbsPdf.h"
#include "RooAbsReal.h"
#include "RooRealProxy.h"
#include "RooObjCacheManager.h"
class RooEffProd: public RooAbsPdf {
public:
inline RooEffProd() : _nset(0), _fixedNset(0) { };
virtual ~RooEffProd();
RooEffProd(const char *name, const char *title, RooAbsPdf& pdf, RooAbsReal& efficiency);
RooEffProd(const RooEffProd& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooEffProd(*this,newname); }
virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooDataSet *prototype,
const RooArgSet* auxProto, Bool_t verbose) const;
virtual Double_t getValV(const RooArgSet* set=0) const ;
virtual Bool_t forceAnalyticalInt(const RooAbsArg& ) const {
return kTRUE ;
}
Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, const char* rangeName=0) const ;
Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
protected:
const RooAbsPdf* pdf() const {
return (RooAbsPdf*) _pdf.absArg() ;
}
const RooAbsReal* eff() const {
return (RooAbsReal*) _eff.absArg() ;
}
virtual Double_t evaluate() const ;
class CacheElem : public RooAbsCacheElement {
public:
CacheElem() : _clone(0), _int(0) {}
virtual ~CacheElem() { delete _int ; delete _clone ; }
RooArgSet _intObs ;
RooEffProd* _clone ;
RooAbsReal* _int ;
virtual RooArgList containedArgs(Action) ;
} ;
mutable RooObjCacheManager _cacheMgr ;
RooRealProxy _pdf ;
RooRealProxy _eff;
mutable const RooArgSet* _nset ;
RooArgSet* _fixedNset ;
ClassDef(RooEffProd,2)
};
#endif