ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 *    File: $Id: RooAbsFunc.h,v 1.9 2007/05/11 09:11:30 verkerke Exp $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_ABS_FUNC
#define ROO_ABS_FUNC

#include "Rtypes.h"
#include <list>
class RooAbsRealLValue ;

class RooAbsFunc {
public:
  inline RooAbsFunc(UInt_t dimension) : _ncall(0), _dimension(dimension), _valid(kTRUE) { }
  inline virtual ~RooAbsFunc() { }
  inline UInt_t getDimension() const { 
    // Dimension of function
    return _dimension; 
  }
  inline Bool_t isValid() const { 
    // Is function in valid state
    return _valid; 
  }

  virtual Double_t operator()(const Double_t xvector[]) const = 0;
  virtual Double_t getMinLimit(UInt_t dimension) const = 0;
  virtual Double_t getMaxLimit(UInt_t dimension) const = 0;

  Int_t numCall() const { 
    // Return number of function calls since last reset
    return _ncall ; 
  }
  void resetNumCall() const { 
    // Reset function call counter
    _ncall = 0 ; 
  }

  virtual void saveXVec() const {
    // Interface to save current values of observables (if supported by binding implementation)
  } ;
  virtual void restoreXVec() const {
    // Interface to restore observables to saved values (if supported
    // by binding implementation)
  } ;

  virtual const char* getName() const { 
    // Name of function binding
    return "(unnamed)" ; 
  }  

  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const {
    // Interface for returning an optional hint for initial sampling points when constructing a curve 
    // projected on observable.  
    return 0 ; 
  }

protected:
  mutable Int_t _ncall ; // Function call counter
  UInt_t _dimension;     // Number of observables
  Bool_t _valid;         // Is binding in valid state?
   ClassDef(RooAbsFunc,0) // Abstract real-valued function interface
};

#endif

 RooAbsFunc.h:1
 RooAbsFunc.h:2
 RooAbsFunc.h:3
 RooAbsFunc.h:4
 RooAbsFunc.h:5
 RooAbsFunc.h:6
 RooAbsFunc.h:7
 RooAbsFunc.h:8
 RooAbsFunc.h:9
 RooAbsFunc.h:10
 RooAbsFunc.h:11
 RooAbsFunc.h:12
 RooAbsFunc.h:13
 RooAbsFunc.h:14
 RooAbsFunc.h:15
 RooAbsFunc.h:16
 RooAbsFunc.h:17
 RooAbsFunc.h:18
 RooAbsFunc.h:19
 RooAbsFunc.h:20
 RooAbsFunc.h:21
 RooAbsFunc.h:22
 RooAbsFunc.h:23
 RooAbsFunc.h:24
 RooAbsFunc.h:25
 RooAbsFunc.h:26
 RooAbsFunc.h:27
 RooAbsFunc.h:28
 RooAbsFunc.h:29
 RooAbsFunc.h:30
 RooAbsFunc.h:31
 RooAbsFunc.h:32
 RooAbsFunc.h:33
 RooAbsFunc.h:34
 RooAbsFunc.h:35
 RooAbsFunc.h:36
 RooAbsFunc.h:37
 RooAbsFunc.h:38
 RooAbsFunc.h:39
 RooAbsFunc.h:40
 RooAbsFunc.h:41
 RooAbsFunc.h:42
 RooAbsFunc.h:43
 RooAbsFunc.h:44
 RooAbsFunc.h:45
 RooAbsFunc.h:46
 RooAbsFunc.h:47
 RooAbsFunc.h:48
 RooAbsFunc.h:49
 RooAbsFunc.h:50
 RooAbsFunc.h:51
 RooAbsFunc.h:52
 RooAbsFunc.h:53
 RooAbsFunc.h:54
 RooAbsFunc.h:55
 RooAbsFunc.h:56
 RooAbsFunc.h:57
 RooAbsFunc.h:58
 RooAbsFunc.h:59
 RooAbsFunc.h:60
 RooAbsFunc.h:61
 RooAbsFunc.h:62
 RooAbsFunc.h:63
 RooAbsFunc.h:64
 RooAbsFunc.h:65
 RooAbsFunc.h:66
 RooAbsFunc.h:67
 RooAbsFunc.h:68
 RooAbsFunc.h:69
 RooAbsFunc.h:70
 RooAbsFunc.h:71
 RooAbsFunc.h:72
 RooAbsFunc.h:73
 RooAbsFunc.h:74
 RooAbsFunc.h:75
 RooAbsFunc.h:76