Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:17

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id: RooAbsFunc.h,v 1.9 2007/05/11 09:11:30 verkerke Exp $
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 #ifndef ROO_ABS_FUNC
0017 #define ROO_ABS_FUNC
0018 
0019 #include <ROOT/RSpan.hxx>
0020 #include <Rtypes.h>
0021 
0022 #include <list>
0023 #include <vector>
0024 
0025 class RooAbsRealLValue ;
0026 
0027 class RooAbsFunc {
0028 public:
0029   inline RooAbsFunc(UInt_t dimension) : _ncall(0), _dimension(dimension), _valid(true) { }
0030   inline RooAbsFunc(const RooAbsFunc& other) : _ncall(0), _dimension(other._dimension), _valid(true) { }
0031 
0032   inline virtual ~RooAbsFunc() { }
0033   inline UInt_t getDimension() const {
0034     // Dimension of function
0035     return _dimension;
0036   }
0037   inline bool isValid() const {
0038     // Is function in valid state
0039     return _valid;
0040   }
0041 
0042   virtual double operator()(const double xvector[]) const = 0;
0043   virtual double getMinLimit(UInt_t dimension) const = 0;
0044   virtual double getMaxLimit(UInt_t dimension) const = 0;
0045 
0046   /// Return number of function calls since last reset
0047   Int_t numCall() const {
0048     return _ncall ;
0049   }
0050 
0051   /// Reset function call counter
0052   void resetNumCall() const {
0053     _ncall = 0 ;
0054   }
0055 
0056   virtual void saveXVec() const {
0057     // Interface to save current values of observables (if supported by binding implementation)
0058   } ;
0059   virtual void restoreXVec() const {
0060     // Interface to restore observables to saved values (if supported
0061     // by binding implementation)
0062   } ;
0063 
0064   /// Name of function binding
0065   virtual const char* getName() const {
0066     return "(unnamed)" ;
0067   }
0068 
0069   virtual std::list<double>* binBoundaries(Int_t) const { return nullptr; }
0070 
0071   /// Interface for returning an optional hint for initial sampling points when constructing a curve
0072   /// projected on observable.
0073   virtual std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const {
0074     return nullptr;
0075   }
0076 
0077 protected:
0078   mutable Int_t _ncall ;  ///< Function call counter
0079   UInt_t _dimension;      ///< Number of observables
0080   bool _valid;          ///< Is binding in valid state?
0081    ClassDef(RooAbsFunc,0) ///< Abstract real-valued function interface
0082 };
0083 
0084 #endif
0085