ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RooGenericPdf.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooGenericPdf.h,v 1.20 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_GENERIC_PDF
17 #define ROO_GENERIC_PDF
18 
19 #include "RooAbsPdf.h"
20 #include "RooFormula.h"
21 #include "RooListProxy.h"
22 
23 class RooArgList ;
24 
25 class RooGenericPdf : public RooAbsPdf {
26 public:
27  // Constructors, assignment etc
28  inline RooGenericPdf() : _formula(0) { }
29  RooGenericPdf(const char *name, const char *title, const char* formula, const RooArgList& dependents);
30  RooGenericPdf(const char *name, const char *title, const RooArgList& dependents);
31  RooGenericPdf(const RooGenericPdf& other, const char* name=0);
32  virtual TObject* clone(const char* newname) const { return new RooGenericPdf(*this,newname); }
33  virtual ~RooGenericPdf();
34 
35  // I/O streaming interface (machine readable)
36  virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
37  virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
38 
39  // Printing interface (human readable)
40  void printMultiline(std::ostream& os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const ;
41  void printMetaArgs(std::ostream& os) const ;
42 
43  // Debugging
44  void dumpFormula() { formula().dump() ; }
45 
46 protected:
47 
48  RooFormula& formula() const ;
49 
50  // Function evaluation
52  virtual Double_t evaluate() const ;
53 
54  Bool_t setFormula(const char* formula) ;
55 
56  // Post-processing of server redirection
57  virtual Bool_t redirectServersHook(const RooAbsCollection& newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
58 
59  virtual Bool_t isValidReal(Double_t value, Bool_t printError) const ;
60 
61  mutable RooFormula* _formula ; //! Formula engine
62  TString _formExpr ; // Formula expression string
63 
64  ClassDef(RooGenericPdf,1) // Generic PDF defined by string expression and list of variables
65 };
66 
67 #endif
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
RooListProxy _actualVars
Definition: RooGenericPdf.h:51
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to given stream.
TString _formExpr
Formula engine.
Definition: RooGenericPdf.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual TObject * clone(const char *newname) const
Definition: RooGenericPdf.h:32
RooFormula * _formula
Definition: RooGenericPdf.h:61
void printMetaArgs(std::ostream &os) const
Add formula expression as meta argument in printing interface.
RooFormula an implementation of ROOT::v5::TFormula that interfaces it to RooAbsArg value objects...
Definition: RooFormula.h:27
virtual Double_t evaluate() const
Calculate current value of this object.
virtual Bool_t isValidReal(Double_t value, Bool_t printError) const
Check if given value is valid.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void printMultiline(std::ostream &os, Int_t content, Bool_t verbose=kFALSE, TString indent="") const
Print info about this object to the specified stream.
bool verbose
virtual ~RooGenericPdf()
Destructor.
static void indent(ostringstream &buf, int indent_level)
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:26
double Double_t
Definition: RtypesCore.h:55
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from given stream.
void dumpFormula()
Definition: RooGenericPdf.h:44
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects...
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
virtual Bool_t redirectServersHook(const RooAbsCollection &newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive)
Propagate server changes to embedded formula object.
Bool_t setFormula(const char *formula)
Change formula expression to given expression.
RooGenericPdf is a concrete implementation of a probability density function, which takes a RooArgLis...
Definition: RooGenericPdf.h:25
RooFormula & formula() const
void dump()
DEBUG: Dump state information.
Definition: RooFormula.cxx:166
float value
Definition: math.cpp:443