Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooFunctor1DBinding.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
5  * Authors: *
6  * WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl *
7  * *
8  * Copyright (c) 2000-2008, NIKHEF, Regents of the University of California *
9  * and Stanford University. All rights reserved. *
10  * *
11  *****************************************************************************/
12 
13 #ifndef ROOFUNCTOR1DBINDING
14 #define ROOFUNCTOR1DBINDING
15 
16 #include "TString.h"
17 #include "RooAbsReal.h"
18 #include "RooArgList.h"
19 #include "RooListProxy.h"
20 #include "RooAbsPdf.h"
21 #include "RooRealProxy.h"
22 #include "RooMsgService.h"
23 #include <string>
24 #include <map>
25 #include <vector>
26 #include "Math/IFunction.h"
27 
28 
29 namespace RooFit {
30 
31 RooAbsReal* bindFunction(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
32 RooAbsPdf* bindPdf(const char* name, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars) ;
33 
34 }
35 
36 
37 class RooFunctor1DBinding : public RooAbsReal {
38 public:
39  RooFunctor1DBinding() : func(0) {
40  // Default constructor
41  } ;
42  RooFunctor1DBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& var);
43  RooFunctor1DBinding(const RooFunctor1DBinding& other, const char* name=0) ;
44  virtual TObject* clone(const char* newname) const { return new RooFunctor1DBinding(*this,newname); }
45  inline virtual ~RooFunctor1DBinding() {}
46  void printArgs(std::ostream& os) const ;
47 
48 protected:
49 
50  Double_t evaluate() const ;
51 
52  const ROOT::Math::IBaseFunctionOneDim* func ; // Functor
53  RooRealProxy var ; // Argument reference
54 
55 
56 private:
57 
58  ClassDef(RooFunctor1DBinding,1) // RooAbsReal binding to a ROOT::Math::IBaseFunctionOneDim
59 };
60 
61 
62 
63 class RooFunctor1DPdfBinding : public RooAbsPdf {
64 public:
65  RooFunctor1DPdfBinding() : func(0) {
66  // Default constructor
67  } ;
68  RooFunctor1DPdfBinding(const char *name, const char *title, const ROOT::Math::IBaseFunctionOneDim& ftor, RooAbsReal& vars);
69  RooFunctor1DPdfBinding(const RooFunctor1DPdfBinding& other, const char* name=0) ;
70  virtual TObject* clone(const char* newname) const { return new RooFunctor1DPdfBinding(*this,newname); }
71  inline virtual ~RooFunctor1DPdfBinding() {}
72  void printArgs(std::ostream& os) const ;
73 
74 protected:
75 
76  Double_t evaluate() const ;
77 
78  const ROOT::Math::IBaseFunctionOneDim* func ; // Functor
79  RooRealProxy var ; // Argument reference
80 
81 
82 private:
83 
84  ClassDef(RooFunctor1DPdfBinding,1) // RooAbsPdf binding to a ROOT::Math::IBaseFunctionOneDim
85 };
86 
87 
88 #endif