00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOPROJECTEDPDF
00013 #define ROOPROJECTEDPDF
00014
00015 #include "RooAbsPdf.h"
00016 #include "RooRealProxy.h"
00017 #include "RooAbsReal.h"
00018 #include "RooObjCacheManager.h"
00019 #include "RooSetProxy.h"
00020
00021 class RooProjectedPdf : public RooAbsPdf {
00022 public:
00023
00024 RooProjectedPdf() ;
00025 RooProjectedPdf(const char *name, const char *title, RooAbsReal& _intpdf, const RooArgSet& intObs);
00026 RooProjectedPdf(const RooProjectedPdf& other, const char* name=0) ;
00027 virtual TObject* clone(const char* newname) const { return new RooProjectedPdf(*this,newname); }
00028 inline virtual ~RooProjectedPdf() { }
00029
00030
00031 virtual Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& analVars, const RooArgSet* normSet, const char* rangeName=0) const ;
00032 virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const char* rangeName=0) const ;
00033 virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ;
00034
00035 virtual Double_t getVal(const RooArgSet* set=0) const ;
00036
00037 Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const;
00038 void initGenerator(Int_t ) {} ;
00039 void generateEvent(Int_t code);
00040
00041 virtual Bool_t selfNormalized() const { return kTRUE ; }
00042
00043
00044 virtual RooAbsPdf* createProjection(const RooArgSet& iset) ;
00045
00046 void printMetaArgs(ostream& os) const ;
00047
00048
00049 protected:
00050
00051 RooRealProxy intpdf ;
00052 RooSetProxy intobs ;
00053 RooSetProxy deps ;
00054
00055 class CacheElem : public RooAbsCacheElement {
00056 public:
00057 virtual ~CacheElem() { delete _projection ; } ;
00058
00059 RooAbsReal* _projection ;
00060
00061 virtual RooArgList containedArgs(Action) ;
00062 virtual void printCompactTreeHook(std::ostream&, const char *, Int_t, Int_t) ;
00063 } ;
00064 mutable RooObjCacheManager _cacheMgr ;
00065
00066 Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t , Bool_t , Bool_t ) ;
00067
00068 mutable RooArgSet* _curNormSet ;
00069
00070 const RooAbsReal* getProjection(const RooArgSet* iset, const RooArgSet* nset, const char* rangeName, int& code) const ;
00071 Double_t evaluate() const ;
00072
00073 private:
00074
00075 ClassDef(RooProjectedPdf,1)
00076 };
00077
00078 #endif