RooGenericPdf.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooGenericPdf.h,v 1.20 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
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   // Constructors, assignment etc
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   // I/O streaming interface (machine readable)
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   // Printing interface (human readable)
00040   void printMultiline(ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
00041   void printMetaArgs(ostream& os) const ;
00042 
00043   // Debugging
00044   void dumpFormula() { formula().dump() ; }
00045 
00046 protected:
00047 
00048   RooFormula& formula() const ;
00049 
00050   // Function evaluation
00051   RooListProxy _actualVars ; 
00052   virtual Double_t evaluate() const ;
00053 
00054   Bool_t setFormula(const char* formula) ;
00055 
00056   // Post-processing of server redirection
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 ; //! Formula engine 
00062   TString _formExpr ;            // Formula expression string
00063 
00064   ClassDef(RooGenericPdf,1) // Generic PDF defined by string expression and list of variables
00065 };
00066 
00067 #endif

Generated on Tue Jul 5 14:26:11 2011 for ROOT_528-00b_version by  doxygen 1.5.1