00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROO_GENERIC_PDF
00017 #define ROO_GENERIC_PDF
00018
00019 #include "RooAbsPdf.h"
00020 #include "RooFormula.h"
00021 #include "RooListProxy.h"
00022
00023 class RooArgList ;
00024
00025 class RooGenericPdf : public RooAbsPdf {
00026 public:
00027
00028 inline RooGenericPdf() : _formula(0) { }
00029 RooGenericPdf(const char *name, const char *title, const char* formula, const RooArgList& dependents);
00030 RooGenericPdf(const char *name, const char *title, const RooArgList& dependents);
00031 RooGenericPdf(const RooGenericPdf& other, const char* name=0);
00032 virtual TObject* clone(const char* newname) const { return new RooGenericPdf(*this,newname); }
00033 virtual ~RooGenericPdf();
00034
00035
00036 virtual Bool_t readFromStream(istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
00037 virtual void writeToStream(ostream& os, Bool_t compact) const ;
00038
00039
00040 void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
00041 void printMetaArgs(ostream& os) const ;
00042
00043
00044 void dumpFormula() { formula().dump() ; }
00045
00046 protected:
00047
00048 RooFormula& formula() const ;
00049
00050
00051 RooListProxy _actualVars ;
00052 virtual Double_t evaluate() const ;
00053
00054 Bool_t setFormula(const char* formula) ;
00055
00056
00057 virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
00058
00059 virtual Bool_t isValidReal(Double_t value, Bool_t printError) const ;
00060
00061 mutable RooFormula* _formula ;
00062 TString _formExpr ;
00063
00064 ClassDef(RooGenericPdf,1)
00065 };
00066
00067 #endif