Logo ROOT  
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 
RooAbsFunc::_ncall
Int_t _ncall
Definition: RooAbsFunc.h:73
RooAbsFunc::getMinLimit
virtual Double_t getMinLimit(UInt_t dimension) const =0
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsFunc::getDimension
UInt_t getDimension() const
Definition: RooAbsFunc.h:29
RooAbsFunc::~RooAbsFunc
virtual ~RooAbsFunc()
Definition: RooAbsFunc.h:28
RooAbsFunc::binBoundaries
virtual std::list< Double_t > * binBoundaries(Int_t) const
Definition: RooAbsFunc.h:64
RooAbsFunc::getMaxLimit
virtual Double_t getMaxLimit(UInt_t dimension) const =0
RooAbsFunc::restoreXVec
virtual void restoreXVec() const
Definition: RooAbsFunc.h:54
RooAbsFunc::plotSamplingHint
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsFunc.h:66
RooAbsFunc::operator()
virtual Double_t operator()(const Double_t xvector[]) const =0
RooAbsFunc::saveXVec
virtual void saveXVec() const
Definition: RooAbsFunc.h:51
RooAbsFunc::_valid
Bool_t _valid
Definition: RooAbsFunc.h:75
bool
RooAbsFunc
Definition: RooAbsFunc.h:23
RooAbsFunc::_dimension
UInt_t _dimension
Definition: RooAbsFunc.h:74
RooAbsFunc::resetNumCall
void resetNumCall() const
Definition: RooAbsFunc.h:46
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
unsigned int
RooAbsFunc::isValid
Bool_t isValid() const
Definition: RooAbsFunc.h:33
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsFunc::RooAbsFunc
RooAbsFunc(const RooAbsFunc &other)
Definition: RooAbsFunc.h:26
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooAbsFunc::numCall
Int_t numCall() const
Definition: RooAbsFunc.h:42
RooAbsFunc::getName
virtual const char * getName() const
Definition: RooAbsFunc.h:59
RooAbsRealLValue
Definition: RooAbsRealLValue.h:31
RooAbsFunc::RooAbsFunc
RooAbsFunc(UInt_t dimension)
Definition: RooAbsFunc.h:25
Rtypes.h
int