/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl                         *
 *                                                                           *
 * Copyright (c) 2000-2008, NIKHEF, Regents of the University of California  *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 *****************************************************************************/

#ifndef ROOFUNCTOR1DBINDING
#define ROOFUNCTOR1DBINDING

#include "TString.h"
#include "RooAbsReal.h"
#include "RooArgList.h"
#include "RooListProxy.h"
#include "RooAbsPdf.h"
#include "RooRealProxy.h"
#include "RooMsgService.h"
#include <string>
#include <map>
#include <vector>
#include "Math/IFunction.h"


namespace RooFit {

RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
RooAbsPdf*  bindPdf(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;

}


class RooFunctor1DBinding : public RooAbsReal {
public:
  RooFunctor1DBinding() : func(0) {
    // Default constructor
  } ; 
  RooFunctor1DBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& var);
  RooFunctor1DBinding(const RooFunctor1DBinding& other, const char* name=0) ;
  virtual TObject* clone(const char* newname) const { return new RooFunctor1DBinding(*this,newname); }
  inline virtual ~RooFunctor1DBinding() {}
  void printArgs(std::ostream& os) const ;

protected:

  Double_t evaluate() const ;

  const ROOT::Math::IBaseFunctionOneDim* func ;    // Functor
  RooRealProxy                       var ;    // Argument reference
  

private:

  ClassDef(RooFunctor1DBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionOneDim
};



class RooFunctor1DPdfBinding : public RooAbsPdf {
public:
  RooFunctor1DPdfBinding() : func(0) {
    // Default constructor
  } ; 
  RooFunctor1DPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars);
  RooFunctor1DPdfBinding(const RooFunctor1DPdfBinding& other, const char* name=0) ;
  virtual TObject* clone(const char* newname) const { return new RooFunctor1DPdfBinding(*this,newname); }
  inline virtual ~RooFunctor1DPdfBinding() {}
  void printArgs(std::ostream& os) const ;

protected:

  Double_t evaluate() const ;

  const ROOT::Math::IBaseFunctionOneDim* func ;    // Functor
  RooRealProxy                           var ;    // Argument reference
  

private:

  ClassDef(RooFunctor1DPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionOneDim
};


#endif
 RooFunctor1DBinding.h:1
 RooFunctor1DBinding.h:2
 RooFunctor1DBinding.h:3
 RooFunctor1DBinding.h:4
 RooFunctor1DBinding.h:5
 RooFunctor1DBinding.h:6
 RooFunctor1DBinding.h:7
 RooFunctor1DBinding.h:8
 RooFunctor1DBinding.h:9
 RooFunctor1DBinding.h:10
 RooFunctor1DBinding.h:11
 RooFunctor1DBinding.h:12
 RooFunctor1DBinding.h:13
 RooFunctor1DBinding.h:14
 RooFunctor1DBinding.h:15
 RooFunctor1DBinding.h:16
 RooFunctor1DBinding.h:17
 RooFunctor1DBinding.h:18
 RooFunctor1DBinding.h:19
 RooFunctor1DBinding.h:20
 RooFunctor1DBinding.h:21
 RooFunctor1DBinding.h:22
 RooFunctor1DBinding.h:23
 RooFunctor1DBinding.h:24
 RooFunctor1DBinding.h:25
 RooFunctor1DBinding.h:26
 RooFunctor1DBinding.h:27
 RooFunctor1DBinding.h:28
 RooFunctor1DBinding.h:29
 RooFunctor1DBinding.h:30
 RooFunctor1DBinding.h:31
 RooFunctor1DBinding.h:32
 RooFunctor1DBinding.h:33
 RooFunctor1DBinding.h:34
 RooFunctor1DBinding.h:35
 RooFunctor1DBinding.h:36
 RooFunctor1DBinding.h:37
 RooFunctor1DBinding.h:38
 RooFunctor1DBinding.h:39
 RooFunctor1DBinding.h:40
 RooFunctor1DBinding.h:41
 RooFunctor1DBinding.h:42
 RooFunctor1DBinding.h:43
 RooFunctor1DBinding.h:44
 RooFunctor1DBinding.h:45
 RooFunctor1DBinding.h:46
 RooFunctor1DBinding.h:47
 RooFunctor1DBinding.h:48
 RooFunctor1DBinding.h:49
 RooFunctor1DBinding.h:50
 RooFunctor1DBinding.h:51
 RooFunctor1DBinding.h:52
 RooFunctor1DBinding.h:53
 RooFunctor1DBinding.h:54
 RooFunctor1DBinding.h:55
 RooFunctor1DBinding.h:56
 RooFunctor1DBinding.h:57
 RooFunctor1DBinding.h:58
 RooFunctor1DBinding.h:59
 RooFunctor1DBinding.h:60
 RooFunctor1DBinding.h:61
 RooFunctor1DBinding.h:62
 RooFunctor1DBinding.h:63
 RooFunctor1DBinding.h:64
 RooFunctor1DBinding.h:65
 RooFunctor1DBinding.h:66
 RooFunctor1DBinding.h:67
 RooFunctor1DBinding.h:68
 RooFunctor1DBinding.h:69
 RooFunctor1DBinding.h:70
 RooFunctor1DBinding.h:71
 RooFunctor1DBinding.h:72
 RooFunctor1DBinding.h:73
 RooFunctor1DBinding.h:74
 RooFunctor1DBinding.h:75
 RooFunctor1DBinding.h:76
 RooFunctor1DBinding.h:77
 RooFunctor1DBinding.h:78
 RooFunctor1DBinding.h:79
 RooFunctor1DBinding.h:80
 RooFunctor1DBinding.h:81
 RooFunctor1DBinding.h:82
 RooFunctor1DBinding.h:83
 RooFunctor1DBinding.h:84
 RooFunctor1DBinding.h:85
 RooFunctor1DBinding.h:86
 RooFunctor1DBinding.h:87
 RooFunctor1DBinding.h:88