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