#ifndef ROO_HIST_PDF
#define ROO_HIST_PDF
#include "RooAbsPdf.h"
#include "RooRealProxy.h"
#include "RooSetProxy.h"
#include "RooAICRegistry.h"
class RooRealVar;
class RooAbsReal;
class RooDataHist ;
class RooHistPdf : public RooAbsPdf {
public:
RooHistPdf() ;
RooHistPdf(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
RooHistPdf(const char *name, const char *title, const RooArgList& pdfObs, const RooArgList& histObs, const RooDataHist& dhist, Int_t intOrder=0);
RooHistPdf(const RooHistPdf& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooHistPdf(*this,newname); }
virtual ~RooHistPdf() ;
RooDataHist& dataHist() {
return *_dataHist ;
}
const RooDataHist& dataHist() const {
return *_dataHist ;
}
void setInterpolationOrder(Int_t order) {
_intOrder = order ;
}
Int_t getInterpolationOrder() const {
return _intOrder ;
}
Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
void setCdfBoundaries(Bool_t flag) {
_cdfBoundaries = flag ;
}
Bool_t getCdfBoundaries() const {
return _cdfBoundaries ;
}
void setUnitNorm(Bool_t flag) {
_unitNorm = flag ;
}
Bool_t haveUnitNorm() const {
return _unitNorm ;
}
virtual Bool_t selfNormalized() const { return _unitNorm ; }
virtual Int_t getMaxVal(const RooArgSet& vars) const ;
virtual Double_t maxVal(Int_t code) const ;
virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ;
virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& , Double_t , Double_t ) const ;
virtual Bool_t isBinnedDistribution(const RooArgSet&) const { return _intOrder==0 ; }
protected:
Bool_t areIdentical(const RooDataHist& dh1, const RooDataHist& dh2) ;
Bool_t importWorkspaceHook(RooWorkspace& ws) ;
Double_t evaluate() const;
Double_t totalVolume() const ;
friend class RooAbsCachedPdf ;
Double_t totVolume() const ;
RooArgSet _histObsList ;
RooSetProxy _pdfObsList ;
RooDataHist* _dataHist ;
TIterator* _histObsIter ;
TIterator* _pdfObsIter ;
mutable RooAICRegistry _codeReg ;
Int_t _intOrder ;
Bool_t _cdfBoundaries ;
mutable Double_t _totVolume ;
Bool_t _unitNorm ;
ClassDef(RooHistPdf,4)
};
#endif