00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_HIST_PDF
00017 #define ROO_HIST_PDF
00018
00019 #include "RooAbsPdf.h"
00020 #include "RooRealProxy.h"
00021 #include "RooSetProxy.h"
00022 #include "RooAICRegistry.h"
00023
00024 class RooRealVar;
00025 class RooAbsReal;
00026 class RooDataHist ;
00027
00028 class RooHistPdf : public RooAbsPdf {
00029 public:
00030 RooHistPdf() ;
00031 RooHistPdf(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
00032 RooHistPdf(const char *name, const char *title, const RooArgList& pdfObs, const RooArgList& histObs, const RooDataHist& dhist, Int_t intOrder=0);
00033 RooHistPdf(const RooHistPdf& other, const char* name=0);
00034 virtual TObject* clone(const char* newname) const { return new RooHistPdf(*this,newname); }
00035 virtual ~RooHistPdf() ;
00036
00037 RooDataHist& dataHist() {
00038
00039 return *_dataHist ;
00040 }
00041 const RooDataHist& dataHist() const {
00042
00043 return *_dataHist ;
00044 }
00045
00046 void setInterpolationOrder(Int_t order) {
00047
00048 _intOrder = order ;
00049 }
00050 Int_t getInterpolationOrder() const {
00051
00052 return _intOrder ;
00053 }
00054
00055 Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
00056 Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
00057
00058 void setCdfBoundaries(Bool_t flag) {
00059
00060 _cdfBoundaries = flag ;
00061 }
00062 Bool_t getCdfBoundaries() const {
00063
00064 return _cdfBoundaries ;
00065 }
00066
00067 void setUnitNorm(Bool_t flag) {
00068
00069 _unitNorm = flag ;
00070 }
00071 Bool_t haveUnitNorm() const {
00072
00073 return _unitNorm ;
00074 }
00075
00076 virtual Bool_t selfNormalized() const { return _unitNorm ; }
00077
00078 virtual Int_t getMaxVal(const RooArgSet& vars) const ;
00079 virtual Double_t maxVal(Int_t code) const ;
00080
00081 virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ;
00082
00083 protected:
00084
00085 Bool_t importWorkspaceHook(RooWorkspace& ws) ;
00086
00087 Double_t evaluate() const;
00088 Double_t totalVolume() const ;
00089 friend class RooAbsCachedPdf ;
00090 Double_t totVolume() const ;
00091
00092 RooArgSet _histObsList ;
00093 RooSetProxy _pdfObsList ;
00094 RooDataHist* _dataHist ;
00095 TIterator* _histObsIter ;
00096 TIterator* _pdfObsIter ;
00097 mutable RooAICRegistry _codeReg ;
00098 Int_t _intOrder ;
00099 Bool_t _cdfBoundaries ;
00100 mutable Double_t _totVolume ;
00101 Bool_t _unitNorm ;
00102
00103 ClassDef(RooHistPdf,4)
00104 };
00105
00106 #endif