Logo ROOT  
Reference Guide
RooFunctor.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
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_FUNCTOR
17#define ROO_FUNCTOR
18
19#include "RooArgSet.h"
20#include "RooAbsReal.h"
21
22class RooAbsFunc ;
23class RooAbsPdf ;
24
26
27public:
28 RooFunctor(const RooAbsFunc& func) ;
29 RooFunctor(const RooAbsReal& func, const RooArgList& observables, const RooArgList& parameters) ;
30 RooFunctor(const RooAbsReal& func, const RooArgList& observables, const RooArgList& parameters, const RooArgSet& nset) ;
31 RooFunctor(const RooFunctor&) ;
32 virtual ~RooFunctor() ;
33
34 Int_t nObs() const {
35 // Number of observables
36 return _nobs ;
37 }
38 Int_t nPar() const {
39 // Number of parameters;
40 return _npar ;
41 }
42
43 //Int_t numCall() const { return _binding->numCall() ; }
44 //void resetNumCall() const { _binding->resetNumCall() ; }
45
46
47 Double_t operator()(Double_t x) const { return eval(x) ; }
48 Double_t operator()(const Double_t* x, const Double_t* p) const { return eval(x,p) ; }
49 Double_t operator()(const Double_t* x) const { return eval(x) ; }
50
51 Double_t eval(const Double_t* /*x*/, const Double_t* /*p*/) const ;
52 Double_t eval(const Double_t* /*x*/) const ;
53 Double_t eval(Double_t /*x*/) const ;
54
55 RooAbsFunc& binding() { return *_binding ; }
56
57protected:
58
59 Bool_t _ownBinding ; // Do we own the binding function
60 RooArgSet _nset ; // Normalization observables
61 RooAbsFunc* _binding ; // Function binding
62 Double_t* _x ; //! Transfer array ;
63 Int_t _npar ; //! Number of parameters ;
64 Int_t _nobs ; //! Number of observables ;
65
66 ClassDef(RooFunctor,0) // Export RooAbsReal as functor
67};
68
69#endif
70
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:326
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:59
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
Definition: RooFunctor.h:25
Int_t nPar() const
Definition: RooFunctor.h:38
Double_t eval(const Double_t *, const Double_t *) const
Definition: RooFunctor.cxx:153
RooAbsFunc * _binding
Definition: RooFunctor.h:61
Int_t nObs() const
Definition: RooFunctor.h:34
Double_t operator()(const Double_t *x) const
Definition: RooFunctor.h:49
Int_t _npar
Transfer array ;.
Definition: RooFunctor.h:63
RooAbsFunc & binding()
Definition: RooFunctor.h:55
Double_t operator()(Double_t x) const
Definition: RooFunctor.h:47
virtual ~RooFunctor()
Destructor.
Definition: RooFunctor.cxx:129
Double_t * _x
Definition: RooFunctor.h:62
Int_t _nobs
Number of parameters ;.
Definition: RooFunctor.h:64
Double_t operator()(const Double_t *x, const Double_t *p) const
Definition: RooFunctor.h:48
RooArgSet _nset
Definition: RooFunctor.h:60
RooFunctor(const RooAbsFunc &func)
Definition: RooFunctor.cxx:48
Bool_t _ownBinding
Definition: RooFunctor.h:59
Double_t x[n]
Definition: legend1.C:17