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 double operator()(double x) const { return eval(x) ; }
44 double operator()(const double* x, const double* p) const { return eval(x,p) ; }
45 double operator()(const double* x) const { return eval(x) ; }
46
47 double eval(const double* /*x*/, const double* /*p*/) const ;
48 double eval(const double* /*x*/) const ;
49 double eval(double /*x*/) const ;
50
51 RooAbsFunc& binding() { return *_binding ; }
52
53protected:
54
55 bool _ownBinding ; ///< Do we own the binding function
56 RooArgSet _nset ; ///< Normalization observables
57 RooAbsFunc* _binding ; ///< Function binding
58 double* _x ; ///<! Transfer array ;
59 Int_t _npar ; ///<! Number of parameters ;
60 Int_t _nobs ; ///<! Number of observables ;
61
62 ClassDef(RooFunctor,0) // Export RooAbsReal as functor
63};
64
65#endif
66
#define ClassDef(name, id)
Definition: Rtypes.h:335
winID h TVirtualViewer3D TVirtualGLPainter p
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:27
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:64
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
Lightweight interface adaptor that exports a RooAbsPdf as a functor.
Definition: RooFunctor.h:25
Int_t nPar() const
Definition: RooFunctor.h:38
RooAbsFunc * _binding
Function binding.
Definition: RooFunctor.h:57
Int_t nObs() const
Definition: RooFunctor.h:34
double operator()(double x) const
Definition: RooFunctor.h:43
Int_t _npar
! Number of parameters ;
Definition: RooFunctor.h:59
RooAbsFunc & binding()
Definition: RooFunctor.h:51
double * _x
! Transfer array ;
Definition: RooFunctor.h:58
virtual ~RooFunctor()
Destructor.
Definition: RooFunctor.cxx:127
double operator()(const double *x) const
Definition: RooFunctor.h:45
Int_t _nobs
! Number of observables ;
Definition: RooFunctor.h:60
bool _ownBinding
Do we own the binding function.
Definition: RooFunctor.h:55
RooArgSet _nset
Normalization observables.
Definition: RooFunctor.h:56
double eval(const double *, const double *) const
Definition: RooFunctor.cxx:151
double operator()(const double *x, const double *p) const
Definition: RooFunctor.h:44
RooFunctor(const RooAbsFunc &func)
Definition: RooFunctor.cxx:46
Double_t x[n]
Definition: legend1.C:17