Logo ROOT   6.08/07
Reference Guide
RooAbsFunc.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooAbsFunc.h,v 1.9 2007/05/11 09:11:30 verkerke Exp $
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_ABS_FUNC
17 #define ROO_ABS_FUNC
18 
19 #include "Rtypes.h"
20 #include <list>
21 class RooAbsRealLValue ;
22 
23 class RooAbsFunc {
24 public:
25  inline RooAbsFunc(UInt_t dimension) : _ncall(0), _dimension(dimension), _valid(kTRUE) { }
26  inline RooAbsFunc(const RooAbsFunc& other) : _ncall(0), _dimension(other._dimension), _valid(kTRUE) { }
27 
28  inline virtual ~RooAbsFunc() { }
29  inline UInt_t getDimension() const {
30  // Dimension of function
31  return _dimension;
32  }
33  inline Bool_t isValid() const {
34  // Is function in valid state
35  return _valid;
36  }
37 
38  virtual Double_t operator()(const Double_t xvector[]) const = 0;
39  virtual Double_t getMinLimit(UInt_t dimension) const = 0;
40  virtual Double_t getMaxLimit(UInt_t dimension) const = 0;
41 
42  Int_t numCall() const {
43  // Return number of function calls since last reset
44  return _ncall ;
45  }
46  void resetNumCall() const {
47  // Reset function call counter
48  _ncall = 0 ;
49  }
50 
51  virtual void saveXVec() const {
52  // Interface to save current values of observables (if supported by binding implementation)
53  } ;
54  virtual void restoreXVec() const {
55  // Interface to restore observables to saved values (if supported
56  // by binding implementation)
57  } ;
58 
59  virtual const char* getName() const {
60  // Name of function binding
61  return "(unnamed)" ;
62  }
63 
64  virtual std::list<Double_t>* binBoundaries(Int_t) const { return 0 ; }
65 
66  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const {
67  // Interface for returning an optional hint for initial sampling points when constructing a curve
68  // projected on observable.
69  return 0 ;
70  }
71 
72 protected:
73  mutable Int_t _ncall ; // Function call counter
74  UInt_t _dimension; // Number of observables
75  Bool_t _valid; // Is binding in valid state?
76  ClassDef(RooAbsFunc,0) // Abstract real-valued function interface
77 };
78 
79 #endif
80 
void resetNumCall() const
Definition: RooAbsFunc.h:46
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Bool_t isValid() const
Definition: RooAbsFunc.h:33
Int_t numCall() const
Definition: RooAbsFunc.h:42
RooAbsFunc(const RooAbsFunc &other)
Definition: RooAbsFunc.h:26
#define ClassDef(name, id)
Definition: Rtypes.h:254
RooAbsFunc(UInt_t dimension)
Definition: RooAbsFunc.h:25
virtual const char * getName() const
Definition: RooAbsFunc.h:59
Int_t _ncall
Definition: RooAbsFunc.h:73
UInt_t getDimension() const
Definition: RooAbsFunc.h:29
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual Double_t getMinLimit(UInt_t dimension) const =0
virtual std::list< Double_t > * binBoundaries(Int_t) const
Definition: RooAbsFunc.h:64
virtual ~RooAbsFunc()
Definition: RooAbsFunc.h:28
virtual Double_t getMaxLimit(UInt_t dimension) const =0
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsFunc.h:66
double Double_t
Definition: RtypesCore.h:55
virtual void restoreXVec() const
Definition: RooAbsFunc.h:54
virtual Double_t operator()(const Double_t xvector[]) const =0
virtual void saveXVec() const
Definition: RooAbsFunc.h:51
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Bool_t _valid
Definition: RooAbsFunc.h:75
const Bool_t kTRUE
Definition: Rtypes.h:91
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23
UInt_t _dimension
Definition: RooAbsFunc.h:74