RooFunctorBinding.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooFunctorBinding.h 28963 2009-06-12 15:47:45Z wouter $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl                         *
00007  *                                                                           *
00008  * Copyright (c) 2000-2008, NIKHEF, Regents of the University of California  *
00009  *                          and Stanford University. All rights reserved.    *
00010  *                                                                           *
00011  *****************************************************************************/
00012 
00013 #ifndef ROOFUNCTORBINDING
00014 #define ROOFUNCTORBINDING
00015 
00016 #include "TString.h"
00017 #include "RooAbsReal.h"
00018 #include "RooArgList.h"
00019 #include "RooListProxy.h"
00020 #include "RooAbsPdf.h"
00021 #include "RooRealProxy.h"
00022 #include "RooMsgService.h"
00023 #include <string>
00024 #include <map>
00025 #include <vector>
00026 #include "Math/IFunction.h"
00027 
00028 
00029 namespace RooFit {
00030 
00031 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor,const RooArgList& vars) ;
00032 RooAbsPdf*  bindPdf(const char* name, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars) ;
00033 
00034 }
00035 
00036 
00037 class RooFunctorBinding : public RooAbsReal {
00038 public:
00039   RooFunctorBinding() : x(0) {
00040     // Default constructor
00041   } ; 
00042   RooFunctorBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
00043   RooFunctorBinding(const RooFunctorBinding& other, const char* name=0) ;
00044   virtual TObject* clone(const char* newname) const { return new RooFunctorBinding(*this,newname); }
00045   inline virtual ~RooFunctorBinding() { delete[] x ; }
00046   void printArgs(ostream& os) const ;
00047 
00048 protected:
00049 
00050   Double_t evaluate() const ;
00051 
00052   const ROOT::Math::IBaseFunctionMultiDim* func ;    // Functor
00053   RooListProxy                       vars ;    // Argument reference
00054   Double_t*                           x ; // Argument value array
00055   
00056 
00057 private:
00058 
00059   ClassDef(RooFunctorBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionMultiDim
00060 };
00061 
00062 
00063 
00064 class RooFunctorPdfBinding : public RooAbsPdf {
00065 public:
00066   RooFunctorPdfBinding() : x(0) {
00067     // Default constructor
00068   } ; 
00069   RooFunctorPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionMultiDim& ftor, const RooArgList& vars);
00070   RooFunctorPdfBinding(const RooFunctorPdfBinding& other, const char* name=0) ;
00071   virtual TObject* clone(const char* newname) const { return new RooFunctorPdfBinding(*this,newname); }
00072   inline virtual ~RooFunctorPdfBinding() { delete[] x ; }
00073   void printArgs(ostream& os) const ;
00074 
00075 protected:
00076 
00077   Double_t evaluate() const ;
00078 
00079   const ROOT::Math::IBaseFunctionMultiDim* func ;    // Functor
00080   RooListProxy                       vars ;    // Argument reference
00081   Double_t*                             x ; // Argument value array
00082   
00083 
00084 private:
00085 
00086   ClassDef(RooFunctorPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionMultiDim
00087 };
00088 
00089 
00090 #endif

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