#ifndef ROO_HIST_FUNC
#define ROO_HIST_FUNC
#include "RooAbsReal.h"
#include "RooRealProxy.h"
#include "RooSetProxy.h"
#include "RooAICRegistry.h"
class RooRealVar;
class RooAbsReal;
class RooDataHist ;
class RooHistFunc : public RooAbsReal {
public:
RooHistFunc() ;
RooHistFunc(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
RooHistFunc(const RooHistFunc& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooHistFunc(*this,newname); }
inline virtual ~RooHistFunc() { }
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 ;
}
virtual Int_t getMaxVal(const RooArgSet& vars) const;
virtual Double_t maxVal(Int_t code) const;
virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& , Double_t , Double_t ) const ;
virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ;
virtual Bool_t isBinnedDistribution(const RooArgSet&) const { return _intOrder==0 ; }
protected:
Bool_t importWorkspaceHook(RooWorkspace& ws) ;
Bool_t areIdentical(const RooDataHist& dh1, const RooDataHist& dh2) ;
Double_t evaluate() const;
Double_t totalVolume() const ;
friend class RooAbsCachedReal ;
Double_t totVolume() const ;
RooSetProxy _depList ;
RooDataHist* _dataHist ;
mutable RooAICRegistry _codeReg ;
Int_t _intOrder ;
Bool_t _cdfBoundaries ;
mutable Double_t _totVolume ;
Bool_t _unitNorm ;
ClassDef(RooHistFunc,1)
};
#endif